From 7750c43d8e147d06861f9678a8b600e0eb7d8ff7 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Tue, 19 Mar 2024 10:33:40 +1030 Subject: [PATCH] tbd --- cmd/loop/staticaddr.go | 78 ++++ loopd/perms/perms.go | 7 + loopd/swapclient_server.go | 156 +++++++ looprpc/client.pb.go | 784 ++++++++++++++++++++++++-------- looprpc/client.proto | 40 ++ looprpc/client.swagger.json | 71 +++ looprpc/client_grpc.pb.go | 36 ++ looprpc/swapclient.pb.json.go | 25 + staticaddr/address/manager.go | 8 +- staticaddr/deposit/interface.go | 7 + 10 files changed, 1008 insertions(+), 204 deletions(-) diff --git a/cmd/loop/staticaddr.go b/cmd/loop/staticaddr.go index b424448..e981a58 100644 --- a/cmd/loop/staticaddr.go +++ b/cmd/loop/staticaddr.go @@ -22,6 +22,7 @@ var staticAddressCommands = cli.Command{ newStaticAddressCommand, listUnspentCommand, withdrawalCommand, + summaryCommand, }, } @@ -184,6 +185,83 @@ func withdraw(ctx *cli.Context) error { return nil } +var summaryCommand = cli.Command{ + Name: "summary", + ShortName: "s", + Usage: "Display a summary of static address related data.", + Description: ` + Displays various static address related data. Utxos, Deposits, + Withdrawls, loop-ins... + `, + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "filter", + Usage: "specify a filter to only display deposits in " + + "the specified state. The state can be one " + + "of [deposited|withdrawing|withdrawn|" + + "publish_expired_deposit|" + + "wait_for_expiry_sweep|expired|failed].", + }, + }, + Action: summary, +} + +func summary(ctx *cli.Context) error { + ctxb := context.Background() + if ctx.NArg() > 0 { + return cli.ShowCommandHelp(ctx, "summary") + } + + client, cleanup, err := getClient(ctx) + if err != nil { + return err + } + defer cleanup() + + var filterState looprpc.DepositState + switch ctx.String("filter") { + case "": + // If no filter is specified, we'll default to showing all. + + case "deposited": + filterState = looprpc.DepositState_DEPOSITED + + case "withdrawing": + filterState = looprpc.DepositState_WITHDRAWING + + case "withdrawn": + filterState = looprpc.DepositState_WITHDRAWN + + case "publish_expired_deposit": + filterState = looprpc.DepositState_PUBLISH_EXPIRED + + case "wait_for_expiry_sweep": + filterState = looprpc.DepositState_WAIT_FOR_EXPIRY_SWEEP + + case "expired": + filterState = looprpc.DepositState_EXPIRED + + case "failed": + filterState = looprpc.DepositState_FAILED_STATE + + default: + filterState = looprpc.DepositState_UNKNOWN_STATE + } + + resp, err := client.GetStaticAddressSummary( + ctxb, &looprpc.StaticAddressSummaryRequest{ + StateFilter: filterState, + }, + ) + if err != nil { + return err + } + + printRespJSON(resp) + + return nil +} + func utxosToOutpoints(utxos []string) ([]*looprpc.OutPoint, error) { var outpoints []*looprpc.OutPoint if len(utxos) == 0 { diff --git a/loopd/perms/perms.go b/loopd/perms/perms.go index cf4a888..f2cf9dc 100644 --- a/loopd/perms/perms.go +++ b/loopd/perms/perms.go @@ -90,6 +90,13 @@ var RequiredPermissions = map[string][]bakery.Op{ Entity: "loop", Action: "in", }}, + "/looprpc.SwapClient/GetStaticAddressSummary": {{ + Entity: "swap", + Action: "read", + }, { + Entity: "loop", + Action: "in", + }}, "/looprpc.SwapClient/GetLsatTokens": {{ Entity: "auth", Action: "read", diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index 14c2b1a..bcc3617 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -19,6 +19,7 @@ import ( "github.com/lightninglabs/aperture/lsat" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" + "github.com/lightninglabs/loop/fsm" "github.com/lightninglabs/loop/instantout" "github.com/lightninglabs/loop/instantout/reservation" "github.com/lightninglabs/loop/labels" @@ -1327,6 +1328,161 @@ func (s *swapClientServer) WithdrawDeposits(ctx context.Context, return &clientrpc.WithdrawDepositsResponse{}, err } +func (s *swapClientServer) GetStaticAddressSummary(ctx context.Context, + req *clientrpc.StaticAddressSummaryRequest) (*clientrpc.StaticAddressSummaryResponse, + error) { + + allDeposits, err := s.depositManager.GetAllDeposits() + if err != nil { + return nil, err + } + + return s.depositSummary(ctx, allDeposits, req.StateFilter) +} + +func (s *swapClientServer) depositSummary(ctx context.Context, + deposits []*deposit.Deposit, + filter clientrpc.DepositState) (*clientrpc.StaticAddressSummaryResponse, + error) { + + var ( + totalNumDeposits = len(deposits) + valueUnconfirmed int64 + valueDeposited int64 + valueExpired int64 + valueWithdrawn int64 + ) + + // Value unconfirmed. + utxos, err := s.staticAddressManager.ListUnspent( + ctx, 0, deposit.MinConfs-1, + ) + if err != nil { + return nil, err + } + for _, u := range utxos { + valueUnconfirmed += int64(u.Value) + } + + for _, d := range deposits { + value := int64(d.Value) + switch d.State { + case deposit.Deposited: + valueDeposited += value + + case deposit.Expired: + valueExpired += value + + case deposit.Withdrawn: + valueWithdrawn += value + } + } + + clientDeposits, err := s.filterClientDeposits(deposits, filter) + if err != nil { + return nil, err + } + + params, err := s.staticAddressManager.GetStaticAddressParameters(ctx) + if err != nil { + return nil, err + } + + address, err := s.staticAddressManager.GetTaprootAddress( + params.ClientPubkey, params.ServerPubkey, int64(params.Expiry), + ) + + return &clientrpc.StaticAddressSummaryResponse{ + StaticAddress: address.String(), + TotalNumDeposits: uint32(totalNumDeposits), + ValueUnconfirmed: valueUnconfirmed, + ValueDeposited: valueDeposited, + ValueExpired: valueExpired, + ValueWithdrawn: valueWithdrawn, + FilteredDeposits: clientDeposits, + }, nil +} + +func (s *swapClientServer) filterClientDeposits(deposits []*deposit.Deposit, + filterState clientrpc.DepositState) ([]*clientrpc.Deposit, error) { + + var clientDeposits []*clientrpc.Deposit + for _, d := range deposits { + if filterState != clientrpc.DepositState_UNKNOWN_STATE && + d.State != toServerState(filterState) { + + continue + } + + outpoint := wire.NewOutPoint(&d.Hash, d.Index).String() + clientDeposits = append(clientDeposits, &clientrpc.Deposit{ + Id: d.ID[:], + State: toClientState(d.State), + Outpoint: outpoint, + Value: int64(d.Value), + ConfirmationHeight: d.ConfirmationHeight, + }) + } + + return clientDeposits, nil +} + +func toClientState(state fsm.StateType) clientrpc.DepositState { + switch state { + case deposit.Deposited: + return clientrpc.DepositState_DEPOSITED + + case deposit.Withdrawing: + return clientrpc.DepositState_WITHDRAWING + + case deposit.Withdrawn: + return clientrpc.DepositState_WITHDRAWN + + case deposit.PublishExpiredDeposit: + return clientrpc.DepositState_PUBLISH_EXPIRED + + case deposit.WaitForExpirySweep: + return clientrpc.DepositState_WAIT_FOR_EXPIRY_SWEEP + + case deposit.Expired: + return clientrpc.DepositState_EXPIRED + + case deposit.Failed: + return clientrpc.DepositState_FAILED_STATE + + default: + return clientrpc.DepositState_UNKNOWN_STATE + } +} + +func toServerState(state clientrpc.DepositState) fsm.StateType { + switch state { + case clientrpc.DepositState_DEPOSITED: + return deposit.Deposited + + case clientrpc.DepositState_WITHDRAWING: + return deposit.Withdrawing + + case clientrpc.DepositState_WITHDRAWN: + return deposit.Withdrawn + + case clientrpc.DepositState_PUBLISH_EXPIRED: + return deposit.PublishExpiredDeposit + + case clientrpc.DepositState_WAIT_FOR_EXPIRY_SWEEP: + return deposit.WaitForExpirySweep + + case clientrpc.DepositState_EXPIRED: + return deposit.Expired + + case clientrpc.DepositState_FAILED_STATE: + return deposit.Failed + + default: + return fsm.EmptyState + } +} + func toServerOutpoints(outpoints []*clientrpc.OutPoint) ([]wire.OutPoint, error) { diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index c271656..761183a 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -469,6 +469,70 @@ func (AutoReason) EnumDescriptor() ([]byte, []int) { return file_client_proto_rawDescGZIP(), []int{5} } +type DepositState int32 + +const ( + DepositState_UNKNOWN_STATE DepositState = 0 + DepositState_DEPOSITED DepositState = 1 + DepositState_WITHDRAWING DepositState = 2 + DepositState_WITHDRAWN DepositState = 3 + DepositState_PUBLISH_EXPIRED DepositState = 4 + DepositState_WAIT_FOR_EXPIRY_SWEEP DepositState = 5 + DepositState_EXPIRED DepositState = 6 + DepositState_FAILED_STATE DepositState = 7 +) + +// Enum value maps for DepositState. +var ( + DepositState_name = map[int32]string{ + 0: "UNKNOWN_STATE", + 1: "DEPOSITED", + 2: "WITHDRAWING", + 3: "WITHDRAWN", + 4: "PUBLISH_EXPIRED", + 5: "WAIT_FOR_EXPIRY_SWEEP", + 6: "EXPIRED", + 7: "FAILED_STATE", + } + DepositState_value = map[string]int32{ + "UNKNOWN_STATE": 0, + "DEPOSITED": 1, + "WITHDRAWING": 2, + "WITHDRAWN": 3, + "PUBLISH_EXPIRED": 4, + "WAIT_FOR_EXPIRY_SWEEP": 5, + "EXPIRED": 6, + "FAILED_STATE": 7, + } +) + +func (x DepositState) Enum() *DepositState { + p := new(DepositState) + *p = x + return p +} + +func (x DepositState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DepositState) Descriptor() protoreflect.EnumDescriptor { + return file_client_proto_enumTypes[6].Descriptor() +} + +func (DepositState) Type() protoreflect.EnumType { + return &file_client_proto_enumTypes[6] +} + +func (x DepositState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DepositState.Descriptor instead. +func (DepositState) EnumDescriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{6} +} + type ListSwapsFilter_SwapTypeFilter int32 const ( @@ -505,11 +569,11 @@ func (x ListSwapsFilter_SwapTypeFilter) String() string { } func (ListSwapsFilter_SwapTypeFilter) Descriptor() protoreflect.EnumDescriptor { - return file_client_proto_enumTypes[6].Descriptor() + return file_client_proto_enumTypes[7].Descriptor() } func (ListSwapsFilter_SwapTypeFilter) Type() protoreflect.EnumType { - return &file_client_proto_enumTypes[6] + return &file_client_proto_enumTypes[7] } func (x ListSwapsFilter_SwapTypeFilter) Number() protoreflect.EnumNumber { @@ -4329,6 +4393,227 @@ func (x *OutPoint) GetOutputIndex() uint32 { return 0 } +type StaticAddressSummaryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StateFilter DepositState `protobuf:"varint,1,opt,name=state_filter,json=stateFilter,proto3,enum=looprpc.DepositState" json:"state_filter,omitempty"` +} + +func (x *StaticAddressSummaryRequest) Reset() { + *x = StaticAddressSummaryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StaticAddressSummaryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StaticAddressSummaryRequest) ProtoMessage() {} + +func (x *StaticAddressSummaryRequest) 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 StaticAddressSummaryRequest.ProtoReflect.Descriptor instead. +func (*StaticAddressSummaryRequest) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{48} +} + +func (x *StaticAddressSummaryRequest) GetStateFilter() DepositState { + if x != nil { + return x.StateFilter + } + return DepositState_UNKNOWN_STATE +} + +type StaticAddressSummaryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StaticAddress string `protobuf:"bytes,1,opt,name=static_address,json=staticAddress,proto3" json:"static_address,omitempty"` + TotalNumDeposits uint32 `protobuf:"varint,2,opt,name=total_num_deposits,json=totalNumDeposits,proto3" json:"total_num_deposits,omitempty"` + ValueUnconfirmed int64 `protobuf:"varint,3,opt,name=value_unconfirmed,json=valueUnconfirmed,proto3" json:"value_unconfirmed,omitempty"` + ValueDeposited int64 `protobuf:"varint,4,opt,name=value_deposited,json=valueDeposited,proto3" json:"value_deposited,omitempty"` + ValueExpired int64 `protobuf:"varint,5,opt,name=value_expired,json=valueExpired,proto3" json:"value_expired,omitempty"` + ValueWithdrawn int64 `protobuf:"varint,6,opt,name=value_withdrawn,json=valueWithdrawn,proto3" json:"value_withdrawn,omitempty"` + FilteredDeposits []*Deposit `protobuf:"bytes,7,rep,name=filtered_deposits,json=filteredDeposits,proto3" json:"filtered_deposits,omitempty"` +} + +func (x *StaticAddressSummaryResponse) Reset() { + *x = StaticAddressSummaryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StaticAddressSummaryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StaticAddressSummaryResponse) ProtoMessage() {} + +func (x *StaticAddressSummaryResponse) 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 StaticAddressSummaryResponse.ProtoReflect.Descriptor instead. +func (*StaticAddressSummaryResponse) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{49} +} + +func (x *StaticAddressSummaryResponse) GetStaticAddress() string { + if x != nil { + return x.StaticAddress + } + return "" +} + +func (x *StaticAddressSummaryResponse) GetTotalNumDeposits() uint32 { + if x != nil { + return x.TotalNumDeposits + } + return 0 +} + +func (x *StaticAddressSummaryResponse) GetValueUnconfirmed() int64 { + if x != nil { + return x.ValueUnconfirmed + } + return 0 +} + +func (x *StaticAddressSummaryResponse) GetValueDeposited() int64 { + if x != nil { + return x.ValueDeposited + } + return 0 +} + +func (x *StaticAddressSummaryResponse) GetValueExpired() int64 { + if x != nil { + return x.ValueExpired + } + return 0 +} + +func (x *StaticAddressSummaryResponse) GetValueWithdrawn() int64 { + if x != nil { + return x.ValueWithdrawn + } + return 0 +} + +func (x *StaticAddressSummaryResponse) GetFilteredDeposits() []*Deposit { + if x != nil { + return x.FilteredDeposits + } + return nil +} + +type Deposit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State DepositState `protobuf:"varint,2,opt,name=state,proto3,enum=looprpc.DepositState" json:"state,omitempty"` + Outpoint string `protobuf:"bytes,3,opt,name=outpoint,proto3" json:"outpoint,omitempty"` + Value int64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` + ConfirmationHeight int64 `protobuf:"varint,5,opt,name=confirmation_height,json=confirmationHeight,proto3" json:"confirmation_height,omitempty"` +} + +func (x *Deposit) Reset() { + *x = Deposit{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deposit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deposit) ProtoMessage() {} + +func (x *Deposit) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[50] + 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 Deposit.ProtoReflect.Descriptor instead. +func (*Deposit) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{50} +} + +func (x *Deposit) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *Deposit) GetState() DepositState { + if x != nil { + return x.State + } + return DepositState_UNKNOWN_STATE +} + +func (x *Deposit) GetOutpoint() string { + if x != nil { + return x.Outpoint + } + return "" +} + +func (x *Deposit) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Deposit) GetConfirmationHeight() int64 { + if x != nil { + return x.ConfirmationHeight + } + return 0 +} + var File_client_proto protoreflect.FileDescriptor var file_client_proto_rawDesc = []byte{ @@ -4836,74 +5121,122 @@ var file_client_proto_rawDesc = []byte{ 0x73, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x78, 0x69, 0x64, 0x53, 0x74, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 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, 0x0c, 0x0a, 0x0a, 0x53, 0x77, 0x61, 0x70, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x28, 0x0d, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, + 0x57, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, + 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd6, 0x02, 0x0a, 0x1c, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x2c, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x2b, + 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x75, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x6e, 0x12, 0x3d, 0x0a, 0x11, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, + 0x10, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x75, + 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x75, + 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2f, 0x0a, 0x13, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 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, 0x2a, 0x9f, + 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x49, 0x4e, 0x47, + 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x4e, 0x10, + 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x5f, 0x45, 0x58, 0x50, + 0x49, 0x52, 0x45, 0x44, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x46, + 0x4f, 0x52, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x59, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x10, + 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x06, 0x12, 0x10, + 0x0a, 0x0c, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x07, + 0x32, 0xbc, 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, @@ -5004,10 +5337,16 @@ var file_client_proto_rawDesc = []byte{ 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x24, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, + 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 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 ( @@ -5022,141 +5361,150 @@ func file_client_proto_rawDescGZIP() []byte { return file_client_proto_rawDescData } -var file_client_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_client_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 51) var file_client_proto_goTypes = []interface{}{ - (AddressType)(0), // 0: looprpc.AddressType - (SwapType)(0), // 1: looprpc.SwapType - (SwapState)(0), // 2: looprpc.SwapState - (FailureReason)(0), // 3: looprpc.FailureReason - (LiquidityRuleType)(0), // 4: looprpc.LiquidityRuleType - (AutoReason)(0), // 5: looprpc.AutoReason - (ListSwapsFilter_SwapTypeFilter)(0), // 6: looprpc.ListSwapsFilter.SwapTypeFilter - (*LoopOutRequest)(nil), // 7: looprpc.LoopOutRequest - (*LoopInRequest)(nil), // 8: looprpc.LoopInRequest - (*SwapResponse)(nil), // 9: looprpc.SwapResponse - (*MonitorRequest)(nil), // 10: looprpc.MonitorRequest - (*SwapStatus)(nil), // 11: looprpc.SwapStatus - (*ListSwapsRequest)(nil), // 12: looprpc.ListSwapsRequest - (*ListSwapsFilter)(nil), // 13: looprpc.ListSwapsFilter - (*ListSwapsResponse)(nil), // 14: looprpc.ListSwapsResponse - (*SwapInfoRequest)(nil), // 15: looprpc.SwapInfoRequest - (*TermsRequest)(nil), // 16: looprpc.TermsRequest - (*InTermsResponse)(nil), // 17: looprpc.InTermsResponse - (*OutTermsResponse)(nil), // 18: looprpc.OutTermsResponse - (*QuoteRequest)(nil), // 19: looprpc.QuoteRequest - (*InQuoteResponse)(nil), // 20: looprpc.InQuoteResponse - (*OutQuoteResponse)(nil), // 21: looprpc.OutQuoteResponse - (*ProbeRequest)(nil), // 22: looprpc.ProbeRequest - (*ProbeResponse)(nil), // 23: looprpc.ProbeResponse - (*TokensRequest)(nil), // 24: looprpc.TokensRequest - (*TokensResponse)(nil), // 25: looprpc.TokensResponse - (*LsatToken)(nil), // 26: looprpc.LsatToken - (*LoopStats)(nil), // 27: looprpc.LoopStats - (*GetInfoRequest)(nil), // 28: looprpc.GetInfoRequest - (*GetInfoResponse)(nil), // 29: looprpc.GetInfoResponse - (*GetLiquidityParamsRequest)(nil), // 30: looprpc.GetLiquidityParamsRequest - (*LiquidityParameters)(nil), // 31: looprpc.LiquidityParameters - (*LiquidityRule)(nil), // 32: looprpc.LiquidityRule - (*SetLiquidityParamsRequest)(nil), // 33: looprpc.SetLiquidityParamsRequest - (*SetLiquidityParamsResponse)(nil), // 34: looprpc.SetLiquidityParamsResponse - (*SuggestSwapsRequest)(nil), // 35: looprpc.SuggestSwapsRequest - (*Disqualified)(nil), // 36: looprpc.Disqualified - (*SuggestSwapsResponse)(nil), // 37: looprpc.SuggestSwapsResponse - (*AbandonSwapRequest)(nil), // 38: looprpc.AbandonSwapRequest - (*AbandonSwapResponse)(nil), // 39: looprpc.AbandonSwapResponse - (*ListReservationsRequest)(nil), // 40: looprpc.ListReservationsRequest - (*ListReservationsResponse)(nil), // 41: looprpc.ListReservationsResponse - (*ClientReservation)(nil), // 42: looprpc.ClientReservation - (*InstantOutRequest)(nil), // 43: looprpc.InstantOutRequest - (*InstantOutResponse)(nil), // 44: looprpc.InstantOutResponse - (*InstantOutQuoteRequest)(nil), // 45: looprpc.InstantOutQuoteRequest - (*InstantOutQuoteResponse)(nil), // 46: looprpc.InstantOutQuoteResponse - (*NewStaticAddressRequest)(nil), // 47: looprpc.NewStaticAddressRequest - (*NewStaticAddressResponse)(nil), // 48: looprpc.NewStaticAddressResponse - (*ListUnspentDepositsRequest)(nil), // 49: looprpc.ListUnspentDepositsRequest - (*ListUnspentDepositsResponse)(nil), // 50: looprpc.ListUnspentDepositsResponse - (*Utxo)(nil), // 51: looprpc.Utxo - (*WithdrawDepositsRequest)(nil), // 52: looprpc.WithdrawDepositsRequest - (*WithdrawDepositsResponse)(nil), // 53: looprpc.WithdrawDepositsResponse - (*OutPoint)(nil), // 54: looprpc.OutPoint - (*swapserverrpc.RouteHint)(nil), // 55: looprpc.RouteHint + (AddressType)(0), // 0: looprpc.AddressType + (SwapType)(0), // 1: looprpc.SwapType + (SwapState)(0), // 2: looprpc.SwapState + (FailureReason)(0), // 3: looprpc.FailureReason + (LiquidityRuleType)(0), // 4: looprpc.LiquidityRuleType + (AutoReason)(0), // 5: looprpc.AutoReason + (DepositState)(0), // 6: looprpc.DepositState + (ListSwapsFilter_SwapTypeFilter)(0), // 7: looprpc.ListSwapsFilter.SwapTypeFilter + (*LoopOutRequest)(nil), // 8: looprpc.LoopOutRequest + (*LoopInRequest)(nil), // 9: looprpc.LoopInRequest + (*SwapResponse)(nil), // 10: looprpc.SwapResponse + (*MonitorRequest)(nil), // 11: looprpc.MonitorRequest + (*SwapStatus)(nil), // 12: looprpc.SwapStatus + (*ListSwapsRequest)(nil), // 13: looprpc.ListSwapsRequest + (*ListSwapsFilter)(nil), // 14: looprpc.ListSwapsFilter + (*ListSwapsResponse)(nil), // 15: looprpc.ListSwapsResponse + (*SwapInfoRequest)(nil), // 16: looprpc.SwapInfoRequest + (*TermsRequest)(nil), // 17: looprpc.TermsRequest + (*InTermsResponse)(nil), // 18: looprpc.InTermsResponse + (*OutTermsResponse)(nil), // 19: looprpc.OutTermsResponse + (*QuoteRequest)(nil), // 20: looprpc.QuoteRequest + (*InQuoteResponse)(nil), // 21: looprpc.InQuoteResponse + (*OutQuoteResponse)(nil), // 22: looprpc.OutQuoteResponse + (*ProbeRequest)(nil), // 23: looprpc.ProbeRequest + (*ProbeResponse)(nil), // 24: looprpc.ProbeResponse + (*TokensRequest)(nil), // 25: looprpc.TokensRequest + (*TokensResponse)(nil), // 26: looprpc.TokensResponse + (*LsatToken)(nil), // 27: looprpc.LsatToken + (*LoopStats)(nil), // 28: looprpc.LoopStats + (*GetInfoRequest)(nil), // 29: looprpc.GetInfoRequest + (*GetInfoResponse)(nil), // 30: looprpc.GetInfoResponse + (*GetLiquidityParamsRequest)(nil), // 31: looprpc.GetLiquidityParamsRequest + (*LiquidityParameters)(nil), // 32: looprpc.LiquidityParameters + (*LiquidityRule)(nil), // 33: looprpc.LiquidityRule + (*SetLiquidityParamsRequest)(nil), // 34: looprpc.SetLiquidityParamsRequest + (*SetLiquidityParamsResponse)(nil), // 35: looprpc.SetLiquidityParamsResponse + (*SuggestSwapsRequest)(nil), // 36: looprpc.SuggestSwapsRequest + (*Disqualified)(nil), // 37: looprpc.Disqualified + (*SuggestSwapsResponse)(nil), // 38: looprpc.SuggestSwapsResponse + (*AbandonSwapRequest)(nil), // 39: looprpc.AbandonSwapRequest + (*AbandonSwapResponse)(nil), // 40: looprpc.AbandonSwapResponse + (*ListReservationsRequest)(nil), // 41: looprpc.ListReservationsRequest + (*ListReservationsResponse)(nil), // 42: looprpc.ListReservationsResponse + (*ClientReservation)(nil), // 43: looprpc.ClientReservation + (*InstantOutRequest)(nil), // 44: looprpc.InstantOutRequest + (*InstantOutResponse)(nil), // 45: looprpc.InstantOutResponse + (*InstantOutQuoteRequest)(nil), // 46: looprpc.InstantOutQuoteRequest + (*InstantOutQuoteResponse)(nil), // 47: looprpc.InstantOutQuoteResponse + (*NewStaticAddressRequest)(nil), // 48: looprpc.NewStaticAddressRequest + (*NewStaticAddressResponse)(nil), // 49: looprpc.NewStaticAddressResponse + (*ListUnspentDepositsRequest)(nil), // 50: looprpc.ListUnspentDepositsRequest + (*ListUnspentDepositsResponse)(nil), // 51: looprpc.ListUnspentDepositsResponse + (*Utxo)(nil), // 52: looprpc.Utxo + (*WithdrawDepositsRequest)(nil), // 53: looprpc.WithdrawDepositsRequest + (*WithdrawDepositsResponse)(nil), // 54: looprpc.WithdrawDepositsResponse + (*OutPoint)(nil), // 55: looprpc.OutPoint + (*StaticAddressSummaryRequest)(nil), // 56: looprpc.StaticAddressSummaryRequest + (*StaticAddressSummaryResponse)(nil), // 57: looprpc.StaticAddressSummaryResponse + (*Deposit)(nil), // 58: looprpc.Deposit + (*swapserverrpc.RouteHint)(nil), // 59: looprpc.RouteHint } var file_client_proto_depIdxs = []int32{ 0, // 0: looprpc.LoopOutRequest.account_addr_type:type_name -> looprpc.AddressType - 55, // 1: looprpc.LoopInRequest.route_hints:type_name -> looprpc.RouteHint + 59, // 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 - 55, // 8: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint - 55, // 9: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint - 26, // 10: looprpc.TokensResponse.tokens:type_name -> looprpc.LsatToken - 27, // 11: looprpc.GetInfoResponse.loop_out_stats:type_name -> looprpc.LoopStats - 27, // 12: looprpc.GetInfoResponse.loop_in_stats:type_name -> looprpc.LoopStats - 32, // 13: looprpc.LiquidityParameters.rules:type_name -> looprpc.LiquidityRule + 14, // 5: looprpc.ListSwapsRequest.list_swap_filter:type_name -> looprpc.ListSwapsFilter + 7, // 6: looprpc.ListSwapsFilter.swap_type:type_name -> looprpc.ListSwapsFilter.SwapTypeFilter + 12, // 7: looprpc.ListSwapsResponse.swaps:type_name -> looprpc.SwapStatus + 59, // 8: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint + 59, // 9: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint + 27, // 10: looprpc.TokensResponse.tokens:type_name -> looprpc.LsatToken + 28, // 11: looprpc.GetInfoResponse.loop_out_stats:type_name -> looprpc.LoopStats + 28, // 12: looprpc.GetInfoResponse.loop_in_stats:type_name -> looprpc.LoopStats + 33, // 13: looprpc.LiquidityParameters.rules:type_name -> looprpc.LiquidityRule 0, // 14: looprpc.LiquidityParameters.account_addr_type:type_name -> looprpc.AddressType 1, // 15: looprpc.LiquidityRule.swap_type:type_name -> looprpc.SwapType 4, // 16: looprpc.LiquidityRule.type:type_name -> looprpc.LiquidityRuleType - 31, // 17: looprpc.SetLiquidityParamsRequest.parameters:type_name -> looprpc.LiquidityParameters + 32, // 17: looprpc.SetLiquidityParamsRequest.parameters:type_name -> looprpc.LiquidityParameters 5, // 18: looprpc.Disqualified.reason:type_name -> looprpc.AutoReason - 7, // 19: looprpc.SuggestSwapsResponse.loop_out:type_name -> looprpc.LoopOutRequest - 8, // 20: looprpc.SuggestSwapsResponse.loop_in:type_name -> looprpc.LoopInRequest - 36, // 21: looprpc.SuggestSwapsResponse.disqualified:type_name -> looprpc.Disqualified - 42, // 22: looprpc.ListReservationsResponse.reservations:type_name -> looprpc.ClientReservation - 51, // 23: looprpc.ListUnspentDepositsResponse.utxos:type_name -> looprpc.Utxo - 54, // 24: looprpc.WithdrawDepositsRequest.outpoints:type_name -> looprpc.OutPoint - 7, // 25: looprpc.SwapClient.LoopOut:input_type -> looprpc.LoopOutRequest - 8, // 26: looprpc.SwapClient.LoopIn:input_type -> looprpc.LoopInRequest - 10, // 27: looprpc.SwapClient.Monitor:input_type -> looprpc.MonitorRequest - 12, // 28: looprpc.SwapClient.ListSwaps:input_type -> looprpc.ListSwapsRequest - 15, // 29: looprpc.SwapClient.SwapInfo:input_type -> looprpc.SwapInfoRequest - 38, // 30: looprpc.SwapClient.AbandonSwap:input_type -> looprpc.AbandonSwapRequest - 16, // 31: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest - 19, // 32: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest - 16, // 33: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest - 19, // 34: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest - 22, // 35: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest - 24, // 36: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest - 28, // 37: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest - 30, // 38: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest - 33, // 39: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest - 35, // 40: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest - 40, // 41: looprpc.SwapClient.ListReservations:input_type -> looprpc.ListReservationsRequest - 43, // 42: looprpc.SwapClient.InstantOut:input_type -> looprpc.InstantOutRequest - 45, // 43: looprpc.SwapClient.InstantOutQuote:input_type -> looprpc.InstantOutQuoteRequest - 47, // 44: looprpc.SwapClient.NewStaticAddress:input_type -> looprpc.NewStaticAddressRequest - 49, // 45: looprpc.SwapClient.ListUnspentDeposits:input_type -> looprpc.ListUnspentDepositsRequest - 52, // 46: looprpc.SwapClient.WithdrawDeposits:input_type -> looprpc.WithdrawDepositsRequest - 9, // 47: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse - 9, // 48: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse - 11, // 49: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus - 14, // 50: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse - 11, // 51: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus - 39, // 52: looprpc.SwapClient.AbandonSwap:output_type -> looprpc.AbandonSwapResponse - 18, // 53: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse - 21, // 54: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse - 17, // 55: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse - 20, // 56: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse - 23, // 57: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse - 25, // 58: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse - 29, // 59: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse - 31, // 60: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters - 34, // 61: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse - 37, // 62: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse - 41, // 63: looprpc.SwapClient.ListReservations:output_type -> looprpc.ListReservationsResponse - 44, // 64: looprpc.SwapClient.InstantOut:output_type -> looprpc.InstantOutResponse - 46, // 65: looprpc.SwapClient.InstantOutQuote:output_type -> looprpc.InstantOutQuoteResponse - 48, // 66: looprpc.SwapClient.NewStaticAddress:output_type -> looprpc.NewStaticAddressResponse - 50, // 67: looprpc.SwapClient.ListUnspentDeposits:output_type -> looprpc.ListUnspentDepositsResponse - 53, // 68: looprpc.SwapClient.WithdrawDeposits:output_type -> looprpc.WithdrawDepositsResponse - 47, // [47:69] is the sub-list for method output_type - 25, // [25:47] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 8, // 19: looprpc.SuggestSwapsResponse.loop_out:type_name -> looprpc.LoopOutRequest + 9, // 20: looprpc.SuggestSwapsResponse.loop_in:type_name -> looprpc.LoopInRequest + 37, // 21: looprpc.SuggestSwapsResponse.disqualified:type_name -> looprpc.Disqualified + 43, // 22: looprpc.ListReservationsResponse.reservations:type_name -> looprpc.ClientReservation + 52, // 23: looprpc.ListUnspentDepositsResponse.utxos:type_name -> looprpc.Utxo + 55, // 24: looprpc.WithdrawDepositsRequest.outpoints:type_name -> looprpc.OutPoint + 6, // 25: looprpc.StaticAddressSummaryRequest.state_filter:type_name -> looprpc.DepositState + 58, // 26: looprpc.StaticAddressSummaryResponse.filtered_deposits:type_name -> looprpc.Deposit + 6, // 27: looprpc.Deposit.state:type_name -> looprpc.DepositState + 8, // 28: looprpc.SwapClient.LoopOut:input_type -> looprpc.LoopOutRequest + 9, // 29: looprpc.SwapClient.LoopIn:input_type -> looprpc.LoopInRequest + 11, // 30: looprpc.SwapClient.Monitor:input_type -> looprpc.MonitorRequest + 13, // 31: looprpc.SwapClient.ListSwaps:input_type -> looprpc.ListSwapsRequest + 16, // 32: looprpc.SwapClient.SwapInfo:input_type -> looprpc.SwapInfoRequest + 39, // 33: looprpc.SwapClient.AbandonSwap:input_type -> looprpc.AbandonSwapRequest + 17, // 34: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest + 20, // 35: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest + 17, // 36: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest + 20, // 37: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest + 23, // 38: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest + 25, // 39: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest + 29, // 40: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest + 31, // 41: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest + 34, // 42: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest + 36, // 43: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest + 41, // 44: looprpc.SwapClient.ListReservations:input_type -> looprpc.ListReservationsRequest + 44, // 45: looprpc.SwapClient.InstantOut:input_type -> looprpc.InstantOutRequest + 46, // 46: looprpc.SwapClient.InstantOutQuote:input_type -> looprpc.InstantOutQuoteRequest + 48, // 47: looprpc.SwapClient.NewStaticAddress:input_type -> looprpc.NewStaticAddressRequest + 50, // 48: looprpc.SwapClient.ListUnspentDeposits:input_type -> looprpc.ListUnspentDepositsRequest + 53, // 49: looprpc.SwapClient.WithdrawDeposits:input_type -> looprpc.WithdrawDepositsRequest + 56, // 50: looprpc.SwapClient.GetStaticAddressSummary:input_type -> looprpc.StaticAddressSummaryRequest + 10, // 51: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse + 10, // 52: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse + 12, // 53: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus + 15, // 54: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse + 12, // 55: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus + 40, // 56: looprpc.SwapClient.AbandonSwap:output_type -> looprpc.AbandonSwapResponse + 19, // 57: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse + 22, // 58: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse + 18, // 59: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse + 21, // 60: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse + 24, // 61: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse + 26, // 62: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse + 30, // 63: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse + 32, // 64: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters + 35, // 65: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse + 38, // 66: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse + 42, // 67: looprpc.SwapClient.ListReservations:output_type -> looprpc.ListReservationsResponse + 45, // 68: looprpc.SwapClient.InstantOut:output_type -> looprpc.InstantOutResponse + 47, // 69: looprpc.SwapClient.InstantOutQuote:output_type -> looprpc.InstantOutQuoteResponse + 49, // 70: looprpc.SwapClient.NewStaticAddress:output_type -> looprpc.NewStaticAddressResponse + 51, // 71: looprpc.SwapClient.ListUnspentDeposits:output_type -> looprpc.ListUnspentDepositsResponse + 54, // 72: looprpc.SwapClient.WithdrawDeposits:output_type -> looprpc.WithdrawDepositsResponse + 57, // 73: looprpc.SwapClient.GetStaticAddressSummary:output_type -> looprpc.StaticAddressSummaryResponse + 51, // [51:74] is the sub-list for method output_type + 28, // [28:51] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_client_proto_init() } @@ -5741,14 +6089,50 @@ func file_client_proto_init() { return nil } } + file_client_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StaticAddressSummaryRequest); 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 interface{}, i int) interface{} { + switch v := v.(*StaticAddressSummaryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Deposit); 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_client_proto_rawDesc, - NumEnums: 7, - NumMessages: 48, + NumEnums: 8, + NumMessages: 51, NumExtensions: 0, NumServices: 1, }, diff --git a/looprpc/client.proto b/looprpc/client.proto index 2234d10..9092b9e 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -145,6 +145,9 @@ service SwapClient { */ rpc WithdrawDeposits (WithdrawDepositsRequest) returns (WithdrawDepositsResponse); + + rpc GetStaticAddressSummary (StaticAddressSummaryRequest) + returns (StaticAddressSummaryResponse); } message LoopOutRequest { @@ -1496,4 +1499,41 @@ message OutPoint { The index of the output on the transaction. */ uint32 output_index = 3; +} + +message StaticAddressSummaryRequest { + DepositState state_filter = 1; +} + +message StaticAddressSummaryResponse { + string static_address = 1; + uint32 total_num_deposits = 2; + int64 value_unconfirmed = 3; + int64 value_deposited = 4; + int64 value_expired = 5; + int64 value_withdrawn = 6; + repeated Deposit filtered_deposits = 7; +} + +enum DepositState { + UNKNOWN_STATE = 0; + DEPOSITED = 1; + WITHDRAWING = 2; + WITHDRAWN = 3; + PUBLISH_EXPIRED = 4; + WAIT_FOR_EXPIRY_SWEEP = 5; + EXPIRED = 6; + FAILED_STATE = 7; +} + +message Deposit { + bytes id = 1; + + DepositState state = 2; + + string outpoint = 3; + + int64 value = 4; + + int64 confirmation_height = 5; } \ No newline at end of file diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index cd8d25d..04a3520 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -618,6 +618,43 @@ } } }, + "looprpcDeposit": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "byte" + }, + "state": { + "$ref": "#/definitions/looprpcDepositState" + }, + "outpoint": { + "type": "string" + }, + "value": { + "type": "string", + "format": "int64" + }, + "confirmation_height": { + "type": "string", + "format": "int64" + } + } + }, + "looprpcDepositState": { + "type": "string", + "enum": [ + "UNKNOWN_STATE", + "DEPOSITED", + "WITHDRAWING", + "WITHDRAWN", + "PUBLISH_EXPIRED", + "WAIT_FOR_EXPIRY_SWEEP", + "EXPIRED", + "FAILED_STATE" + ], + "default": "UNKNOWN_STATE" + }, "looprpcDisqualified": { "type": "object", "properties": { @@ -1367,6 +1404,40 @@ "looprpcSetLiquidityParamsResponse": { "type": "object" }, + "looprpcStaticAddressSummaryResponse": { + "type": "object", + "properties": { + "static_address": { + "type": "string" + }, + "total_num_deposits": { + "type": "integer", + "format": "int64" + }, + "value_unconfirmed": { + "type": "string", + "format": "int64" + }, + "value_deposited": { + "type": "string", + "format": "int64" + }, + "value_expired": { + "type": "string", + "format": "int64" + }, + "value_withdrawn": { + "type": "string", + "format": "int64" + }, + "filtered_deposits": { + "type": "array", + "items": { + "$ref": "#/definitions/looprpcDeposit" + } + } + } + }, "looprpcSuggestSwapsResponse": { "type": "object", "properties": { diff --git a/looprpc/client_grpc.pb.go b/looprpc/client_grpc.pb.go index 914766f..5f39ab8 100644 --- a/looprpc/client_grpc.pb.go +++ b/looprpc/client_grpc.pb.go @@ -102,6 +102,7 @@ type SwapClientClient interface { // loop:`static withdraw` //WithdrawDeposits withdraws a selection or all deposits of a static address. WithdrawDeposits(ctx context.Context, in *WithdrawDepositsRequest, opts ...grpc.CallOption) (*WithdrawDepositsResponse, error) + GetStaticAddressSummary(ctx context.Context, in *StaticAddressSummaryRequest, opts ...grpc.CallOption) (*StaticAddressSummaryResponse, error) } type swapClientClient struct { @@ -333,6 +334,15 @@ func (c *swapClientClient) WithdrawDeposits(ctx context.Context, in *WithdrawDep return out, nil } +func (c *swapClientClient) GetStaticAddressSummary(ctx context.Context, in *StaticAddressSummaryRequest, opts ...grpc.CallOption) (*StaticAddressSummaryResponse, error) { + out := new(StaticAddressSummaryResponse) + err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetStaticAddressSummary", 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 @@ -421,6 +431,7 @@ type SwapClientServer interface { // loop:`static withdraw` //WithdrawDeposits withdraws a selection or all deposits of a static address. WithdrawDeposits(context.Context, *WithdrawDepositsRequest) (*WithdrawDepositsResponse, error) + GetStaticAddressSummary(context.Context, *StaticAddressSummaryRequest) (*StaticAddressSummaryResponse, error) mustEmbedUnimplementedSwapClientServer() } @@ -494,6 +505,9 @@ func (UnimplementedSwapClientServer) ListUnspentDeposits(context.Context, *ListU func (UnimplementedSwapClientServer) WithdrawDeposits(context.Context, *WithdrawDepositsRequest) (*WithdrawDepositsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WithdrawDeposits not implemented") } +func (UnimplementedSwapClientServer) GetStaticAddressSummary(context.Context, *StaticAddressSummaryRequest) (*StaticAddressSummaryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStaticAddressSummary not implemented") +} func (UnimplementedSwapClientServer) mustEmbedUnimplementedSwapClientServer() {} // UnsafeSwapClientServer may be embedded to opt out of forward compatibility for this service. @@ -906,6 +920,24 @@ func _SwapClient_WithdrawDeposits_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _SwapClient_GetStaticAddressSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StaticAddressSummaryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SwapClientServer).GetStaticAddressSummary(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.SwapClient/GetStaticAddressSummary", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SwapClientServer).GetStaticAddressSummary(ctx, req.(*StaticAddressSummaryRequest)) + } + 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) @@ -997,6 +1029,10 @@ var SwapClient_ServiceDesc = grpc.ServiceDesc{ MethodName: "WithdrawDeposits", Handler: _SwapClient_WithdrawDeposits_Handler, }, + { + MethodName: "GetStaticAddressSummary", + Handler: _SwapClient_GetStaticAddressSummary_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/looprpc/swapclient.pb.json.go b/looprpc/swapclient.pb.json.go index d9ab5c3..740aa35 100644 --- a/looprpc/swapclient.pb.json.go +++ b/looprpc/swapclient.pb.json.go @@ -587,4 +587,29 @@ func RegisterSwapClientJSONCallbacks(registry map[string]func(ctx context.Contex } callback(string(respBytes), nil) } + + registry["looprpc.SwapClient.GetStaticAddressSummary"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &StaticAddressSummaryRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSwapClientClient(conn) + resp, err := client.GetStaticAddressSummary(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } } diff --git a/staticaddr/address/manager.go b/staticaddr/address/manager.go index 43c98d1..07e034c 100644 --- a/staticaddr/address/manager.go +++ b/staticaddr/address/manager.go @@ -83,7 +83,7 @@ func (m *Manager) NewAddress(ctx context.Context) (*btcutil.AddressTaproot, m.Unlock() - return m.getTaprootAddress(clientPubKey, serverPubKey, expiry) + return m.GetTaprootAddress(clientPubKey, serverPubKey, expiry) } m.Unlock() @@ -167,12 +167,12 @@ func (m *Manager) NewAddress(ctx context.Context) (*btcutil.AddressTaproot, log.Infof("imported static address taproot script to lnd wallet: %v", addr) - return m.getTaprootAddress( + return m.GetTaprootAddress( clientPubKey.PubKey, serverPubKey, int64(serverParams.Expiry), ) } -func (m *Manager) getTaprootAddress(clientPubkey, +func (m *Manager) GetTaprootAddress(clientPubkey, serverPubkey *btcec.PublicKey, expiry int64) (*btcutil.AddressTaproot, error) { @@ -225,7 +225,7 @@ func (m *Manager) ListUnspentRaw(ctx context.Context, minConfs, } } - taprootAddress, err := m.getTaprootAddress( + taprootAddress, err := m.GetTaprootAddress( staticAddress.ClientPubkey, staticAddress.ServerPubkey, int64(staticAddress.Expiry), ) diff --git a/staticaddr/deposit/interface.go b/staticaddr/deposit/interface.go index dc98f16..673f94e 100644 --- a/staticaddr/deposit/interface.go +++ b/staticaddr/deposit/interface.go @@ -3,6 +3,8 @@ package deposit import ( "context" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcutil" "github.com/lightninglabs/loop/staticaddr/address" "github.com/lightninglabs/loop/staticaddr/script" "github.com/lightningnetwork/lnd/lnwallet" @@ -41,4 +43,9 @@ type AddressManager interface { // ListUnspent returns a list of utxos at the static address. ListUnspent(ctx context.Context, minConfs, maxConfs int32) ([]*lnwallet.Utxo, error) + + // GetTaprootAddress returns a taproot address. + GetTaprootAddress(clientPubkey, + serverPubkey *btcec.PublicKey, + expiry int64) (*btcutil.AddressTaproot, error) }