From ea6dd78dbb3f456704efa075d43c8c904be5640b Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 3 Dec 2024 12:19:55 +0100 Subject: [PATCH 01/14] utils: add subscription manager --- utils/subscription.go | 148 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 utils/subscription.go diff --git a/utils/subscription.go b/utils/subscription.go new file mode 100644 index 000000000..8e31e2d90 --- /dev/null +++ b/utils/subscription.go @@ -0,0 +1,148 @@ +package utils + +import ( + "context" + "sync" + "time" +) + +// Subscription is an interface that allows to subscribe to events and handle +// them. +type Subscription[E any] interface { + Subscribe(ctx context.Context) (eventChan <-chan E, errChan <-chan error, err error) + HandleEvent(event E) error + HandleError(err error) +} + +// SubscriptionManager is a manager that handles the subscription lifecycle. +type SubscriptionManager[E any] struct { + subscription Subscription[E] + isSubscribed bool + mutex sync.Mutex + backoff time.Duration + quitChan chan struct{} +} + +// NewSubscriptionManager creates a new subscription manager. +func NewSubscriptionManager[E any](subscription Subscription[E], +) *SubscriptionManager[E] { + + return &SubscriptionManager[E]{ + subscription: subscription, + backoff: time.Second * 2, + quitChan: make(chan struct{}), + } +} + +// IsSubscribed returns true if the subscription manager is currently +// subscribed. +func (sm *SubscriptionManager[E]) IsSubscribed() bool { + sm.mutex.Lock() + defer sm.mutex.Unlock() + return sm.isSubscribed +} + +// Start starts the subscription manager. +func (sm *SubscriptionManager[E]) Start(ctx context.Context) { + sm.mutex.Lock() + if sm.isSubscribed { + sm.mutex.Unlock() + return + } + sm.mutex.Unlock() + + go sm.manageSubscription(ctx) +} + +// Stop stops the subscription manager. +func (sm *SubscriptionManager[E]) Stop() { + close(sm.quitChan) +} + +// manageSubscription manages the subscription lifecycle. +func (sm *SubscriptionManager[E]) manageSubscription(ctx context.Context) { + defer func() { + sm.mutex.Lock() + sm.isSubscribed = false + sm.mutex.Unlock() + }() + + // The outer loop is used to retry the subscription. In case of an + // error it will retry the subscription after a backoff, until the + // context is done or the quit channel is closed. + for { + eventChan, errChan, err := sm.subscription.Subscribe(ctx) + if err != nil { + sm.subscription.HandleError(err) + if !sm.shouldRetry(ctx) { + return + } + continue + } + + sm.mutex.Lock() + sm.isSubscribed = true + sm.mutex.Unlock() + + // The inner loop is used to handle events and errors. It will + // retry the subscription in case of an error, until the context + // is done or the quit channel is closed. + handleLoop: + for { + select { + case event, ok := <-eventChan: + if !ok { + if !sm.shouldRetry(ctx) { + return + } + break handleLoop + } + if err := sm.subscription.HandleEvent(event); err != nil { + sm.subscription.HandleError(err) + } + + case err, ok := <-errChan: + if !ok || err == nil { + if !sm.shouldRetry(ctx) { + return + } + break handleLoop + } + sm.subscription.HandleError(err) + if !sm.shouldRetry(ctx) { + return + } + // If we receive an error we break out of the + // handleLoop to retry the subscription. + break handleLoop + + case <-ctx.Done(): + return + + case <-sm.quitChan: + return + } + } + } +} + +// shouldRetry determines if the subscription manager should retry the +// subscription. +func (sm *SubscriptionManager[E]) shouldRetry(ctx context.Context) bool { + sm.mutex.Lock() + sm.isSubscribed = false + sm.mutex.Unlock() + + select { + case <-sm.quitChan: + return false + case <-ctx.Done(): + return false + case <-time.After(sm.backoff): + // Exponential backoff with cap + if sm.backoff < time.Minute { + sm.backoff *= 2 + } + return true + } +} From 6a70166ebf23a9893496d2da817b585dc7d909ad Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 3 Dec 2024 13:27:12 +0100 Subject: [PATCH 02/14] fsm: add generic fsm This commit adds a generic fsm which will help with threadsafe access for fsm values --- fsm/generic_fsm.go | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 fsm/generic_fsm.go diff --git a/fsm/generic_fsm.go b/fsm/generic_fsm.go new file mode 100644 index 000000000..5a430cafd --- /dev/null +++ b/fsm/generic_fsm.go @@ -0,0 +1,72 @@ +package fsm + +import "sync" + +type GenericFSM[T any] struct { + *StateMachine + + Val *T + ValLock sync.RWMutex +} + +// NewGenericFSM creates a new generic FSM with the given initial state and +// value. +func NewGenericFSM[T any](fsm *StateMachine, val *T) *GenericFSM[T] { + return &GenericFSM[T]{ + StateMachine: fsm, + Val: val, + } +} + +type callOptions struct { + withMainMutex bool +} + +// CallOption is a functional option that can be used to modify the runFuncs. +type CallOption func(*callOptions) + +// WithMainMutex is an option that can be used to run the function with the main +// mutex locked. This requires the FSM to not be currently running an action. +func WithMainMutex() CallOption { + return func(o *callOptions) { + o.withMainMutex = true + } +} + +// RunFunc runs the given function in the FSM. It locks the FSM value lock +// before running the function and unlocks it after the function is done. +func (fsm *GenericFSM[T]) RunFunc(fn func(val *T) error, options ...CallOption, +) error { + + opts := &callOptions{} + for _, option := range options { + option(opts) + } + + fsm.ValLock.Lock() + defer fsm.ValLock.Unlock() + if opts.withMainMutex { + fsm.mutex.Lock() + defer fsm.mutex.Unlock() + } + + return fn(fsm.Val) +} + +// GetVal returns the value of the FSM. +func (fsm *GenericFSM[T]) GetVal(options ...CallOption) *T { + opts := &callOptions{} + for _, option := range options { + option(opts) + } + + fsm.ValLock.RLock() + defer fsm.ValLock.RUnlock() + + if opts.withMainMutex { + fsm.mutex.Lock() + defer fsm.mutex.Unlock() + } + + return fsm.Val +} From 7037ecb4e18bbd0b6b33feafdf1fdc4954bd4e63 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 3 Dec 2024 13:27:38 +0100 Subject: [PATCH 03/14] fsm: add helper to acquire lock This commit adds a helper function to the fsm to acquire the fsm lock and safely acces members. --- fsm/fsm.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fsm/fsm.go b/fsm/fsm.go index a16a33567..3a71637ca 100644 --- a/fsm/fsm.go +++ b/fsm/fsm.go @@ -269,6 +269,27 @@ func (s *StateMachine) SendEvent(ctx context.Context, event EventType, } } +// GetStateMachineLock locks the state machine mutex and returns a function that +// unlocks it. +func (s *StateMachine) GetStateMachineLock(ctx context.Context) (func(), error) { + gotLock := make(chan struct{}) + // Try to get the lock. + go func() { + s.mutex.Lock() + close(gotLock) + }() + + for { + select { + case <-ctx.Done(): + return nil, errors.New("context canceled") + + case <-gotLock: + return s.mutex.Unlock, nil + } + } +} + // RegisterObserver registers an observer with the state machine. func (s *StateMachine) RegisterObserver(observer Observer) { s.observerMutex.Lock() From 82f9246dfbdc60210a556d656bcfd8130b348d77 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:22:20 +0200 Subject: [PATCH 04/14] hyperloop: create hyperloop package This commit adds the initial logger and interfaces to the hyperloop package. --- hyperloop/interfaces.go | 38 ++++++++++++++++++++++++++++++++++++++ hyperloop/log.go | 26 ++++++++++++++++++++++++++ loopd/log.go | 4 ++++ 3 files changed, 68 insertions(+) create mode 100644 hyperloop/interfaces.go create mode 100644 hyperloop/log.go diff --git a/hyperloop/interfaces.go b/hyperloop/interfaces.go new file mode 100644 index 000000000..2566d43cd --- /dev/null +++ b/hyperloop/interfaces.go @@ -0,0 +1,38 @@ +package hyperloop + +import ( + "context" + + "github.com/btcsuite/btcd/btcutil" +) + +// Store is the interface that stores the hyperloop. +type Store interface { + // CreateHyperloop stores the hyperloop in the database. + CreateHyperloop(ctx context.Context, hyperloop *Hyperloop) error + + // UpdateHyperloop updates the hyperloop in the database. + UpdateHyperloop(ctx context.Context, hyperloop *Hyperloop) error + + // CreateHyperloopParticipant stores the hyperloop participant in the + // database. + CreateHyperloopParticipant(ctx context.Context, + participant *HyperloopParticipant) error + + // UpdateHyperloopParticipant updates the hyperloop participant in the + // database. + UpdateHyperloopParticipant(ctx context.Context, + participant *HyperloopParticipant) error + + // GetHyperloop retrieves the hyperloop from the database. + GetHyperloop(ctx context.Context, id ID) (*Hyperloop, error) + + // ListHyperloops lists all existing hyperloops the client has ever + // made. + ListHyperloops(ctx context.Context) ([]*Hyperloop, error) +} + +type HyperloopManager interface { + fetchHyperLoopTotalSweepAmt(hyperloopID ID, + sweepAddr btcutil.Address) (btcutil.Amount, error) +} diff --git a/hyperloop/log.go b/hyperloop/log.go new file mode 100644 index 000000000..8f0999ece --- /dev/null +++ b/hyperloop/log.go @@ -0,0 +1,26 @@ +package hyperloop + +import ( + "github.com/btcsuite/btclog" + "github.com/lightningnetwork/lnd/build" +) + +// Subsystem defines the sub system name of this package. +const Subsystem = "HYPRL" + +// log is a logger that is initialized with no output filters. This +// means the package will not perform any logging by default until the caller +// requests it. +var log btclog.Logger + +// The default amount of logging is none. +func init() { + UseLogger(build.NewSubLogger(Subsystem, nil)) +} + +// UseLogger uses a specified Logger to output package logging info. +// This should be used in preference to SetLogWriter if the caller is also +// using btclog. +func UseLogger(logger btclog.Logger) { + log = logger +} diff --git a/loopd/log.go b/loopd/log.go index ef8c64779..6183b18e0 100644 --- a/loopd/log.go +++ b/loopd/log.go @@ -6,6 +6,7 @@ import ( "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/hyperloop" "github.com/lightninglabs/loop/instantout" "github.com/lightninglabs/loop/instantout/reservation" "github.com/lightninglabs/loop/liquidity" @@ -54,6 +55,9 @@ func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor) { lnd.AddSubLogger( root, sweep.Subsystem, intercept, sweep.UseLogger, ) + lnd.AddSubLogger( + root, hyperloop.Subsystem, intercept, hyperloop.UseLogger, + ) } // genSubLogger creates a logger for a subsystem. We provide an instance of From dac2cb3f9e090f8194f6565c1897569ab7a873a8 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:30:58 +0200 Subject: [PATCH 05/14] hyperloop: add hyperloop script --- hyperloop/script.go | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 hyperloop/script.go diff --git a/hyperloop/script.go b/hyperloop/script.go new file mode 100644 index 000000000..c32dba90f --- /dev/null +++ b/hyperloop/script.go @@ -0,0 +1,119 @@ +package hyperloop + +import ( + "fmt" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr" + "github.com/btcsuite/btcd/txscript" + "github.com/lightningnetwork/lnd/input" +) + +const ( + + // TaprootMultiSigWitnessSize evaluates to 66 bytes: + // - num_witness_elements: 1 byte + // - sig_varint_len: 1 byte + // - : 64 bytes + TaprootMultiSigWitnessSize = 1 + 1 + 64 + + // TaprootExpiryScriptSize evaluates to 39 bytes: + // - OP_DATA: 1 byte (trader_key length) + // - : 32 bytes + // - OP_CHECKSIGVERIFY: 1 byte + // - : 4 bytes + // - OP_CHECKLOCKTIMEVERIFY: 1 byte + TaprootExpiryScriptSize = 1 + 32 + 1 + 4 + 1 + + // TaprootExpiryWitnessSize evaluates to 140 bytes: + // - num_witness_elements: 1 byte + // - trader_sig_varint_len: 1 byte (trader_sig length) + // - : 64 bytes + // - witness_script_varint_len: 1 byte (script length) + // - : 39 bytes + // - control_block_varint_len: 1 byte (control block length) + // - : 33 bytes + TaprootExpiryWitnessSize = 1 + 1 + 64 + 1 + TaprootExpiryScriptSize + 1 + 33 +) + +func HyperLoopScript(expiry uint32, serverKey *btcec.PublicKey, + clientKeys []*btcec.PublicKey) ([]byte, error) { + + taprootKey, _, _, err := TaprootKey(expiry, serverKey, clientKeys) + if err != nil { + return nil, err + } + return PayToWitnessTaprootScript(taprootKey) +} + +// TaprootKey returns the aggregated MuSig2 combined internal key and the +// tweaked Taproot key of an hyperloop output, as well as the expiry script tap +// leaf. +func TaprootKey(expiry uint32, serverKey *btcec.PublicKey, + clientKeys []*btcec.PublicKey) (*btcec.PublicKey, *btcec.PublicKey, + *txscript.TapLeaf, error) { + + expiryLeaf, err := TaprootExpiryScript(expiry, serverKey) + if err != nil { + return nil, nil, nil, err + } + + rootHash := expiryLeaf.TapHash() + + aggregateKey, err := input.MuSig2CombineKeys( + input.MuSig2Version100RC2, + clientKeys, + true, + &input.MuSig2Tweaks{ + TaprootTweak: rootHash[:], + }, + ) + if err != nil { + return nil, nil, nil, fmt.Errorf("error combining keys: %v", err) + } + + return aggregateKey.FinalKey, aggregateKey.PreTweakedKey, expiryLeaf, nil +} + +// PayToWitnessTaprootScript creates a new script to pay to a version 1 +// (taproot) witness program. The passed hash is expected to be valid. +func PayToWitnessTaprootScript(taprootKey *btcec.PublicKey) ([]byte, error) { + builder := txscript.NewScriptBuilder() + + builder.AddOp(txscript.OP_1) + builder.AddData(schnorr.SerializePubKey(taprootKey)) + + return builder.Script() +} + +// TaprootExpiryScript returns the leaf script of the expiry script path. +// +// OP_CHECKSIGVERIFY OP_CHECKSEQUENCEVERIFY. +func TaprootExpiryScript(expiry uint32, + serverKey *btcec.PublicKey) (*txscript.TapLeaf, error) { + + builder := txscript.NewScriptBuilder() + + builder.AddData(schnorr.SerializePubKey(serverKey)) + builder.AddOp(txscript.OP_CHECKSIGVERIFY) + + builder.AddInt64(int64(expiry)) + builder.AddOp(txscript.OP_CHECKSEQUENCEVERIFY) + + script, err := builder.Script() + if err != nil { + return nil, err + } + + leaf := txscript.NewBaseTapLeaf(script) + return &leaf, nil +} + +func ExpirySpendWeight() int64 { + var weightEstimator input.TxWeightEstimator + weightEstimator.AddWitnessInput(TaprootExpiryWitnessSize) + + weightEstimator.AddP2TROutput() + + return int64(weightEstimator.Weight()) +} From 3716adb6f1033eb232ea4f3aed0e1e87838937a7 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:32:09 +0200 Subject: [PATCH 06/14] swapserverrpc: add hyperloop service --- swapserverrpc/hyperloop.pb.go | 2298 ++++++++++++++++++++++++++++ swapserverrpc/hyperloop.proto | 178 +++ swapserverrpc/hyperloop_grpc.pb.go | 525 +++++++ 3 files changed, 3001 insertions(+) create mode 100644 swapserverrpc/hyperloop.pb.go create mode 100644 swapserverrpc/hyperloop.proto create mode 100644 swapserverrpc/hyperloop_grpc.pb.go diff --git a/swapserverrpc/hyperloop.pb.go b/swapserverrpc/hyperloop.pb.go new file mode 100644 index 000000000..f8fc3e668 --- /dev/null +++ b/swapserverrpc/hyperloop.pb.go @@ -0,0 +1,2298 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.21.12 +// source: hyperloop.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 HyperloopStatus int32 + +const ( + HyperloopStatus_UNDEFINED HyperloopStatus = 0 + HyperloopStatus_PENDING HyperloopStatus = 1 + HyperloopStatus_PUBLISHED HyperloopStatus = 2 + HyperloopStatus_WAIT_FOR_HTLC_NONCES HyperloopStatus = 3 + HyperloopStatus_WAIT_FOR_HTLC_SIGS HyperloopStatus = 4 + HyperloopStatus_WAIT_FOR_PREIMAGES HyperloopStatus = 5 + HyperloopStatus_WAIT_FOR_SWEEPLESS_SWEEP_SIGS HyperloopStatus = 6 + HyperloopStatus_SWEEPLESS_SWEEP_PUBLISHED HyperloopStatus = 7 + HyperloopStatus_SWEEPLESS_SWEEP_CONFIRMED HyperloopStatus = 8 + HyperloopStatus_HYPERLOOP_FAILED HyperloopStatus = 9 +) + +// Enum value maps for HyperloopStatus. +var ( + HyperloopStatus_name = map[int32]string{ + 0: "UNDEFINED", + 1: "PENDING", + 2: "PUBLISHED", + 3: "WAIT_FOR_HTLC_NONCES", + 4: "WAIT_FOR_HTLC_SIGS", + 5: "WAIT_FOR_PREIMAGES", + 6: "WAIT_FOR_SWEEPLESS_SWEEP_SIGS", + 7: "SWEEPLESS_SWEEP_PUBLISHED", + 8: "SWEEPLESS_SWEEP_CONFIRMED", + 9: "HYPERLOOP_FAILED", + } + HyperloopStatus_value = map[string]int32{ + "UNDEFINED": 0, + "PENDING": 1, + "PUBLISHED": 2, + "WAIT_FOR_HTLC_NONCES": 3, + "WAIT_FOR_HTLC_SIGS": 4, + "WAIT_FOR_PREIMAGES": 5, + "WAIT_FOR_SWEEPLESS_SWEEP_SIGS": 6, + "SWEEPLESS_SWEEP_PUBLISHED": 7, + "SWEEPLESS_SWEEP_CONFIRMED": 8, + "HYPERLOOP_FAILED": 9, + } +) + +func (x HyperloopStatus) Enum() *HyperloopStatus { + p := new(HyperloopStatus) + *p = x + return p +} + +func (x HyperloopStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HyperloopStatus) Descriptor() protoreflect.EnumDescriptor { + return file_hyperloop_proto_enumTypes[0].Descriptor() +} + +func (HyperloopStatus) Type() protoreflect.EnumType { + return &file_hyperloop_proto_enumTypes[0] +} + +func (x HyperloopStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HyperloopStatus.Descriptor instead. +func (HyperloopStatus) EnumDescriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{0} +} + +type HyperloopNotificationStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *HyperloopNotificationStreamRequest) Reset() { + *x = HyperloopNotificationStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperloopNotificationStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperloopNotificationStreamRequest) ProtoMessage() {} + +func (x *HyperloopNotificationStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 HyperloopNotificationStreamRequest.ProtoReflect.Descriptor instead. +func (*HyperloopNotificationStreamRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{0} +} + +func (x *HyperloopNotificationStreamRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type HyperloopNotificationStreamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status HyperloopStatus `protobuf:"varint,1,opt,name=status,proto3,enum=looprpc.HyperloopStatus" json:"status,omitempty"` +} + +func (x *HyperloopNotificationStreamResponse) Reset() { + *x = HyperloopNotificationStreamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperloopNotificationStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperloopNotificationStreamResponse) ProtoMessage() {} + +func (x *HyperloopNotificationStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 HyperloopNotificationStreamResponse.ProtoReflect.Descriptor instead. +func (*HyperloopNotificationStreamResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{1} +} + +func (x *HyperloopNotificationStreamResponse) GetStatus() HyperloopStatus { + if x != nil { + return x.Status + } + return HyperloopStatus_UNDEFINED +} + +type GetPendingHyperloopRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetPendingHyperloopRequest) Reset() { + *x = GetPendingHyperloopRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPendingHyperloopRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPendingHyperloopRequest) ProtoMessage() {} + +func (x *GetPendingHyperloopRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 GetPendingHyperloopRequest.ProtoReflect.Descriptor instead. +func (*GetPendingHyperloopRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{2} +} + +type GetPendingHyperloopResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PendingPrivateHyperloop *PendingHyperloop `protobuf:"bytes,1,opt,name=pending_private_hyperloop,json=pendingPrivateHyperloop,proto3" json:"pending_private_hyperloop,omitempty"` +} + +func (x *GetPendingHyperloopResponse) Reset() { + *x = GetPendingHyperloopResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPendingHyperloopResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPendingHyperloopResponse) ProtoMessage() {} + +func (x *GetPendingHyperloopResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 GetPendingHyperloopResponse.ProtoReflect.Descriptor instead. +func (*GetPendingHyperloopResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{3} +} + +func (x *GetPendingHyperloopResponse) GetPendingPrivateHyperloop() *PendingHyperloop { + if x != nil { + return x.PendingPrivateHyperloop + } + return nil +} + +type PendingHyperloop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + PublishDeadlineUnix int64 `protobuf:"varint,2,opt,name=publish_deadline_unix,json=publishDeadlineUnix,proto3" json:"publish_deadline_unix,omitempty"` + ParticipantCount int32 `protobuf:"varint,3,opt,name=participant_count,json=participantCount,proto3" json:"participant_count,omitempty"` +} + +func (x *PendingHyperloop) Reset() { + *x = PendingHyperloop{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingHyperloop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingHyperloop) ProtoMessage() {} + +func (x *PendingHyperloop) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 PendingHyperloop.ProtoReflect.Descriptor instead. +func (*PendingHyperloop) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{4} +} + +func (x *PendingHyperloop) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *PendingHyperloop) GetPublishDeadlineUnix() int64 { + if x != nil { + return x.PublishDeadlineUnix + } + return 0 +} + +func (x *PendingHyperloop) GetParticipantCount() int32 { + if x != nil { + return x.ParticipantCount + } + return 0 +} + +type RegisterHyperloopRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReceiverKey []byte `protobuf:"bytes,1,opt,name=receiver_key,json=receiverKey,proto3" json:"receiver_key,omitempty"` + SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + Amt int64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"` + HyperloopPublishTimeUnix int64 `protobuf:"varint,4,opt,name=hyperloop_publish_time_unix,json=hyperloopPublishTimeUnix,proto3" json:"hyperloop_publish_time_unix,omitempty"` + SweepAddr string `protobuf:"bytes,5,opt,name=sweep_addr,json=sweepAddr,proto3" json:"sweep_addr,omitempty"` + Private bool `protobuf:"varint,6,opt,name=private,proto3" json:"private,omitempty"` +} + +func (x *RegisterHyperloopRequest) Reset() { + *x = RegisterHyperloopRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterHyperloopRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterHyperloopRequest) ProtoMessage() {} + +func (x *RegisterHyperloopRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 RegisterHyperloopRequest.ProtoReflect.Descriptor instead. +func (*RegisterHyperloopRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{5} +} + +func (x *RegisterHyperloopRequest) GetReceiverKey() []byte { + if x != nil { + return x.ReceiverKey + } + return nil +} + +func (x *RegisterHyperloopRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *RegisterHyperloopRequest) GetAmt() int64 { + if x != nil { + return x.Amt + } + return 0 +} + +func (x *RegisterHyperloopRequest) GetHyperloopPublishTimeUnix() int64 { + if x != nil { + return x.HyperloopPublishTimeUnix + } + return 0 +} + +func (x *RegisterHyperloopRequest) GetSweepAddr() string { + if x != nil { + return x.SweepAddr + } + return "" +} + +func (x *RegisterHyperloopRequest) GetPrivate() bool { + if x != nil { + return x.Private + } + return false +} + +type RegisterHyperloopResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + ServerKey []byte `protobuf:"bytes,2,opt,name=server_key,json=serverKey,proto3" json:"server_key,omitempty"` + HtlcCltvExpiry int32 `protobuf:"varint,3,opt,name=htlc_cltv_expiry,json=htlcCltvExpiry,proto3" json:"htlc_cltv_expiry,omitempty"` + HyperloopCsvExpiry int32 `protobuf:"varint,4,opt,name=hyperloop_csv_expiry,json=hyperloopCsvExpiry,proto3" json:"hyperloop_csv_expiry,omitempty"` + Invoice string `protobuf:"bytes,5,opt,name=invoice,proto3" json:"invoice,omitempty"` +} + +func (x *RegisterHyperloopResponse) Reset() { + *x = RegisterHyperloopResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterHyperloopResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterHyperloopResponse) ProtoMessage() {} + +func (x *RegisterHyperloopResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 RegisterHyperloopResponse.ProtoReflect.Descriptor instead. +func (*RegisterHyperloopResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{6} +} + +func (x *RegisterHyperloopResponse) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *RegisterHyperloopResponse) GetServerKey() []byte { + if x != nil { + return x.ServerKey + } + return nil +} + +func (x *RegisterHyperloopResponse) GetHtlcCltvExpiry() int32 { + if x != nil { + return x.HtlcCltvExpiry + } + return 0 +} + +func (x *RegisterHyperloopResponse) GetHyperloopCsvExpiry() int32 { + if x != nil { + return x.HyperloopCsvExpiry + } + return 0 +} + +func (x *RegisterHyperloopResponse) GetInvoice() string { + if x != nil { + return x.Invoice + } + return "" +} + +type FetchHyperloopHtlcFeeRatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *FetchHyperloopHtlcFeeRatesRequest) Reset() { + *x = FetchHyperloopHtlcFeeRatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcFeeRatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcFeeRatesRequest) ProtoMessage() {} + +func (x *FetchHyperloopHtlcFeeRatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 FetchHyperloopHtlcFeeRatesRequest.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcFeeRatesRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{7} +} + +func (x *FetchHyperloopHtlcFeeRatesRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type FetchHyperloopHtlcFeeRatesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HtlcFeeRates []int64 `protobuf:"varint,1,rep,packed,name=htlc_fee_rates,json=htlcFeeRates,proto3" json:"htlc_fee_rates,omitempty"` +} + +func (x *FetchHyperloopHtlcFeeRatesResponse) Reset() { + *x = FetchHyperloopHtlcFeeRatesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcFeeRatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcFeeRatesResponse) ProtoMessage() {} + +func (x *FetchHyperloopHtlcFeeRatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 FetchHyperloopHtlcFeeRatesResponse.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcFeeRatesResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{8} +} + +func (x *FetchHyperloopHtlcFeeRatesResponse) GetHtlcFeeRates() []int64 { + if x != nil { + return x.HtlcFeeRates + } + return nil +} + +type FetchHyperloopParticipantsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *FetchHyperloopParticipantsRequest) Reset() { + *x = FetchHyperloopParticipantsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopParticipantsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopParticipantsRequest) ProtoMessage() {} + +func (x *FetchHyperloopParticipantsRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 FetchHyperloopParticipantsRequest.ProtoReflect.Descriptor instead. +func (*FetchHyperloopParticipantsRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{9} +} + +func (x *FetchHyperloopParticipantsRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type FetchHyperloopParticipantsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Participants []*HyperloopParticipant `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"` +} + +func (x *FetchHyperloopParticipantsResponse) Reset() { + *x = FetchHyperloopParticipantsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopParticipantsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopParticipantsResponse) ProtoMessage() {} + +func (x *FetchHyperloopParticipantsResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 FetchHyperloopParticipantsResponse.ProtoReflect.Descriptor instead. +func (*FetchHyperloopParticipantsResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{10} +} + +func (x *FetchHyperloopParticipantsResponse) GetParticipants() []*HyperloopParticipant { + if x != nil { + return x.Participants + } + return nil +} + +type HyperloopParticipant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + SweepAddr string `protobuf:"bytes,2,opt,name=sweep_addr,json=sweepAddr,proto3" json:"sweep_addr,omitempty"` +} + +func (x *HyperloopParticipant) Reset() { + *x = HyperloopParticipant{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperloopParticipant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperloopParticipant) ProtoMessage() {} + +func (x *HyperloopParticipant) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_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 HyperloopParticipant.ProtoReflect.Descriptor instead. +func (*HyperloopParticipant) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{11} +} + +func (x *HyperloopParticipant) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *HyperloopParticipant) GetSweepAddr() string { + if x != nil { + return x.SweepAddr + } + return "" +} + +type PushHyperloopHtlcNoncesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + HtlcNonces map[int64][]byte `protobuf:"bytes,3,rep,name=htlc_nonces,json=htlcNonces,proto3" json:"htlc_nonces,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PushHyperloopHtlcNoncesRequest) Reset() { + *x = PushHyperloopHtlcNoncesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopHtlcNoncesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopHtlcNoncesRequest) ProtoMessage() {} + +func (x *PushHyperloopHtlcNoncesRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[12] + 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 PushHyperloopHtlcNoncesRequest.ProtoReflect.Descriptor instead. +func (*PushHyperloopHtlcNoncesRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{12} +} + +func (x *PushHyperloopHtlcNoncesRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *PushHyperloopHtlcNoncesRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *PushHyperloopHtlcNoncesRequest) GetHtlcNonces() map[int64][]byte { + if x != nil { + return x.HtlcNonces + } + return nil +} + +type PushHyperloopHtlcNoncesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerHtlcNonces map[int64][]byte `protobuf:"bytes,1,rep,name=server_htlc_nonces,json=serverHtlcNonces,proto3" json:"server_htlc_nonces,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + HtlcRawTxns map[int64][]byte `protobuf:"bytes,2,rep,name=htlc_raw_txns,json=htlcRawTxns,proto3" json:"htlc_raw_txns,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PushHyperloopHtlcNoncesResponse) Reset() { + *x = PushHyperloopHtlcNoncesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopHtlcNoncesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopHtlcNoncesResponse) ProtoMessage() {} + +func (x *PushHyperloopHtlcNoncesResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[13] + 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 PushHyperloopHtlcNoncesResponse.ProtoReflect.Descriptor instead. +func (*PushHyperloopHtlcNoncesResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{13} +} + +func (x *PushHyperloopHtlcNoncesResponse) GetServerHtlcNonces() map[int64][]byte { + if x != nil { + return x.ServerHtlcNonces + } + return nil +} + +func (x *PushHyperloopHtlcNoncesResponse) GetHtlcRawTxns() map[int64][]byte { + if x != nil { + return x.HtlcRawTxns + } + return nil +} + +type FetchHyperloopHtlcNoncesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *FetchHyperloopHtlcNoncesRequest) Reset() { + *x = FetchHyperloopHtlcNoncesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcNoncesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcNoncesRequest) ProtoMessage() {} + +func (x *FetchHyperloopHtlcNoncesRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[14] + 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 FetchHyperloopHtlcNoncesRequest.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcNoncesRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{14} +} + +func (x *FetchHyperloopHtlcNoncesRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type ParticipantNonces struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParticipantNonce [][]byte `protobuf:"bytes,1,rep,name=participant_nonce,json=participantNonce,proto3" json:"participant_nonce,omitempty"` +} + +func (x *ParticipantNonces) Reset() { + *x = ParticipantNonces{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParticipantNonces) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParticipantNonces) ProtoMessage() {} + +func (x *ParticipantNonces) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[15] + 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 ParticipantNonces.ProtoReflect.Descriptor instead. +func (*ParticipantNonces) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{15} +} + +func (x *ParticipantNonces) GetParticipantNonce() [][]byte { + if x != nil { + return x.ParticipantNonce + } + return nil +} + +type FetchHyperloopHtlcNoncesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HtlcNoncesByFees map[int64]*ParticipantNonces `protobuf:"bytes,1,rep,name=htlc_nonces_by_fees,json=htlcNoncesByFees,proto3" json:"htlc_nonces_by_fees,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *FetchHyperloopHtlcNoncesResponse) Reset() { + *x = FetchHyperloopHtlcNoncesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcNoncesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcNoncesResponse) ProtoMessage() {} + +func (x *FetchHyperloopHtlcNoncesResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[16] + 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 FetchHyperloopHtlcNoncesResponse.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcNoncesResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{16} +} + +func (x *FetchHyperloopHtlcNoncesResponse) GetHtlcNoncesByFees() map[int64]*ParticipantNonces { + if x != nil { + return x.HtlcNoncesByFees + } + return nil +} + +type PushHyperloopHtlcSigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + HtlcSigs map[int64][]byte `protobuf:"bytes,3,rep,name=htlc_sigs,json=htlcSigs,proto3" json:"htlc_sigs,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PushHyperloopHtlcSigRequest) Reset() { + *x = PushHyperloopHtlcSigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopHtlcSigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopHtlcSigRequest) ProtoMessage() {} + +func (x *PushHyperloopHtlcSigRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[17] + 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 PushHyperloopHtlcSigRequest.ProtoReflect.Descriptor instead. +func (*PushHyperloopHtlcSigRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{17} +} + +func (x *PushHyperloopHtlcSigRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *PushHyperloopHtlcSigRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *PushHyperloopHtlcSigRequest) GetHtlcSigs() map[int64][]byte { + if x != nil { + return x.HtlcSigs + } + return nil +} + +type PushHyperloopHtlcSigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PushHyperloopHtlcSigResponse) Reset() { + *x = PushHyperloopHtlcSigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopHtlcSigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopHtlcSigResponse) ProtoMessage() {} + +func (x *PushHyperloopHtlcSigResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[18] + 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 PushHyperloopHtlcSigResponse.ProtoReflect.Descriptor instead. +func (*PushHyperloopHtlcSigResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{18} +} + +type FetchHyperloopHtlcSigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *FetchHyperloopHtlcSigRequest) Reset() { + *x = FetchHyperloopHtlcSigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcSigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcSigRequest) ProtoMessage() {} + +func (x *FetchHyperloopHtlcSigRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[19] + 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 FetchHyperloopHtlcSigRequest.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcSigRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{19} +} + +func (x *FetchHyperloopHtlcSigRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type FetchHyperloopHtlcSigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HtlcSigsByFees map[int64][]byte `protobuf:"bytes,1,rep,name=htlc_sigs_by_fees,json=htlcSigsByFees,proto3" json:"htlc_sigs_by_fees,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *FetchHyperloopHtlcSigResponse) Reset() { + *x = FetchHyperloopHtlcSigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopHtlcSigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopHtlcSigResponse) ProtoMessage() {} + +func (x *FetchHyperloopHtlcSigResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[20] + 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 FetchHyperloopHtlcSigResponse.ProtoReflect.Descriptor instead. +func (*FetchHyperloopHtlcSigResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{20} +} + +func (x *FetchHyperloopHtlcSigResponse) GetHtlcSigsByFees() map[int64][]byte { + if x != nil { + return x.HtlcSigsByFees + } + return nil +} + +type PushHyperloopPreimageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + Preimage []byte `protobuf:"bytes,2,opt,name=preimage,proto3" json:"preimage,omitempty"` + SweepNonce []byte `protobuf:"bytes,3,opt,name=sweep_nonce,json=sweepNonce,proto3" json:"sweep_nonce,omitempty"` +} + +func (x *PushHyperloopPreimageRequest) Reset() { + *x = PushHyperloopPreimageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopPreimageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopPreimageRequest) ProtoMessage() {} + +func (x *PushHyperloopPreimageRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[21] + 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 PushHyperloopPreimageRequest.ProtoReflect.Descriptor instead. +func (*PushHyperloopPreimageRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{21} +} + +func (x *PushHyperloopPreimageRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *PushHyperloopPreimageRequest) GetPreimage() []byte { + if x != nil { + return x.Preimage + } + return nil +} + +func (x *PushHyperloopPreimageRequest) GetSweepNonce() []byte { + if x != nil { + return x.SweepNonce + } + return nil +} + +type PushHyperloopPreimageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerSweepNonce []byte `protobuf:"bytes,1,opt,name=server_sweep_nonce,json=serverSweepNonce,proto3" json:"server_sweep_nonce,omitempty"` + SweepRawTx []byte `protobuf:"bytes,2,opt,name=sweep_raw_tx,json=sweepRawTx,proto3" json:"sweep_raw_tx,omitempty"` + SweepFeeRate int64 `protobuf:"varint,3,opt,name=sweep_fee_rate,json=sweepFeeRate,proto3" json:"sweep_fee_rate,omitempty"` +} + +func (x *PushHyperloopPreimageResponse) Reset() { + *x = PushHyperloopPreimageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopPreimageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopPreimageResponse) ProtoMessage() {} + +func (x *PushHyperloopPreimageResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[22] + 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 PushHyperloopPreimageResponse.ProtoReflect.Descriptor instead. +func (*PushHyperloopPreimageResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{22} +} + +func (x *PushHyperloopPreimageResponse) GetServerSweepNonce() []byte { + if x != nil { + return x.ServerSweepNonce + } + return nil +} + +func (x *PushHyperloopPreimageResponse) GetSweepRawTx() []byte { + if x != nil { + return x.SweepRawTx + } + return nil +} + +func (x *PushHyperloopPreimageResponse) GetSweepFeeRate() int64 { + if x != nil { + return x.SweepFeeRate + } + return 0 +} + +type FetchHyperloopSweeplessSweepNonceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` +} + +func (x *FetchHyperloopSweeplessSweepNonceRequest) Reset() { + *x = FetchHyperloopSweeplessSweepNonceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopSweeplessSweepNonceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopSweeplessSweepNonceRequest) ProtoMessage() {} + +func (x *FetchHyperloopSweeplessSweepNonceRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[23] + 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 FetchHyperloopSweeplessSweepNonceRequest.ProtoReflect.Descriptor instead. +func (*FetchHyperloopSweeplessSweepNonceRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{23} +} + +func (x *FetchHyperloopSweeplessSweepNonceRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +type FetchHyperloopSweeplessSweepNonceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SweeplessSweepNonces [][]byte `protobuf:"bytes,1,rep,name=sweepless_sweep_nonces,json=sweeplessSweepNonces,proto3" json:"sweepless_sweep_nonces,omitempty"` +} + +func (x *FetchHyperloopSweeplessSweepNonceResponse) Reset() { + *x = FetchHyperloopSweeplessSweepNonceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchHyperloopSweeplessSweepNonceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchHyperloopSweeplessSweepNonceResponse) ProtoMessage() {} + +func (x *FetchHyperloopSweeplessSweepNonceResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[24] + 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 FetchHyperloopSweeplessSweepNonceResponse.ProtoReflect.Descriptor instead. +func (*FetchHyperloopSweeplessSweepNonceResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{24} +} + +func (x *FetchHyperloopSweeplessSweepNonceResponse) GetSweeplessSweepNonces() [][]byte { + if x != nil { + return x.SweeplessSweepNonces + } + return nil +} + +type PushHyperloopSweeplessSweepSigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HyperloopId []byte `protobuf:"bytes,1,opt,name=hyperloop_id,json=hyperloopId,proto3" json:"hyperloop_id,omitempty"` + SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + SweepSig []byte `protobuf:"bytes,3,opt,name=sweep_sig,json=sweepSig,proto3" json:"sweep_sig,omitempty"` +} + +func (x *PushHyperloopSweeplessSweepSigRequest) Reset() { + *x = PushHyperloopSweeplessSweepSigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopSweeplessSweepSigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopSweeplessSweepSigRequest) ProtoMessage() {} + +func (x *PushHyperloopSweeplessSweepSigRequest) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[25] + 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 PushHyperloopSweeplessSweepSigRequest.ProtoReflect.Descriptor instead. +func (*PushHyperloopSweeplessSweepSigRequest) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{25} +} + +func (x *PushHyperloopSweeplessSweepSigRequest) GetHyperloopId() []byte { + if x != nil { + return x.HyperloopId + } + return nil +} + +func (x *PushHyperloopSweeplessSweepSigRequest) GetSwapHash() []byte { + if x != nil { + return x.SwapHash + } + return nil +} + +func (x *PushHyperloopSweeplessSweepSigRequest) GetSweepSig() []byte { + if x != nil { + return x.SweepSig + } + return nil +} + +type PushHyperloopSweeplessSweepSigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PushHyperloopSweeplessSweepSigResponse) Reset() { + *x = PushHyperloopSweeplessSweepSigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hyperloop_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushHyperloopSweeplessSweepSigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushHyperloopSweeplessSweepSigResponse) ProtoMessage() {} + +func (x *PushHyperloopSweeplessSweepSigResponse) ProtoReflect() protoreflect.Message { + mi := &file_hyperloop_proto_msgTypes[26] + 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 PushHyperloopSweeplessSweepSigResponse.ProtoReflect.Descriptor instead. +func (*PushHyperloopSweeplessSweepSigResponse) Descriptor() ([]byte, []int) { + return file_hyperloop_proto_rawDescGZIP(), []int{26} +} + +var File_hyperloop_proto protoreflect.FileDescriptor + +var file_hyperloop_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x22, 0x47, 0x0a, 0x22, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x23, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x1c, 0x0a, 0x1a, + 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x74, 0x0a, 0x1b, 0x47, 0x65, + 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x19, 0x70, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x52, 0x17, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x22, 0x96, 0x01, 0x0a, 0x10, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, + 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x11, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x18, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 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, 0x10, 0x0a, 0x03, 0x61, 0x6d, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x61, 0x6d, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, + 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x77, 0x65, + 0x65, 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x22, 0xd3, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4b, 0x65, 0x79, + 0x12, 0x28, 0x0a, 0x10, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x63, 0x6c, 0x74, 0x76, 0x5f, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x68, 0x74, 0x6c, 0x63, + 0x43, 0x6c, 0x74, 0x76, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x63, 0x73, 0x76, 0x5f, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x43, 0x73, 0x76, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, + 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, + 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x21, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x46, 0x65, 0x65, 0x52, + 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, 0x64, 0x22, 0x4a, + 0x0a, 0x22, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x48, 0x74, 0x6c, 0x63, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x66, 0x65, 0x65, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0c, 0x68, 0x74, + 0x6c, 0x63, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x22, 0x46, 0x0a, 0x21, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x49, 0x64, 0x22, 0x67, 0x0a, 0x22, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, + 0x6f, 0x70, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x0c, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x77, 0x65, 0x65, 0x70, 0x41, 0x64, 0x64, + 0x72, 0x22, 0xf9, 0x01, 0x0a, 0x1e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, 0x64, 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, 0x58, 0x0a, 0x0b, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0a, 0x68, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x3d, + 0x0a, 0x0f, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf3, 0x02, + 0x0a, 0x1f, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, + 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x6c, 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x74, 0x6c, 0x63, + 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x74, + 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x5d, 0x0a, 0x0d, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x78, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, + 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x52, 0x61, 0x77, 0x54, 0x78, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x68, 0x74, 0x6c, 0x63, 0x52, 0x61, 0x77, 0x54, 0x78, 0x6e, 0x73, 0x1a, 0x43, + 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x48, 0x74, 0x6c, 0x63, 0x52, 0x61, 0x77, 0x54, 0x78, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x1f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, 0x64, 0x22, 0x40, 0x0a, 0x11, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2b, + 0x0a, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0xf3, 0x01, 0x0a, 0x20, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, + 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6e, 0x0a, 0x13, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x5f, + 0x62, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, + 0x63, 0x65, 0x73, 0x42, 0x79, 0x46, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, + 0x68, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x79, 0x46, 0x65, 0x65, 0x73, + 0x1a, 0x5f, 0x0a, 0x15, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x79, + 0x46, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xeb, 0x01, 0x0a, 0x1b, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, + 0x6f, 0x70, 0x49, 0x64, 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, 0x4f, 0x0a, 0x09, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x73, 0x69, 0x67, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, + 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, + 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x53, + 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x68, 0x74, 0x6c, 0x63, 0x53, 0x69, + 0x67, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x1e, 0x0a, 0x1c, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x41, 0x0a, 0x1c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x49, 0x64, 0x22, 0xc9, 0x01, 0x0a, 0x1d, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x73, 0x69, 0x67, + 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x73, + 0x42, 0x79, 0x46, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x68, 0x74, 0x6c, + 0x63, 0x53, 0x69, 0x67, 0x73, 0x42, 0x79, 0x46, 0x65, 0x65, 0x73, 0x1a, 0x41, 0x0a, 0x13, 0x48, + 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x73, 0x42, 0x79, 0x46, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7e, + 0x0a, 0x1c, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, + 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x95, + 0x01, 0x0a, 0x1d, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x77, 0x65, 0x65, 0x70, + 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x20, + 0x0a, 0x0c, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x77, 0x65, 0x65, 0x70, 0x52, 0x61, 0x77, 0x54, 0x78, + 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x77, 0x65, 0x65, 0x70, 0x46, + 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x22, 0x4d, 0x0a, 0x28, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, + 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x29, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, + 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x5f, + 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x14, 0x73, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, + 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x25, 0x50, 0x75, 0x73, + 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, + 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x49, 0x64, 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, 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x73, 0x69, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x77, 0x65, 0x65, 0x70, 0x53, 0x69, 0x67, 0x22, + 0x28, 0x0a, 0x26, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x53, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xfd, 0x01, 0x0a, 0x0f, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, + 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x55, 0x42, + 0x4c, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x41, 0x49, 0x54, + 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x48, 0x54, 0x4c, 0x43, 0x5f, 0x4e, 0x4f, 0x4e, 0x43, 0x45, 0x53, + 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x48, + 0x54, 0x4c, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x53, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x41, + 0x49, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x50, 0x52, 0x45, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x53, + 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x53, + 0x57, 0x45, 0x45, 0x50, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x53, + 0x49, 0x47, 0x53, 0x10, 0x06, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x57, 0x45, 0x45, 0x50, 0x4c, 0x45, + 0x53, 0x53, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, + 0x45, 0x44, 0x10, 0x07, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x57, 0x45, 0x45, 0x50, 0x4c, 0x45, 0x53, + 0x53, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, + 0x44, 0x10, 0x08, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x59, 0x50, 0x45, 0x52, 0x4c, 0x4f, 0x4f, 0x50, + 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x09, 0x32, 0xe0, 0x0a, 0x0a, 0x0f, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x7a, 0x0a, + 0x1b, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2b, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x60, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x12, 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x11, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x12, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x1a, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x46, 0x65, 0x65, + 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, + 0x6c, 0x63, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x46, 0x65, + 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, + 0x0a, 0x1a, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, + 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x17, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x27, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, + 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x18, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x28, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, + 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x73, 0x12, 0x24, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, + 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, + 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x16, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, + 0x53, 0x69, 0x67, 0x73, 0x12, 0x25, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, + 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, + 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x6f, 0x6f, 0x70, 0x48, 0x74, 0x6c, 0x63, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x15, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, + 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x21, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, + 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, + 0x65, 0x12, 0x31, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, + 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, + 0x65, 0x74, 0x63, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, + 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x1e, 0x50, 0x75, 0x73, + 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, + 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, 0x70, 0x53, 0x69, 0x67, 0x12, 0x2e, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, + 0x70, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x48, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x6f, 0x6f, 0x70, 0x53, 0x77, 0x65, 0x65, 0x70, 0x6c, 0x65, 0x73, 0x73, 0x53, 0x77, 0x65, 0x65, + 0x70, 0x53, 0x69, 0x67, 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_hyperloop_proto_rawDescOnce sync.Once + file_hyperloop_proto_rawDescData = file_hyperloop_proto_rawDesc +) + +func file_hyperloop_proto_rawDescGZIP() []byte { + file_hyperloop_proto_rawDescOnce.Do(func() { + file_hyperloop_proto_rawDescData = protoimpl.X.CompressGZIP(file_hyperloop_proto_rawDescData) + }) + return file_hyperloop_proto_rawDescData +} + +var file_hyperloop_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_hyperloop_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_hyperloop_proto_goTypes = []interface{}{ + (HyperloopStatus)(0), // 0: looprpc.HyperloopStatus + (*HyperloopNotificationStreamRequest)(nil), // 1: looprpc.HyperloopNotificationStreamRequest + (*HyperloopNotificationStreamResponse)(nil), // 2: looprpc.HyperloopNotificationStreamResponse + (*GetPendingHyperloopRequest)(nil), // 3: looprpc.GetPendingHyperloopRequest + (*GetPendingHyperloopResponse)(nil), // 4: looprpc.GetPendingHyperloopResponse + (*PendingHyperloop)(nil), // 5: looprpc.PendingHyperloop + (*RegisterHyperloopRequest)(nil), // 6: looprpc.RegisterHyperloopRequest + (*RegisterHyperloopResponse)(nil), // 7: looprpc.RegisterHyperloopResponse + (*FetchHyperloopHtlcFeeRatesRequest)(nil), // 8: looprpc.FetchHyperloopHtlcFeeRatesRequest + (*FetchHyperloopHtlcFeeRatesResponse)(nil), // 9: looprpc.FetchHyperloopHtlcFeeRatesResponse + (*FetchHyperloopParticipantsRequest)(nil), // 10: looprpc.FetchHyperloopParticipantsRequest + (*FetchHyperloopParticipantsResponse)(nil), // 11: looprpc.FetchHyperloopParticipantsResponse + (*HyperloopParticipant)(nil), // 12: looprpc.HyperloopParticipant + (*PushHyperloopHtlcNoncesRequest)(nil), // 13: looprpc.PushHyperloopHtlcNoncesRequest + (*PushHyperloopHtlcNoncesResponse)(nil), // 14: looprpc.PushHyperloopHtlcNoncesResponse + (*FetchHyperloopHtlcNoncesRequest)(nil), // 15: looprpc.FetchHyperloopHtlcNoncesRequest + (*ParticipantNonces)(nil), // 16: looprpc.ParticipantNonces + (*FetchHyperloopHtlcNoncesResponse)(nil), // 17: looprpc.FetchHyperloopHtlcNoncesResponse + (*PushHyperloopHtlcSigRequest)(nil), // 18: looprpc.PushHyperloopHtlcSigRequest + (*PushHyperloopHtlcSigResponse)(nil), // 19: looprpc.PushHyperloopHtlcSigResponse + (*FetchHyperloopHtlcSigRequest)(nil), // 20: looprpc.FetchHyperloopHtlcSigRequest + (*FetchHyperloopHtlcSigResponse)(nil), // 21: looprpc.FetchHyperloopHtlcSigResponse + (*PushHyperloopPreimageRequest)(nil), // 22: looprpc.PushHyperloopPreimageRequest + (*PushHyperloopPreimageResponse)(nil), // 23: looprpc.PushHyperloopPreimageResponse + (*FetchHyperloopSweeplessSweepNonceRequest)(nil), // 24: looprpc.FetchHyperloopSweeplessSweepNonceRequest + (*FetchHyperloopSweeplessSweepNonceResponse)(nil), // 25: looprpc.FetchHyperloopSweeplessSweepNonceResponse + (*PushHyperloopSweeplessSweepSigRequest)(nil), // 26: looprpc.PushHyperloopSweeplessSweepSigRequest + (*PushHyperloopSweeplessSweepSigResponse)(nil), // 27: looprpc.PushHyperloopSweeplessSweepSigResponse + nil, // 28: looprpc.PushHyperloopHtlcNoncesRequest.HtlcNoncesEntry + nil, // 29: looprpc.PushHyperloopHtlcNoncesResponse.ServerHtlcNoncesEntry + nil, // 30: looprpc.PushHyperloopHtlcNoncesResponse.HtlcRawTxnsEntry + nil, // 31: looprpc.FetchHyperloopHtlcNoncesResponse.HtlcNoncesByFeesEntry + nil, // 32: looprpc.PushHyperloopHtlcSigRequest.HtlcSigsEntry + nil, // 33: looprpc.FetchHyperloopHtlcSigResponse.HtlcSigsByFeesEntry +} +var file_hyperloop_proto_depIdxs = []int32{ + 0, // 0: looprpc.HyperloopNotificationStreamResponse.status:type_name -> looprpc.HyperloopStatus + 5, // 1: looprpc.GetPendingHyperloopResponse.pending_private_hyperloop:type_name -> looprpc.PendingHyperloop + 12, // 2: looprpc.FetchHyperloopParticipantsResponse.participants:type_name -> looprpc.HyperloopParticipant + 28, // 3: looprpc.PushHyperloopHtlcNoncesRequest.htlc_nonces:type_name -> looprpc.PushHyperloopHtlcNoncesRequest.HtlcNoncesEntry + 29, // 4: looprpc.PushHyperloopHtlcNoncesResponse.server_htlc_nonces:type_name -> looprpc.PushHyperloopHtlcNoncesResponse.ServerHtlcNoncesEntry + 30, // 5: looprpc.PushHyperloopHtlcNoncesResponse.htlc_raw_txns:type_name -> looprpc.PushHyperloopHtlcNoncesResponse.HtlcRawTxnsEntry + 31, // 6: looprpc.FetchHyperloopHtlcNoncesResponse.htlc_nonces_by_fees:type_name -> looprpc.FetchHyperloopHtlcNoncesResponse.HtlcNoncesByFeesEntry + 32, // 7: looprpc.PushHyperloopHtlcSigRequest.htlc_sigs:type_name -> looprpc.PushHyperloopHtlcSigRequest.HtlcSigsEntry + 33, // 8: looprpc.FetchHyperloopHtlcSigResponse.htlc_sigs_by_fees:type_name -> looprpc.FetchHyperloopHtlcSigResponse.HtlcSigsByFeesEntry + 16, // 9: looprpc.FetchHyperloopHtlcNoncesResponse.HtlcNoncesByFeesEntry.value:type_name -> looprpc.ParticipantNonces + 1, // 10: looprpc.HyperloopServer.HyperloopNotificationStream:input_type -> looprpc.HyperloopNotificationStreamRequest + 3, // 11: looprpc.HyperloopServer.GetPendingHyperloop:input_type -> looprpc.GetPendingHyperloopRequest + 6, // 12: looprpc.HyperloopServer.RegisterHyperloop:input_type -> looprpc.RegisterHyperloopRequest + 8, // 13: looprpc.HyperloopServer.FetchHyperloopHtlcFeeRates:input_type -> looprpc.FetchHyperloopHtlcFeeRatesRequest + 10, // 14: looprpc.HyperloopServer.FetchHyperloopParticipants:input_type -> looprpc.FetchHyperloopParticipantsRequest + 13, // 15: looprpc.HyperloopServer.PushHyperloopHtlcNonces:input_type -> looprpc.PushHyperloopHtlcNoncesRequest + 15, // 16: looprpc.HyperloopServer.FetchHyperloopHtlcNonces:input_type -> looprpc.FetchHyperloopHtlcNoncesRequest + 18, // 17: looprpc.HyperloopServer.PushHyperloopHtlcSigs:input_type -> looprpc.PushHyperloopHtlcSigRequest + 20, // 18: looprpc.HyperloopServer.FetchHyperloopHtlcSigs:input_type -> looprpc.FetchHyperloopHtlcSigRequest + 22, // 19: looprpc.HyperloopServer.PushHyperloopPreimage:input_type -> looprpc.PushHyperloopPreimageRequest + 24, // 20: looprpc.HyperloopServer.FetchHyperloopSweeplessSweepNonce:input_type -> looprpc.FetchHyperloopSweeplessSweepNonceRequest + 26, // 21: looprpc.HyperloopServer.PushHyperloopSweeplessSweepSig:input_type -> looprpc.PushHyperloopSweeplessSweepSigRequest + 2, // 22: looprpc.HyperloopServer.HyperloopNotificationStream:output_type -> looprpc.HyperloopNotificationStreamResponse + 4, // 23: looprpc.HyperloopServer.GetPendingHyperloop:output_type -> looprpc.GetPendingHyperloopResponse + 7, // 24: looprpc.HyperloopServer.RegisterHyperloop:output_type -> looprpc.RegisterHyperloopResponse + 9, // 25: looprpc.HyperloopServer.FetchHyperloopHtlcFeeRates:output_type -> looprpc.FetchHyperloopHtlcFeeRatesResponse + 11, // 26: looprpc.HyperloopServer.FetchHyperloopParticipants:output_type -> looprpc.FetchHyperloopParticipantsResponse + 14, // 27: looprpc.HyperloopServer.PushHyperloopHtlcNonces:output_type -> looprpc.PushHyperloopHtlcNoncesResponse + 17, // 28: looprpc.HyperloopServer.FetchHyperloopHtlcNonces:output_type -> looprpc.FetchHyperloopHtlcNoncesResponse + 19, // 29: looprpc.HyperloopServer.PushHyperloopHtlcSigs:output_type -> looprpc.PushHyperloopHtlcSigResponse + 21, // 30: looprpc.HyperloopServer.FetchHyperloopHtlcSigs:output_type -> looprpc.FetchHyperloopHtlcSigResponse + 23, // 31: looprpc.HyperloopServer.PushHyperloopPreimage:output_type -> looprpc.PushHyperloopPreimageResponse + 25, // 32: looprpc.HyperloopServer.FetchHyperloopSweeplessSweepNonce:output_type -> looprpc.FetchHyperloopSweeplessSweepNonceResponse + 27, // 33: looprpc.HyperloopServer.PushHyperloopSweeplessSweepSig:output_type -> looprpc.PushHyperloopSweeplessSweepSigResponse + 22, // [22:34] is the sub-list for method output_type + 10, // [10:22] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_hyperloop_proto_init() } +func file_hyperloop_proto_init() { + if File_hyperloop_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_hyperloop_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HyperloopNotificationStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HyperloopNotificationStreamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPendingHyperloopRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPendingHyperloopResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingHyperloop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterHyperloopRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterHyperloopResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcFeeRatesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcFeeRatesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopParticipantsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopParticipantsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HyperloopParticipant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopHtlcNoncesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopHtlcNoncesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcNoncesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParticipantNonces); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcNoncesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopHtlcSigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopHtlcSigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcSigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopHtlcSigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopPreimageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopPreimageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopSweeplessSweepNonceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchHyperloopSweeplessSweepNonceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopSweeplessSweepSigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hyperloop_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushHyperloopSweeplessSweepSigResponse); 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_hyperloop_proto_rawDesc, + NumEnums: 1, + NumMessages: 33, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_hyperloop_proto_goTypes, + DependencyIndexes: file_hyperloop_proto_depIdxs, + EnumInfos: file_hyperloop_proto_enumTypes, + MessageInfos: file_hyperloop_proto_msgTypes, + }.Build() + File_hyperloop_proto = out.File + file_hyperloop_proto_rawDesc = nil + file_hyperloop_proto_goTypes = nil + file_hyperloop_proto_depIdxs = nil +} diff --git a/swapserverrpc/hyperloop.proto b/swapserverrpc/hyperloop.proto new file mode 100644 index 000000000..1979c4aa6 --- /dev/null +++ b/swapserverrpc/hyperloop.proto @@ -0,0 +1,178 @@ +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 HyperloopServer { + rpc HyperloopNotificationStream (HyperloopNotificationStreamRequest) + returns (stream HyperloopNotificationStreamResponse); + rpc GetPendingHyperloop (GetPendingHyperloopRequest) + returns (GetPendingHyperloopResponse); + rpc RegisterHyperloop (RegisterHyperloopRequest) + returns (RegisterHyperloopResponse); + rpc FetchHyperloopHtlcFeeRates (FetchHyperloopHtlcFeeRatesRequest) + returns (FetchHyperloopHtlcFeeRatesResponse); + rpc FetchHyperloopParticipants (FetchHyperloopParticipantsRequest) + returns (FetchHyperloopParticipantsResponse); + rpc PushHyperloopHtlcNonces (PushHyperloopHtlcNoncesRequest) + returns (PushHyperloopHtlcNoncesResponse); + rpc FetchHyperloopHtlcNonces (FetchHyperloopHtlcNoncesRequest) + returns (FetchHyperloopHtlcNoncesResponse); + rpc PushHyperloopHtlcSigs (PushHyperloopHtlcSigRequest) + returns (PushHyperloopHtlcSigResponse); + rpc FetchHyperloopHtlcSigs (FetchHyperloopHtlcSigRequest) + returns (FetchHyperloopHtlcSigResponse); + rpc PushHyperloopPreimage (PushHyperloopPreimageRequest) + returns (PushHyperloopPreimageResponse); + rpc FetchHyperloopSweeplessSweepNonce ( + FetchHyperloopSweeplessSweepNonceRequest) + returns (FetchHyperloopSweeplessSweepNonceResponse); + rpc PushHyperloopSweeplessSweepSig (PushHyperloopSweeplessSweepSigRequest) + returns (PushHyperloopSweeplessSweepSigResponse); +} + +message HyperloopNotificationStreamRequest { + bytes hyperloop_id = 1; +} + +enum HyperloopStatus { + UNDEFINED = 0; + PENDING = 1; + PUBLISHED = 2; + WAIT_FOR_HTLC_NONCES = 3; + WAIT_FOR_HTLC_SIGS = 4; + WAIT_FOR_PREIMAGES = 5; + WAIT_FOR_SWEEPLESS_SWEEP_SIGS = 6; + SWEEPLESS_SWEEP_PUBLISHED = 7; + SWEEPLESS_SWEEP_CONFIRMED = 8; + HYPERLOOP_FAILED = 9; +} + +message HyperloopNotificationStreamResponse { + HyperloopStatus status = 1; +} + +message GetPendingHyperloopRequest { +} + +message GetPendingHyperloopResponse { + PendingHyperloop pending_private_hyperloop = 1; +} + +message PendingHyperloop { + bytes hyperloop_id = 1; + int64 publish_deadline_unix = 2; + int32 participant_count = 3; +} + +message RegisterHyperloopRequest { + bytes receiver_key = 1; + bytes swap_hash = 2; + int64 amt = 3; + int64 hyperloop_publish_time_unix = 4; + string sweep_addr = 5; + bool private = 6; +} + +message RegisterHyperloopResponse { + bytes hyperloop_id = 1; + bytes server_key = 2; + int32 htlc_cltv_expiry = 3; + int32 hyperloop_csv_expiry = 4; + string invoice = 5; +} + +message FetchHyperloopHtlcFeeRatesRequest { + bytes hyperloop_id = 1; +} + +message FetchHyperloopHtlcFeeRatesResponse { + repeated int64 htlc_fee_rates = 1; +} + +message FetchHyperloopParticipantsRequest { + bytes hyperloop_id = 1; +} + +message FetchHyperloopParticipantsResponse { + repeated HyperloopParticipant participants = 1; +} + +message HyperloopParticipant { + bytes public_key = 1; + string sweep_addr = 2; +} + +message PushHyperloopHtlcNoncesRequest { + bytes hyperloop_id = 1; + bytes swap_hash = 2; + map htlc_nonces = 3; +} + +message PushHyperloopHtlcNoncesResponse { + map server_htlc_nonces = 1; + map htlc_raw_txns = 2; +} + +message FetchHyperloopHtlcNoncesRequest { + bytes hyperloop_id = 1; +} + +message ParticipantNonces { + repeated bytes participant_nonce = 1; +} + +message FetchHyperloopHtlcNoncesResponse { + map htlc_nonces_by_fees = 1; +} + +message PushHyperloopHtlcSigRequest { + bytes hyperloop_id = 1; + bytes swap_hash = 2; + map htlc_sigs = 3; +} + +message PushHyperloopHtlcSigResponse { +} + +message FetchHyperloopHtlcSigRequest { + bytes hyperloop_id = 1; +} + +message FetchHyperloopHtlcSigResponse { + map htlc_sigs_by_fees = 1; +} + +message PushHyperloopPreimageRequest { + bytes hyperloop_id = 1; + bytes preimage = 2; + bytes sweep_nonce = 3; +} + +message PushHyperloopPreimageResponse { + bytes server_sweep_nonce = 1; + bytes sweep_raw_tx = 2; + int64 sweep_fee_rate = 3; +} + +message FetchHyperloopSweeplessSweepNonceRequest { + bytes hyperloop_id = 1; +} + +message FetchHyperloopSweeplessSweepNonceResponse { + repeated bytes sweepless_sweep_nonces = 1; +} + +message PushHyperloopSweeplessSweepSigRequest { + bytes hyperloop_id = 1; + bytes swap_hash = 2; + bytes sweep_sig = 3; +} + +message PushHyperloopSweeplessSweepSigResponse { +} diff --git a/swapserverrpc/hyperloop_grpc.pb.go b/swapserverrpc/hyperloop_grpc.pb.go new file mode 100644 index 000000000..6b735028a --- /dev/null +++ b/swapserverrpc/hyperloop_grpc.pb.go @@ -0,0 +1,525 @@ +// 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 + +// HyperloopServerClient is the client API for HyperloopServer 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 HyperloopServerClient interface { + HyperloopNotificationStream(ctx context.Context, in *HyperloopNotificationStreamRequest, opts ...grpc.CallOption) (HyperloopServer_HyperloopNotificationStreamClient, error) + GetPendingHyperloop(ctx context.Context, in *GetPendingHyperloopRequest, opts ...grpc.CallOption) (*GetPendingHyperloopResponse, error) + RegisterHyperloop(ctx context.Context, in *RegisterHyperloopRequest, opts ...grpc.CallOption) (*RegisterHyperloopResponse, error) + FetchHyperloopHtlcFeeRates(ctx context.Context, in *FetchHyperloopHtlcFeeRatesRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcFeeRatesResponse, error) + FetchHyperloopParticipants(ctx context.Context, in *FetchHyperloopParticipantsRequest, opts ...grpc.CallOption) (*FetchHyperloopParticipantsResponse, error) + PushHyperloopHtlcNonces(ctx context.Context, in *PushHyperloopHtlcNoncesRequest, opts ...grpc.CallOption) (*PushHyperloopHtlcNoncesResponse, error) + FetchHyperloopHtlcNonces(ctx context.Context, in *FetchHyperloopHtlcNoncesRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcNoncesResponse, error) + PushHyperloopHtlcSigs(ctx context.Context, in *PushHyperloopHtlcSigRequest, opts ...grpc.CallOption) (*PushHyperloopHtlcSigResponse, error) + FetchHyperloopHtlcSigs(ctx context.Context, in *FetchHyperloopHtlcSigRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcSigResponse, error) + PushHyperloopPreimage(ctx context.Context, in *PushHyperloopPreimageRequest, opts ...grpc.CallOption) (*PushHyperloopPreimageResponse, error) + FetchHyperloopSweeplessSweepNonce(ctx context.Context, in *FetchHyperloopSweeplessSweepNonceRequest, opts ...grpc.CallOption) (*FetchHyperloopSweeplessSweepNonceResponse, error) + PushHyperloopSweeplessSweepSig(ctx context.Context, in *PushHyperloopSweeplessSweepSigRequest, opts ...grpc.CallOption) (*PushHyperloopSweeplessSweepSigResponse, error) +} + +type hyperloopServerClient struct { + cc grpc.ClientConnInterface +} + +func NewHyperloopServerClient(cc grpc.ClientConnInterface) HyperloopServerClient { + return &hyperloopServerClient{cc} +} + +func (c *hyperloopServerClient) HyperloopNotificationStream(ctx context.Context, in *HyperloopNotificationStreamRequest, opts ...grpc.CallOption) (HyperloopServer_HyperloopNotificationStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &HyperloopServer_ServiceDesc.Streams[0], "/looprpc.HyperloopServer/HyperloopNotificationStream", opts...) + if err != nil { + return nil, err + } + x := &hyperloopServerHyperloopNotificationStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type HyperloopServer_HyperloopNotificationStreamClient interface { + Recv() (*HyperloopNotificationStreamResponse, error) + grpc.ClientStream +} + +type hyperloopServerHyperloopNotificationStreamClient struct { + grpc.ClientStream +} + +func (x *hyperloopServerHyperloopNotificationStreamClient) Recv() (*HyperloopNotificationStreamResponse, error) { + m := new(HyperloopNotificationStreamResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *hyperloopServerClient) GetPendingHyperloop(ctx context.Context, in *GetPendingHyperloopRequest, opts ...grpc.CallOption) (*GetPendingHyperloopResponse, error) { + out := new(GetPendingHyperloopResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/GetPendingHyperloop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) RegisterHyperloop(ctx context.Context, in *RegisterHyperloopRequest, opts ...grpc.CallOption) (*RegisterHyperloopResponse, error) { + out := new(RegisterHyperloopResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/RegisterHyperloop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) FetchHyperloopHtlcFeeRates(ctx context.Context, in *FetchHyperloopHtlcFeeRatesRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcFeeRatesResponse, error) { + out := new(FetchHyperloopHtlcFeeRatesResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/FetchHyperloopHtlcFeeRates", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) FetchHyperloopParticipants(ctx context.Context, in *FetchHyperloopParticipantsRequest, opts ...grpc.CallOption) (*FetchHyperloopParticipantsResponse, error) { + out := new(FetchHyperloopParticipantsResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/FetchHyperloopParticipants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) PushHyperloopHtlcNonces(ctx context.Context, in *PushHyperloopHtlcNoncesRequest, opts ...grpc.CallOption) (*PushHyperloopHtlcNoncesResponse, error) { + out := new(PushHyperloopHtlcNoncesResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/PushHyperloopHtlcNonces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) FetchHyperloopHtlcNonces(ctx context.Context, in *FetchHyperloopHtlcNoncesRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcNoncesResponse, error) { + out := new(FetchHyperloopHtlcNoncesResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/FetchHyperloopHtlcNonces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) PushHyperloopHtlcSigs(ctx context.Context, in *PushHyperloopHtlcSigRequest, opts ...grpc.CallOption) (*PushHyperloopHtlcSigResponse, error) { + out := new(PushHyperloopHtlcSigResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/PushHyperloopHtlcSigs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) FetchHyperloopHtlcSigs(ctx context.Context, in *FetchHyperloopHtlcSigRequest, opts ...grpc.CallOption) (*FetchHyperloopHtlcSigResponse, error) { + out := new(FetchHyperloopHtlcSigResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/FetchHyperloopHtlcSigs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) PushHyperloopPreimage(ctx context.Context, in *PushHyperloopPreimageRequest, opts ...grpc.CallOption) (*PushHyperloopPreimageResponse, error) { + out := new(PushHyperloopPreimageResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/PushHyperloopPreimage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) FetchHyperloopSweeplessSweepNonce(ctx context.Context, in *FetchHyperloopSweeplessSweepNonceRequest, opts ...grpc.CallOption) (*FetchHyperloopSweeplessSweepNonceResponse, error) { + out := new(FetchHyperloopSweeplessSweepNonceResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/FetchHyperloopSweeplessSweepNonce", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hyperloopServerClient) PushHyperloopSweeplessSweepSig(ctx context.Context, in *PushHyperloopSweeplessSweepSigRequest, opts ...grpc.CallOption) (*PushHyperloopSweeplessSweepSigResponse, error) { + out := new(PushHyperloopSweeplessSweepSigResponse) + err := c.cc.Invoke(ctx, "/looprpc.HyperloopServer/PushHyperloopSweeplessSweepSig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HyperloopServerServer is the server API for HyperloopServer service. +// All implementations must embed UnimplementedHyperloopServerServer +// for forward compatibility +type HyperloopServerServer interface { + HyperloopNotificationStream(*HyperloopNotificationStreamRequest, HyperloopServer_HyperloopNotificationStreamServer) error + GetPendingHyperloop(context.Context, *GetPendingHyperloopRequest) (*GetPendingHyperloopResponse, error) + RegisterHyperloop(context.Context, *RegisterHyperloopRequest) (*RegisterHyperloopResponse, error) + FetchHyperloopHtlcFeeRates(context.Context, *FetchHyperloopHtlcFeeRatesRequest) (*FetchHyperloopHtlcFeeRatesResponse, error) + FetchHyperloopParticipants(context.Context, *FetchHyperloopParticipantsRequest) (*FetchHyperloopParticipantsResponse, error) + PushHyperloopHtlcNonces(context.Context, *PushHyperloopHtlcNoncesRequest) (*PushHyperloopHtlcNoncesResponse, error) + FetchHyperloopHtlcNonces(context.Context, *FetchHyperloopHtlcNoncesRequest) (*FetchHyperloopHtlcNoncesResponse, error) + PushHyperloopHtlcSigs(context.Context, *PushHyperloopHtlcSigRequest) (*PushHyperloopHtlcSigResponse, error) + FetchHyperloopHtlcSigs(context.Context, *FetchHyperloopHtlcSigRequest) (*FetchHyperloopHtlcSigResponse, error) + PushHyperloopPreimage(context.Context, *PushHyperloopPreimageRequest) (*PushHyperloopPreimageResponse, error) + FetchHyperloopSweeplessSweepNonce(context.Context, *FetchHyperloopSweeplessSweepNonceRequest) (*FetchHyperloopSweeplessSweepNonceResponse, error) + PushHyperloopSweeplessSweepSig(context.Context, *PushHyperloopSweeplessSweepSigRequest) (*PushHyperloopSweeplessSweepSigResponse, error) + mustEmbedUnimplementedHyperloopServerServer() +} + +// UnimplementedHyperloopServerServer must be embedded to have forward compatible implementations. +type UnimplementedHyperloopServerServer struct { +} + +func (UnimplementedHyperloopServerServer) HyperloopNotificationStream(*HyperloopNotificationStreamRequest, HyperloopServer_HyperloopNotificationStreamServer) error { + return status.Errorf(codes.Unimplemented, "method HyperloopNotificationStream not implemented") +} +func (UnimplementedHyperloopServerServer) GetPendingHyperloop(context.Context, *GetPendingHyperloopRequest) (*GetPendingHyperloopResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPendingHyperloop not implemented") +} +func (UnimplementedHyperloopServerServer) RegisterHyperloop(context.Context, *RegisterHyperloopRequest) (*RegisterHyperloopResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterHyperloop not implemented") +} +func (UnimplementedHyperloopServerServer) FetchHyperloopHtlcFeeRates(context.Context, *FetchHyperloopHtlcFeeRatesRequest) (*FetchHyperloopHtlcFeeRatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchHyperloopHtlcFeeRates not implemented") +} +func (UnimplementedHyperloopServerServer) FetchHyperloopParticipants(context.Context, *FetchHyperloopParticipantsRequest) (*FetchHyperloopParticipantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchHyperloopParticipants not implemented") +} +func (UnimplementedHyperloopServerServer) PushHyperloopHtlcNonces(context.Context, *PushHyperloopHtlcNoncesRequest) (*PushHyperloopHtlcNoncesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushHyperloopHtlcNonces not implemented") +} +func (UnimplementedHyperloopServerServer) FetchHyperloopHtlcNonces(context.Context, *FetchHyperloopHtlcNoncesRequest) (*FetchHyperloopHtlcNoncesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchHyperloopHtlcNonces not implemented") +} +func (UnimplementedHyperloopServerServer) PushHyperloopHtlcSigs(context.Context, *PushHyperloopHtlcSigRequest) (*PushHyperloopHtlcSigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushHyperloopHtlcSigs not implemented") +} +func (UnimplementedHyperloopServerServer) FetchHyperloopHtlcSigs(context.Context, *FetchHyperloopHtlcSigRequest) (*FetchHyperloopHtlcSigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchHyperloopHtlcSigs not implemented") +} +func (UnimplementedHyperloopServerServer) PushHyperloopPreimage(context.Context, *PushHyperloopPreimageRequest) (*PushHyperloopPreimageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushHyperloopPreimage not implemented") +} +func (UnimplementedHyperloopServerServer) FetchHyperloopSweeplessSweepNonce(context.Context, *FetchHyperloopSweeplessSweepNonceRequest) (*FetchHyperloopSweeplessSweepNonceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchHyperloopSweeplessSweepNonce not implemented") +} +func (UnimplementedHyperloopServerServer) PushHyperloopSweeplessSweepSig(context.Context, *PushHyperloopSweeplessSweepSigRequest) (*PushHyperloopSweeplessSweepSigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushHyperloopSweeplessSweepSig not implemented") +} +func (UnimplementedHyperloopServerServer) mustEmbedUnimplementedHyperloopServerServer() {} + +// UnsafeHyperloopServerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HyperloopServerServer will +// result in compilation errors. +type UnsafeHyperloopServerServer interface { + mustEmbedUnimplementedHyperloopServerServer() +} + +func RegisterHyperloopServerServer(s grpc.ServiceRegistrar, srv HyperloopServerServer) { + s.RegisterService(&HyperloopServer_ServiceDesc, srv) +} + +func _HyperloopServer_HyperloopNotificationStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(HyperloopNotificationStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(HyperloopServerServer).HyperloopNotificationStream(m, &hyperloopServerHyperloopNotificationStreamServer{stream}) +} + +type HyperloopServer_HyperloopNotificationStreamServer interface { + Send(*HyperloopNotificationStreamResponse) error + grpc.ServerStream +} + +type hyperloopServerHyperloopNotificationStreamServer struct { + grpc.ServerStream +} + +func (x *hyperloopServerHyperloopNotificationStreamServer) Send(m *HyperloopNotificationStreamResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _HyperloopServer_GetPendingHyperloop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPendingHyperloopRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).GetPendingHyperloop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/GetPendingHyperloop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).GetPendingHyperloop(ctx, req.(*GetPendingHyperloopRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_RegisterHyperloop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterHyperloopRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).RegisterHyperloop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/RegisterHyperloop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).RegisterHyperloop(ctx, req.(*RegisterHyperloopRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_FetchHyperloopHtlcFeeRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchHyperloopHtlcFeeRatesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).FetchHyperloopHtlcFeeRates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/FetchHyperloopHtlcFeeRates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).FetchHyperloopHtlcFeeRates(ctx, req.(*FetchHyperloopHtlcFeeRatesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_FetchHyperloopParticipants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchHyperloopParticipantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).FetchHyperloopParticipants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/FetchHyperloopParticipants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).FetchHyperloopParticipants(ctx, req.(*FetchHyperloopParticipantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_PushHyperloopHtlcNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushHyperloopHtlcNoncesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).PushHyperloopHtlcNonces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/PushHyperloopHtlcNonces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).PushHyperloopHtlcNonces(ctx, req.(*PushHyperloopHtlcNoncesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_FetchHyperloopHtlcNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchHyperloopHtlcNoncesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).FetchHyperloopHtlcNonces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/FetchHyperloopHtlcNonces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).FetchHyperloopHtlcNonces(ctx, req.(*FetchHyperloopHtlcNoncesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_PushHyperloopHtlcSigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushHyperloopHtlcSigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).PushHyperloopHtlcSigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/PushHyperloopHtlcSigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).PushHyperloopHtlcSigs(ctx, req.(*PushHyperloopHtlcSigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_FetchHyperloopHtlcSigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchHyperloopHtlcSigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).FetchHyperloopHtlcSigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/FetchHyperloopHtlcSigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).FetchHyperloopHtlcSigs(ctx, req.(*FetchHyperloopHtlcSigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_PushHyperloopPreimage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushHyperloopPreimageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).PushHyperloopPreimage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/PushHyperloopPreimage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).PushHyperloopPreimage(ctx, req.(*PushHyperloopPreimageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_FetchHyperloopSweeplessSweepNonce_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchHyperloopSweeplessSweepNonceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).FetchHyperloopSweeplessSweepNonce(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/FetchHyperloopSweeplessSweepNonce", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).FetchHyperloopSweeplessSweepNonce(ctx, req.(*FetchHyperloopSweeplessSweepNonceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HyperloopServer_PushHyperloopSweeplessSweepSig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushHyperloopSweeplessSweepSigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HyperloopServerServer).PushHyperloopSweeplessSweepSig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.HyperloopServer/PushHyperloopSweeplessSweepSig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HyperloopServerServer).PushHyperloopSweeplessSweepSig(ctx, req.(*PushHyperloopSweeplessSweepSigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// HyperloopServer_ServiceDesc is the grpc.ServiceDesc for HyperloopServer service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var HyperloopServer_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "looprpc.HyperloopServer", + HandlerType: (*HyperloopServerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPendingHyperloop", + Handler: _HyperloopServer_GetPendingHyperloop_Handler, + }, + { + MethodName: "RegisterHyperloop", + Handler: _HyperloopServer_RegisterHyperloop_Handler, + }, + { + MethodName: "FetchHyperloopHtlcFeeRates", + Handler: _HyperloopServer_FetchHyperloopHtlcFeeRates_Handler, + }, + { + MethodName: "FetchHyperloopParticipants", + Handler: _HyperloopServer_FetchHyperloopParticipants_Handler, + }, + { + MethodName: "PushHyperloopHtlcNonces", + Handler: _HyperloopServer_PushHyperloopHtlcNonces_Handler, + }, + { + MethodName: "FetchHyperloopHtlcNonces", + Handler: _HyperloopServer_FetchHyperloopHtlcNonces_Handler, + }, + { + MethodName: "PushHyperloopHtlcSigs", + Handler: _HyperloopServer_PushHyperloopHtlcSigs_Handler, + }, + { + MethodName: "FetchHyperloopHtlcSigs", + Handler: _HyperloopServer_FetchHyperloopHtlcSigs_Handler, + }, + { + MethodName: "PushHyperloopPreimage", + Handler: _HyperloopServer_PushHyperloopPreimage_Handler, + }, + { + MethodName: "FetchHyperloopSweeplessSweepNonce", + Handler: _HyperloopServer_FetchHyperloopSweeplessSweepNonce_Handler, + }, + { + MethodName: "PushHyperloopSweeplessSweepSig", + Handler: _HyperloopServer_PushHyperloopSweeplessSweepSig_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "HyperloopNotificationStream", + Handler: _HyperloopServer_HyperloopNotificationStream_Handler, + ServerStreams: true, + }, + }, + Metadata: "hyperloop.proto", +} From 7fbdaa9ac5550c5262734090a9871e97a80e3876 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:32:33 +0200 Subject: [PATCH 07/14] looprpc: add hyperloop calls --- looprpc/client.pb.go | 868 +++++++++++++++++++++++++--------- looprpc/client.proto | 34 ++ looprpc/client.swagger.json | 52 ++ looprpc/client_grpc.pb.go | 72 +++ looprpc/swapclient.pb.json.go | 50 ++ 5 files changed, 854 insertions(+), 222 deletions(-) diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 1b8c19bc7..ed664867e 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -3949,6 +3949,312 @@ func (x *InstantOut) GetSweepTxId() string { return "" } +type HyperLoopOutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` + Private bool `protobuf:"varint,2,opt,name=private,proto3" json:"private,omitempty"` + PrivatePublishTime int64 `protobuf:"varint,3,opt,name=private_publish_time,json=privatePublishTime,proto3" json:"private_publish_time,omitempty"` + CustomSweepAddr string `protobuf:"bytes,4,opt,name=custom_sweep_addr,json=customSweepAddr,proto3" json:"custom_sweep_addr,omitempty"` +} + +func (x *HyperLoopOutRequest) Reset() { + *x = HyperLoopOutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperLoopOutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperLoopOutRequest) ProtoMessage() {} + +func (x *HyperLoopOutRequest) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[45] + 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 HyperLoopOutRequest.ProtoReflect.Descriptor instead. +func (*HyperLoopOutRequest) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{45} +} + +func (x *HyperLoopOutRequest) GetAmt() uint64 { + if x != nil { + return x.Amt + } + return 0 +} + +func (x *HyperLoopOutRequest) GetPrivate() bool { + if x != nil { + return x.Private + } + return false +} + +func (x *HyperLoopOutRequest) GetPrivatePublishTime() int64 { + if x != nil { + return x.PrivatePublishTime + } + return 0 +} + +func (x *HyperLoopOutRequest) GetCustomSweepAddr() string { + if x != nil { + return x.CustomSweepAddr + } + return "" +} + +type HyperLoopOutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hyperloop *HyperLoopOut `protobuf:"bytes,1,opt,name=hyperloop,proto3" json:"hyperloop,omitempty"` +} + +func (x *HyperLoopOutResponse) Reset() { + *x = HyperLoopOutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperLoopOutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperLoopOutResponse) ProtoMessage() {} + +func (x *HyperLoopOutResponse) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[46] + 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 HyperLoopOutResponse.ProtoReflect.Descriptor instead. +func (*HyperLoopOutResponse) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{46} +} + +func (x *HyperLoopOutResponse) GetHyperloop() *HyperLoopOut { + if x != nil { + return x.Hyperloop + } + return nil +} + +type ListHyperLoopOutsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListHyperLoopOutsRequest) Reset() { + *x = ListHyperLoopOutsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListHyperLoopOutsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHyperLoopOutsRequest) ProtoMessage() {} + +func (x *ListHyperLoopOutsRequest) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[47] + 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 ListHyperLoopOutsRequest.ProtoReflect.Descriptor instead. +func (*ListHyperLoopOutsRequest) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{47} +} + +type ListHyperLoopOutsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Swaps []*HyperLoopOut `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"` +} + +func (x *ListHyperLoopOutsResponse) Reset() { + *x = ListHyperLoopOutsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListHyperLoopOutsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHyperLoopOutsResponse) ProtoMessage() {} + +func (x *ListHyperLoopOutsResponse) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[48] + 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 ListHyperLoopOutsResponse.ProtoReflect.Descriptor instead. +func (*ListHyperLoopOutsResponse) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{48} +} + +func (x *ListHyperLoopOutsResponse) GetSwaps() []*HyperLoopOut { + if x != nil { + return x.Swaps + } + return nil +} + +type HyperLoopOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdBytes []byte `protobuf:"bytes,1,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + SwapHashBytes []byte `protobuf:"bytes,3,opt,name=swap_hash_bytes,json=swapHashBytes,proto3" json:"swap_hash_bytes,omitempty"` + SwapHash string `protobuf:"bytes,4,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` + Amt uint64 `protobuf:"varint,5,opt,name=amt,proto3" json:"amt,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + PublishTimeUnix int64 `protobuf:"varint,7,opt,name=publish_time_unix,json=publishTimeUnix,proto3" json:"publish_time_unix,omitempty"` + SweepAddress string `protobuf:"bytes,8,opt,name=sweep_address,json=sweepAddress,proto3" json:"sweep_address,omitempty"` +} + +func (x *HyperLoopOut) Reset() { + *x = HyperLoopOut{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HyperLoopOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HyperLoopOut) ProtoMessage() {} + +func (x *HyperLoopOut) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[49] + 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 HyperLoopOut.ProtoReflect.Descriptor instead. +func (*HyperLoopOut) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{49} +} + +func (x *HyperLoopOut) GetIdBytes() []byte { + if x != nil { + return x.IdBytes + } + return nil +} + +func (x *HyperLoopOut) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *HyperLoopOut) GetSwapHashBytes() []byte { + if x != nil { + return x.SwapHashBytes + } + return nil +} + +func (x *HyperLoopOut) GetSwapHash() string { + if x != nil { + return x.SwapHash + } + return "" +} + +func (x *HyperLoopOut) GetAmt() uint64 { + if x != nil { + return x.Amt + } + return 0 +} + +func (x *HyperLoopOut) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *HyperLoopOut) GetPublishTimeUnix() int64 { + if x != nil { + return x.PublishTimeUnix + } + return 0 +} + +func (x *HyperLoopOut) GetSweepAddress() string { + if x != nil { + return x.SweepAddress + } + return "" +} + var File_client_proto protoreflect.FileDescriptor var file_client_proto_rawDesc = []byte{ @@ -4437,175 +4743,222 @@ var file_client_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x77, 0x65, - 0x65, 0x70, 0x54, 0x78, 0x49, 0x64, 0x2a, 0x3b, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x12, 0x0a, 0x0e, 0x54, 0x41, 0x50, 0x52, 0x4f, 0x4f, 0x54, 0x5f, 0x50, 0x55, 0x42, 0x4b, 0x45, - 0x59, 0x10, 0x01, 0x2a, 0x25, 0x0a, 0x08, 0x53, 0x77, 0x61, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0c, 0x0a, 0x08, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x73, 0x0a, 0x09, 0x53, 0x77, - 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x49, 0x54, 0x49, - 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x52, 0x45, 0x49, 0x4d, 0x41, - 0x47, 0x45, 0x5f, 0x52, 0x45, 0x56, 0x45, 0x41, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, - 0x0e, 0x48, 0x54, 0x4c, 0x43, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x12, 0x0a, - 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, - 0x56, 0x4f, 0x49, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, - 0xeb, 0x02, 0x0a, 0x0d, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x41, - 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4f, 0x46, 0x46, - 0x43, 0x48, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x41, 0x49, 0x4c, 0x55, - 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, - 0x54, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x54, 0x49, 0x4d, 0x45, - 0x4f, 0x55, 0x54, 0x10, 0x03, 0x12, 0x25, 0x0a, 0x21, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, - 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, - 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, - 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x54, - 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x52, 0x59, 0x10, 0x05, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x41, - 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x43, - 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4d, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x06, 0x12, - 0x1c, 0x0a, 0x18, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, - 0x4e, 0x5f, 0x41, 0x42, 0x41, 0x4e, 0x44, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x07, 0x12, 0x31, 0x0a, - 0x2d, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, - 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4e, - 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x08, - 0x12, 0x2b, 0x0a, 0x27, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, - 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x48, 0x54, 0x4c, - 0x43, 0x5f, 0x41, 0x4d, 0x54, 0x5f, 0x53, 0x57, 0x45, 0x50, 0x54, 0x10, 0x09, 0x2a, 0x2f, 0x0a, - 0x11, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x2a, 0xa6, - 0x03, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, - 0x13, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x54, - 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x55, - 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, - 0x46, 0x45, 0x45, 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x45, 0x4c, 0x41, - 0x50, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, - 0x04, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, - 0x5f, 0x53, 0x57, 0x41, 0x50, 0x5f, 0x46, 0x45, 0x45, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x41, - 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x45, 0x52, - 0x5f, 0x46, 0x45, 0x45, 0x10, 0x06, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x59, 0x10, 0x07, 0x12, 0x1f, - 0x0a, 0x1b, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x41, - 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x4f, 0x46, 0x46, 0x10, 0x08, 0x12, - 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, - 0x4f, 0x4f, 0x50, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, 0x54, - 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, - 0x10, 0x0a, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, - 0x4e, 0x5f, 0x4c, 0x49, 0x51, 0x55, 0x49, 0x44, 0x49, 0x54, 0x59, 0x5f, 0x4f, 0x4b, 0x10, 0x0b, - 0x12, 0x23, 0x0a, 0x1f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, - 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, - 0x45, 0x4e, 0x54, 0x10, 0x0c, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x45, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, - 0x43, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x0d, 0x32, 0xab, 0x0c, 0x0a, 0x0a, 0x53, 0x77, 0x61, 0x70, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, - 0x74, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, - 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x37, 0x0a, 0x06, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, - 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, + 0x65, 0x70, 0x54, 0x78, 0x49, 0x64, 0x22, 0x9f, 0x01, 0x0a, 0x13, 0x48, 0x79, 0x70, 0x65, 0x72, + 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x61, 0x6d, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x6d, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, + 0x77, 0x65, 0x65, 0x70, 0x41, 0x64, 0x64, 0x72, 0x22, 0x4b, 0x0a, 0x14, 0x48, 0x79, 0x70, 0x65, + 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x33, 0x0a, 0x09, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, + 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x09, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x6f, 0x6f, 0x70, 0x22, 0x1a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x79, 0x70, + 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x48, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, + 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, + 0x0a, 0x05, 0x73, 0x77, 0x61, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, + 0x70, 0x4f, 0x75, 0x74, 0x52, 0x05, 0x73, 0x77, 0x61, 0x70, 0x73, 0x22, 0xf7, 0x01, 0x0a, 0x0c, + 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x69, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x77, 0x61, 0x70, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0d, 0x73, 0x77, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x77, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, + 0x61, 0x6d, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x6d, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, + 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x77, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x77, 0x65, 0x65, 0x70, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x3b, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, + 0x0a, 0x0e, 0x54, 0x41, 0x50, 0x52, 0x4f, 0x4f, 0x54, 0x5f, 0x50, 0x55, 0x42, 0x4b, 0x45, 0x59, + 0x10, 0x01, 0x2a, 0x25, 0x0a, 0x08, 0x53, 0x77, 0x61, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, + 0x0a, 0x08, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x73, 0x0a, 0x09, 0x53, 0x77, 0x61, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, + 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x52, 0x45, 0x49, 0x4d, 0x41, 0x47, + 0x45, 0x5f, 0x52, 0x45, 0x56, 0x45, 0x41, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, + 0x48, 0x54, 0x4c, 0x43, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, + 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x12, 0x0a, 0x0a, + 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, 0x56, + 0x4f, 0x49, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, 0xeb, + 0x02, 0x0a, 0x0d, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x41, 0x49, + 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4f, 0x46, 0x46, 0x43, + 0x48, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, + 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, + 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, + 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, + 0x55, 0x54, 0x10, 0x03, 0x12, 0x25, 0x0a, 0x21, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, + 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, + 0x45, 0x4e, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x46, + 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x45, + 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x52, 0x59, 0x10, 0x05, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x41, 0x49, + 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x43, 0x4f, + 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4d, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x06, 0x12, 0x1c, + 0x0a, 0x18, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, + 0x5f, 0x41, 0x42, 0x41, 0x4e, 0x44, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x07, 0x12, 0x31, 0x0a, 0x2d, + 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, + 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x46, + 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x08, 0x12, + 0x2b, 0x0a, 0x27, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, + 0x4e, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x48, 0x54, 0x4c, 0x43, + 0x5f, 0x41, 0x4d, 0x54, 0x5f, 0x53, 0x57, 0x45, 0x50, 0x54, 0x10, 0x09, 0x2a, 0x2f, 0x0a, 0x11, + 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x2a, 0xa6, 0x03, + 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, + 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, + 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x55, 0x54, + 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x46, + 0x45, 0x45, 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, + 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x45, 0x4c, 0x41, 0x50, + 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, + 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, 0x04, + 0x12, 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, + 0x53, 0x57, 0x41, 0x50, 0x5f, 0x46, 0x45, 0x45, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, + 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x45, 0x52, 0x5f, + 0x46, 0x45, 0x45, 0x10, 0x06, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, + 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x59, 0x10, 0x07, 0x12, 0x1f, 0x0a, + 0x1b, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, + 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x4f, 0x46, 0x46, 0x10, 0x08, 0x12, 0x18, + 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, + 0x4f, 0x50, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, + 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, + 0x0a, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, + 0x5f, 0x4c, 0x49, 0x51, 0x55, 0x49, 0x44, 0x49, 0x54, 0x59, 0x5f, 0x4f, 0x4b, 0x10, 0x0b, 0x12, + 0x23, 0x0a, 0x1f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, + 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, + 0x4e, 0x54, 0x10, 0x0c, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, + 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x45, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, + 0x49, 0x45, 0x4e, 0x54, 0x10, 0x0d, 0x32, 0xd4, 0x0d, 0x0a, 0x0a, 0x53, 0x77, 0x61, 0x70, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, + 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x37, 0x0a, 0x06, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, + 0x69, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4d, + 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, + 0x73, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x77, 0x61, 0x70, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x77, 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, - 0x70, 0x73, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x77, 0x61, - 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, - 0x53, 0x77, 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, - 0x77, 0x61, 0x70, 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, - 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, 0x61, 0x6e, 0x64, - 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, - 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x12, 0x15, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, - 0x4f, 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x40, 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, - 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, - 0x63, 0x2e, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x54, - 0x65, 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, - 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, - 0x49, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, - 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, - 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, - 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, - 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x73, 0x61, 0x74, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, - 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, - 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, - 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, - 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, - 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, - 0x12, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, - 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, - 0x63, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, - 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x12, 0x1c, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, - 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, - 0x12, 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6c, + 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, + 0x61, 0x70, 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, 0x61, + 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, + 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4f, + 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x40, 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, + 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x54, 0x65, + 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, + 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, + 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, + 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, + 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, + 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x73, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, 0x32, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x34, 0x30, 0x32, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, + 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, + 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x12, + 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, + 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, + 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x12, + 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, + 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, - 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, - 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x54, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, - 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 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, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, + 0x73, 0x12, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, + 0x70, 0x4f, 0x75, 0x74, 0x12, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, + 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x79, 0x70, + 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5a, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, + 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x79, 0x70, 0x65, 0x72, 0x4c, 0x6f, 0x6f, + 0x70, 0x4f, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, + 0x25, 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, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4621,7 +4974,7 @@ func file_client_proto_rawDescGZIP() []byte { } var file_client_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 45) +var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_client_proto_goTypes = []any{ (AddressType)(0), // 0: looprpc.AddressType (SwapType)(0), // 1: looprpc.SwapType @@ -4675,19 +5028,24 @@ var file_client_proto_goTypes = []any{ (*ListInstantOutsRequest)(nil), // 49: looprpc.ListInstantOutsRequest (*ListInstantOutsResponse)(nil), // 50: looprpc.ListInstantOutsResponse (*InstantOut)(nil), // 51: looprpc.InstantOut - (*swapserverrpc.RouteHint)(nil), // 52: looprpc.RouteHint + (*HyperLoopOutRequest)(nil), // 52: looprpc.HyperLoopOutRequest + (*HyperLoopOutResponse)(nil), // 53: looprpc.HyperLoopOutResponse + (*ListHyperLoopOutsRequest)(nil), // 54: looprpc.ListHyperLoopOutsRequest + (*ListHyperLoopOutsResponse)(nil), // 55: looprpc.ListHyperLoopOutsResponse + (*HyperLoopOut)(nil), // 56: looprpc.HyperLoopOut + (*swapserverrpc.RouteHint)(nil), // 57: looprpc.RouteHint } var file_client_proto_depIdxs = []int32{ 0, // 0: looprpc.LoopOutRequest.account_addr_type:type_name -> looprpc.AddressType - 52, // 1: looprpc.LoopInRequest.route_hints:type_name -> looprpc.RouteHint + 57, // 1: looprpc.LoopInRequest.route_hints:type_name -> looprpc.RouteHint 1, // 2: looprpc.SwapStatus.type:type_name -> looprpc.SwapType 2, // 3: looprpc.SwapStatus.state:type_name -> looprpc.SwapState 3, // 4: looprpc.SwapStatus.failure_reason:type_name -> looprpc.FailureReason 13, // 5: looprpc.ListSwapsRequest.list_swap_filter:type_name -> looprpc.ListSwapsFilter 6, // 6: looprpc.ListSwapsFilter.swap_type:type_name -> looprpc.ListSwapsFilter.SwapTypeFilter 11, // 7: looprpc.ListSwapsResponse.swaps:type_name -> looprpc.SwapStatus - 52, // 8: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint - 52, // 9: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint + 57, // 8: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint + 57, // 9: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint 28, // 10: looprpc.TokensResponse.tokens:type_name -> looprpc.L402Token 29, // 11: looprpc.GetInfoResponse.loop_out_stats:type_name -> looprpc.LoopStats 29, // 12: looprpc.GetInfoResponse.loop_in_stats:type_name -> looprpc.LoopStats @@ -4702,55 +5060,61 @@ var file_client_proto_depIdxs = []int32{ 38, // 21: looprpc.SuggestSwapsResponse.disqualified:type_name -> looprpc.Disqualified 44, // 22: looprpc.ListReservationsResponse.reservations:type_name -> looprpc.ClientReservation 51, // 23: looprpc.ListInstantOutsResponse.swaps:type_name -> looprpc.InstantOut - 7, // 24: looprpc.SwapClient.LoopOut:input_type -> looprpc.LoopOutRequest - 8, // 25: looprpc.SwapClient.LoopIn:input_type -> looprpc.LoopInRequest - 10, // 26: looprpc.SwapClient.Monitor:input_type -> looprpc.MonitorRequest - 12, // 27: looprpc.SwapClient.ListSwaps:input_type -> looprpc.ListSwapsRequest - 15, // 28: looprpc.SwapClient.SwapInfo:input_type -> looprpc.SwapInfoRequest - 40, // 29: looprpc.SwapClient.AbandonSwap:input_type -> looprpc.AbandonSwapRequest - 16, // 30: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest - 19, // 31: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest - 16, // 32: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest - 19, // 33: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest - 22, // 34: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest - 24, // 35: looprpc.SwapClient.GetL402Tokens:input_type -> looprpc.TokensRequest - 24, // 36: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest - 26, // 37: looprpc.SwapClient.FetchL402Token:input_type -> looprpc.FetchL402TokenRequest - 30, // 38: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest - 32, // 39: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest - 35, // 40: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest - 37, // 41: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest - 42, // 42: looprpc.SwapClient.ListReservations:input_type -> looprpc.ListReservationsRequest - 45, // 43: looprpc.SwapClient.InstantOut:input_type -> looprpc.InstantOutRequest - 47, // 44: looprpc.SwapClient.InstantOutQuote:input_type -> looprpc.InstantOutQuoteRequest - 49, // 45: looprpc.SwapClient.ListInstantOuts:input_type -> looprpc.ListInstantOutsRequest - 9, // 46: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse - 9, // 47: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse - 11, // 48: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus - 14, // 49: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse - 11, // 50: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus - 41, // 51: looprpc.SwapClient.AbandonSwap:output_type -> looprpc.AbandonSwapResponse - 18, // 52: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse - 21, // 53: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse - 17, // 54: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse - 20, // 55: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse - 23, // 56: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse - 25, // 57: looprpc.SwapClient.GetL402Tokens:output_type -> looprpc.TokensResponse - 25, // 58: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse - 27, // 59: looprpc.SwapClient.FetchL402Token:output_type -> looprpc.FetchL402TokenResponse - 31, // 60: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse - 33, // 61: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters - 36, // 62: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse - 39, // 63: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse - 43, // 64: looprpc.SwapClient.ListReservations:output_type -> looprpc.ListReservationsResponse - 46, // 65: looprpc.SwapClient.InstantOut:output_type -> looprpc.InstantOutResponse - 48, // 66: looprpc.SwapClient.InstantOutQuote:output_type -> looprpc.InstantOutQuoteResponse - 50, // 67: looprpc.SwapClient.ListInstantOuts:output_type -> looprpc.ListInstantOutsResponse - 46, // [46:68] is the sub-list for method output_type - 24, // [24:46] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 56, // 24: looprpc.HyperLoopOutResponse.hyperloop:type_name -> looprpc.HyperLoopOut + 56, // 25: looprpc.ListHyperLoopOutsResponse.swaps:type_name -> looprpc.HyperLoopOut + 7, // 26: looprpc.SwapClient.LoopOut:input_type -> looprpc.LoopOutRequest + 8, // 27: looprpc.SwapClient.LoopIn:input_type -> looprpc.LoopInRequest + 10, // 28: looprpc.SwapClient.Monitor:input_type -> looprpc.MonitorRequest + 12, // 29: looprpc.SwapClient.ListSwaps:input_type -> looprpc.ListSwapsRequest + 15, // 30: looprpc.SwapClient.SwapInfo:input_type -> looprpc.SwapInfoRequest + 40, // 31: looprpc.SwapClient.AbandonSwap:input_type -> looprpc.AbandonSwapRequest + 16, // 32: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest + 19, // 33: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest + 16, // 34: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest + 19, // 35: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest + 22, // 36: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest + 24, // 37: looprpc.SwapClient.GetL402Tokens:input_type -> looprpc.TokensRequest + 24, // 38: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest + 26, // 39: looprpc.SwapClient.FetchL402Token:input_type -> looprpc.FetchL402TokenRequest + 30, // 40: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest + 32, // 41: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest + 35, // 42: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest + 37, // 43: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest + 42, // 44: looprpc.SwapClient.ListReservations:input_type -> looprpc.ListReservationsRequest + 45, // 45: looprpc.SwapClient.InstantOut:input_type -> looprpc.InstantOutRequest + 47, // 46: looprpc.SwapClient.InstantOutQuote:input_type -> looprpc.InstantOutQuoteRequest + 49, // 47: looprpc.SwapClient.ListInstantOuts:input_type -> looprpc.ListInstantOutsRequest + 52, // 48: looprpc.SwapClient.HyperLoopOut:input_type -> looprpc.HyperLoopOutRequest + 54, // 49: looprpc.SwapClient.ListHyperLoopOuts:input_type -> looprpc.ListHyperLoopOutsRequest + 9, // 50: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse + 9, // 51: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse + 11, // 52: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus + 14, // 53: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse + 11, // 54: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus + 41, // 55: looprpc.SwapClient.AbandonSwap:output_type -> looprpc.AbandonSwapResponse + 18, // 56: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse + 21, // 57: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse + 17, // 58: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse + 20, // 59: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse + 23, // 60: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse + 25, // 61: looprpc.SwapClient.GetL402Tokens:output_type -> looprpc.TokensResponse + 25, // 62: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse + 27, // 63: looprpc.SwapClient.FetchL402Token:output_type -> looprpc.FetchL402TokenResponse + 31, // 64: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse + 33, // 65: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters + 36, // 66: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse + 39, // 67: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse + 43, // 68: looprpc.SwapClient.ListReservations:output_type -> looprpc.ListReservationsResponse + 46, // 69: looprpc.SwapClient.InstantOut:output_type -> looprpc.InstantOutResponse + 48, // 70: looprpc.SwapClient.InstantOutQuote:output_type -> looprpc.InstantOutQuoteResponse + 50, // 71: looprpc.SwapClient.ListInstantOuts:output_type -> looprpc.ListInstantOutsResponse + 53, // 72: looprpc.SwapClient.HyperLoopOut:output_type -> looprpc.HyperLoopOutResponse + 55, // 73: looprpc.SwapClient.ListHyperLoopOuts:output_type -> looprpc.ListHyperLoopOutsResponse + 50, // [50:74] is the sub-list for method output_type + 26, // [26:50] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_client_proto_init() } @@ -5299,6 +5663,66 @@ func file_client_proto_init() { return nil } } + file_client_proto_msgTypes[45].Exporter = func(v any, i int) any { + switch v := v.(*HyperLoopOutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[46].Exporter = func(v any, i int) any { + switch v := v.(*HyperLoopOutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[47].Exporter = func(v any, i int) any { + switch v := v.(*ListHyperLoopOutsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[48].Exporter = func(v any, i int) any { + switch v := v.(*ListHyperLoopOutsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[49].Exporter = func(v any, i int) any { + switch v := v.(*HyperLoopOut); 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{ @@ -5306,7 +5730,7 @@ func file_client_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_client_proto_rawDesc, NumEnums: 7, - NumMessages: 45, + NumMessages: 50, NumExtensions: 0, NumServices: 1, }, diff --git a/looprpc/client.proto b/looprpc/client.proto index 434a99b3a..4208a0040 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -149,6 +149,11 @@ service SwapClient { */ rpc ListInstantOuts (ListInstantOutsRequest) returns (ListInstantOutsResponse); + + rpc HyperLoopOut (HyperLoopOutRequest) returns (HyperLoopOutResponse); + + rpc ListHyperLoopOuts (ListHyperLoopOutsRequest) + returns (ListHyperLoopOutsResponse); } message LoopOutRequest { @@ -1452,3 +1457,32 @@ message InstantOut { */ string sweep_tx_id = 5; } + +message HyperLoopOutRequest { + uint64 amt = 1; + bool private = 2; + int64 private_publish_time = 3; + string custom_sweep_addr = 4; +} + +message HyperLoopOutResponse { + HyperLoopOut hyperloop = 1; +} + +message ListHyperLoopOutsRequest { +} + +message ListHyperLoopOutsResponse { + repeated HyperLoopOut swaps = 1; +} + +message HyperLoopOut { + bytes id_bytes = 1; + string id = 2; + bytes swap_hash_bytes = 3; + string swap_hash = 4; + uint64 amt = 5; + string state = 6; + int64 publish_time_unix = 7; + string sweep_address = 8; +} \ No newline at end of file diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index ded532ab0..02294b012 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -746,6 +746,47 @@ } } }, + "looprpcHyperLoopOut": { + "type": "object", + "properties": { + "id_bytes": { + "type": "string", + "format": "byte" + }, + "id": { + "type": "string" + }, + "swap_hash_bytes": { + "type": "string", + "format": "byte" + }, + "swap_hash": { + "type": "string" + }, + "amt": { + "type": "string", + "format": "uint64" + }, + "state": { + "type": "string" + }, + "publish_time_unix": { + "type": "string", + "format": "int64" + }, + "sweep_address": { + "type": "string" + } + } + }, + "looprpcHyperLoopOutResponse": { + "type": "object", + "properties": { + "hyperloop": { + "$ref": "#/definitions/looprpcHyperLoopOut" + } + } + }, "looprpcInQuoteResponse": { "type": "object", "properties": { @@ -1060,6 +1101,17 @@ ], "default": "UNKNOWN" }, + "looprpcListHyperLoopOutsResponse": { + "type": "object", + "properties": { + "swaps": { + "type": "array", + "items": { + "$ref": "#/definitions/looprpcHyperLoopOut" + } + } + } + }, "looprpcListInstantOutsResponse": { "type": "object", "properties": { diff --git a/looprpc/client_grpc.pb.go b/looprpc/client_grpc.pb.go index b67705bc3..d49a96b1c 100644 --- a/looprpc/client_grpc.pb.go +++ b/looprpc/client_grpc.pb.go @@ -106,6 +106,8 @@ type SwapClientClient interface { // ListInstantOuts returns a list of all currently known instant out swaps and // their current status. ListInstantOuts(ctx context.Context, in *ListInstantOutsRequest, opts ...grpc.CallOption) (*ListInstantOutsResponse, error) + HyperLoopOut(ctx context.Context, in *HyperLoopOutRequest, opts ...grpc.CallOption) (*HyperLoopOutResponse, error) + ListHyperLoopOuts(ctx context.Context, in *ListHyperLoopOutsRequest, opts ...grpc.CallOption) (*ListHyperLoopOutsResponse, error) } type swapClientClient struct { @@ -337,6 +339,24 @@ func (c *swapClientClient) ListInstantOuts(ctx context.Context, in *ListInstantO return out, nil } +func (c *swapClientClient) HyperLoopOut(ctx context.Context, in *HyperLoopOutRequest, opts ...grpc.CallOption) (*HyperLoopOutResponse, error) { + out := new(HyperLoopOutResponse) + err := c.cc.Invoke(ctx, "/looprpc.SwapClient/HyperLoopOut", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *swapClientClient) ListHyperLoopOuts(ctx context.Context, in *ListHyperLoopOutsRequest, opts ...grpc.CallOption) (*ListHyperLoopOutsResponse, error) { + out := new(ListHyperLoopOutsResponse) + err := c.cc.Invoke(ctx, "/looprpc.SwapClient/ListHyperLoopOuts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SwapClientServer is the server API for SwapClient service. // All implementations must embed UnimplementedSwapClientServer // for forward compatibility @@ -429,6 +449,8 @@ type SwapClientServer interface { // ListInstantOuts returns a list of all currently known instant out swaps and // their current status. ListInstantOuts(context.Context, *ListInstantOutsRequest) (*ListInstantOutsResponse, error) + HyperLoopOut(context.Context, *HyperLoopOutRequest) (*HyperLoopOutResponse, error) + ListHyperLoopOuts(context.Context, *ListHyperLoopOutsRequest) (*ListHyperLoopOutsResponse, error) mustEmbedUnimplementedSwapClientServer() } @@ -502,6 +524,12 @@ func (UnimplementedSwapClientServer) InstantOutQuote(context.Context, *InstantOu func (UnimplementedSwapClientServer) ListInstantOuts(context.Context, *ListInstantOutsRequest) (*ListInstantOutsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListInstantOuts not implemented") } +func (UnimplementedSwapClientServer) HyperLoopOut(context.Context, *HyperLoopOutRequest) (*HyperLoopOutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HyperLoopOut not implemented") +} +func (UnimplementedSwapClientServer) ListHyperLoopOuts(context.Context, *ListHyperLoopOutsRequest) (*ListHyperLoopOutsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListHyperLoopOuts not implemented") +} func (UnimplementedSwapClientServer) mustEmbedUnimplementedSwapClientServer() {} // UnsafeSwapClientServer may be embedded to opt out of forward compatibility for this service. @@ -914,6 +942,42 @@ func _SwapClient_ListInstantOuts_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _SwapClient_HyperLoopOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HyperLoopOutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SwapClientServer).HyperLoopOut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.SwapClient/HyperLoopOut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SwapClientServer).HyperLoopOut(ctx, req.(*HyperLoopOutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SwapClient_ListHyperLoopOuts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListHyperLoopOutsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SwapClientServer).ListHyperLoopOuts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.SwapClient/ListHyperLoopOuts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SwapClientServer).ListHyperLoopOuts(ctx, req.(*ListHyperLoopOutsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SwapClient_ServiceDesc is the grpc.ServiceDesc for SwapClient service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1005,6 +1069,14 @@ var SwapClient_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListInstantOuts", Handler: _SwapClient_ListInstantOuts_Handler, }, + { + MethodName: "HyperLoopOut", + Handler: _SwapClient_HyperLoopOut_Handler, + }, + { + MethodName: "ListHyperLoopOuts", + Handler: _SwapClient_ListHyperLoopOuts_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/looprpc/swapclient.pb.json.go b/looprpc/swapclient.pb.json.go index 8164f37be..526e9489f 100644 --- a/looprpc/swapclient.pb.json.go +++ b/looprpc/swapclient.pb.json.go @@ -587,4 +587,54 @@ func RegisterSwapClientJSONCallbacks(registry map[string]func(ctx context.Contex } callback(string(respBytes), nil) } + + registry["looprpc.SwapClient.HyperLoopOut"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &HyperLoopOutRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSwapClientClient(conn) + resp, err := client.HyperLoopOut(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + + registry["looprpc.SwapClient.ListHyperLoopOuts"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &ListHyperLoopOutsRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSwapClientClient(conn) + resp, err := client.ListHyperLoopOuts(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } } From 5bf2e220f4d63e02db06fae0f7ad9f7bdb99cf2d Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:29:36 +0200 Subject: [PATCH 08/14] hyperloop: add hyperloop struct and funcs This commit adds the hyperloop struct and associated funcs. --- hyperloop/hyperloop.go | 739 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 739 insertions(+) create mode 100644 hyperloop/hyperloop.go diff --git a/hyperloop/hyperloop.go b/hyperloop/hyperloop.go new file mode 100644 index 000000000..12fb7252e --- /dev/null +++ b/hyperloop/hyperloop.go @@ -0,0 +1,739 @@ +package hyperloop + +import ( + "bytes" + "context" + "crypto/rand" + "encoding/hex" + "fmt" + "time" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/chaincfg" + "github.com/btcsuite/btcd/txscript" + "github.com/btcsuite/btcd/wire" + "github.com/lightninglabs/lndclient" + "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/looprpc" + "github.com/lightninglabs/loop/swap" + "github.com/lightningnetwork/lnd/input" + "github.com/lightningnetwork/lnd/keychain" + "github.com/lightningnetwork/lnd/lntypes" + "github.com/lightningnetwork/lnd/lnwallet/chainfee" +) + +// ID is a unique identifier for a hyperloop. +type ID [32]byte + +// NewHyperLoopId creates a new hyperloop id. +func NewHyperLoopId() (ID, error) { + var id ID + _, err := rand.Read(id[:]) + return id, err +} + +// ParseHyperloopId parses the given id into a hyperloop id. +func ParseHyperloopId(id []byte) (ID, error) { + var newID ID + if len(id) != 32 { + return newID, fmt.Errorf("invalid hyperloop id") + } + copy(newID[:], id) + return newID, nil +} + +// String returns a human-readable string representation of the hyperloop id. +func (i ID) String() string { + return hex.EncodeToString(i[:]) +} + +type Hyperloop struct { + // ID is the hyperloop identifier, this can be the same between multiple + // hyperloops, as swaps can be batched. + ID ID + + // PublishTime is the time where we request the hyperloop output to be + // published. + PublishTime time.Time + + // State is the current state of the hyperloop. + State fsm.StateType + + // SwapHash is the hash of the swap preimage and identifier of the htlc + // that goes onchain. + SwapHash lntypes.Hash + + // SwapPreimage is the preimage of the swap hash. + SwapPreimage lntypes.Preimage + + // SwapInvoice is the invoice that the server sends to the client and the + // client pays. + SwapInvoice string + + // InitiationHeight is the height at which the hyperloop was initiated. + InitiationHeight int32 + + // Amt is the requested amount of the hyperloop. + Amt btcutil.Amount + + // SweepAddr is the address we sweep the funds to after the hyperloop is + // completed. + SweepAddr btcutil.Address + + // KeyDesc is the key descriptor used to derive the keys for the hyperloop. + KeyDesc *keychain.KeyDescriptor + + // ServerKey is the key of the server used in the hyperloop musig2 output. + ServerKey *btcec.PublicKey + + // Participants are all the participants of the hyperloop including the + // requesting client. + Participants []*HyperloopParticipant + + // HtlcFeeRates are the fee rates for the htlc tx. + HtlcFeeRates []chainfee.SatPerKWeight + + // HyperloopExpiry is the csv expiry of the hyperloop output. + HyperLoopExpiry uint32 + + // ConfirmedOutpoint is the outpoint of the confirmed hyperloop output. + ConfirmedOutpoint *wire.OutPoint + + // ConfirmedValue is the value of the confirmed hyperloop output. + ConfirmedValue btcutil.Amount + + // ConfirmationHeight is the height at which the hyperloop output was + // confirmed. + ConfirmationHeight int32 + + // HtlcExpiry is the expiry of each of the htlc swap outputs. + HtlcExpiry int32 + + // HtlcMusig2Sessions are the musig2 session for the htlc tx. + HtlcMusig2Sessions map[int64]*input.MuSig2SessionInfo + + // HtlcServerNonces are the nonces of the server for the htlc tx. + HtlcServerNonces map[int64][66]byte + + // HtlcRawTxns are the raw txns for the htlc tx. + HtlcRawTxns map[int64]*wire.MsgTx + + // HtlcFullSigs are the full signatures for the htlc tx. + HtlcFullSigs map[int64][]byte + + // SweeplessSweepMusig2Session is the musig2 session for the sweepless + // sweep tx. + SweeplessSweepMusig2Session *input.MuSig2SessionInfo + + // SweepServerNonce is the nonce of the server for the sweepless sweep + // tx. + SweepServerNonce [66]byte + + // SweeplessSweepRawTx is the raw tx for the sweepless sweep tx. + SweeplessSweepRawTx *wire.MsgTx +} + +// newHyperLoop creates a new hyperloop with the given parameters. +func newHyperLoop(publishTime time.Time, amt btcutil.Amount, + keyDesc *keychain.KeyDescriptor, preimage lntypes.Preimage, + sweepAddr btcutil.Address, initiationHeight int32) *Hyperloop { + + return &Hyperloop{ + PublishTime: publishTime, + SwapPreimage: preimage, + SwapHash: preimage.Hash(), + KeyDesc: keyDesc, + Amt: amt, + SweepAddr: sweepAddr, + InitiationHeight: initiationHeight, + HtlcMusig2Sessions: make(map[int64]*input.MuSig2SessionInfo), + HtlcServerNonces: make(map[int64][66]byte), + HtlcFullSigs: make(map[int64][]byte), + HtlcRawTxns: make(map[int64]*wire.MsgTx), + } +} + +// addInitialHyperLoopInfo adds the initial server info to the hyperloop. +func (h *Hyperloop) addInitialHyperLoopInfo(id ID, + hyperLoopExpiry uint32, htlcExpiry int32, serverKey *btcec.PublicKey, + swapInvoice string) { + + h.ID = id + h.HtlcExpiry = htlcExpiry + h.HyperLoopExpiry = hyperLoopExpiry + h.ServerKey = serverKey + h.SwapInvoice = swapInvoice +} + +// String returns a human-readable string representation of the hyperloop. +// It encodes the first 3 bytes of the ID as a hex string adds a colon and then +// the first 3 bytes of the swap hash. +func (h *Hyperloop) String() string { + return fmt.Sprintf("%x:%x", h.ID[:3], h.SwapHash[:3]) +} + +// HyperloopParticipant is a helper struct to store the participant information +// of the hyperloop. +type HyperloopParticipant struct { + pubkey *btcec.PublicKey + sweepAddress btcutil.Address +} + +// startHtlcSessions starts the musig2 sessions for each fee rate of the htlc +// tx. +func (h *Hyperloop) startHtlcFeerateSessions(ctx context.Context, + signer lndclient.SignerClient) error { + + for _, feeRate := range h.HtlcFeeRates { + session, err := h.startHtlcSession(ctx, signer) + if err != nil { + return err + } + + h.HtlcMusig2Sessions[int64(feeRate)] = session + } + + return nil +} + +// startHtlcSession starts a musig2 session for the htlc tx. +func (h *Hyperloop) startHtlcSession(ctx context.Context, + signer lndclient.SignerClient) (*input.MuSig2SessionInfo, error) { + + rootHash, err := h.getHyperLoopRootHash() + if err != nil { + return nil, err + } + + allPubkeys, err := h.getHyperLoopPubkeys() + if err != nil { + return nil, err + } + + var rawKeys [][]byte + for _, key := range allPubkeys { + key := key + rawKeys = append(rawKeys, key.SerializeCompressed()) + } + + htlcSession, err := signer.MuSig2CreateSession( + ctx, input.MuSig2Version100RC2, &h.KeyDesc.KeyLocator, + rawKeys, + lndclient.MuSig2TaprootTweakOpt(rootHash, false), + ) + if err != nil { + return nil, err + } + + return htlcSession, nil +} + +func (h *Hyperloop) getHtlcFeeRateMusig2Nonces() map[int64][]byte { + nonces := make(map[int64][]byte) + for feeRate, session := range h.HtlcMusig2Sessions { + nonces[feeRate] = session.PublicNonce[:] + } + + return nonces +} + +// startSweeplessSession starts the musig2 session for the sweepless sweep tx. +func (h *Hyperloop) startSweeplessSession(ctx context.Context, + signer lndclient.SignerClient) error { + + rootHash, err := h.getHyperLoopRootHash() + if err != nil { + return err + } + + allPubkeys, err := h.getHyperLoopPubkeys() + if err != nil { + return err + } + + var rawKeys [][]byte + for _, key := range allPubkeys { + key := key + rawKeys = append(rawKeys, key.SerializeCompressed()) + } + + sweeplessSweepSession, err := signer.MuSig2CreateSession( + ctx, input.MuSig2Version100RC2, + &h.KeyDesc.KeyLocator, rawKeys, + lndclient.MuSig2TaprootTweakOpt(rootHash, false), + ) + if err != nil { + return err + } + + h.SweeplessSweepMusig2Session = sweeplessSweepSession + + return nil +} + +// registerHtlcNonces registers the htlc nonces for the hyperloop. +func (h *Hyperloop) registerHtlcNonces(ctx context.Context, + signer lndclient.SignerClient, nonceMap map[int64][][66]byte) error { + + for feeRate, nonces := range nonceMap { + session, ok := h.HtlcMusig2Sessions[feeRate] + if !ok { + return fmt.Errorf("missing session for fee rate %d", + feeRate) + } + noncesWithoutOwn := h.removeOwnNonceFromSet( + session, nonces, + ) + + serverNonce, ok := h.HtlcServerNonces[feeRate] + if !ok { + return fmt.Errorf("missing server nonce for fee rate "+ + "%d", feeRate) + } + noncesWithoutOwn = append(noncesWithoutOwn, serverNonce) + + haveAllNonces, err := signer.MuSig2RegisterNonces( + ctx, session.SessionID, noncesWithoutOwn, + ) + if err != nil { + return err + } + + if !haveAllNonces { + return fmt.Errorf("not all nonces registered") + } + } + + return nil +} + +// registerSweeplessSweepNonces registers the sweepless sweep nonces for the +// hyperloop. +func (h *Hyperloop) registerSweeplessSweepNonces(ctx context.Context, + signer lndclient.SignerClient, nonces [][66]byte) error { + + nonces = append(nonces, h.SweepServerNonce) + + noncesWithoutOwn := h.removeOwnNonceFromSet( + h.SweeplessSweepMusig2Session, nonces, + ) + + haveAllNonces, err := signer.MuSig2RegisterNonces( + ctx, h.SweeplessSweepMusig2Session.SessionID, noncesWithoutOwn, + ) + if err != nil { + return err + } + if !haveAllNonces { + return fmt.Errorf("not all nonces registered") + } + + return nil +} + +// removeOwnNonceFromSet removes the own nonce from the set of nonces. +func (h *Hyperloop) removeOwnNonceFromSet(session *input.MuSig2SessionInfo, + nonces [][66]byte) [][66]byte { + + var ownNonce [66]byte + copy(ownNonce[:], session.PublicNonce[:]) + + var noncesWithoutOwn [][66]byte + for _, nonce := range nonces { + nonce := nonce + if nonce != ownNonce { + noncesWithoutOwn = append(noncesWithoutOwn, nonce) + } + } + + return noncesWithoutOwn +} + +// setHtlcFeeRates sets the fee rates for the htlc tx. +func (h *Hyperloop) setHtlcFeeRates(feeRates []int64) { + h.HtlcFeeRates = make([]chainfee.SatPerKWeight, len(feeRates)) + for i, feeRate := range feeRates { + h.HtlcFeeRates[i] = chainfee.SatPerKWeight(feeRate) + } +} + +// getSigForTx returns the signature for the given hyperloop tx with the +// specified musig2 session id. +func (h *Hyperloop) getSigForTx(ctx context.Context, + signer lndclient.SignerClient, tx *wire.MsgTx, + musig2SessionId [32]byte) ([]byte, error) { + + sigHash, err := h.getTxSighash(tx) + if err != nil { + return nil, err + } + + sig, err := signer.MuSig2Sign( + ctx, musig2SessionId, sigHash, false, + ) + if err != nil { + return nil, err + } + + return sig, nil +} + +// getTxSighash returns the sighash for the given hyperloop tx. +func (h *Hyperloop) getTxSighash(tx *wire.MsgTx) ([32]byte, error) { + prevOutFetcher, err := h.getHyperLoopPrevOutputFetcher() + if err != nil { + return [32]byte{}, err + } + + sigHashes := txscript.NewTxSigHashes(tx, prevOutFetcher) + + taprootSigHash, err := txscript.CalcTaprootSignatureHash( + sigHashes, txscript.SigHashDefault, + tx, 0, prevOutFetcher, + ) + if err != nil { + return [32]byte{}, err + } + + var digest [32]byte + copy(digest[:], taprootSigHash) + + return digest, nil +} + +// getHyperLoopPrevOutputFetcher returns a canned prev output fetcher for the +// hyperloop. This is required for the signature generation and verification. +func (h *Hyperloop) getHyperLoopPrevOutputFetcher() (txscript.PrevOutputFetcher, + error) { + + hyperloopScript, err := h.getHyperLoopScript() + if err != nil { + return nil, err + } + + return txscript.NewCannedPrevOutputFetcher( + hyperloopScript, int64(h.ConfirmedValue), + ), nil +} + +// getHtlc returns the htlc for the participant that is the client. +func (h *Hyperloop) getHtlc(chainParams *chaincfg.Params) (*swap.Htlc, + error) { + + serverKey, err := get33Bytes(h.ServerKey) + if err != nil { + return nil, err + } + + clientKey, err := get33Bytes(h.KeyDesc.PubKey) + if err != nil { + return nil, err + } + + htlcV2, err := swap.NewHtlcV2( + h.HtlcExpiry, serverKey, clientKey, + h.SwapHash, chainParams, + ) + if err != nil { + return nil, err + } + + return htlcV2, nil +} + +// getHyperLoopScript returns the pkscript for the hyperloop output. +func (h *Hyperloop) getHyperLoopScript() ([]byte, error) { + pubkeys, err := h.getHyperLoopPubkeys() + if err != nil { + return nil, err + } + + return HyperLoopScript(h.HyperLoopExpiry, h.ServerKey, pubkeys) +} + +// getHyperLoopRootHash returns the root hash of the hyperloop. +func (h *Hyperloop) getHyperLoopRootHash() ([]byte, error) { + pubkeys, err := h.getHyperLoopPubkeys() + if err != nil { + return nil, err + } + + _, _, leaf, err := TaprootKey( + h.HyperLoopExpiry, h.ServerKey, pubkeys, + ) + if err != nil { + return nil, err + } + + rootHash := leaf.TapHash() + + return rootHash[:], nil +} + +// getHyperLoopPubkeys returns the pubkeys of all participants and the server. +func (h *Hyperloop) getHyperLoopPubkeys() ([]*btcec.PublicKey, error) { + pubkeys := make([]*btcec.PublicKey, 0, len(h.Participants)) + for _, participant := range h.Participants { + participant := participant + if participant.pubkey == nil { + return nil, fmt.Errorf("missing participant pubkey") + } + pubkeys = append(pubkeys, participant.pubkey) + } + + pubkeys = append(pubkeys, h.ServerKey) + + return pubkeys, nil +} + +// getHtlcFee returns the absolute fee for the htlc tx. +func (h *Hyperloop) getHtlcFee(feeRate chainfee.SatPerKWeight, +) btcutil.Amount { + + var weightEstimate input.TxWeightEstimator + + // Add the input. + weightEstimate.AddTaprootKeySpendInput(txscript.SigHashAll) + + // Add the outputs. + for i := 0; i < len(h.Participants); i++ { + weightEstimate.AddP2WSHOutput() + } + + weight := weightEstimate.Weight() + + return feeRate.FeeForWeight(weight) +} + +// registerHtlcTx registers the htlc tx for the hyperloop and checks that it is +// valid. +func (h *Hyperloop) registerHtlcTx(chainParams *chaincfg.Params, + feeRate int64, htlcTx *wire.MsgTx) error { + + myHtlc, err := h.getHtlc(chainParams) + if err != nil { + return err + } + + // Get the Htlc Fee. + absoluteFee := h.getHtlcFee(chainfee.SatPerKWeight(feeRate)) + // Get the fee per output. + feePerOutput := absoluteFee / btcutil.Amount(len(h.Participants)) + + // First we'll check that our htlc output is part of the tx. + foundPkScript := false + for _, txOut := range htlcTx.TxOut { + if bytes.Equal(txOut.PkScript, myHtlc.PkScript) { + foundPkScript = true + if btcutil.Amount(txOut.Value) != h.Amt-feePerOutput { + return fmt.Errorf("invalid htlc amount, "+ + "expected %v got %v", h.Amt, + txOut.Value) + } + break + } + } + if !foundPkScript { + return fmt.Errorf("htlc output not found") + } + + // Check that one of the inputs is the confirmed hyperloop output. + var foundInput bool + for _, txIn := range htlcTx.TxIn { + if txIn.PreviousOutPoint == *h.ConfirmedOutpoint { + foundInput = true + break + } + } + + if !foundInput { + return fmt.Errorf("sweepless sweep input not found") + } + + // Check that the sequence number is correct. + // Todo config this or check otherwise e.g. against invoice expiries, + // or the hyperloop expiry. + if htlcTx.TxIn[0].Sequence != 5 { + return fmt.Errorf("invalid htlc sequence, expected 5 got %v", + htlcTx.TxIn[0].Sequence) + } + + // TODO (sputn1ck) calculate actual fee and check that it is correct. + h.HtlcRawTxns[feeRate] = htlcTx + + return nil +} + +// registerHtlcSig registers the htlc signature for the hyperloop tx and +// checks that it is valid. +func (h *Hyperloop) registerHtlcSig(feeRate int64, sig []byte) error { + htlcTx, ok := h.HtlcRawTxns[feeRate] + if !ok { + return fmt.Errorf("missing htlc tx") + } + + return h.checkSigForTx(htlcTx, sig) +} + +// checkSigForTx checks the given signature for the given version of the +// hyperloop tx. +func (h *Hyperloop) checkSigForTx(tx *wire.MsgTx, sig []byte) error { + tx.TxIn[0].Witness = [][]byte{ + sig, + } + + pkscript, err := h.getHyperLoopScript() + if err != nil { + return err + } + + prevOutFetcher, err := h.getHyperLoopPrevOutputFetcher() + if err != nil { + return err + } + hashCache := txscript.NewTxSigHashes( + tx, prevOutFetcher, + ) + + engine, err := txscript.NewEngine( + pkscript, tx, 0, txscript.StandardVerifyFlags, + nil, hashCache, int64(h.ConfirmedValue), prevOutFetcher, + ) + if err != nil { + return err + } + + return engine.Execute() +} + +// registerSweeplessSweepTx registers the sweepless sweep tx for the hyperloop +// and checks that it is valid. +func (h *Hyperloop) registerSweeplessSweepTx(sweeplessSweepTx *wire.MsgTx, + feeRate chainfee.SatPerKWeight, totalSweepAmt btcutil.Amount) error { + + myPkScript, err := txscript.PayToAddrScript(h.SweepAddr) + if err != nil { + return err + } + + // Create a map of addresses + sweepPkScriptAmtMap := make(map[btcutil.Address]interface{}) + for _, participant := range h.Participants { + participant := participant + sweepPkScriptAmtMap[participant.sweepAddress] = 0 + } + + sweeplessSweepFee, err := h.getSweeplessSweepFee( + feeRate, sweepPkScriptAmtMap, + ) + if err != nil { + return err + } + + feePerOutput := sweeplessSweepFee / btcutil.Amount(len(sweepPkScriptAmtMap)) + + var foundPkScript bool + + // Check that the output is as we expect, where we sweep all the funds + // to the sweep address. + for _, txOut := range sweeplessSweepTx.TxOut { + if bytes.Equal(txOut.PkScript, myPkScript) { + foundPkScript = true + if btcutil.Amount(txOut.Value) != totalSweepAmt-feePerOutput { + return fmt.Errorf("invalid sweepless sweep"+ + " amount, expected %v got %v", + totalSweepAmt-feePerOutput, txOut.Value) + } + break + } + } + + if !foundPkScript { + return fmt.Errorf("sweepless sweep output not found") + } + + // Check that one of the inputs is the confirmed hyperloop output. + var foundInput bool + for _, txIn := range sweeplessSweepTx.TxIn { + if txIn.PreviousOutPoint == *h.ConfirmedOutpoint { + foundInput = true + break + } + } + + if !foundInput { + return fmt.Errorf("sweepless sweep input not found") + } + + h.SweeplessSweepRawTx = sweeplessSweepTx + + return nil +} + +// getSweeplessSweepFee returns the absolute fee for the sweepless sweep tx. +func (h *Hyperloop) getSweeplessSweepFee(feeRate chainfee.SatPerKWeight, + sweepAddrMap map[btcutil.Address]interface{}) (btcutil.Amount, + error) { + + var weightEstimate input.TxWeightEstimator + + // Add the input. + weightEstimate.AddTaprootKeySpendInput(txscript.SigHashAll) + + // Add the outputs. + for sweepAddr := range sweepAddrMap { + switch sweepAddr.(type) { + case *btcutil.AddressWitnessScriptHash: + weightEstimate.AddP2WSHOutput() + + case *btcutil.AddressWitnessPubKeyHash: + weightEstimate.AddP2WKHOutput() + + case *btcutil.AddressScriptHash: + weightEstimate.AddP2SHOutput() + + case *btcutil.AddressPubKeyHash: + weightEstimate.AddP2PKHOutput() + + case *btcutil.AddressTaproot: + weightEstimate.AddP2TROutput() + + default: + return 0, fmt.Errorf("estimate fee: unknown address"+ + " type %T", sweepAddr) + } + } + + weight := weightEstimate.Weight() + + return feeRate.FeeForWeight(weight), nil +} + +// get33Bytes returns the 33 byte representation of the given pubkey. +func get33Bytes(pubkey *btcec.PublicKey) ([33]byte, error) { + var key [33]byte + if pubkey == nil { + return key, fmt.Errorf("missing participant pubkey") + } + if len(pubkey.SerializeCompressed()) != 33 { + return key, fmt.Errorf("invalid participant pubkey") + } + copy(key[:], pubkey.SerializeCompressed()) + + return key, nil +} + +// ToRpcHyperloop converts the hyperloop to the rpc representation. +func (h *Hyperloop) ToRpcHyperloop() *looprpc.HyperLoopOut { + return &looprpc.HyperLoopOut{ + IdBytes: h.ID[:], + Id: h.ID.String(), + SwapHash: h.SwapHash.String(), + SwapHashBytes: h.SwapHash[:], + Amt: uint64(h.Amt), + State: string(h.State), + PublishTimeUnix: h.PublishTime.Unix(), + SweepAddress: h.SweepAddr.String(), + } +} From 337fb3fb72027a8514bc3c34005d8ca3e739900c Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:31:21 +0200 Subject: [PATCH 09/14] hyperloop: add fsm and actions --- hyperloop/actions.go | 884 +++++++++++++++++++++++++++++++++++++++++++ hyperloop/fsm.go | 615 ++++++++++++++++++++++++++++++ 2 files changed, 1499 insertions(+) create mode 100644 hyperloop/actions.go create mode 100644 hyperloop/fsm.go diff --git a/hyperloop/actions.go b/hyperloop/actions.go new file mode 100644 index 000000000..0df5ce1da --- /dev/null +++ b/hyperloop/actions.go @@ -0,0 +1,884 @@ +package hyperloop + +import ( + "bytes" + "context" + "crypto/rand" + "errors" + "time" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/schnorr/musig2" + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/chaincfg" + "github.com/btcsuite/btcd/txscript" + "github.com/btcsuite/btcd/wire" + "github.com/lightninglabs/lndclient" + "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/swap" + "github.com/lightninglabs/loop/swapserverrpc" + "github.com/lightningnetwork/lnd/chainntnfs" + "github.com/lightningnetwork/lnd/lnrpc" + "github.com/lightningnetwork/lnd/lntypes" + "github.com/lightningnetwork/lnd/lnwallet/chainfee" +) + +var ( + + // Define route independent max routing fees. We have currently no way + // to get a reliable estimate of the routing fees. Best we can do is + // the minimum routing fees, which is not very indicative. + maxRoutingFeeBase = btcutil.Amount(10) + + maxRoutingFeeRate = int64(20000) + + // defaultSendpaymentTimeout is the default timeout for the swap invoice. + defaultSendpaymentTimeout = time.Minute * 5 +) + +// initHyperloopContext contains the request parameters for a hyperloop. +type initHyperloopContext struct { + swapAmt btcutil.Amount + private bool + publishTime time.Time + sweepAddr btcutil.Address + initiationHeight int32 +} + +// initHyperloopAction is the action that initializes the hyperloop. +func (f *FSM) initHyperloopAction(ctx context.Context, + eventCtx fsm.EventContext) fsm.EventType { + + f.ValLock.Lock() + defer f.ValLock.Unlock() + + initCtx, ok := eventCtx.(*initHyperloopContext) + if !ok { + return f.HandleError(fsm.ErrInvalidContextType) + } + + // Create a new receiver key descriptor. + receiverKeyDesc, err := f.cfg.Wallet.DeriveNextKey(ctx, 42069) + if err != nil { + return f.HandleError(err) + } + + // Create a new swap preimage. + var swapPreimage lntypes.Preimage + if _, err := rand.Read(swapPreimage[:]); err != nil { + return f.HandleError(err) + } + + hyperloop := newHyperLoop( + initCtx.publishTime, initCtx.swapAmt, receiverKeyDesc, + swapPreimage, initCtx.sweepAddr, initCtx.initiationHeight, + ) + + // Request the hyperloop from the server. + registerRes, err := f.cfg.HyperloopClient.RegisterHyperloop( + ctx, &swapserverrpc.RegisterHyperloopRequest{ + ReceiverKey: hyperloop. + KeyDesc.PubKey.SerializeCompressed(), + SwapHash: hyperloop.SwapHash[:], + Amt: int64(hyperloop.Amt), + Private: initCtx.private, + HyperloopPublishTimeUnix: hyperloop.PublishTime.Unix(), + SweepAddr: hyperloop.SweepAddr.String(), + }, + ) + if err != nil { + return f.HandleError(err) + } + + f.Debugf("Registered hyperloop: %x", registerRes.HyperloopId) + + var hyperloopId ID + copy(hyperloopId[:], registerRes.HyperloopId) + + senderKey, err := btcec.ParsePubKey(registerRes.ServerKey) + if err != nil { + return f.HandleError(err) + } + + hyperloop.addInitialHyperLoopInfo( + hyperloopId, + uint32(registerRes.HyperloopCsvExpiry), + registerRes.HtlcCltvExpiry, + senderKey, + registerRes.Invoice, + ) + + f.hyperloop = hyperloop + f.Val = hyperloop + + // TODO: implement sql store. + // Now that we have the hyperloop response from the server, we can + // create the hyperloop in the database. + // err = f.cfg.Store.CreateHyperloop(ctx, hyperloop) + // if err != nil { + // return f.HandleError(err) + // } + + return OnInit +} + +// registerHyperloopAction is the action that registers the hyperloop by +// paying the server. +func (f *FSM) registerHyperloopAction(ctx context.Context, + eventCtx fsm.EventContext) fsm.EventType { + + // Create a context which we can cancel if we're registered. + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + // Poll the server to check if we're registered. + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + + p, err := f.cfg.HyperloopClient.FetchHyperloopParticipants( + ctx, + &swapserverrpc.FetchHyperloopParticipantsRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return false, err + } + + for _, participant := range p.Participants { + if bytes.Equal(participant.PublicKey, + f.hyperloop.KeyDesc. + PubKey.SerializeCompressed()) { + + return true, nil + } + } + + // If the server is already further than the pending state, + // we failed to register. + if int(res.Status) >= int(swapserverrpc.HyperloopStatus_PUBLISHED) { //nolint:lll + return false, errors.New("registration failed") + } + + return false, nil + } + + resultChan, errChan := f.waitForStateChan(ctx, checkFunc) + + // Dispatch the swap payment. + paymentChan, payErrChan, err := f.cfg.Router.SendPayment( + ctx, lndclient.SendPaymentRequest{ + Invoice: f.hyperloop.SwapInvoice, + MaxFee: getMaxRoutingFee(f.hyperloop.Amt), + Timeout: defaultSendpaymentTimeout, + }, + ) + if err != nil { + return f.HandleError(err) + } + + for { + select { + case <-ctx.Done(): + f.Debugf("Context canceled") + return fsm.NoOp + + case err := <-payErrChan: + f.Debugf("Payment error: %v", err) + return f.HandleError(err) + + case err := <-errChan: + f.Debugf("Error: %v", err) + return f.HandleError(err) + + case res := <-paymentChan: + f.Debugf("Payment result: %v", res) + if res.State == lnrpc.Payment_FAILED { + return f.HandleError( + errors.New("payment failed")) + } + + case <-resultChan: + return OnRegistered + } + } +} + +// waitForPublishAction is the action that waits for the hyperloop to be +// published. +func (f *FSM) waitForPublishAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + + if res.Status == swapserverrpc.HyperloopStatus_PUBLISHED || + res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_HTLC_NONCES { //nolint:lll + + return true, nil + } + + return false, nil + } + + err := f.waitForState(ctx, checkFunc) + if err != nil { + return f.HandleError(err) + } + + p, err := f.cfg.HyperloopClient.FetchHyperloopParticipants( + ctx, + &swapserverrpc.FetchHyperloopParticipantsRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return f.HandleError(err) + } + + // If we're published, the list of participants is final. + participants, err := getParticipants(p.Participants, f.cfg.ChainParams) + if err != nil { + return f.HandleError(err) + } + + f.ValLock.Lock() + f.hyperloop.Participants = participants + f.ValLock.Unlock() + + return OnPublished +} + +// waitForConfirmationAction is the action that waits for the hyperloop to be +// confirmed. +func (f *FSM) waitForConfirmationAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + pkScript, err := f.hyperloop.getHyperLoopScript() + if err != nil { + return f.HandleError(err) + } + + subChan, errChan, err := f.cfg.ChainNotifier.RegisterConfirmationsNtfn( + ctx, nil, pkScript, 2, f.hyperloop.InitiationHeight, + ) + if err != nil { + return f.HandleError(err) + } + + for { + select { + case <-ctx.Done(): + return fsm.NoOp + + case err := <-errChan: + return f.HandleError(err) + + case conf := <-subChan: + f.hyperloop.ConfirmationHeight = int32(conf.BlockHeight) + outpoint, amt, err := getOutpointFromTx( + conf.Tx, pkScript, + ) + if err != nil { + return f.HandleError(err) + } + + f.ValLock.Lock() + f.hyperloop.ConfirmedOutpoint = outpoint + f.hyperloop.ConfirmedValue = btcutil.Amount(amt) + f.ValLock.Unlock() + + return OnConfirmed + } + } +} + +// pushHtlcNonceAction is the action that pushes the htlc nonce to the server. +func (f *FSM) pushHtlcNonceAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + // If the length of htlc nonces is equal to the + // number of participants, we're ready to sign. + return res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_HTLC_NONCES, // nolint:lll + nil + } + + err := f.waitForState(ctx, checkFunc) + if err != nil { + return f.HandleError(err) + } + + // We'll first fetch the feeRates from the server. + feeRates, err := f.cfg.HyperloopClient.FetchHyperloopHtlcFeeRates( + ctx, &swapserverrpc.FetchHyperloopHtlcFeeRatesRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return f.HandleError(err) + } + + f.Debugf("Fetched htlc fee rates: %v", feeRates.HtlcFeeRates) + + f.ValLock.Lock() + defer f.ValLock.Unlock() + f.hyperloop.setHtlcFeeRates(feeRates.HtlcFeeRates) + + err = f.hyperloop.startHtlcFeerateSessions(ctx, f.cfg.Signer) + if err != nil { + return f.HandleError(err) + } + + nonceMap := f.hyperloop.getHtlcFeeRateMusig2Nonces() + + for feeRate, nonce := range nonceMap { + f.Debugf("Pushing nonce for fee rate %v %v", feeRate, + len(nonce)) + } + + res, err := f.cfg.HyperloopClient.PushHyperloopHtlcNonces( + ctx, &swapserverrpc.PushHyperloopHtlcNoncesRequest{ + HyperloopId: f.hyperloop.ID[:], + SwapHash: f.hyperloop.SwapHash[:], + HtlcNonces: nonceMap, + }, + ) + if err != nil { + return f.HandleError(err) + } + + for feeRate, nonce := range res.ServerHtlcNonces { + var nonceBytes [musig2.PubNonceSize]byte + copy(nonceBytes[:], nonce) + + f.hyperloop.HtlcServerNonces[feeRate] = nonceBytes + } + + for feeRate, txBytes := range res.HtlcRawTxns { + rawTx := &wire.MsgTx{} + err := rawTx.Deserialize(bytes.NewReader(txBytes)) + if err != nil { + return f.HandleError(err) + } + + err = f.hyperloop.registerHtlcTx( + f.cfg.ChainParams, feeRate, rawTx, + ) + if err != nil { + return f.HandleError(err) + } + } + + return OnPushedHtlcNonce +} + +// waitForReadyForHtlcSignAction is the action that waits for the server to be +// ready for the htlc sign. +func (f *FSM) waitForReadyForHtlcSignAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + // If the length of htlc nonces is equal to the + // number of participants, we're ready to sign. + return res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_HTLC_SIGS, // nolint:lll + nil + } + + err := f.waitForState(ctx, checkFunc) + if err != nil { + return f.HandleError(err) + } + + res, err := f.cfg.HyperloopClient.FetchHyperloopHtlcNonces( + ctx, &swapserverrpc.FetchHyperloopHtlcNoncesRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return f.HandleError(err) + } + + f.ValLock.Lock() + defer f.ValLock.Unlock() + + nonceMap := make(map[int64][][66]byte, len(res.HtlcNoncesByFees)) + for feeRate, htlcNonces := range res.HtlcNoncesByFees { + nonceMap[feeRate] = make( + [][66]byte, 0, len(htlcNonces.ParticipantNonce), + ) + for _, htlcNonce := range htlcNonces.ParticipantNonce { + htlcNonce := htlcNonce + var nonce [66]byte + copy(nonce[:], htlcNonce) + nonceMap[feeRate] = append(nonceMap[feeRate], nonce) + } + } + + err = f.hyperloop.registerHtlcNonces(ctx, f.cfg.Signer, nonceMap) + if err != nil { + return f.HandleError(err) + } + + return OnReadyForHtlcSig +} + +// pushHtlcSigAction is the action that pushes the htlc signatures to the server. +func (f *FSM) pushHtlcSigAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + f.ValLock.Lock() + defer f.ValLock.Unlock() + + htlcSigsMap := make(map[int64][]byte, len(f.hyperloop.HtlcRawTxns)) + f.Debugf("Pushing htlc sigs for raw txns: %v", + len(f.hyperloop.HtlcRawTxns)) + for feeRate, htlcTx := range f.hyperloop.HtlcRawTxns { + musigSession, ok := f.hyperloop.HtlcMusig2Sessions[feeRate] + if !ok { + return f.HandleError(errors.New( + "no musig session found")) + } + sig, err := f.hyperloop.getSigForTx( + ctx, f.cfg.Signer, htlcTx, musigSession.SessionID, + ) + if err != nil { + return f.HandleError(err) + } + htlcSigsMap[feeRate] = sig + } + + _, err := f.cfg.HyperloopClient.PushHyperloopHtlcSigs( + ctx, &swapserverrpc.PushHyperloopHtlcSigRequest{ + SwapHash: f.hyperloop.SwapHash[:], + HyperloopId: f.hyperloop.ID[:], + HtlcSigs: htlcSigsMap, + }, + ) + if err != nil { + return f.HandleError(err) + } + + return OnPushedHtlcSig +} + +// waitForHtlcSig is the action where we poll the server for the htlc signature. +func (f *FSM) waitForHtlcSig(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + + return res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_PREIMAGES, // nolint:lll + nil + } + + resChan, errChan := f.waitForStateChan(ctx, checkFunc) + select { + case <-ctx.Done(): + return fsm.NoOp + + case err := <-errChan: + return f.HandleError(err) + + case <-resChan: + + // We'll also need to check if the hyperloop has been spent. + case spend := <-f.spendChan: + return f.getHyperloopSpendingEvent(spend) + } + + res, err := f.cfg.HyperloopClient.FetchHyperloopHtlcSigs( + ctx, &swapserverrpc.FetchHyperloopHtlcSigRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return f.HandleError(err) + } + + f.ValLock.Lock() + defer f.ValLock.Unlock() + + // Try to register the htlc sig, this will verify the sig is valid. + for feeRate, htlcSig := range res.HtlcSigsByFees { + err := f.hyperloop.registerHtlcSig(feeRate, htlcSig) + if err != nil { + return f.HandleError(err) + } + } + + return OnReceivedHtlcSig +} + +// pushPreimageAction is the action that pushes the preimage to the server. +func (f *FSM) pushPreimageAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + + return res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_PREIMAGES, // nolint:lll + nil + } + + resChan, errChan := f.waitForStateChan(ctx, checkFunc) + select { + case <-ctx.Done(): + return fsm.NoOp + + case err := <-errChan: + return f.HandleError(err) + + case <-resChan: + + // We'll also need to check if the hyperloop has been spent. + case spend := <-f.spendChan: + return f.getHyperloopSpendingEvent(spend) + } + + // Start the sweep session. + err := f.hyperloop.startSweeplessSession(ctx, f.cfg.Signer) + if err != nil { + return f.HandleError(err) + } + + res, err := f.cfg.HyperloopClient.PushHyperloopPreimage( + ctx, &swapserverrpc.PushHyperloopPreimageRequest{ + HyperloopId: f.hyperloop.ID[:], + Preimage: f.hyperloop.SwapPreimage[:], + SweepNonce: f.hyperloop.SweeplessSweepMusig2Session.PublicNonce[:], // nolint:lll + }, + ) + if err != nil { + return f.HandleError(err) + } + + copy(f.hyperloop.SweepServerNonce[:], res.ServerSweepNonce) + + sweepTx := &wire.MsgTx{} + err = sweepTx.Deserialize(bytes.NewReader(res.SweepRawTx)) + if err != nil { + return f.HandleError(err) + } + + // We need to fetch the full swap amount we're sweeping to our sweep + // address. + swapAmt, err := f.swapAmtFetcher.fetchHyperLoopTotalSweepAmt( + f.hyperloop.ID, f.hyperloop.SweepAddr, + ) + if err != nil { + return f.HandleError(err) + } + + err = f.hyperloop.registerSweeplessSweepTx( + sweepTx, chainfee.SatPerKWeight(res.SweepFeeRate), swapAmt, + ) + if err != nil { + return f.HandleError(err) + } + + return OnPushedPreimage +} + +// waitForReadyForSweepAction is the action that waits for the server to be +// ready for the sweep. +func (f *FSM) waitForReadyForSweepAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + checkFunc := func(res *swapserverrpc. + HyperloopNotificationStreamResponse) (bool, error) { + + return res.Status == swapserverrpc.HyperloopStatus_WAIT_FOR_SWEEPLESS_SWEEP_SIGS, // nolint:lll + nil + } + + resChan, errChan := f.waitForStateChan(ctx, checkFunc) + + select { + case <-ctx.Done(): + return fsm.NoOp + + case err := <-errChan: + return f.HandleError(err) + + case <-resChan: + + // We'll also need to check if the hyperloop has been spent. + case spend := <-f.spendChan: + return f.getHyperloopSpendingEvent(spend) + } + + res, err := f.cfg.HyperloopClient.FetchHyperloopSweeplessSweepNonce( + ctx, &swapserverrpc.FetchHyperloopSweeplessSweepNonceRequest{ + HyperloopId: f.hyperloop.ID[:], + }, + ) + if err != nil { + return f.HandleError(err) + } + + var nonces [][66]byte + for _, sweepNonce := range res.SweeplessSweepNonces { + sweepNonce := sweepNonce + + var nonce [66]byte + copy(nonce[:], sweepNonce) + nonces = append(nonces, nonce) + } + + err = f.hyperloop.registerSweeplessSweepNonces( + ctx, f.cfg.Signer, nonces, + ) + if err != nil { + return f.HandleError(err) + } + + return OnReadyForSweeplessSweepSig +} + +func (f *FSM) pushSweepSigAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + sig, err := f.hyperloop.getSigForTx( + ctx, f.cfg.Signer, f.hyperloop.SweeplessSweepRawTx, + f.hyperloop.SweeplessSweepMusig2Session.SessionID, + ) + if err != nil { + return f.HandleError(err) + } + + _, err = f.cfg.HyperloopClient.PushHyperloopSweeplessSweepSig( + ctx, &swapserverrpc.PushHyperloopSweeplessSweepSigRequest{ + HyperloopId: f.hyperloop.ID[:], + SwapHash: f.hyperloop.SwapHash[:], + SweepSig: sig, + }, + ) + if err != nil { + return f.HandleError(err) + } + + return OnPushedSweeplessSweepSig +} + +func (f *FSM) waitForSweepPublishAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + select { + case <-ctx.Done(): + return fsm.NoOp + + case spend := <-f.spendChan: + return f.getHyperloopSpendingEvent(spend) + } +} + +// waitForSweeplessSweepConfirmationAction is the action that waits for the +// sweepless sweep to be confirmed. +func (f *FSM) waitForSweeplessSweepConfirmationAction(ctx context.Context, + _ fsm.EventContext) fsm.EventType { + + sweeplessSweepTxHash := f.hyperloop.SweeplessSweepRawTx.TxHash() + pkscript, err := txscript.PayToAddrScript(f.hyperloop.SweepAddr) + if err != nil { + return f.HandleError(err) + } + + confChan, errChan, err := f.cfg.ChainNotifier.RegisterConfirmationsNtfn( + ctx, &sweeplessSweepTxHash, pkscript, 2, + f.hyperloop.ConfirmationHeight, + ) + if err != nil { + return f.HandleError(err) + } + + for { + select { + case <-ctx.Done(): + return fsm.NoOp + + case err := <-errChan: + return f.HandleError(err) + + case <-confChan: + return OnSweeplessSweepConfirmed + } + } +} + +// waitForState polls the server for the hyperloop status until the +// status matches the expected status. Once the status matches, it returns the +// response. +func (f *FSM) waitForState(ctx context.Context, + checkFunc func(*swapserverrpc.HyperloopNotificationStreamResponse, + ) (bool, error)) error { + + // Create a context which we can cancel if we're published. + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + for { + select { + case <-ctx.Done(): + return errors.New("context canceled") + + case <-time.After(time.Second * 5): + f.lastNotificationMutex.Lock() + if f.lastNotification == nil { + f.lastNotificationMutex.Unlock() + continue + } + + status, err := checkFunc(f.lastNotification) + if err != nil { + f.lastNotificationMutex.Unlock() + return err + } + if status { + f.lastNotificationMutex.Unlock() + return nil + } + f.lastNotificationMutex.Unlock() + } + } +} + +// waitForStateChan polls the server for the hyperloop status and returns +// channels for receiving the result or error. +func (f *FSM) waitForStateChan( + ctx context.Context, + checkFunc func(*swapserverrpc.HyperloopNotificationStreamResponse, + ) (bool, error), +) (chan *swapserverrpc.HyperloopNotificationStreamResponse, chan error) { + + resultChan := make( + chan *swapserverrpc.HyperloopNotificationStreamResponse, 1, + ) + errChan := make(chan error, 1) + + go func() { + // Create a context which we can cancel if we're published. + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + for { + select { + case <-ctx.Done(): + errChan <- errors.New("context canceled") + return + + case <-time.After(time.Second): + f.lastNotificationMutex.Lock() + if f.lastNotification == nil { + f.lastNotificationMutex.Unlock() + continue + } + + status, err := checkFunc(f.lastNotification) + if err != nil { + f.lastNotificationMutex.Unlock() + errChan <- err + return + } + + if status { + f.lastNotificationMutex.Unlock() + resultChan <- f.lastNotification + return + } + f.lastNotificationMutex.Unlock() + } + } + }() + + return resultChan, errChan +} + +// handleAsyncError is a helper method that logs an error and sends an error +// event to the FSM. +func (f *FSM) handleAsyncError(ctx context.Context, err error) { + f.LastActionError = err + f.Errorf("Error on async action: %v", err) + err2 := f.SendEvent(ctx, fsm.OnError, err) + if err2 != nil { + f.Errorf("Error sending event: %v", err2) + } +} + +// getMaxRoutingFee returns the maximum routing fee for a given amount. +func getMaxRoutingFee(amt btcutil.Amount) btcutil.Amount { + return swap.CalcFee(amt, maxRoutingFeeBase, maxRoutingFeeRate) +} + +// getOutpointFromTx returns the outpoint and value of the pkScript in the tx. +func getOutpointFromTx(tx *wire.MsgTx, pkScript []byte) (*wire.OutPoint, int64, + error) { + + for i, txOut := range tx.TxOut { + if bytes.Equal(pkScript, txOut.PkScript) { + txHash := tx.TxHash() + + return wire.NewOutPoint(&txHash, uint32(i)), + txOut.Value, nil + } + } + return nil, 0, errors.New("pk script not found in tx") +} + +// getParticipants adds the participant public keys to the +// hyperloop. +func getParticipants(rpcParticipants []*swapserverrpc.HyperloopParticipant, + chainParams *chaincfg.Params) ([]*HyperloopParticipant, error) { + + participants := make([]*HyperloopParticipant, 0, len(rpcParticipants)) + for _, p := range rpcParticipants { + p := p + pubkey, err := btcec.ParsePubKey(p.PublicKey) + if err != nil { + return nil, err + } + + sweepAddr, err := btcutil.DecodeAddress( + p.SweepAddr, chainParams, + ) + if err != nil { + return nil, err + } + + participants = append(participants, &HyperloopParticipant{ + pubkey: pubkey, + sweepAddress: sweepAddr, + }) + } + + return participants, nil +} + +// getHyperloopSpendingEvent returns the event that should be triggered when the +// hyperloop output is spent. It returns an error if the spending transaction is +// unexpected. +func (f *FSM) getHyperloopSpendingEvent(spendDetails *chainntnfs.SpendDetail, +) fsm.EventType { + + spendingTxHash := spendDetails.SpendingTx.TxHash() + + // TODO: implement htlc spending + // for _, htlcTx := range f.hyperloop.HtlcRawTxns { + // htlcTxHash := htlcTx.TxHash() + + // if bytes.Equal(spendingTxHash[:], htlcTxHash[:]) { + // return OnHtlcPublished + // } + // } + + sweeplessSweepTxHash := f.hyperloop.SweeplessSweepRawTx.TxHash() + + if bytes.Equal(spendingTxHash[:], sweeplessSweepTxHash[:]) { + return OnSweeplessSweepPublish + } + + return f.HandleError(errors.New("unexpected tx spent")) +} diff --git a/hyperloop/fsm.go b/hyperloop/fsm.go new file mode 100644 index 000000000..0e00a3a6d --- /dev/null +++ b/hyperloop/fsm.go @@ -0,0 +1,615 @@ +package hyperloop + +import ( + "bytes" + "context" + "sync" + + "github.com/btcsuite/btcd/chaincfg" + "github.com/lightninglabs/lndclient" + "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/swapserverrpc" + "github.com/lightninglabs/loop/utils" + "github.com/lightningnetwork/lnd/chainntnfs" +) + +const ( + // defaultObserverSize is the size of the fsm observer channel. + defaultObserverSize = 15 +) + +// States represents the possible states of the hyperloop FSM. +var ( + // Init is the initial state of the hyperloop FSM. + Init = fsm.StateType("Init") + + // Registering is the state where we try to pay the hyperloop invoice. + Registering = fsm.StateType("Registering") + + // WaitForPublish is the state where we wait for the hyperloop output + // to be published. + WaitForPublish = fsm.StateType("WaitForPublish") + + // WaitForConfirmation is the state where we wait for the hyperloop + // output to be confirmed. + WaitForConfirmation = fsm.StateType("WaitForConfirmation") + + // PushHtlcNonce is the state where we push the htlc nonce to the + // server. + PushHtlcNonce = fsm.StateType("PushHtlcNonce") + + // WaitForReadyForHtlcSig is the event that is triggered when the server + // is ready to receive the htlc sig. + WaitForReadyForHtlcSig = fsm.StateType("WaitForReadyForHtlcSig") + + // PushHtlcSig is the state where we push the htlc sig to the server. + PushHtlcSig = fsm.StateType("PushHtlcSig") + + // WaitForHtlcSig is the state where we wait for the final htlc sig. + WaitForHtlcSig = fsm.StateType("WaitForHtlcSig") + + // PushPreimage is the state where we push the preimage and sweepless + // sweep nonce to the server. + PushPreimage = fsm.StateType("PushPreimage") + + // WaitForReadyForSweeplessSweepSig is the event that is triggered when + // the server is ready to receive the sweepless sweep sig. + WaitForReadyForSweeplessSweepSig = fsm.StateType("WaitForReadyForSweeplessSweepSig") // nolint: lll + + // PushSweeplessSweepSig is the state where we push the sweepless sweep + // sig to the server. + PushSweeplessSweepSig = fsm.StateType("PushSweeplessSweepSig") + + // WaitForSweepPublish is the state where we wait for the sweep + // transaction to be published. + WaitForSweepPublish = fsm.StateType("WaitForSweepPublish") + + // WaitForSweepConfirmation is the state where we wait for the sweep + // transaction to be confirmed. + WaitForSweepConfirmation = fsm.StateType("WaitForSweepConfirmation") + + // SweepConfirmed is a final state where the sweep transaction has been + // confirmed. + SweepConfirmed = fsm.StateType("SweepConfirmed") + + // WaitForHtlcPublishBlockheight is the state where we wait for the + // htlc publish blockheight to be reached. + WaitForHtlcPublishBlockheight = fsm.StateType("WaitForHtlcPublishBlockheight") // nolint: lll + + // PublishHtlc is the state where we publish the htlc transaction. + PublishHtlc = fsm.StateType("PublishHtlc") + + // TODO: implement HTLC states + // WaitForHtlcConfirmation is the state where we wait for the htlc + // transaction to be confirmed. + // WaitForHtlcConfirmation = fsm.StateType("WaitForHtlcConfirmation"). + + // HtlcConfirmed is the state where the htlc transaction has been + // confirmed. + // HtlcConfirmed = fsm.StateType("HtlcConfirmed"). + + // PublishHtlcSweep is the state where we publish the htlc sweep + // transaction. + // PublishHtlcSweep = fsm.StateType("PublishHtlcSweep"). + + // WaitForHtlcSweepConfirmation is the state where we wait for the htlc + // sweep transaction to be confirmed. + // WaitForHtlcSweepConfirmation = fsm.StateType("WaitForHtlcSweepConfirmation"). + + // HtlcSweepConfirmed is the state where the htlc sweep transaction has + // beenconfirmed. + // HtlcSweepConfirmed = fsm.StateType("HtlcSweepConfirmed"). + + // Failed is a final state where the hyperloop has failed. + Failed = fsm.StateType("Failed") +) + +// Events represents the possible events that can be sent to the hyperloop FSM. +var ( + // OnStart is the event that is sent when the hyperloop FSM is started. + OnStart = fsm.EventType("OnStart") + + // OnInit is the event is sent when the FSM is initialized. + OnInit = fsm.EventType("OnInit") + + // OnRegistered is the event that is triggered when we have been + // registered with the server. + OnRegistered = fsm.EventType("OnRegistered") + + // OnPublished is the event that is triggered when the hyperloop output + // has been published. + OnPublished = fsm.EventType("OnPublished") + + // OnConfirmed is the event that is triggered when the hyperloop output + // has been confirmed. + OnConfirmed = fsm.EventType("OnConfirmed") + + // OnPushedHtlcNonce is the event that is triggered when the htlc nonce + // has been pushed to the server. + OnPushedHtlcNonce = fsm.EventType("OnPushedHtlcNonce") + + // OnReadyForHtlcSig is the event that is triggered when the server is + // ready to receive the htlc sig. + OnReadyForHtlcSig = fsm.EventType("OnReadyForHtlcSig") + + // OnPushedHtlcSig is the event that is sent when the htlc sig has been + // pushed to the server. + OnPushedHtlcSig = fsm.EventType("OnPushedHtlcSig") + + // OnReceivedHtlcSig is the event that is sent when the htlc sig has + // been received. + OnReceivedHtlcSig = fsm.EventType("OnReceivedHtlcSig") + + // OnPushedPreimage is the event that is sent when the preimage has been + // pushed to the server. + OnPushedPreimage = fsm.EventType("OnPushedPreimage") + + // OnReadyForSweeplessSweepSig is the event that is sent when the server + // is ready to receive the sweepless sweep sig. + OnReadyForSweeplessSweepSig = fsm.EventType("OnReadyForSweeplessSweepSig") + + // OnPushedSweeplessSweepSig is the event that is sent when the + // sweepless sweep sig has been pushed to the server. + OnPushedSweeplessSweepSig = fsm.EventType("OnPushedSweeplessSweepSig") + + // OnSweeplessSweepPublish is the event that is sent when the sweepless + // sweep transaction has been published. + OnSweeplessSweepPublish = fsm.EventType("OnSweeplessSweepPublish") + + // OnSweeplessSweepConfirmed is the event that is sent when the + // sweepless sweep transaction has been confirmed. + OnSweeplessSweepConfirmed = fsm.EventType("OnSweeplessSweepConfirmed") + + // TODO: implement HTLC events + // OnPublishHtlc is the event that is sent when we should publish the htlc + // transaction. + // OnPublishHtlc = fsm.EventType("OnPublishHtlc"). + + // OnHtlcPublished is the event that is sent when the htlc transaction has + // been published. + // OnHtlcPublished = fsm.EventType("OnHtlcPublished"). + + // OnHtlcConfirmed is the event that is sent when the htlc transaction has + // been confirmed. + // OnHtlcConfirmed = fsm.EventType("OnHtlcConfirmed"). + + // OnSweepHtlc is the event that is sent when we publish the htlc sweep + // transaction. + // OnSweepHtlc = fsm.EventType("OnSweepHtlc"). + + // OnSweepPublished is the event that is sent when the sweep transaction + // has been published. + OnSweepPublished = fsm.EventType("OnSweepPublished") + + // OnHtlcSweepConfirmed is the event that is sent when the htlc sweep + // transaction has been confirmed. + OnHtlcSweepConfirmed = fsm.EventType("OnHtlcSweepConfirmed") + + // OnHyperlppSpent is the event that is sent when the hyperloop output + // has been spent. + OnHyperloopSpent = fsm.EventType("OnHyperloopSpent") + + // OnPaymentFailed is the event that is sent when the payment has + // failed. + OnPaymentFailed = fsm.EventType("OnPaymentFailed") +) + +// FSMConfig contains the services required for the hyperloop FSM. +type FSMConfig struct { + // Store is used to store the hyperloop. + Store Store + + // LndClient is used to interact with the lnd node. + LndClient lndclient.LightningClient + + // Signer is used to sign transactions. + Signer lndclient.SignerClient + + // Wallet is used to derive keys. + Wallet lndclient.WalletKitClient + + // ChainNotifier is used to listen for chain events. + ChainNotifier lndclient.ChainNotifierClient + + // RouterClient is used to dispatch and track payments. + RouterClient lndclient.RouterClient + + // Network is the network that is used for the swap. + Network *chaincfg.Params +} + +// FSM is the state machine that manages the hyperloop process. +type FSM struct { + *fsm.GenericFSM[Hyperloop] + + cfg *Config + + swapAmtFetcher HyperloopManager + + // hyperloop contains all the data required for the hyperloop process. + hyperloop *Hyperloop + + notificationManager *utils.SubscriptionManager[*swapserverrpc.HyperloopNotificationStreamResponse] // nolint: lll + + spendManager *utils.SubscriptionManager[*chainntnfs.SpendDetail] + + // lastNotification is the last notification that we received. + lastNotification *swapserverrpc.HyperloopNotificationStreamResponse + + // lastNotificationMutex is used to ensure that we safely access the + // lastNotification variable. + lastNotificationMutex sync.Mutex + + // spendChan is the channel that we receive the spend notification on. + spendChan chan *chainntnfs.SpendDetail +} + +// NewFSM creates a new instant out FSM. +func NewFSM(cfg *Config, swapAmtFetcher HyperloopManager) (*FSM, error) { + hyperloop := &Hyperloop{ + State: fsm.EmptyState, + } + + return NewFSMFromHyperloop(cfg, hyperloop, swapAmtFetcher) +} + +// NewFSMFromHyperloop creates a new instantout FSM from an existing instantout +// recovered from the database. +func NewFSMFromHyperloop(cfg *Config, hyperloop *Hyperloop, + swapAmtFetcher HyperloopManager) (*FSM, error) { + + instantOutFSM := &FSM{ + cfg: cfg, + hyperloop: hyperloop, + spendChan: make(chan *chainntnfs.SpendDetail), + swapAmtFetcher: swapAmtFetcher, + } + + stateMachine := fsm.NewStateMachineWithState( + instantOutFSM.GetStateMap(), hyperloop.State, + defaultObserverSize, + ) + + instantOutFSM.GenericFSM = fsm.NewGenericFSM(stateMachine, hyperloop) + + instantOutFSM.ActionEntryFunc = instantOutFSM.updateHyperloop + + return instantOutFSM, nil +} + +// GetHyperloopStates returns the statemap that defines the hyperloop FSM. +func (f *FSM) GetStateMap() fsm.States { + return fsm.States{ + fsm.EmptyState: fsm.State{ + Transitions: fsm.Transitions{ + OnStart: Init, + }, + Action: nil, + }, + Init: fsm.State{ + Transitions: fsm.Transitions{ + OnInit: Registering, + fsm.OnError: Failed, + }, + Action: f.initHyperloopAction, + }, + Registering: fsm.State{ + Transitions: fsm.Transitions{ + OnRegistered: WaitForPublish, + fsm.OnError: Failed, + }, + Action: f.registerHyperloopAction, + }, + WaitForPublish: fsm.State{ + Transitions: fsm.Transitions{ + OnPublished: WaitForConfirmation, + fsm.OnError: Failed, + }, + Action: f.waitForPublishAction, + }, + WaitForConfirmation: fsm.State{ + Transitions: fsm.Transitions{ + OnConfirmed: PushHtlcNonce, + fsm.OnError: Failed, + }, + Action: f.waitForConfirmationAction, + }, + PushHtlcNonce: fsm.State{ + Transitions: fsm.Transitions{ + OnPushedHtlcNonce: WaitForReadyForHtlcSig, + fsm.OnError: Failed, + }, + Action: f.pushHtlcNonceAction, + }, + WaitForReadyForHtlcSig: fsm.State{ + Transitions: fsm.Transitions{ + OnReadyForHtlcSig: PushHtlcSig, + fsm.OnError: Failed, + }, + Action: f.waitForReadyForHtlcSignAction, + }, + PushHtlcSig: fsm.State{ + Transitions: fsm.Transitions{ + OnPushedHtlcSig: WaitForHtlcSig, + fsm.OnError: Failed, + }, + Action: f.pushHtlcSigAction, + }, + // At this point we have pushed the htlc sig to the server and + // the hyperloop could be spent to the htlc at any time, so + // we'll need to be careful and be ready to sweep it. + WaitForHtlcSig: fsm.State{ + Transitions: fsm.Transitions{ + OnReceivedHtlcSig: PushPreimage, + // TODO: implement htlc states + // OnHtlcPublished: WaitForHtlcConfirmation, + fsm.OnError: Failed, + }, + Action: f.waitForHtlcSig, + }, + PushPreimage: fsm.State{ + Transitions: fsm.Transitions{ + OnPushedPreimage: WaitForReadyForSweeplessSweepSig, + fsm.OnError: Failed, + }, + Action: f.pushPreimageAction, + }, + WaitForReadyForSweeplessSweepSig: fsm.State{ + Transitions: fsm.Transitions{ + OnReadyForSweeplessSweepSig: PushSweeplessSweepSig, + // TODO: implement htlc states + // OnHtlcPublished: WaitForHtlcConfirmation, + fsm.OnError: Failed, + }, + Action: f.waitForReadyForSweepAction, + }, + PushSweeplessSweepSig: fsm.State{ + Transitions: fsm.Transitions{ + OnPushedSweeplessSweepSig: WaitForSweepPublish, + fsm.OnError: Failed, + }, + Action: f.pushSweepSigAction, + }, + WaitForSweepPublish: fsm.State{ + Transitions: fsm.Transitions{ + OnSweeplessSweepPublish: WaitForSweepConfirmation, + // TODO: implement htlc states + // OnHtlcPublished: WaitForHtlcConfirmation, + fsm.OnError: Failed, + }, + Action: f.waitForSweepPublishAction, + }, + WaitForSweepConfirmation: fsm.State{ + Transitions: fsm.Transitions{ + OnSweeplessSweepConfirmed: SweepConfirmed, + fsm.OnError: Failed, + }, + Action: f.waitForSweeplessSweepConfirmationAction, + }, + SweepConfirmed: fsm.State{ + Action: fsm.NoOpAction, + }, + // todo htlc states + Failed: fsm.State{ + Action: fsm.NoOpAction, + }, + } +} + +// updateHyperloop updates the hyperloop in the database. This function +// is called after every new state transition. +func (r *FSM) updateHyperloop(ctx context.Context, + notification fsm.Notification) { + + if r.hyperloop == nil { + return + } + + r.Debugf( + "NextState: %v, PreviousState: %v, Event: %v", + notification.NextState, notification.PreviousState, + notification.Event, + ) + + r.hyperloop.State = notification.NextState + + // Don't update the reservation if we are in an initial state or if we + // are transitioning from an initial state to a failed state. + if r.hyperloop.State == fsm.EmptyState || + r.hyperloop.State == Init || + (notification.PreviousState == Init && + r.hyperloop.State == Failed) { + + return + } + + // TODO: implement store. + // err := r.cfg.Store.UpdateHyperloop(ctx, r.hyperloop) + // if err != nil { + // r.Errorf("unable to update hyperloop: %v", err) + // } + + // Subscribe to the hyperloop notifications. + r.subscribeHyperloopNotifications(ctx) + + // Subscribe to the spend notification of the current outpoint. + r.subscribeHyperloopOutpointSpend(ctx) +} + +func (f *FSM) subscribeHyperloopOutpointSpend(ctx context.Context) { + if isFinalState(f.hyperloop.State) { + // If we are in a final state, we stop the spend manager. + if f.spendManager != nil && f.spendManager.IsSubscribed() { + f.spendManager.Stop() + } + return + } + // If we don't have an outpoint yet, we can't subscribe to it. + if f.hyperloop.ConfirmedOutpoint == nil { + return + } + + if f.spendManager == nil { + subscription := &HyperloopOutpointSpendSubscription{fsm: f} + f.spendManager = utils.NewSubscriptionManager(subscription) + } + + if !f.spendManager.IsSubscribed() { + f.spendManager.Start(ctx) + } +} + +type HyperloopOutpointSpendSubscription struct { + fsm *FSM +} + +func (hoss *HyperloopOutpointSpendSubscription) Subscribe(ctx context.Context, +) (<-chan *chainntnfs.SpendDetail, <-chan error, error) { + + pkscript, err := hoss.fsm.hyperloop.getHyperLoopScript() + if err != nil { + return nil, nil, err + } + + spendChan, errChan, err := hoss.fsm.cfg.ChainNotifier.RegisterSpendNtfn( + ctx, hoss.fsm.hyperloop.ConfirmedOutpoint, pkscript, + hoss.fsm.hyperloop.ConfirmationHeight, + ) + if err != nil { + return nil, nil, err + } + + // No need to wrap channels, just return them directly + return spendChan, errChan, nil +} + +func (hoss *HyperloopOutpointSpendSubscription) HandleEvent( + event *chainntnfs.SpendDetail) error { + + hoss.fsm.spendChan <- event + return nil +} + +func (hoss *HyperloopOutpointSpendSubscription) HandleError(err error) { + hoss.fsm.Errorf("error in spend subscription: %v", err) + hoss.fsm.handleAsyncError(context.Background(), err) +} + +func (f *FSM) subscribeHyperloopNotifications(ctx context.Context) { + emptyId := ID{} + if bytes.Equal(f.hyperloop.ID[:], emptyId[:]) { + log.Errorf("hyperloop id is empty, can't subscribe to notifications") + return + } + + if isFinalState(f.hyperloop.State) { + // If we are in a final state, we stop the ntfn manager. + if f.notificationManager != nil && + f.notificationManager.IsSubscribed() { + + f.notificationManager.Stop() + } + return + } + if f.notificationManager == nil { + subscription := &HyperloopNotificationSubscription{fsm: f} + f.notificationManager = utils.NewSubscriptionManager( + subscription, + ) + } + + if !f.notificationManager.IsSubscribed() { + f.notificationManager.Start(ctx) + } +} + +type HyperloopNotificationSubscription struct { + fsm *FSM +} + +func (hns *HyperloopNotificationSubscription) Subscribe(ctx context.Context) ( + <-chan *swapserverrpc.HyperloopNotificationStreamResponse, <-chan error, + error) { + + client, err := hns.fsm.cfg.HyperloopClient.HyperloopNotificationStream( + ctx, &swapserverrpc.HyperloopNotificationStreamRequest{ + HyperloopId: hns.fsm.hyperloop.ID[:], + }, + ) + if err != nil { + return nil, nil, err + } + + eventChan := make( + chan *swapserverrpc.HyperloopNotificationStreamResponse, + ) + errChan := make(chan error) + + go func() { + defer close(eventChan) + defer close(errChan) + for { + notification, err := client.Recv() + if err != nil { + hns.fsm.Errorf("error receiving hyperloop notification: %v", err) + errChan <- err + return + } + hns.fsm.Debugf("Received notification: %v", notification) + eventChan <- notification + } + }() + + return eventChan, errChan, nil +} + +func (hns *HyperloopNotificationSubscription) HandleEvent( + event *swapserverrpc.HyperloopNotificationStreamResponse) error { + + hns.fsm.lastNotificationMutex.Lock() + hns.fsm.lastNotification = event + hns.fsm.lastNotificationMutex.Unlock() + return nil +} + +func (hns *HyperloopNotificationSubscription) HandleError(err error) { + hns.fsm.Errorf("error receiving hyperloop notification: %v", err) +} + +// Infof logs an info message with the reservation hash as prefix. +func (f *FSM) Infof(format string, args ...interface{}) { + log.Infof( + "Hyperloop %v: "+format, + append( + []interface{}{f.hyperloop.ID}, + args..., + )..., + ) +} + +// Debugf logs a debug message with the reservation hash as prefix. +func (f *FSM) Debugf(format string, args ...interface{}) { + log.Debugf( + "Hyperloop %v: "+format, + append( + []interface{}{f.hyperloop.String()}, + args..., + )..., + ) +} + +// Errorf logs an error message with the reservation hash as prefix. +func (f *FSM) Errorf(format string, args ...interface{}) { + log.Errorf( + "Hyperloop %v: "+format, + append( + []interface{}{f.hyperloop.String()}, + args..., + )..., + ) +} + +// isFinalState returns true if the FSM is in a final state. +func isFinalState(state fsm.StateType) bool { + return state == SweepConfirmed || state == Failed +} From ad49563d1673b9628105a2b637398b83765d12a9 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:31:35 +0200 Subject: [PATCH 10/14] hyperloop: add hyperloop manager --- hyperloop/manager.go | 250 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 hyperloop/manager.go diff --git a/hyperloop/manager.go b/hyperloop/manager.go new file mode 100644 index 000000000..1be7fa6b7 --- /dev/null +++ b/hyperloop/manager.go @@ -0,0 +1,250 @@ +package hyperloop + +import ( + "context" + "errors" + "sync" + "time" + + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/chaincfg" + "github.com/lightninglabs/lndclient" + "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/swapserverrpc" + "github.com/lightningnetwork/lnd/lnrpc/walletrpc" +) + +var ( + // defaultFSMObserverTimeout is the default timeout we'll wait for the + // fsm to reach a certain state. + defaultFSMObserverTimeout = time.Second * 15 +) + +// newHyperloopRequest is a request to create a new hyperloop. +type newHyperloopRequest struct { + amt btcutil.Amount + customSweepAddr string + respChan chan *Hyperloop + errChan chan error +} + +// Config contains all the services that the reservation FSM needs to operate. +type Config struct { + // Store is the store that is used to store the hyperloop. + // TODO: implement the store. + Store Store + + // Wallet handles the key derivation for the reservation. + Wallet lndclient.WalletKitClient + + // ChainNotifier is used to subscribe to block notifications. + ChainNotifier lndclient.ChainNotifierClient + + // Signer is used to sign messages. + Signer lndclient.SignerClient + + // Router is used to pay the offchain payments. + Router lndclient.RouterClient + + // HyperloopClient is the client used to communicate with the + // swap server. + HyperloopClient swapserverrpc.HyperloopServerClient + + // ChainParams are the params for the bitcoin network. + ChainParams *chaincfg.Params +} + +type Manager struct { + cfg *Config + + pendingHyperloops map[ID][]*FSM + hyperloopRequests chan *newHyperloopRequest + + sync.Mutex +} + +// NewManager creates a new hyperloop manager. +func NewManager(cfg *Config) *Manager { + return &Manager{ + cfg: cfg, + pendingHyperloops: make(map[ID][]*FSM), + hyperloopRequests: make(chan *newHyperloopRequest), + } +} + +// Run starts the hyperloop manager. +func (m *Manager) Run(ctx context.Context, initialBlockHeight int32) error { + runCtx, cancel := context.WithCancel(ctx) + defer cancel() + + // Subscribe to blockheight. + blockChan, errChan, err := m.cfg.ChainNotifier.RegisterBlockEpochNtfn( + runCtx, + ) + if err != nil { + return err + } + + blockHeight := initialBlockHeight + + for { + select { + case blockHeight = <-blockChan: + + case req := <-m.hyperloopRequests: + hyperloop, err := m.newHyperLoopOut( + runCtx, req.amt, req.customSweepAddr, + blockHeight, + ) + if err != nil { + log.Errorf("unable to create hyperloop: %v", + err) + req.errChan <- err + } else { + req.respChan <- hyperloop + } + + case err := <-errChan: + log.Errorf("unable to get block height: %v", err) + return err + + case <-runCtx.Done(): + return nil + } + } +} + +// RequestNewHyperloop requests a new hyperloop. If we have a pending hyperloop, +// we'll use the same id and sweep address in order to batch a possible sweep. +func (m *Manager) RequestNewHyperloop(ctx context.Context, amt btcutil.Amount, + customSweepAddr string) (*Hyperloop, error) { + + req := &newHyperloopRequest{ + amt: amt, + customSweepAddr: customSweepAddr, + respChan: make(chan *Hyperloop), + errChan: make(chan error), + } + + select { + case <-ctx.Done(): + return nil, ctx.Err() + case m.hyperloopRequests <- req: + } + + var ( + hyperloop *Hyperloop + err error + ) + + select { + case <-ctx.Done(): + return nil, ctx.Err() + + case hyperloop = <-req.respChan: + + case err = <-req.errChan: + } + + if err != nil { + return nil, err + } + + return hyperloop, err +} + +// newHyperLoopOut creates a new hyperloop out swap. If we have a pending +// hyperloop, we'll use the same id and sweep address in order to batch +// a possible sweep. +func (m *Manager) newHyperLoopOut(ctx context.Context, amt btcutil.Amount, + customSweepAddr string, blockheight int32) (*Hyperloop, error) { + + var ( + sweepAddr btcutil.Address + publishDeadline time.Time + err error + ) + + // For now we'll set the publish deadline to 30 minutes from now. + publishDeadline = time.Now().Add(time.Minute * 30) + + // Create a sweep pk script. + if customSweepAddr == "" { + sweepAddr, err = m.cfg.Wallet.NextAddr( + ctx, "", walletrpc.AddressType_TAPROOT_PUBKEY, + false, + ) + if err != nil { + return nil, err + } + } else { + sweepAddr, err = btcutil.DecodeAddress( + customSweepAddr, m.cfg.ChainParams, + ) + if err != nil { + return nil, err + } + } + + req := &initHyperloopContext{ + swapAmt: amt, + sweepAddr: sweepAddr, + publishTime: publishDeadline, + initiationHeight: blockheight, + // We'll only do private hyperloops for now. + private: true, + } + + // Create a new hyperloop fsm. + hl, err := NewFSM(m.cfg, m) + if err != nil { + return nil, err + } + + go func() { + err = hl.SendEvent(ctx, OnStart, req) + if err != nil { + log.Errorf("unable to send event to hyperloop fsm: %v", + err) + } + }() + + err = hl.DefaultObserver.WaitForState( + ctx, defaultFSMObserverTimeout, WaitForPublish, + fsm.WithAbortEarlyOnErrorOption(), + ) + if err != nil { + return nil, err + } + + m.Lock() + m.pendingHyperloops[hl.hyperloop.ID] = append( + m.pendingHyperloops[hl.hyperloop.ID], hl, + ) + m.Unlock() + + hyperloop := hl.GetVal() + return hyperloop, nil +} + +// fetchHyperLoopTotalSweepAmt returns the total amount that will be swept in +// the hyperloop for the given hyperloop id and sweep address. +func (m *Manager) fetchHyperLoopTotalSweepAmt(hyperloopID ID, + sweepAddr btcutil.Address) (btcutil.Amount, error) { + + m.Lock() + defer m.Unlock() + if hyperloops, ok := m.pendingHyperloops[hyperloopID]; ok { + var totalAmt btcutil.Amount + for _, hyperloop := range hyperloops { + hl := hyperloop.GetVal() + if hl.SweepAddr.String() == sweepAddr.String() { + totalAmt += hl.Amt + } + } + + return totalAmt, nil + } + + return 0, errors.New("hyperloop not found") +} From 746555a7dd40a355e26e674ff553f0e9349bfe18 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:33:38 +0200 Subject: [PATCH 11/14] loopd: add hyperloop manager --- loopd/daemon.go | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/loopd/daemon.go b/loopd/daemon.go index e96e04286..a6afebf93 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -16,6 +16,7 @@ import ( proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" + "github.com/lightninglabs/loop/hyperloop" "github.com/lightninglabs/loop/instantout" "github.com/lightninglabs/loop/instantout/reservation" "github.com/lightninglabs/loop/loopd/perms" @@ -450,6 +451,11 @@ func (d *Daemon) initialize(withMacaroonService bool) error { swapClient.Conn, ) + // Create a hyperloop server client. + hyperloopClient := loop_swaprpc.NewHyperloopServerClient( + swapClient.Conn, + ) + // Both the client RPC server and the swap server client should stop // on main context cancel. So we create it early and pass it down. d.mainCtx, d.mainCtxCancel = context.WithCancel(context.Background()) @@ -529,6 +535,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { var ( reservationManager *reservation.Manager instantOutManager *instantout.Manager + hyperloopManager *hyperloop.Manager ) // Create the reservation and instantout managers. @@ -569,6 +576,16 @@ func (d *Daemon) initialize(withMacaroonService bool) error { instantOutManager = instantout.NewInstantOutManager( instantOutConfig, ) + + hyperloopConfig := &hyperloop.Config{ + Wallet: d.lnd.WalletKit, + ChainNotifier: d.lnd.ChainNotifier, + Signer: d.lnd.Signer, + Router: d.lnd.Router, + HyperloopClient: hyperloopClient, + ChainParams: d.lnd.ChainParams, + } + hyperloopManager = hyperloop.NewManager(hyperloopConfig) } // Now finally fully initialize the swap client RPC server instance. @@ -584,6 +601,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { mainCtx: d.mainCtx, reservationManager: reservationManager, instantOutManager: instantOutManager, + hyperloopManager: hyperloopManager, } // Retrieve all currently existing swaps from the database. @@ -728,6 +746,34 @@ func (d *Daemon) initialize(withMacaroonService bool) error { } } + // Start the hyperloop manager. + if d.hyperloopManager != nil { + d.wg.Add(1) + go func() { + defer d.wg.Done() + + log.Info("Starting hyperloop manager") + defer log.Info("Hyperloop manager stopped") + + // We need to know the current block height to properly + // initialize the hyperloop manager. + getInfo, err := d.lnd.Client.GetInfo(d.mainCtx) + if err != nil { + d.internalErrChan <- err + return + } + + err = d.hyperloopManager.Run( + d.mainCtx, int32(getInfo.BlockHeight), + ) + if err != nil && !errors.Is(err, context.Canceled) { + log.Errorf("Error running hyperloop manager:"+ + " %v", err) + d.internalErrChan <- err + } + }() + } + // Last, start our internal error handler. This will return exactly one // error or nil on the main error channel to inform the caller that // something went wrong or that shutdown is complete. We don't add to From 1e9eec19ffbda1a74a24c8c898fa8f2f870c557f Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:34:08 +0200 Subject: [PATCH 12/14] loopd: add hyperloop rpc call --- loopd/perms/perms.go | 4 ++++ loopd/swapclient_server.go | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/loopd/perms/perms.go b/loopd/perms/perms.go index 12022fb8e..1de549a5b 100644 --- a/loopd/perms/perms.go +++ b/loopd/perms/perms.go @@ -120,4 +120,8 @@ var RequiredPermissions = map[string][]bakery.Op{ Entity: "swap", Action: "read", }}, + "/looprpc.SwapClient/HyperLoopOut": {{ + Entity: "swap", + Action: "write", + }}, } diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index b27bf4230..a30d6e3c5 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -18,6 +18,7 @@ import ( "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" + "github.com/lightninglabs/loop/hyperloop" "github.com/lightninglabs/loop/instantout" "github.com/lightninglabs/loop/instantout/reservation" "github.com/lightninglabs/loop/labels" @@ -83,6 +84,7 @@ type swapClientServer struct { lnd *lndclient.LndServices reservationManager *reservation.Manager instantOutManager *instantout.Manager + hyperloopManager *hyperloop.Manager swaps map[lntypes.Hash]loop.SwapInfo subscribers map[int]chan<- interface{} statusChan chan loop.SwapInfo @@ -91,6 +93,24 @@ type swapClientServer struct { mainCtx context.Context } +func (s *swapClientServer) HyperLoopOut(ctx context.Context, + req *looprpc.HyperLoopOutRequest) ( + *looprpc.HyperLoopOutResponse, error) { + + log.Infof("HyperLoop out request received") + + hyperloop, err := s.hyperloopManager.RequestNewHyperloop( + ctx, btcutil.Amount(req.Amt), req.CustomSweepAddr, + ) + if err != nil { + return nil, err + } + + return &looprpc.HyperLoopOutResponse{ + Hyperloop: hyperloop.ToRpcHyperloop(), + }, nil +} + // LoopOut initiates a loop out swap with the given parameters. The call returns // after the swap has been set up with the swap server. From that point onwards, // progress can be tracked via the LoopOutStatus stream that is returned from From e2db611e75baf447b0a9422a82d136f9d462d067 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:34:21 +0200 Subject: [PATCH 13/14] loopcli: add hyperloop cmd --- cmd/loop/hyperloop.go | 78 +++++++++++++++++++++++++++++++++++++++++++ cmd/loop/main.go | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 cmd/loop/hyperloop.go diff --git a/cmd/loop/hyperloop.go b/cmd/loop/hyperloop.go new file mode 100644 index 000000000..b9e2bb072 --- /dev/null +++ b/cmd/loop/hyperloop.go @@ -0,0 +1,78 @@ +package main + +import ( + "context" + + "github.com/lightninglabs/loop/looprpc" + "github.com/urfave/cli" +) + +var hyperloopCommand = cli.Command{ + Name: "hyperloop", + Usage: "perform a fee optimized off-chain to on-chain swap (hyperloop)", + Description: ` + + `, + ArgsUsage: "amt", + Flags: []cli.Flag{ + cli.Uint64Flag{ + Name: "amt", + Usage: "the amount in satoshis to loop out. To check " + + "for the minimum and maximum amounts to loop " + + "out please consult \"loop terms\"", + }, + cli.StringFlag{ + Name: "addr", + Usage: "the optional address that the looped out funds " + + "should be sent to, if let blank the funds " + + "will go to lnd's wallet", + }, + }, + + Action: hyperloop, +} + +func hyperloop(ctx *cli.Context) error { + args := ctx.Args() + + var amtStr string + switch { + case ctx.IsSet("amt"): + amtStr = ctx.String("amt") + + case ctx.NArg() > 0: + amtStr = args[0] + + default: + // Show command help if no arguments and flags were provided. + return cli.ShowCommandHelp(ctx, "hyperloop") + } + + amt, err := parseAmt(amtStr) + if err != nil { + return err + } + + // First set up the swap client itself. + client, cleanup, err := getClient(ctx) + if err != nil { + return err + } + defer cleanup() + ctxb := context.Background() + + hyperloopRes, err := client.HyperLoopOut( + ctxb, + &looprpc.HyperLoopOutRequest{ + Amt: uint64(amt), + CustomSweepAddr: ctx.String("addr"), + }, + ) + if err != nil { + return err + } + + printJSON(hyperloopRes) + + return nil +} diff --git a/cmd/loop/main.go b/cmd/loop/main.go index cfed2c220..c2d796605 100644 --- a/cmd/loop/main.go +++ b/cmd/loop/main.go @@ -148,7 +148,7 @@ func main() { listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand, setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand, getInfoCommand, abandonSwapCommand, reservationsCommands, - instantOutCommand, listInstantOutsCommand, + instantOutCommand, listInstantOutsCommand, hyperloopCommand, } err := app.Run(os.Args) From 8b7f1a7f0b0047d780b540714e99cf566c0cc5a0 Mon Sep 17 00:00:00 2001 From: sputn1ck Date: Tue, 13 Aug 2024 12:36:28 +0200 Subject: [PATCH 14/14] fsm: add hyperloop fsm --- fsm/stateparser/stateparser.go | 8 ++++++ hyperloop/fsm.md | 45 ++++++++++++++++++++++++++++++++++ scripts/fsm-generate.sh | 5 ++-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 hyperloop/fsm.md diff --git a/fsm/stateparser/stateparser.go b/fsm/stateparser/stateparser.go index d70645230..a816768bc 100644 --- a/fsm/stateparser/stateparser.go +++ b/fsm/stateparser/stateparser.go @@ -10,6 +10,7 @@ import ( "sort" "github.com/lightninglabs/loop/fsm" + "github.com/lightninglabs/loop/hyperloop" "github.com/lightninglabs/loop/instantout" "github.com/lightninglabs/loop/instantout/reservation" ) @@ -57,6 +58,13 @@ func run() error { return err } + case "hyperloop": + hyperloop := hyperloop.FSM{} + err = writeMermaidFile(fp, hyperloop.GetStateMap()) + if err != nil { + return err + } + default: fmt.Println("Missing or wrong argument: fsm must be one of:") fmt.Println("\treservations") diff --git a/hyperloop/fsm.md b/hyperloop/fsm.md new file mode 100644 index 000000000..d1deb0ee8 --- /dev/null +++ b/hyperloop/fsm.md @@ -0,0 +1,45 @@ +```mermaid +stateDiagram-v2 +[*] --> Init: OnStart +Failed +Init +Init --> Failed: OnError +Init --> Registering: OnInit +PushHtlcNonce +PushHtlcNonce --> WaitForReadyForHtlcSig: OnPushedHtlcNonce +PushHtlcNonce --> Failed: OnError +PushHtlcSig +PushHtlcSig --> WaitForHtlcSig: OnPushedHtlcSig +PushHtlcSig --> Failed: OnError +PushPreimage +PushPreimage --> WaitForReadyForSweeplessSweepSig: OnPushedPreimage +PushPreimage --> Failed: OnError +PushSweeplessSweepSig +PushSweeplessSweepSig --> WaitForSweepPublish: OnPushedSweeplessSweepSig +PushSweeplessSweepSig --> Failed: OnError +Registering +Registering --> WaitForPublish: OnRegistered +Registering --> Failed: OnError +SweepConfirmed +WaitForConfirmation +WaitForConfirmation --> PushHtlcNonce: OnConfirmed +WaitForConfirmation --> Failed: OnError +WaitForHtlcSig +WaitForHtlcSig --> PushPreimage: OnReceivedHtlcSig +WaitForHtlcSig --> Failed: OnError +WaitForPublish +WaitForPublish --> WaitForConfirmation: OnPublished +WaitForPublish --> Failed: OnError +WaitForReadyForHtlcSig +WaitForReadyForHtlcSig --> PushHtlcSig: OnReadyForHtlcSig +WaitForReadyForHtlcSig --> Failed: OnError +WaitForReadyForSweeplessSweepSig +WaitForReadyForSweeplessSweepSig --> PushSweeplessSweepSig: OnReadyForSweeplessSweepSig +WaitForReadyForSweeplessSweepSig --> Failed: OnError +WaitForSweepConfirmation +WaitForSweepConfirmation --> SweepConfirmed: OnSweeplessSweepConfirmed +WaitForSweepConfirmation --> Failed: OnError +WaitForSweepPublish +WaitForSweepPublish --> WaitForSweepConfirmation: OnSweeplessSweepPublish +WaitForSweepPublish --> Failed: OnError +``` \ No newline at end of file diff --git a/scripts/fsm-generate.sh b/scripts/fsm-generate.sh index 4ab2d74cb..f62cab371 100755 --- a/scripts/fsm-generate.sh +++ b/scripts/fsm-generate.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash go run ./fsm/stateparser/stateparser.go --out ./fsm/example_fsm.md --fsm example -go run ./fsm/stateparser/stateparser.go --out ./reservation/reservation_fsm.md --fsm reservation -go run ./fsm/stateparser/stateparser.go --out ./instantout/fsm.md --fsm instantout \ No newline at end of file +go run ./fsm/stateparser/stateparser.go --out ./instantout/reservation/reservation_fsm.md --fsm reservation +go run ./fsm/stateparser/stateparser.go --out ./instantout/fsm.md --fsm instantout +go run ./fsm/stateparser/stateparser.go --out ./hyperloop/fsm.md --fsm hyperloop \ No newline at end of file