From 932a55aaf606c4ff1d4be5c411c89cfc88e1ff05 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Wed, 25 Oct 2023 23:31:20 +0200 Subject: [PATCH] swapserverrpc: add instantout service --- swapserverrpc/instantout.pb.go | 1090 +++++++++++++++++++++++++++ swapserverrpc/instantout.proto | 136 ++++ swapserverrpc/instantout_grpc.pb.go | 301 ++++++++ 3 files changed, 1527 insertions(+) create mode 100644 swapserverrpc/instantout.pb.go create mode 100644 swapserverrpc/instantout.proto create mode 100644 swapserverrpc/instantout_grpc.pb.go diff --git a/swapserverrpc/instantout.pb.go b/swapserverrpc/instantout.pb.go new file mode 100644 index 0000000..ac809b7 --- /dev/null +++ b/swapserverrpc/instantout.pb.go @@ -0,0 +1,1090 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.6.1 +// source: instantout.proto + +// We can't change this to swapserverrpc, it would be a breaking change because +// the package name is also contained in the HTTP URIs and old clients would +// call the wrong endpoints. Luckily with the go_package option we can have +// different golang and RPC package names to fix protobuf namespace conflicts. + +package swapserverrpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type InstantOutProtocolVersion int32 + +const ( + InstantOutProtocolVersion_INSTANTOUT_NONE InstantOutProtocolVersion = 0 + InstantOutProtocolVersion_INSTANTOUT_FULL_RESERVATION InstantOutProtocolVersion = 1 +) + +// Enum value maps for InstantOutProtocolVersion. +var ( + InstantOutProtocolVersion_name = map[int32]string{ + 0: "INSTANTOUT_NONE", + 1: "INSTANTOUT_FULL_RESERVATION", + } + InstantOutProtocolVersion_value = map[string]int32{ + "INSTANTOUT_NONE": 0, + "INSTANTOUT_FULL_RESERVATION": 1, + } +) + +func (x InstantOutProtocolVersion) Enum() *InstantOutProtocolVersion { + p := new(InstantOutProtocolVersion) + *p = x + return p +} + +func (x InstantOutProtocolVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InstantOutProtocolVersion) Descriptor() protoreflect.EnumDescriptor { + return file_instantout_proto_enumTypes[0].Descriptor() +} + +func (InstantOutProtocolVersion) Type() protoreflect.EnumType { + return &file_instantout_proto_enumTypes[0] +} + +func (x InstantOutProtocolVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InstantOutProtocolVersion.Descriptor instead. +func (InstantOutProtocolVersion) EnumDescriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{0} +} + +type InstantLoopOutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Htlc related fields: + // The key for the htlc preimage spending path. + ReceiverKey []byte `protobuf:"bytes,1,opt,name=receiver_key,json=receiverKey,proto3" json:"receiver_key,omitempty"` + // The hash of the preimage that will be used to settle the htlc. + SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + // The requested absolute block height of the on-chain htlc. + Expiry int32 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` + // The fee rate in sat/kw that should be used for the htlc. + HtlcFeeRate uint64 `protobuf:"varint,4,opt,name=htlc_fee_rate,json=htlcFeeRate,proto3" json:"htlc_fee_rate,omitempty"` + // The reservations used as the inputs. + ReservationIds [][]byte `protobuf:"bytes,5,rep,name=reservation_ids,json=reservationIds,proto3" json:"reservation_ids,omitempty"` + // The protocol version to use for the swap. + ProtocolVersion InstantOutProtocolVersion `protobuf:"varint,6,opt,name=protocol_version,json=protocolVersion,proto3,enum=looprpc.InstantOutProtocolVersion" json:"protocol_version,omitempty"` +} + +func (x *InstantLoopOutRequest) Reset() { + *x = InstantLoopOutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstantLoopOutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstantLoopOutRequest) ProtoMessage() {} + +func (x *InstantLoopOutRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstantLoopOutRequest.ProtoReflect.Descriptor instead. +func (*InstantLoopOutRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{0} +} + +func (x *InstantLoopOutRequest) GetReceiverKey() []byte { + if x != nil { + return x.ReceiverKey + } + return nil +} + +func (x *InstantLoopOutRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *InstantLoopOutRequest) GetExpiry() int32 { + if x != nil { + return x.Expiry + } + return 0 +} + +func (x *InstantLoopOutRequest) GetHtlcFeeRate() uint64 { + if x != nil { + return x.HtlcFeeRate + } + return 0 +} + +func (x *InstantLoopOutRequest) GetReservationIds() [][]byte { + if x != nil { + return x.ReservationIds + } + return nil +} + +func (x *InstantLoopOutRequest) GetProtocolVersion() InstantOutProtocolVersion { + if x != nil { + return x.ProtocolVersion + } + return InstantOutProtocolVersion_INSTANTOUT_NONE +} + +type InstantLoopOutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The swap invoice that the client should pay. + SwapInvoice string `protobuf:"bytes,1,opt,name=swap_invoice,json=swapInvoice,proto3" json:"swap_invoice,omitempty"` + // the key for the htlc expiry path. + SenderKey []byte `protobuf:"bytes,2,opt,name=sender_key,json=senderKey,proto3" json:"sender_key,omitempty"` +} + +func (x *InstantLoopOutResponse) Reset() { + *x = InstantLoopOutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstantLoopOutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstantLoopOutResponse) ProtoMessage() {} + +func (x *InstantLoopOutResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstantLoopOutResponse.ProtoReflect.Descriptor instead. +func (*InstantLoopOutResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{1} +} + +func (x *InstantLoopOutResponse) GetSwapInvoice() string { + if x != nil { + return x.SwapInvoice + } + return "" +} + +func (x *InstantLoopOutResponse) GetSenderKey() []byte { + if x != nil { + return x.SenderKey + } + return nil +} + +type PollPaymentAcceptedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of the swap invoice. + SwapHash []byte `protobuf:"bytes,1,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` +} + +func (x *PollPaymentAcceptedRequest) Reset() { + *x = PollPaymentAcceptedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PollPaymentAcceptedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PollPaymentAcceptedRequest) ProtoMessage() {} + +func (x *PollPaymentAcceptedRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PollPaymentAcceptedRequest.ProtoReflect.Descriptor instead. +func (*PollPaymentAcceptedRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{2} +} + +func (x *PollPaymentAcceptedRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +type PollPaymentAcceptedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whether the payment has been accepted. + Accepted bool `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"` +} + +func (x *PollPaymentAcceptedResponse) Reset() { + *x = PollPaymentAcceptedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PollPaymentAcceptedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PollPaymentAcceptedResponse) ProtoMessage() {} + +func (x *PollPaymentAcceptedResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PollPaymentAcceptedResponse.ProtoReflect.Descriptor instead. +func (*PollPaymentAcceptedResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{3} +} + +func (x *PollPaymentAcceptedResponse) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + +type InitHtlcSigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of the swap invoice. + SwapHash []byte `protobuf:"bytes,1,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + // The nonces that the client will use to generate the htlc sigs. + HtlcClientNonces [][]byte `protobuf:"bytes,2,rep,name=htlc_client_nonces,json=htlcClientNonces,proto3" json:"htlc_client_nonces,omitempty"` +} + +func (x *InitHtlcSigRequest) Reset() { + *x = InitHtlcSigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitHtlcSigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitHtlcSigRequest) ProtoMessage() {} + +func (x *InitHtlcSigRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitHtlcSigRequest.ProtoReflect.Descriptor instead. +func (*InitHtlcSigRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{4} +} + +func (x *InitHtlcSigRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *InitHtlcSigRequest) GetHtlcClientNonces() [][]byte { + if x != nil { + return x.HtlcClientNonces + } + return nil +} + +type InitHtlcSigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The nonces that the server will use to generate the htlc sigs. + HtlcServerNonces [][]byte `protobuf:"bytes,2,rep,name=htlc_server_nonces,json=htlcServerNonces,proto3" json:"htlc_server_nonces,omitempty"` +} + +func (x *InitHtlcSigResponse) Reset() { + *x = InitHtlcSigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitHtlcSigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitHtlcSigResponse) ProtoMessage() {} + +func (x *InitHtlcSigResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitHtlcSigResponse.ProtoReflect.Descriptor instead. +func (*InitHtlcSigResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{5} +} + +func (x *InitHtlcSigResponse) GetHtlcServerNonces() [][]byte { + if x != nil { + return x.HtlcServerNonces + } + return nil +} + +type PushHtlcSigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of the swap invoice. + SwapHash []byte `protobuf:"bytes,1,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + // The sigs that the client generated for the reservation inputs. + ClientSigs [][]byte `protobuf:"bytes,2,rep,name=client_sigs,json=clientSigs,proto3" json:"client_sigs,omitempty"` +} + +func (x *PushHtlcSigRequest) Reset() { + *x = PushHtlcSigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHtlcSigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHtlcSigRequest) ProtoMessage() {} + +func (x *PushHtlcSigRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushHtlcSigRequest.ProtoReflect.Descriptor instead. +func (*PushHtlcSigRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{6} +} + +func (x *PushHtlcSigRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *PushHtlcSigRequest) GetClientSigs() [][]byte { + if x != nil { + return x.ClientSigs + } + return nil +} + +type PushHtlcSigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The sigs that the server generated for the reservation inputs. + ServerSigs [][]byte `protobuf:"bytes,1,rep,name=server_sigs,json=serverSigs,proto3" json:"server_sigs,omitempty"` +} + +func (x *PushHtlcSigResponse) Reset() { + *x = PushHtlcSigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHtlcSigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHtlcSigResponse) ProtoMessage() {} + +func (x *PushHtlcSigResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushHtlcSigResponse.ProtoReflect.Descriptor instead. +func (*PushHtlcSigResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{7} +} + +func (x *PushHtlcSigResponse) GetServerSigs() [][]byte { + if x != nil { + return x.ServerSigs + } + return nil +} + +type PushPreimageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The preimage that the client generated for the swap. + Preimage []byte `protobuf:"bytes,1,opt,name=preimage,proto3" json:"preimage,omitempty"` + // The nonces that the client used to generate the sweepless sweep sigs. + ClientNonces [][]byte `protobuf:"bytes,2,rep,name=client_nonces,json=clientNonces,proto3" json:"client_nonces,omitempty"` + // The address that the client wants to sweep the htlc to. + ClientSweepAddr string `protobuf:"bytes,3,opt,name=client_sweep_addr,json=clientSweepAddr,proto3" json:"client_sweep_addr,omitempty"` + // The fee rate in sat/kw that the client wants to use for the sweep. + MusigTxFeeRate uint64 `protobuf:"varint,4,opt,name=musig_tx_fee_rate,json=musigTxFeeRate,proto3" json:"musig_tx_fee_rate,omitempty"` +} + +func (x *PushPreimageRequest) Reset() { + *x = PushPreimageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushPreimageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushPreimageRequest) ProtoMessage() {} + +func (x *PushPreimageRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushPreimageRequest.ProtoReflect.Descriptor instead. +func (*PushPreimageRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{8} +} + +func (x *PushPreimageRequest) GetPreimage() []byte { + if x != nil { + return x.Preimage + } + return nil +} + +func (x *PushPreimageRequest) GetClientNonces() [][]byte { + if x != nil { + return x.ClientNonces + } + return nil +} + +func (x *PushPreimageRequest) GetClientSweepAddr() string { + if x != nil { + return x.ClientSweepAddr + } + return "" +} + +func (x *PushPreimageRequest) GetMusigTxFeeRate() uint64 { + if x != nil { + return x.MusigTxFeeRate + } + return 0 +} + +type PushPreimageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The sweep sigs that the server generated for the htlc. + Musig2SweepSigs [][]byte `protobuf:"bytes,1,rep,name=musig2_sweep_sigs,json=musig2SweepSigs,proto3" json:"musig2_sweep_sigs,omitempty"` + // The nonces that the server used to generate the sweepless sweep sigs. + ServerNonces [][]byte `protobuf:"bytes,2,rep,name=server_nonces,json=serverNonces,proto3" json:"server_nonces,omitempty"` +} + +func (x *PushPreimageResponse) Reset() { + *x = PushPreimageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushPreimageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushPreimageResponse) ProtoMessage() {} + +func (x *PushPreimageResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushPreimageResponse.ProtoReflect.Descriptor instead. +func (*PushPreimageResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{9} +} + +func (x *PushPreimageResponse) GetMusig2SweepSigs() [][]byte { + if x != nil { + return x.Musig2SweepSigs + } + return nil +} + +func (x *PushPreimageResponse) GetServerNonces() [][]byte { + if x != nil { + return x.ServerNonces + } + return nil +} + +type CancelInstantSwapRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of the swap invoice. + SwapHash []byte `protobuf:"bytes,1,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` +} + +func (x *CancelInstantSwapRequest) Reset() { + *x = CancelInstantSwapRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelInstantSwapRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelInstantSwapRequest) ProtoMessage() {} + +func (x *CancelInstantSwapRequest) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelInstantSwapRequest.ProtoReflect.Descriptor instead. +func (*CancelInstantSwapRequest) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{10} +} + +func (x *CancelInstantSwapRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +type CancelInstantSwapResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CancelInstantSwapResponse) Reset() { + *x = CancelInstantSwapResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_instantout_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelInstantSwapResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelInstantSwapResponse) ProtoMessage() {} + +func (x *CancelInstantSwapResponse) ProtoReflect() protoreflect.Message { + mi := &file_instantout_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelInstantSwapResponse.ProtoReflect.Descriptor instead. +func (*CancelInstantSwapResponse) Descriptor() ([]byte, []int) { + return file_instantout_proto_rawDescGZIP(), []int{11} +} + +var File_instantout_proto protoreflect.FileDescriptor + +var file_instantout_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x6f, 0x75, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x22, 0x8b, 0x02, 0x0a, 0x15, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x61, + 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x22, 0x0a, + 0x0d, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x68, 0x74, 0x6c, 0x63, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, + 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x16, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x69, 0x6e, 0x76, 0x6f, + 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x77, 0x61, 0x70, 0x49, + 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x39, 0x0a, 0x1a, 0x50, 0x6f, 0x6c, 0x6c, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, + 0x22, 0x39, 0x0a, 0x1b, 0x50, 0x6f, 0x6c, 0x6c, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, + 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x5f, 0x0a, 0x12, 0x49, + 0x6e, 0x69, 0x74, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2c, + 0x0a, 0x12, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x68, 0x74, 0x6c, 0x63, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x13, + 0x49, 0x6e, 0x69, 0x74, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x10, 0x68, 0x74, 0x6c, 0x63, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x73, 0x22, 0x52, 0x0a, 0x12, 0x50, 0x75, 0x73, 0x68, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x69, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x53, 0x69, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x13, 0x50, 0x75, 0x73, 0x68, 0x48, 0x74, 0x6c, + 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x69, 0x67, 0x73, 0x22, 0xad, 0x01, + 0x0a, 0x13, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x77, 0x65, 0x65, 0x70, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x29, 0x0a, 0x11, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x66, + 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6d, + 0x75, 0x73, 0x69, 0x67, 0x54, 0x78, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x22, 0x67, 0x0a, + 0x14, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x5f, + 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x73, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0f, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x53, 0x77, 0x65, 0x65, 0x70, 0x53, 0x69, 0x67, + 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x37, 0x0a, 0x18, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, + 0x1b, 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x51, 0x0a, 0x19, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, 0x53, + 0x54, 0x41, 0x4e, 0x54, 0x4f, 0x55, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1f, + 0x0a, 0x1b, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x54, 0x4f, 0x55, 0x54, 0x5f, 0x46, 0x55, 0x4c, + 0x4c, 0x5f, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x32, + 0x8c, 0x04, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, 0x77, 0x61, 0x70, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x15, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x1e, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x60, 0x0a, 0x13, 0x50, 0x6f, 0x6c, 0x6c, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x50, 0x6f, 0x6c, 0x6c, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6f, 0x6c, 0x6c, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, + 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, + 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, 0x74, 0x6c, 0x63, + 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x50, + 0x75, 0x73, 0x68, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, + 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x65, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, + 0x73, 0x68, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x74, 0x53, 0x77, 0x61, 0x70, 0x12, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, + 0x63, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x53, + 0x77, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x74, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2d, + 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, + 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, + 0x73, 0x77, 0x61, 0x70, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_instantout_proto_rawDescOnce sync.Once + file_instantout_proto_rawDescData = file_instantout_proto_rawDesc +) + +func file_instantout_proto_rawDescGZIP() []byte { + file_instantout_proto_rawDescOnce.Do(func() { + file_instantout_proto_rawDescData = protoimpl.X.CompressGZIP(file_instantout_proto_rawDescData) + }) + return file_instantout_proto_rawDescData +} + +var file_instantout_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_instantout_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_instantout_proto_goTypes = []interface{}{ + (InstantOutProtocolVersion)(0), // 0: looprpc.InstantOutProtocolVersion + (*InstantLoopOutRequest)(nil), // 1: looprpc.InstantLoopOutRequest + (*InstantLoopOutResponse)(nil), // 2: looprpc.InstantLoopOutResponse + (*PollPaymentAcceptedRequest)(nil), // 3: looprpc.PollPaymentAcceptedRequest + (*PollPaymentAcceptedResponse)(nil), // 4: looprpc.PollPaymentAcceptedResponse + (*InitHtlcSigRequest)(nil), // 5: looprpc.InitHtlcSigRequest + (*InitHtlcSigResponse)(nil), // 6: looprpc.InitHtlcSigResponse + (*PushHtlcSigRequest)(nil), // 7: looprpc.PushHtlcSigRequest + (*PushHtlcSigResponse)(nil), // 8: looprpc.PushHtlcSigResponse + (*PushPreimageRequest)(nil), // 9: looprpc.PushPreimageRequest + (*PushPreimageResponse)(nil), // 10: looprpc.PushPreimageResponse + (*CancelInstantSwapRequest)(nil), // 11: looprpc.CancelInstantSwapRequest + (*CancelInstantSwapResponse)(nil), // 12: looprpc.CancelInstantSwapResponse +} +var file_instantout_proto_depIdxs = []int32{ + 0, // 0: looprpc.InstantLoopOutRequest.protocol_version:type_name -> looprpc.InstantOutProtocolVersion + 1, // 1: looprpc.InstantSwapServer.RequestInstantLoopOut:input_type -> looprpc.InstantLoopOutRequest + 3, // 2: looprpc.InstantSwapServer.PollPaymentAccepted:input_type -> looprpc.PollPaymentAcceptedRequest + 5, // 3: looprpc.InstantSwapServer.InitHtlcSig:input_type -> looprpc.InitHtlcSigRequest + 7, // 4: looprpc.InstantSwapServer.PushHtlcSig:input_type -> looprpc.PushHtlcSigRequest + 9, // 5: looprpc.InstantSwapServer.PushPreimage:input_type -> looprpc.PushPreimageRequest + 11, // 6: looprpc.InstantSwapServer.CancelInstantSwap:input_type -> looprpc.CancelInstantSwapRequest + 2, // 7: looprpc.InstantSwapServer.RequestInstantLoopOut:output_type -> looprpc.InstantLoopOutResponse + 4, // 8: looprpc.InstantSwapServer.PollPaymentAccepted:output_type -> looprpc.PollPaymentAcceptedResponse + 6, // 9: looprpc.InstantSwapServer.InitHtlcSig:output_type -> looprpc.InitHtlcSigResponse + 8, // 10: looprpc.InstantSwapServer.PushHtlcSig:output_type -> looprpc.PushHtlcSigResponse + 10, // 11: looprpc.InstantSwapServer.PushPreimage:output_type -> looprpc.PushPreimageResponse + 12, // 12: looprpc.InstantSwapServer.CancelInstantSwap:output_type -> looprpc.CancelInstantSwapResponse + 7, // [7:13] is the sub-list for method output_type + 1, // [1:7] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_instantout_proto_init() } +func file_instantout_proto_init() { + if File_instantout_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_instantout_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstantLoopOutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstantLoopOutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PollPaymentAcceptedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PollPaymentAcceptedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitHtlcSigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitHtlcSigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHtlcSigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHtlcSigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushPreimageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushPreimageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelInstantSwapRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_instantout_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CancelInstantSwapResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_instantout_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_instantout_proto_goTypes, + DependencyIndexes: file_instantout_proto_depIdxs, + EnumInfos: file_instantout_proto_enumTypes, + MessageInfos: file_instantout_proto_msgTypes, + }.Build() + File_instantout_proto = out.File + file_instantout_proto_rawDesc = nil + file_instantout_proto_goTypes = nil + file_instantout_proto_depIdxs = nil +} diff --git a/swapserverrpc/instantout.proto b/swapserverrpc/instantout.proto new file mode 100644 index 0000000..e8e95a2 --- /dev/null +++ b/swapserverrpc/instantout.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; + +// We can't change this to swapserverrpc, it would be a breaking change because +// the package name is also contained in the HTTP URIs and old clients would +// call the wrong endpoints. Luckily with the go_package option we can have +// different golang and RPC package names to fix protobuf namespace conflicts. +package looprpc; + +option go_package = "github.com/lightninglabs/loop/swapserverrpc"; + +service InstantSwapServer { + // RequestInstantLoopOut initiates an instant loop out swap. + rpc RequestInstantLoopOut (InstantLoopOutRequest) + returns (InstantLoopOutResponse); + + // PollPaymentAccepted polls the server to see if the payment has been + // accepted. + rpc PollPaymentAccepted (PollPaymentAcceptedRequest) + returns (PollPaymentAcceptedResponse); + + // InitHtlcSig is called by the client to initiate the htlc sig exchange. + rpc InitHtlcSig (InitHtlcSigRequest) returns (InitHtlcSigResponse); + + // PushHtlcSig is called by the client to push the htlc sigs to the server. + rpc PushHtlcSig (PushHtlcSigRequest) returns (PushHtlcSigResponse); + + // PushPreimage is called by the client to push the preimage to the server. + // This returns the musig2 signatures that the client needs to sweep the + // htlc. + rpc PushPreimage (PushPreimageRequest) returns (PushPreimageResponse); + + // CancelInstantSwap tries to cancel the instant swap. This can only be + // called if the swap has not been accepted yet. + rpc CancelInstantSwap (CancelInstantSwapRequest) + returns (CancelInstantSwapResponse); +} + +message InstantLoopOutRequest { + // Htlc related fields: + // The key for the htlc preimage spending path. + bytes receiver_key = 1; + + // The hash of the preimage that will be used to settle the htlc. + bytes swap_hash = 2; + + // The requested absolute block height of the on-chain htlc. + int32 expiry = 3; + + // The fee rate in sat/kw that should be used for the htlc. + uint64 htlc_fee_rate = 4; + + // The reservations used as the inputs. + repeated bytes reservation_ids = 5; + + // The protocol version to use for the swap. + InstantOutProtocolVersion protocol_version = 6; +} + +message InstantLoopOutResponse { + // The swap invoice that the client should pay. + string swap_invoice = 1; + + // the key for the htlc expiry path. + bytes sender_key = 2; +}; + +message PollPaymentAcceptedRequest { + // The hash of the swap invoice. + bytes swap_hash = 1; +} + +message PollPaymentAcceptedResponse { + // Whether the payment has been accepted. + bool accepted = 1; +} + +message InitHtlcSigRequest { + // The hash of the swap invoice. + bytes swap_hash = 1; + + // The nonces that the client will use to generate the htlc sigs. + repeated bytes htlc_client_nonces = 2; +} + +message InitHtlcSigResponse { + // The nonces that the server will use to generate the htlc sigs. + repeated bytes htlc_server_nonces = 2; +} + +message PushHtlcSigRequest { + // The hash of the swap invoice. + bytes swap_hash = 1; + + // The sigs that the client generated for the reservation inputs. + repeated bytes client_sigs = 2; +} + +message PushHtlcSigResponse { + // The sigs that the server generated for the reservation inputs. + repeated bytes server_sigs = 1; +} + +message PushPreimageRequest { + // The preimage that the client generated for the swap. + bytes preimage = 1; + + // The nonces that the client used to generate the sweepless sweep sigs. + repeated bytes client_nonces = 2; + + // The address that the client wants to sweep the htlc to. + string client_sweep_addr = 3; + + // The fee rate in sat/kw that the client wants to use for the sweep. + uint64 musig_tx_fee_rate = 4; +} + +message PushPreimageResponse { + // The sweep sigs that the server generated for the htlc. + repeated bytes musig2_sweep_sigs = 1; + + // The nonces that the server used to generate the sweepless sweep sigs. + repeated bytes server_nonces = 2; +} + +message CancelInstantSwapRequest { + // The hash of the swap invoice. + bytes swap_hash = 1; +} + +message CancelInstantSwapResponse { +} + +enum InstantOutProtocolVersion { + INSTANTOUT_NONE = 0; + INSTANTOUT_FULL_RESERVATION = 1; +}; diff --git a/swapserverrpc/instantout_grpc.pb.go b/swapserverrpc/instantout_grpc.pb.go new file mode 100644 index 0000000..e9d105a --- /dev/null +++ b/swapserverrpc/instantout_grpc.pb.go @@ -0,0 +1,301 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package swapserverrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// InstantSwapServerClient is the client API for InstantSwapServer service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type InstantSwapServerClient interface { + // RequestInstantLoopOut initiates an instant loop out swap. + RequestInstantLoopOut(ctx context.Context, in *InstantLoopOutRequest, opts ...grpc.CallOption) (*InstantLoopOutResponse, error) + // PollPaymentAccepted polls the server to see if the payment has been + // accepted. + PollPaymentAccepted(ctx context.Context, in *PollPaymentAcceptedRequest, opts ...grpc.CallOption) (*PollPaymentAcceptedResponse, error) + // InitHtlcSig is called by the client to initiate the htlc sig exchange. + InitHtlcSig(ctx context.Context, in *InitHtlcSigRequest, opts ...grpc.CallOption) (*InitHtlcSigResponse, error) + // PushHtlcSig is called by the client to push the htlc sigs to the server. + PushHtlcSig(ctx context.Context, in *PushHtlcSigRequest, opts ...grpc.CallOption) (*PushHtlcSigResponse, error) + // PushPreimage is called by the client to push the preimage to the server. + // This returns the musig2 signatures that the client needs to sweep the + // htlc. + PushPreimage(ctx context.Context, in *PushPreimageRequest, opts ...grpc.CallOption) (*PushPreimageResponse, error) + // CancelInstantSwap tries to cancel the instant swap. This can only be + // called if the swap has not been accepted yet. + CancelInstantSwap(ctx context.Context, in *CancelInstantSwapRequest, opts ...grpc.CallOption) (*CancelInstantSwapResponse, error) +} + +type instantSwapServerClient struct { + cc grpc.ClientConnInterface +} + +func NewInstantSwapServerClient(cc grpc.ClientConnInterface) InstantSwapServerClient { + return &instantSwapServerClient{cc} +} + +func (c *instantSwapServerClient) RequestInstantLoopOut(ctx context.Context, in *InstantLoopOutRequest, opts ...grpc.CallOption) (*InstantLoopOutResponse, error) { + out := new(InstantLoopOutResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/RequestInstantLoopOut", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instantSwapServerClient) PollPaymentAccepted(ctx context.Context, in *PollPaymentAcceptedRequest, opts ...grpc.CallOption) (*PollPaymentAcceptedResponse, error) { + out := new(PollPaymentAcceptedResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/PollPaymentAccepted", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instantSwapServerClient) InitHtlcSig(ctx context.Context, in *InitHtlcSigRequest, opts ...grpc.CallOption) (*InitHtlcSigResponse, error) { + out := new(InitHtlcSigResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/InitHtlcSig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instantSwapServerClient) PushHtlcSig(ctx context.Context, in *PushHtlcSigRequest, opts ...grpc.CallOption) (*PushHtlcSigResponse, error) { + out := new(PushHtlcSigResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/PushHtlcSig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instantSwapServerClient) PushPreimage(ctx context.Context, in *PushPreimageRequest, opts ...grpc.CallOption) (*PushPreimageResponse, error) { + out := new(PushPreimageResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/PushPreimage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instantSwapServerClient) CancelInstantSwap(ctx context.Context, in *CancelInstantSwapRequest, opts ...grpc.CallOption) (*CancelInstantSwapResponse, error) { + out := new(CancelInstantSwapResponse) + err := c.cc.Invoke(ctx, "/looprpc.InstantSwapServer/CancelInstantSwap", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InstantSwapServerServer is the server API for InstantSwapServer service. +// All implementations must embed UnimplementedInstantSwapServerServer +// for forward compatibility +type InstantSwapServerServer interface { + // RequestInstantLoopOut initiates an instant loop out swap. + RequestInstantLoopOut(context.Context, *InstantLoopOutRequest) (*InstantLoopOutResponse, error) + // PollPaymentAccepted polls the server to see if the payment has been + // accepted. + PollPaymentAccepted(context.Context, *PollPaymentAcceptedRequest) (*PollPaymentAcceptedResponse, error) + // InitHtlcSig is called by the client to initiate the htlc sig exchange. + InitHtlcSig(context.Context, *InitHtlcSigRequest) (*InitHtlcSigResponse, error) + // PushHtlcSig is called by the client to push the htlc sigs to the server. + PushHtlcSig(context.Context, *PushHtlcSigRequest) (*PushHtlcSigResponse, error) + // PushPreimage is called by the client to push the preimage to the server. + // This returns the musig2 signatures that the client needs to sweep the + // htlc. + PushPreimage(context.Context, *PushPreimageRequest) (*PushPreimageResponse, error) + // CancelInstantSwap tries to cancel the instant swap. This can only be + // called if the swap has not been accepted yet. + CancelInstantSwap(context.Context, *CancelInstantSwapRequest) (*CancelInstantSwapResponse, error) + mustEmbedUnimplementedInstantSwapServerServer() +} + +// UnimplementedInstantSwapServerServer must be embedded to have forward compatible implementations. +type UnimplementedInstantSwapServerServer struct { +} + +func (UnimplementedInstantSwapServerServer) RequestInstantLoopOut(context.Context, *InstantLoopOutRequest) (*InstantLoopOutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestInstantLoopOut not implemented") +} +func (UnimplementedInstantSwapServerServer) PollPaymentAccepted(context.Context, *PollPaymentAcceptedRequest) (*PollPaymentAcceptedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PollPaymentAccepted not implemented") +} +func (UnimplementedInstantSwapServerServer) InitHtlcSig(context.Context, *InitHtlcSigRequest) (*InitHtlcSigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitHtlcSig not implemented") +} +func (UnimplementedInstantSwapServerServer) PushHtlcSig(context.Context, *PushHtlcSigRequest) (*PushHtlcSigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushHtlcSig not implemented") +} +func (UnimplementedInstantSwapServerServer) PushPreimage(context.Context, *PushPreimageRequest) (*PushPreimageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushPreimage not implemented") +} +func (UnimplementedInstantSwapServerServer) CancelInstantSwap(context.Context, *CancelInstantSwapRequest) (*CancelInstantSwapResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelInstantSwap not implemented") +} +func (UnimplementedInstantSwapServerServer) mustEmbedUnimplementedInstantSwapServerServer() {} + +// UnsafeInstantSwapServerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InstantSwapServerServer will +// result in compilation errors. +type UnsafeInstantSwapServerServer interface { + mustEmbedUnimplementedInstantSwapServerServer() +} + +func RegisterInstantSwapServerServer(s grpc.ServiceRegistrar, srv InstantSwapServerServer) { + s.RegisterService(&InstantSwapServer_ServiceDesc, srv) +} + +func _InstantSwapServer_RequestInstantLoopOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InstantLoopOutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).RequestInstantLoopOut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/RequestInstantLoopOut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).RequestInstantLoopOut(ctx, req.(*InstantLoopOutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstantSwapServer_PollPaymentAccepted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PollPaymentAcceptedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).PollPaymentAccepted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/PollPaymentAccepted", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).PollPaymentAccepted(ctx, req.(*PollPaymentAcceptedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstantSwapServer_InitHtlcSig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitHtlcSigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).InitHtlcSig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/InitHtlcSig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).InitHtlcSig(ctx, req.(*InitHtlcSigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstantSwapServer_PushHtlcSig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushHtlcSigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).PushHtlcSig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/PushHtlcSig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).PushHtlcSig(ctx, req.(*PushHtlcSigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstantSwapServer_PushPreimage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushPreimageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).PushPreimage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/PushPreimage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).PushPreimage(ctx, req.(*PushPreimageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstantSwapServer_CancelInstantSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelInstantSwapRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstantSwapServerServer).CancelInstantSwap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.InstantSwapServer/CancelInstantSwap", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstantSwapServerServer).CancelInstantSwap(ctx, req.(*CancelInstantSwapRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// InstantSwapServer_ServiceDesc is the grpc.ServiceDesc for InstantSwapServer service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var InstantSwapServer_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "looprpc.InstantSwapServer", + HandlerType: (*InstantSwapServerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RequestInstantLoopOut", + Handler: _InstantSwapServer_RequestInstantLoopOut_Handler, + }, + { + MethodName: "PollPaymentAccepted", + Handler: _InstantSwapServer_PollPaymentAccepted_Handler, + }, + { + MethodName: "InitHtlcSig", + Handler: _InstantSwapServer_InitHtlcSig_Handler, + }, + { + MethodName: "PushHtlcSig", + Handler: _InstantSwapServer_PushHtlcSig_Handler, + }, + { + MethodName: "PushPreimage", + Handler: _InstantSwapServer_PushPreimage_Handler, + }, + { + MethodName: "CancelInstantSwap", + Handler: _InstantSwapServer_CancelInstantSwap_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "instantout.proto", +}