diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 9d02a5f9..1b27310f 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -49754,6 +49754,21 @@ paths: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated + vaults when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -50031,6 +50046,21 @@ paths: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated + vaults when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -50302,6 +50332,21 @@ paths: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated + vaults when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -51915,6 +51960,231 @@ paths: + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + in: path + required: true + type: string + tags: + - Query + /side/btcbridge/utxos/{address}/stats: + get: + summary: >- + QueryUTXOCountAndBalancesByAddress queries the total count and balances + of the unlocked utxos by the given address. + operationId: SideBtcbridgeQueryUTXOCountAndBalancesByAddress + responses: + '200': + description: A successful response. + schema: + type: object + properties: + count: + type: integer + format: int64 + value: + type: string + format: int64 + runeBalances: + type: array + items: + type: object + properties: + id: + type: string + title: serialized rune id + amount: + type: string + title: rune amount + title: Rune Balance + description: >- + QueryUTXOCountAndBalancesByAddressResponse is the response type + for the Query/UTXOCountAndBalancesByAddress RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + JSON ==== @@ -82811,6 +83081,21 @@ definitions: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated vaults when + the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -83071,6 +83356,21 @@ definitions: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated vaults + when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -83241,6 +83541,21 @@ definitions: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated vaults + when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -83308,6 +83623,21 @@ definitions: - ASSET_TYPE_RUNES: RUNE: dog•go•to•the•moon title: AssetType defines the type of asset title: asset types of vaults to be generated + disable_bridge: + type: boolean + title: indicates if disabling bridge deposit and withdrawal + enable_transfer: + type: boolean + title: >- + indicates if transferring assets to the newly generated vaults + when the DKG request is completed + target_utxo_num: + type: integer + format: int64 + title: target number of the UTXOs to be transferred each time + fee_rate: + type: string + title: fee rate for vault transfer expiration: type: string format: date-time @@ -83434,6 +83764,30 @@ definitions: Transition period after which TSS participants update process is completed description: QueryParamsResponse is response type for the Query/Params RPC method. + side.btcbridge.QueryUTXOCountAndBalancesByAddressResponse: + type: object + properties: + count: + type: integer + format: int64 + value: + type: string + format: int64 + runeBalances: + type: array + items: + type: object + properties: + id: + type: string + title: serialized rune id + amount: + type: string + title: rune amount + title: Rune Balance + description: >- + QueryUTXOCountAndBalancesByAddressResponse is the response type for the + Query/UTXOCountAndBalancesByAddress RPC method. side.btcbridge.QueryUTXOsByAddressResponse: type: object properties: diff --git a/proto/side/btcbridge/btcbridge.proto b/proto/side/btcbridge/btcbridge.proto index bbf2ed3c..d5da24b7 100644 --- a/proto/side/btcbridge/btcbridge.proto +++ b/proto/side/btcbridge/btcbridge.proto @@ -115,10 +115,18 @@ message DKGRequest { uint32 threshold = 3; // asset types of vaults to be generated repeated AssetType vault_types = 4; + // indicates if disabling bridge deposit and withdrawal + bool disable_bridge = 5; + // indicates if transferring assets to the newly generated vaults when the DKG request is completed + bool enable_transfer = 6; + // target number of the UTXOs to be transferred each time + uint32 target_utxo_num = 7; + // fee rate for vault transfer + string fee_rate = 8; // expiration time - google.protobuf.Timestamp expiration = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; + google.protobuf.Timestamp expiration = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; // status - DKGRequestStatus status = 6; + DKGRequestStatus status = 10; } // DKG Completion Request diff --git a/proto/side/btcbridge/query.proto b/proto/side/btcbridge/query.proto index 011c47c2..c0e17d4b 100644 --- a/proto/side/btcbridge/query.proto +++ b/proto/side/btcbridge/query.proto @@ -51,6 +51,10 @@ service Query { rpc QueryUTXOsByAddress(QueryUTXOsByAddressRequest) returns (QueryUTXOsByAddressResponse) { option (google.api.http).get = "/side/btcbridge/utxos/{address}"; } + // QueryUTXOCountAndBalancesByAddress queries the total count and balances of the unlocked utxos by the given address. + rpc QueryUTXOCountAndBalancesByAddress(QueryUTXOCountAndBalancesByAddressRequest) returns (QueryUTXOCountAndBalancesByAddressResponse) { + option (google.api.http).get = "/side/btcbridge/utxos/{address}/stats"; + } // QueryDKGRequest queries the DKG request by the given id. rpc QueryDKGRequest(QueryDKGRequestRequest) returns (QueryDKGRequestResponse) { option (google.api.http).get = "/side/btcbridge/dkg/request/{id}"; @@ -171,6 +175,18 @@ message QueryUTXOsByAddressResponse { repeated UTXO utxos = 1; } +// QueryUTXOCountAndBalancesByAddressRequest is the request type for the Query/UTXOCountAndBalancesByAddress RPC method. +message QueryUTXOCountAndBalancesByAddressRequest { + string address = 1; +} + +// QueryUTXOCountAndBalancesByAddressResponse is the response type for the Query/UTXOCountAndBalancesByAddress RPC method. +message QueryUTXOCountAndBalancesByAddressResponse { + uint32 count = 1; + int64 value = 2; + repeated RuneBalance runeBalances = 3; +} + // QueryDKGRequestRequest is the request type for the Query/DKGRequest RPC method. message QueryDKGRequestRequest { uint64 id = 1; diff --git a/proto/side/btcbridge/tx.proto b/proto/side/btcbridge/tx.proto index 5d9edecc..851daecd 100644 --- a/proto/side/btcbridge/tx.proto +++ b/proto/side/btcbridge/tx.proto @@ -120,6 +120,14 @@ message MsgInitiateDKG { uint32 threshold = 3; // asset types of vaults to be generated repeated AssetType vault_types = 4; + // indicates if disabling bridge functionalities including deposit and withdrawal + bool disable_bridge = 5; + // indicates if transferring the current vaults to the newly generated vaults when the DKG request is completed + bool enable_transfer = 6; + // target number of the UTXOs to be transferred each time + uint32 target_utxo_num = 7; + // fee rate for vault transfer + string fee_rate = 8; } // MsgInitiateDKGResponse defines the Msg/InitiateDKG response type. @@ -152,8 +160,12 @@ message MsgTransferVault { uint64 dest_version = 3; // asset type AssetType asset_type = 4; - // a set of pre-built PSBTs to perform the asset transfer + // a set of optional pre-built PSBTs to perform the asset transfer repeated string psbts = 5; + // target number of the UTXOs to be transferred; only take effect when psbt not provided + uint32 target_utxo_num = 6; + // fee rate; only take effect when psbt not provided + string fee_rate = 7; } // MsgTransferVaultResponse defines the Msg/TransferVault response type. diff --git a/x/btcbridge/abci.go b/x/btcbridge/abci.go index 228ca353..48eb58c1 100644 --- a/x/btcbridge/abci.go +++ b/x/btcbridge/abci.go @@ -40,5 +40,34 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) { // update status req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_COMPLETED k.SetDKGRequest(ctx, req) + + // transfer vaults if the EnableTransfer flag set + if req.EnableTransfer { + err := transferVaults(ctx, k, req.TargetUtxoNum, req.FeeRate) + + // reenable bridge when successfully transferred + if err == nil && req.DisableBridge { + k.EnableBridge(ctx) + } + } + } +} + +// transferVaults performs the vault asset transfer (possibly partially) +func transferVaults(ctx sdk.Context, k keeper.Keeper, targetUtxoNum uint32, feeRate string) error { + latestVaultVersion := k.GetLatestVaultVersion(ctx) + + if err := k.TransferVault(ctx, latestVaultVersion-1, latestVaultVersion, types.AssetType_ASSET_TYPE_RUNES, nil, targetUtxoNum, feeRate); err != nil { + k.Logger(ctx).Error("transfer vault errored", "source version", latestVaultVersion-1, "destination version", latestVaultVersion, "asset type", types.AssetType_ASSET_TYPE_RUNES, "target utxo num", targetUtxoNum, "fee rate", feeRate, "err", err) + + return err + } + + if err := k.TransferVault(ctx, latestVaultVersion-1, latestVaultVersion, types.AssetType_ASSET_TYPE_BTC, nil, targetUtxoNum, feeRate); err != nil { + k.Logger(ctx).Error("transfer vault errored", "source version", latestVaultVersion-1, "destination version", latestVaultVersion, "asset type", types.AssetType_ASSET_TYPE_BTC, "target utxo num", targetUtxoNum, "fee rate", feeRate, "err", err) + + return err } + + return nil } diff --git a/x/btcbridge/client/cli/query.go b/x/btcbridge/client/cli/query.go index 21ac2300..de9dc5f4 100644 --- a/x/btcbridge/client/cli/query.go +++ b/x/btcbridge/client/cli/query.go @@ -31,8 +31,9 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdBestBlock()) cmd.AddCommand(CmdQueryBlock()) - cmd.AddCommand(CmdQueryWithdrawRequest()) + cmd.AddCommand(CmdQueryWithdrawRequests()) cmd.AddCommand(CmdQueryUTXOs()) + cmd.AddCommand(CmdQueryUTXOStats()) cmd.AddCommand(CmdQueryDKGRequests()) cmd.AddCommand(CmdQueryDKGCompletionRequests()) // this line is used by starport scaffolding # 1 @@ -94,7 +95,7 @@ func CmdBestBlock() *cobra.Command { return cmd } -// CmdQueryBlock returns the command to query the heights of the light client +// CmdQueryBlock returns the command to query the block by hash or height func CmdQueryBlock() *cobra.Command { cmd := &cobra.Command{ Use: "block [hash or height]", @@ -132,10 +133,10 @@ func CmdQueryBlock() *cobra.Command { return cmd } -// CmdQueryWithdrawRequest returns the command to query withdrawal request -func CmdQueryWithdrawRequest() *cobra.Command { +// CmdQueryWithdrawRequests returns the command to query withdrawal requests +func CmdQueryWithdrawRequests() *cobra.Command { cmd := &cobra.Command{ - Use: "withdraw-request [status | address | tx hash]", + Use: "withdraw-requests [status | address | tx hash]", Short: "Query withdrawal requests by status, address or tx hash", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -185,6 +186,7 @@ func CmdQueryWithdrawRequest() *cobra.Command { return cmd } +// CmdQueryUTXOs returns the command to query utxos by the optional address func CmdQueryUTXOs() *cobra.Command { cmd := &cobra.Command{ Use: "utxos [address]", @@ -228,6 +230,41 @@ func CmdQueryUTXOs() *cobra.Command { return cmd } +// CmdQueryUTXOStats returns the command to query the utxo statistics by address +func CmdQueryUTXOStats() *cobra.Command { + cmd := &cobra.Command{ + Use: "utxo-stats [address]", + Short: "Query the utxo statistics by the given address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + _, err = sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.QueryUTXOCountAndBalancesByAddress(cmd.Context(), &types.QueryUTXOCountAndBalancesByAddressRequest{ + Address: args[0], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // CmdQueryDKGRequests returns the command to query DKG requests func CmdQueryDKGRequests() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/btcbridge/keeper/msg_server.go b/x/btcbridge/keeper/msg_server.go index 05a4107a..d34cae02 100644 --- a/x/btcbridge/keeper/msg_server.go +++ b/x/btcbridge/keeper/msg_server.go @@ -222,7 +222,7 @@ func (m msgServer) InitiateDKG(goCtx context.Context, msg *types.MsgInitiateDKG) ctx := sdk.UnwrapSDKContext(goCtx) - req, err := m.Keeper.InitiateDKG(ctx, msg.Participants, msg.Threshold, msg.VaultTypes) + req, err := m.Keeper.InitiateDKG(ctx, msg.Participants, msg.Threshold, msg.VaultTypes, msg.DisableBridge, msg.EnableTransfer, msg.TargetUtxoNum, msg.FeeRate) if err != nil { return nil, err } @@ -276,7 +276,7 @@ func (m msgServer) TransferVault(goCtx context.Context, msg *types.MsgTransferVa ctx := sdk.UnwrapSDKContext(goCtx) - if err := m.Keeper.TransferVault(ctx, msg.SourceVersion, msg.DestVersion, msg.AssetType, msg.Psbts); err != nil { + if err := m.Keeper.TransferVault(ctx, msg.SourceVersion, msg.DestVersion, msg.AssetType, msg.Psbts, msg.TargetUtxoNum, msg.FeeRate); err != nil { return nil, err } diff --git a/x/btcbridge/keeper/params.go b/x/btcbridge/keeper/params.go index 58456633..55d22e72 100644 --- a/x/btcbridge/keeper/params.go +++ b/x/btcbridge/keeper/params.go @@ -47,3 +47,23 @@ func (k Keeper) GetVaultByAssetTypeAndVersion(ctx sdk.Context, assetType types.A return nil } + +// EnableBridge enables the bridge deposit and withdrawal +func (k Keeper) EnableBridge(ctx sdk.Context) { + params := k.GetParams(ctx) + + params.DepositEnabled = true + params.WithdrawEnabled = true + + k.SetParams(ctx, params) +} + +// DisableBridge disables the bridge deposit and withdrawal +func (k Keeper) DisableBridge(ctx sdk.Context) { + params := k.GetParams(ctx) + + params.DepositEnabled = false + params.WithdrawEnabled = false + + k.SetParams(ctx, params) +} diff --git a/x/btcbridge/keeper/queries.go b/x/btcbridge/keeper/queries.go index f2a3d93d..17c7b4df 100644 --- a/x/btcbridge/keeper/queries.go +++ b/x/btcbridge/keeper/queries.go @@ -165,6 +165,26 @@ func (k Keeper) QueryUTXOsByAddress(goCtx context.Context, req *types.QueryUTXOs return &types.QueryUTXOsByAddressResponse{Utxos: utxos}, nil } +func (k Keeper) QueryUTXOCountAndBalancesByAddress(goCtx context.Context, req *types.QueryUTXOCountAndBalancesByAddressRequest) (*types.QueryUTXOCountAndBalancesByAddressResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + _, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err + } + + count, value, runeBalances := k.GetUnlockedUTXOCountAndBalancesByAddr(ctx, req.Address) + + return &types.QueryUTXOCountAndBalancesByAddressResponse{ + Count: count, + Value: value, + RuneBalances: runeBalances, + }, nil +} + func (k Keeper) QueryDKGRequest(goCtx context.Context, req *types.QueryDKGRequestRequest) (*types.QueryDKGRequestResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") diff --git a/x/btcbridge/keeper/tss.go b/x/btcbridge/keeper/tss.go index 71a47808..5124b3ed 100644 --- a/x/btcbridge/keeper/tss.go +++ b/x/btcbridge/keeper/tss.go @@ -2,11 +2,11 @@ package keeper import ( "bytes" + "strconv" "time" "github.com/btcsuite/btcd/btcutil/psbt" "github.com/btcsuite/btcd/txscript" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -166,7 +166,7 @@ func (k Keeper) IterateDKGCompletionRequests(ctx sdk.Context, id uint64, cb func } // InitiateDKG initiates the DKG request by the specified params -func (k Keeper) InitiateDKG(ctx sdk.Context, participants []*types.DKGParticipant, threshold uint32, vaultTypes []types.AssetType) (*types.DKGRequest, error) { +func (k Keeper) InitiateDKG(ctx sdk.Context, participants []*types.DKGParticipant, threshold uint32, vaultTypes []types.AssetType, disableBridge bool, enableTransfer bool, targetUtxoNum uint32, feeRate string) (*types.DKGRequest, error) { for _, p := range participants { consAddress, _ := sdk.ConsAddressFromHex(p.ConsensusAddress) @@ -180,13 +180,21 @@ func (k Keeper) InitiateDKG(ctx sdk.Context, participants []*types.DKGParticipan } } + if disableBridge { + k.DisableBridge(ctx) + } + req := &types.DKGRequest{ - Id: k.GetNextDKGRequestID(ctx), - Participants: participants, - Threshold: threshold, - VaultTypes: vaultTypes, - Expiration: k.GetDKGRequestExpirationTime(ctx), - Status: types.DKGRequestStatus_DKG_REQUEST_STATUS_PENDING, + Id: k.GetNextDKGRequestID(ctx), + Participants: participants, + Threshold: threshold, + VaultTypes: vaultTypes, + DisableBridge: disableBridge, + EnableTransfer: enableTransfer, + TargetUtxoNum: targetUtxoNum, + FeeRate: feeRate, + Expiration: k.GetDKGRequestExpirationTime(ctx), + Status: types.DKGRequestStatus_DKG_REQUEST_STATUS_PENDING, } k.SetDKGRequest(ctx, req) @@ -248,7 +256,7 @@ func (k Keeper) CompleteDKG(ctx sdk.Context, req *types.DKGCompletionRequest) er } // TransferVault performs the vault asset transfer from the source version to the destination version -func (k Keeper) TransferVault(ctx sdk.Context, sourceVersion uint64, destVersion uint64, assetType types.AssetType, psbts []string) error { +func (k Keeper) TransferVault(ctx sdk.Context, sourceVersion uint64, destVersion uint64, assetType types.AssetType, psbts []string, targetUtxoNum uint32, feeRate string) error { sourceVault := k.GetVaultByAssetTypeAndVersion(ctx, assetType, sourceVersion) if sourceVault == nil { return types.ErrVaultDoesNotExist @@ -259,29 +267,55 @@ func (k Keeper) TransferVault(ctx sdk.Context, sourceVersion uint64, destVersion return types.ErrVaultDoesNotExist } - for i := range psbts { - p, _ := psbt.NewFromRawBytes(bytes.NewReader([]byte(psbts[i])), true) + // handle pre-built psbts if any + if len(psbts) > 0 { + for i := range psbts { + p, _ := psbt.NewFromRawBytes(bytes.NewReader([]byte(psbts[i])), true) - if err := k.handleTransferTx(ctx, p, sourceVault, destVault, assetType); err != nil { - return err + if err := k.handleTransferVaultTx(ctx, p, sourceVault, destVault, assetType); err != nil { + return err + } + + signingReq := &types.BitcoinWithdrawRequest{ + Address: k.authority, + Sequence: k.IncrementRequestSequence(ctx), + Txid: p.UnsignedTx.TxHash().String(), + Psbt: psbts[i], + Status: types.WithdrawStatus_WITHDRAW_STATUS_CREATED, + } + + k.SetWithdrawRequest(ctx, signingReq) } - signingReq := &types.BitcoinWithdrawRequest{ - Address: k.authority, - Sequence: k.IncrementRequestSequence(ctx), - Txid: p.UnsignedTx.TxHash().String(), - Psbt: psbts[i], - Status: types.WithdrawStatus_WITHDRAW_STATUS_CREATED, + return nil + } + + parsedFeeRate, _ := strconv.ParseInt(feeRate, 10, 64) + + var err error + var signingReq *types.BitcoinWithdrawRequest + + switch assetType { + case types.AssetType_ASSET_TYPE_BTC: + signingReq, err = k.BuildTransferVaultBtcSigningRequest(ctx, sourceVault, destVault, targetUtxoNum, parsedFeeRate) + if err != nil { + return err } - k.SetWithdrawRequest(ctx, signingReq) + case types.AssetType_ASSET_TYPE_RUNES: + signingReq, err = k.BuildTransferVaultRunesSigningRequest(ctx, sourceVault, destVault, targetUtxoNum, parsedFeeRate) + if err != nil { + return err + } } + k.SetWithdrawRequest(ctx, signingReq) + return nil } -// handleTransferTx handles the specified tx for the vault transfer -func (k Keeper) handleTransferTx(ctx sdk.Context, p *psbt.Packet, sourceVault, destVault *types.Vault, assetType types.AssetType) error { +// handleTransferVaultTx handles the pre-built tx for the vault transfer +func (k Keeper) handleTransferVaultTx(ctx sdk.Context, p *psbt.Packet, sourceVault, destVault *types.Vault, assetType types.AssetType) error { txHash := p.UnsignedTx.TxHash().String() if assetType == types.AssetType_ASSET_TYPE_RUNES { @@ -325,6 +359,8 @@ func (k Keeper) handleTransferTx(ctx sdk.Context, p *psbt.Packet, sourceVault, d if assetType == types.AssetType_ASSET_TYPE_RUNES && vault.AssetType == types.AssetType_ASSET_TYPE_RUNES { runeBalances = append(runeBalances, utxo.Runes...) } + + _ = k.LockUTXO(ctx, hash, uint64(vout)) } for i, out := range p.UnsignedTx.TxOut { @@ -379,9 +415,125 @@ func (k Keeper) handleTransferTx(ctx sdk.Context, p *psbt.Packet, sourceVault, d } } + // mark minted + k.addToMintHistory(ctx, p.UnsignedTx.TxHash().String()) + return nil } +// BuildTransferVaultBtcSigningRequest builds the signing request to transfer btc of the given vault +func (k Keeper) BuildTransferVaultBtcSigningRequest(ctx sdk.Context, sourceVault *types.Vault, destVault *types.Vault, targetUtxoNum uint32, feeRate int64) (*types.BitcoinWithdrawRequest, error) { + utxos := make([]*types.UTXO, 0) + + k.IterateUTXOsByAddr(ctx, sourceVault.Address, func(addr string, utxo *types.UTXO) (stop bool) { + if utxo.IsLocked { + return false + } + + utxos = append(utxos, utxo) + + return len(utxos) >= int(targetUtxoNum) + }) + + if len(utxos) == 0 { + return nil, types.ErrInsufficientUTXOs + } + + p, selectedUtxos, changeUtxo, err := types.BuildTransferAllBtcPsbt(utxos, destVault.Address, feeRate) + if err != nil { + return nil, err + } + + psbtB64, err := p.B64Encode() + if err != nil { + return nil, types.ErrFailToSerializePsbt + } + + // lock the involved utxos + _ = k.LockUTXOs(ctx, utxos) + _ = k.LockUTXOs(ctx, selectedUtxos) + + // save the change utxo and mark minted + if changeUtxo != nil { + k.saveUTXO(ctx, changeUtxo) + // mark minted + k.addToMintHistory(ctx, p.UnsignedTx.TxHash().String()) + } + + signingReq := &types.BitcoinWithdrawRequest{ + Address: k.authority, + Sequence: k.IncrementRequestSequence(ctx), + Txid: p.UnsignedTx.TxHash().String(), + Psbt: psbtB64, + Status: types.WithdrawStatus_WITHDRAW_STATUS_CREATED, + } + + return signingReq, nil +} + +// BuildTransferVaultRunesSigningRequest builds the signing request to transfer runes of the given vault +func (k Keeper) BuildTransferVaultRunesSigningRequest(ctx sdk.Context, sourceVault *types.Vault, destVault *types.Vault, targetUtxoNum uint32, feeRate int64) (*types.BitcoinWithdrawRequest, error) { + runesUtxos := make([]*types.UTXO, 0) + runeBalances := make(types.RuneBalances, 0) + + k.IterateUTXOsByAddr(ctx, sourceVault.Address, func(addr string, utxo *types.UTXO) (stop bool) { + if utxo.IsLocked { + return false + } + + runesUtxos = append(runesUtxos, utxo) + runeBalances = append(runeBalances, utxo.Runes...) + + return len(runesUtxos) >= int(targetUtxoNum) + }) + + if len(runesUtxos) == 0 { + return nil, types.ErrInsufficientUTXOs + } + + sourceBtcVault := k.GetVaultByAssetTypeAndVersion(ctx, types.AssetType_ASSET_TYPE_BTC, sourceVault.Version).Address + destBtcVault := k.GetVaultByAssetTypeAndVersion(ctx, types.AssetType_ASSET_TYPE_BTC, destVault.Version).Address + + btcUtxoIterator := k.GetUTXOIteratorByAddr(ctx, sourceBtcVault) + + p, selectedUtxos, changeUtxo, runesChangeUtxo, err := types.BuildTransferAllRunesPsbt(runesUtxos, btcUtxoIterator, destBtcVault, runeBalances.Compact(), feeRate, destBtcVault) + if err != nil { + return nil, err + } + + psbtB64, err := p.B64Encode() + if err != nil { + return nil, types.ErrFailToSerializePsbt + } + + // lock the involved utxos + _ = k.LockUTXOs(ctx, runesUtxos) + _ = k.LockUTXOs(ctx, selectedUtxos) + + // save the change utxo and mark minted + if changeUtxo != nil { + k.saveUTXO(ctx, changeUtxo) + // mark minted + k.addToMintHistory(ctx, p.UnsignedTx.TxHash().String()) + } + + // save the runes change utxo and mark minted + if runesChangeUtxo != nil { + k.saveUTXO(ctx, runesChangeUtxo) + k.addToMintHistory(ctx, p.UnsignedTx.TxHash().String()) + } + + signingReq := &types.BitcoinWithdrawRequest{ + Address: k.authority, + Sequence: k.IncrementRequestSequence(ctx), + Txid: p.UnsignedTx.TxHash().String(), + Psbt: psbtB64, + Status: types.WithdrawStatus_WITHDRAW_STATUS_CREATED, + } + + return signingReq, nil +} + // CheckVaults checks if the provided vaults are valid func (k Keeper) CheckVaults(ctx sdk.Context, vaults []string, vaultTypes []types.AssetType) error { currentVaults := k.GetParams(ctx).Vaults diff --git a/x/btcbridge/keeper/utxo.go b/x/btcbridge/keeper/utxo.go index 8f864bb3..29feea0d 100644 --- a/x/btcbridge/keeper/utxo.go +++ b/x/btcbridge/keeper/utxo.go @@ -134,7 +134,7 @@ func (bvk *BaseUTXOViewKeeper) GetUnlockedUTXOsByAddr(ctx sdk.Context, addr stri } // GetOrderedUTXOsByAddr gets all unlocked utxos of the given address in the descending order by amount -// Note: high gas is required due to sort +// Note: high gas is required due to sorting func (bvk *BaseUTXOViewKeeper) GetOrderedUTXOsByAddr(ctx sdk.Context, addr string) []*types.UTXO { // get unlocked utxos utxos := bvk.GetUnlockedUTXOsByAddr(ctx, addr) @@ -178,6 +178,24 @@ func (bvk *BaseUTXOViewKeeper) GetTargetRunesUTXOs(ctx sdk.Context, addr string, return utxos, runeBalancesDelta } +func (bvk *BaseUTXOViewKeeper) GetUnlockedUTXOCountAndBalancesByAddr(ctx sdk.Context, addr string) (uint32, int64, []*types.RuneBalance) { + count := uint32(0) + value := int64(0) + runeBalances := make(types.RuneBalances, 0) + + bvk.IterateUTXOsByAddr(ctx, addr, func(addr string, utxo *types.UTXO) (stop bool) { + if !utxo.IsLocked { + count += 1 + value += int64(utxo.Amount) + runeBalances = append(runeBalances, utxo.Runes...) + } + + return false + }) + + return count, value, runeBalances.Compact() +} + func (bvk *BaseUTXOViewKeeper) IterateAllUTXOs(ctx sdk.Context, cb func(utxo *types.UTXO) (stop bool)) { store := ctx.KVStore(bvk.storeKey) diff --git a/x/btcbridge/types/bitcoin.go b/x/btcbridge/types/bitcoin.go index d394b6a5..7ec498de 100644 --- a/x/btcbridge/types/bitcoin.go +++ b/x/btcbridge/types/bitcoin.go @@ -69,6 +69,42 @@ func BuildPsbt(utxoIterator UTXOIterator, recipient string, amount int64, feeRat return p, selectedUTXOs, changeUTXO, nil } +// BuildTransferAllBtcPsbt builds a bitcoin psbt to transfer all given btc. +// Assume that the utxo script type is witness. +func BuildTransferAllBtcPsbt(utxos []*UTXO, recipient string, feeRate int64) (*psbt.Packet, []*UTXO, *UTXO, error) { + chaincfg := sdk.GetConfig().GetBtcChainCfg() + + recipientAddr, err := btcutil.DecodeAddress(recipient, chaincfg) + if err != nil { + return nil, nil, nil, err + } + + recipientPkScript, err := txscript.PayToAddrScript(recipientAddr) + if err != nil { + return nil, nil, nil, err + } + + txOuts := make([]*wire.TxOut, 0) + txOuts = append(txOuts, wire.NewTxOut(0, recipientPkScript)) + + unsignedTx, selectedUTXOs, err := BuildUnsignedTransactionWithoutExtraChange([]*UTXO{}, txOuts, utxos, feeRate) + if err != nil { + return nil, nil, nil, err + } + + p, err := psbt.NewFromUnsignedTx(unsignedTx) + if err != nil { + return nil, nil, nil, err + } + + for i, utxo := range selectedUTXOs { + p.Inputs[i].SighashType = DefaultSigHashType + p.Inputs[i].WitnessUtxo = wire.NewTxOut(int64(utxo.Amount), utxo.PubKeyScript) + } + + return p, selectedUTXOs, GetChangeUTXO(unsignedTx, recipient), nil +} + // BuildRunesPsbt builds a bitcoin psbt for runes edict from the given params. // Assume that the utxo script type is witness. func BuildRunesPsbt(utxos []*UTXO, paymentUTXOIterator UTXOIterator, recipient string, runeId string, amount uint128.Uint128, feeRate int64, runeBalancesDelta []*RuneBalance, runesChange string, change string) (*psbt.Packet, []*UTXO, *UTXO, *UTXO, error) { @@ -108,7 +144,7 @@ func BuildRunesPsbt(utxos []*UTXO, paymentUTXOIterator UTXOIterator, recipient s edictOutputIndex := uint32(1) if len(runeBalancesDelta) > 0 { - runesChangeUTXO = GetRunesChangeUTXO(runeId, runeBalancesDelta, runesChange, runesChangePkScript, 1) + runesChangeUTXO = GetRunesChangeUTXO(runeBalancesDelta, runesChange, runesChangePkScript, 1) // allocate the remaining runes to the first non-OP_RETURN output by default txOuts = append(txOuts, wire.NewTxOut(RunesOutValue, runesChangePkScript)) @@ -155,6 +191,60 @@ func BuildRunesPsbt(utxos []*UTXO, paymentUTXOIterator UTXOIterator, recipient s return p, selectedUTXOs, changeUTXO, runesChangeUTXO, nil } +// BuildTransferAllRunesPsbt builds a bitcoin psbt to transfer all specified runes. +// Assume that the utxo script type is witness. +func BuildTransferAllRunesPsbt(utxos []*UTXO, paymentUTXOIterator UTXOIterator, recipient string, runeBalancesDelta []*RuneBalance, feeRate int64, btcChange string) (*psbt.Packet, []*UTXO, *UTXO, *UTXO, error) { + chaincfg := sdk.GetConfig().GetBtcChainCfg() + + recipientAddr, err := btcutil.DecodeAddress(recipient, chaincfg) + if err != nil { + return nil, nil, nil, nil, err + } + + recipientPkScript, err := txscript.PayToAddrScript(recipientAddr) + if err != nil { + return nil, nil, nil, nil, err + } + + changeAddr, err := btcutil.DecodeAddress(btcChange, chaincfg) + if err != nil { + return nil, nil, nil, nil, err + } + + txOuts := make([]*wire.TxOut, 0) + + // fill the runes protocol script without payload + txOuts = append(txOuts, wire.NewTxOut(0, []byte{txscript.OP_RETURN, txscript.OP_13})) + + // allocate the remaining runes to the first non-OP_RETURN output by default + txOuts = append(txOuts, wire.NewTxOut(RunesOutValue, recipientPkScript)) + + unsignedTx, selectedUTXOs, changeUTXO, err := BuildUnsignedTransaction(utxos, txOuts, paymentUTXOIterator, feeRate, changeAddr) + if err != nil { + return nil, nil, nil, nil, err + } + + p, err := psbt.NewFromUnsignedTx(unsignedTx) + if err != nil { + return nil, nil, nil, nil, err + } + + runesChangeUTXO := GetRunesChangeUTXO(runeBalancesDelta, recipient, recipientPkScript, 1) + runesChangeUTXO.Txid = unsignedTx.TxHash().String() + + for i, utxo := range utxos { + p.Inputs[i].SighashType = DefaultSigHashType + p.Inputs[i].WitnessUtxo = wire.NewTxOut(int64(utxo.Amount), utxo.PubKeyScript) + } + + for i, utxo := range selectedUTXOs { + p.Inputs[i+len(utxos)].SighashType = DefaultSigHashType + p.Inputs[i+len(utxos)].WitnessUtxo = wire.NewTxOut(int64(utxo.Amount), utxo.PubKeyScript) + } + + return p, selectedUTXOs, changeUTXO, runesChangeUTXO, nil +} + // BuildUnsignedTransaction builds an unsigned tx from the given params. func BuildUnsignedTransaction(utxos []*UTXO, txOuts []*wire.TxOut, paymentUTXOIterator UTXOIterator, feeRate int64, change btcutil.Address) (*wire.MsgTx, []*UTXO, *UTXO, error) { tx := wire.NewMsgTx(TxVersion) @@ -188,7 +278,7 @@ func BuildUnsignedTransaction(utxos []*UTXO, txOuts []*wire.TxOut, paymentUTXOIt return nil, nil, nil, err } - if err := CheckTransactionWeight(tx); err != nil { + if err := CheckTransactionWeight(tx, append(utxos, selectedUTXOs...)); err != nil { return nil, nil, nil, err } @@ -200,6 +290,52 @@ func BuildUnsignedTransaction(utxos []*UTXO, txOuts []*wire.TxOut, paymentUTXOIt return tx, selectedUTXOs, changeUTXO, nil } +// BuildUnsignedTransactionWithoutExtraChange builds an unsigned tx from the given params. +// All payment utxos will be spent and the last out is the recipient (and change) out. +func BuildUnsignedTransactionWithoutExtraChange(utxos []*UTXO, txOuts []*wire.TxOut, paymentUTXOs []*UTXO, feeRate int64) (*wire.MsgTx, []*UTXO, error) { + tx := wire.NewMsgTx(TxVersion) + + inAmount := int64(0) + outAmount := int64(0) + + for _, utxo := range utxos { + AddUTXOToTx(tx, utxo) + inAmount += int64(utxo.Amount) + } + + for _, utxo := range paymentUTXOs { + AddUTXOToTx(tx, utxo) + inAmount += int64(utxo.Amount) + } + + for i, txOut := range txOuts { + if i != len(txOuts)-1 && IsDustOut(txOut) { + return nil, nil, ErrDustOutput + } + + tx.AddTxOut(txOut) + outAmount += txOut.Value + } + + fee := GetTxVirtualSize(tx, append(utxos, paymentUTXOs...)) * feeRate + + change := inAmount - outAmount - fee + if change <= 0 { + return nil, nil, ErrInsufficientUTXOs + } + + txOuts[len(txOuts)-1].Value += change + if IsDustOut(txOuts[len(txOuts)-1]) { + return nil, nil, ErrDustOutput + } + + if err := CheckTransactionWeight(tx, append(utxos, paymentUTXOs...)); err != nil { + return nil, nil, err + } + + return tx, paymentUTXOs, nil +} + // AddPaymentUTXOsToTx adds the given payment utxos to the tx. func AddPaymentUTXOsToTx(tx *wire.MsgTx, utxos []*UTXO, inOutDiff int64, paymentUTXOIterator UTXOIterator, changeOut *wire.TxOut, feeRate int64) ([]*UTXO, error) { selectedUTXOs := make([]*UTXO, 0) @@ -280,7 +416,7 @@ func GetChangeUTXO(tx *wire.MsgTx, change string) *UTXO { } // GetRunesChangeUTXO gets the runes change utxo. -func GetRunesChangeUTXO(runeId string, runeBalancesDelta []*RuneBalance, change string, changePkScript []byte, outIndex uint32) *UTXO { +func GetRunesChangeUTXO(runeBalancesDelta []*RuneBalance, change string, changePkScript []byte, outIndex uint32) *UTXO { return &UTXO{ Vout: uint64(outIndex), Address: change, @@ -291,46 +427,66 @@ func GetRunesChangeUTXO(runeId string, runeBalancesDelta []*RuneBalance, change } // GetTxVirtualSize gets the virtual size of the given tx. -// Assume that the utxo script type is p2tr, p2wpkh, p2sh-p2wpkh or p2pkh. func GetTxVirtualSize(tx *wire.MsgTx, utxos []*UTXO) int64 { + newTx := PopulateTxWithDummyWitness(tx, utxos) + + return mempool.GetTxVirtualSize(btcutil.NewTx(newTx)) +} + +// CheckTransactionWeight checks if the weight of the given tx exceeds the allowed maximum weight +func CheckTransactionWeight(tx *wire.MsgTx, utxos []*UTXO) error { + newTx := PopulateTxWithDummyWitness(tx, utxos) + + weight := blockchain.GetTransactionWeight(btcutil.NewTx(newTx)) + if weight > MaxTransactionWeight { + return ErrMaxTransactionWeightExceeded + } + + return nil +} + +// PopulateTxWithDummyWitness populates the given tx with the dummy witness +// Assume that the utxo script type is the witness type. +// If utxos are not provided, the witness type is defaulted to taproot +func PopulateTxWithDummyWitness(tx *wire.MsgTx, utxos []*UTXO) *wire.MsgTx { + if len(utxos) == 0 { + return PopulateTxWithDummyTaprootWitness(tx) + } + newTx := tx.Copy() for i, txIn := range newTx.TxIn { - var dummySigScript []byte var dummyWitness []byte switch txscript.GetScriptClass(utxos[i].PubKeyScript) { case txscript.WitnessV1TaprootTy: + // maximum size when the sig hash is not SigHashDefault dummyWitness = make([]byte, 65) case txscript.WitnessV0PubKeyHashTy: dummyWitness = make([]byte, 73+33) - case txscript.ScriptHashTy: - dummySigScript = make([]byte, 1+1+1+20) - dummyWitness = make([]byte, 73+33) - - case txscript.PubKeyHashTy: - dummySigScript = make([]byte, 1+73+1+33) - default: } - txIn.SignatureScript = dummySigScript txIn.Witness = wire.TxWitness{dummyWitness} } - return mempool.GetTxVirtualSize(btcutil.NewTx(newTx)) + return newTx } -// CheckTransactionWeight checks if the weight of the given tx exceeds the allowed maximum weight -func CheckTransactionWeight(tx *wire.MsgTx) error { - weight := blockchain.GetTransactionWeight(btcutil.NewTx(tx)) - if weight > MaxTransactionWeight { - return ErrMaxTransactionWeightExceeded +// PopulateTxWithDummyTaprootWitness populates the given tx with the dummy taproot witness +func PopulateTxWithDummyTaprootWitness(tx *wire.MsgTx) *wire.MsgTx { + newTx := tx.Copy() + + for _, txIn := range newTx.TxIn { + // maximum size when the sig hash is not SigHashDefault + dummyWitness := make([]byte, 65) + + txIn.Witness = wire.TxWitness{dummyWitness} } - return nil + return newTx } // IsDustOut returns true if the given output is dust, false otherwise diff --git a/x/btcbridge/types/btcbridge.pb.go b/x/btcbridge/types/btcbridge.pb.go index 0dedf38f..e0a1ab09 100644 --- a/x/btcbridge/types/btcbridge.pb.go +++ b/x/btcbridge/types/btcbridge.pb.go @@ -642,10 +642,18 @@ type DKGRequest struct { Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` // asset types of vaults to be generated VaultTypes []AssetType `protobuf:"varint,4,rep,packed,name=vault_types,json=vaultTypes,proto3,enum=side.btcbridge.AssetType" json:"vault_types,omitempty"` + // indicates if disabling bridge deposit and withdrawal + DisableBridge bool `protobuf:"varint,5,opt,name=disable_bridge,json=disableBridge,proto3" json:"disable_bridge,omitempty"` + // indicates if transferring assets to the newly generated vaults when the DKG request is completed + EnableTransfer bool `protobuf:"varint,6,opt,name=enable_transfer,json=enableTransfer,proto3" json:"enable_transfer,omitempty"` + // target number of the UTXOs to be transferred each time + TargetUtxoNum uint32 `protobuf:"varint,7,opt,name=target_utxo_num,json=targetUtxoNum,proto3" json:"target_utxo_num,omitempty"` + // fee rate for vault transfer + FeeRate string `protobuf:"bytes,8,opt,name=fee_rate,json=feeRate,proto3" json:"fee_rate,omitempty"` // expiration time - Expiration *time.Time `protobuf:"bytes,5,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` + Expiration *time.Time `protobuf:"bytes,9,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` // status - Status DKGRequestStatus `protobuf:"varint,6,opt,name=status,proto3,enum=side.btcbridge.DKGRequestStatus" json:"status,omitempty"` + Status DKGRequestStatus `protobuf:"varint,10,opt,name=status,proto3,enum=side.btcbridge.DKGRequestStatus" json:"status,omitempty"` } func (m *DKGRequest) Reset() { *m = DKGRequest{} } @@ -709,6 +717,34 @@ func (m *DKGRequest) GetVaultTypes() []AssetType { return nil } +func (m *DKGRequest) GetDisableBridge() bool { + if m != nil { + return m.DisableBridge + } + return false +} + +func (m *DKGRequest) GetEnableTransfer() bool { + if m != nil { + return m.EnableTransfer + } + return false +} + +func (m *DKGRequest) GetTargetUtxoNum() uint32 { + if m != nil { + return m.TargetUtxoNum + } + return 0 +} + +func (m *DKGRequest) GetFeeRate() string { + if m != nil { + return m.FeeRate + } + return "" +} + func (m *DKGRequest) GetExpiration() *time.Time { if m != nil { return m.Expiration @@ -822,73 +858,79 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/btcbridge.proto", fileDescriptor_9ff68b16012a2359) } var fileDescriptor_9ff68b16012a2359 = []byte{ - // 1052 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xcb, 0x6e, 0x23, 0x45, - 0x14, 0x4d, 0xfb, 0x35, 0xf6, 0x75, 0xc6, 0x78, 0x8a, 0xc8, 0x38, 0xce, 0xe0, 0x58, 0x16, 0x42, - 0x61, 0x90, 0xda, 0x4a, 0x10, 0x08, 0xb1, 0xb3, 0xd3, 0x9d, 0xc4, 0xca, 0x93, 0xb2, 0xa3, 0x20, - 0x36, 0xad, 0x7e, 0x14, 0x76, 0x29, 0x76, 0x57, 0xd3, 0x55, 0x1d, 0x9c, 0x2d, 0x5f, 0x30, 0xbf, - 0xc0, 0x96, 0x05, 0x6b, 0xc4, 0x17, 0xcc, 0x72, 0x96, 0xac, 0x00, 0x25, 0x7b, 0x56, 0x7c, 0x00, - 0xaa, 0xea, 0x6e, 0xc7, 0xf6, 0x18, 0x76, 0xf7, 0xdc, 0x7b, 0xaa, 0xee, 0xe3, 0xdc, 0xae, 0x86, - 0x26, 0xa7, 0x1e, 0xe9, 0x38, 0xc2, 0x75, 0x42, 0xea, 0x8d, 0x16, 0x2c, 0x3d, 0x08, 0x99, 0x60, - 0xa8, 0x22, 0xe3, 0xfa, 0xdc, 0xdb, 0xd8, 0x1a, 0xb1, 0x11, 0x53, 0xa1, 0x8e, 0xb4, 0x62, 0x56, - 0x63, 0x7b, 0xc4, 0xd8, 0x68, 0x42, 0x3a, 0x0a, 0x39, 0x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de, 0x76, 0xeb, 0x7d, 0x5b, 0x08, 0x00, 0x00, + // 1141 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0x4f, 0x6f, 0x1a, 0xc7, + 0x1b, 0xf6, 0x02, 0x26, 0xf0, 0x12, 0x13, 0x32, 0xbf, 0x88, 0x1f, 0xc6, 0x29, 0x46, 0xa8, 0x4d, + 0xdd, 0x54, 0x02, 0xc5, 0x55, 0xab, 0xaa, 0x37, 0xf0, 0x6e, 0x1c, 0xe4, 0xc4, 0x76, 0x07, 0x50, + 0xaa, 0x5e, 0x56, 0xb3, 0xbb, 0x63, 0x58, 0x19, 0x76, 0xb6, 0x33, 0xb3, 0x2e, 0xbe, 0xf6, 0x13, + 0xe4, 0x2b, 0xf4, 0xda, 0x43, 0xcf, 0xfd, 0x08, 0xb9, 0x54, 0xca, 0xb1, 0xa7, 0xb6, 0xb2, 0xef, + 0x3d, 0xf5, 0x03, 0x54, 0x33, 0xbb, 0x8b, 0x81, 0xd0, 0xde, 0xde, 0xf7, 0x79, 0x9f, 0xd9, 0xf7, + 0xdf, 0xc3, 0x2b, 0xa0, 0x21, 0x7c, 0x8f, 0x76, 0x1c, 0xe9, 0x3a, 0xdc, 0xf7, 0xc6, 0x4b, 0x56, + 0x3b, 0xe4, 0x4c, 0x32, 0x54, 0x56, 0xf1, 0xf6, 0x02, 0xad, 0x3f, 0x1a, 0xb3, 0x31, 0xd3, 0xa1, + 0x8e, 0xb2, 0x62, 0x56, 0x7d, 0x77, 0xcc, 0xd8, 0x78, 0x4a, 0x3b, 0xda, 0x73, 0xa2, 0x8b, 0x0e, + 0x09, 0xae, 0x93, 0xd0, 0xfe, 0x7a, 0x48, 0xfa, 0x33, 0x2a, 0x24, 0x99, 0x85, 0x09, 0xa1, 0xe1, + 0x32, 0x31, 0x63, 0xa2, 0xe3, 0x10, 0x41, 0x3b, 0x57, 0xcf, 0x1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e, 0x1a, 0xc6, 0x9f, 0x37, 0x0d, 0xe3, 0xcd, 0x6d, 0x63, + 0xeb, 0xdd, 0x6d, 0x63, 0xeb, 0xb7, 0xdb, 0xc6, 0xd6, 0xb7, 0xed, 0xb1, 0x2f, 0x27, 0x91, 0xd3, + 0x76, 0xd9, 0xac, 0xa3, 0x94, 0xa5, 0x85, 0xe9, 0xb2, 0xa9, 0x76, 0x3a, 0xf3, 0xa5, 0xbf, 0x04, + 0xfa, 0x57, 0xe9, 0xe4, 0x35, 0xe1, 0xb3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x31, 0x3c, + 0x13, 0xee, 0x08, 0x00, 0x00, } func (m *BlockHeader) Marshal() (dAtA []byte, err error) { @@ -1288,7 +1330,7 @@ func (m *DKGRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Status != 0 { i = encodeVarintBtcbridge(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x50 } if m.Expiration != nil { n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) @@ -1298,7 +1340,39 @@ func (m *DKGRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n2 i = encodeVarintBtcbridge(dAtA, i, uint64(n2)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x4a + } + if len(m.FeeRate) > 0 { + i -= len(m.FeeRate) + copy(dAtA[i:], m.FeeRate) + i = encodeVarintBtcbridge(dAtA, i, uint64(len(m.FeeRate))) + i-- + dAtA[i] = 0x42 + } + if m.TargetUtxoNum != 0 { + i = encodeVarintBtcbridge(dAtA, i, uint64(m.TargetUtxoNum)) + i-- + dAtA[i] = 0x38 + } + if m.EnableTransfer { + i-- + if m.EnableTransfer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.DisableBridge { + i-- + if m.DisableBridge { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } if len(m.VaultTypes) > 0 { dAtA4 := make([]byte, len(m.VaultTypes)*10) @@ -1618,6 +1692,19 @@ func (m *DKGRequest) Size() (n int) { } n += 1 + sovBtcbridge(uint64(l)) + l } + if m.DisableBridge { + n += 2 + } + if m.EnableTransfer { + n += 2 + } + if m.TargetUtxoNum != 0 { + n += 1 + sovBtcbridge(uint64(m.TargetUtxoNum)) + } + l = len(m.FeeRate) + if l > 0 { + n += 1 + l + sovBtcbridge(uint64(l)) + } if m.Expiration != nil { l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) n += 1 + l + sovBtcbridge(uint64(l)) @@ -3036,6 +3123,97 @@ func (m *DKGRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: wrong wireType = %d for field VaultTypes", wireType) } case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableBridge", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBtcbridge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableBridge = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableTransfer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBtcbridge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableTransfer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetUtxoNum", wireType) + } + m.TargetUtxoNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBtcbridge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetUtxoNum |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBtcbridge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBtcbridge + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBtcbridge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) } @@ -3071,7 +3249,7 @@ func (m *DKGRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } diff --git a/x/btcbridge/types/message_initiate_dkg.go b/x/btcbridge/types/message_initiate_dkg.go index 723f9295..b52f5fa5 100644 --- a/x/btcbridge/types/message_initiate_dkg.go +++ b/x/btcbridge/types/message_initiate_dkg.go @@ -1,6 +1,8 @@ package types import ( + "strconv" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -71,5 +73,15 @@ func (m *MsgInitiateDKG) ValidateBasic() error { vaultTypes[t] = true } + if m.EnableTransfer { + if m.TargetUtxoNum == 0 { + return sdkerrors.Wrap(ErrInvalidDKGParams, "target number of utxos must be greater than 0") + } + + if feeRate, err := strconv.ParseInt(m.FeeRate, 10, 64); err != nil || feeRate <= 0 { + return ErrInvalidFeeRate + } + } + return nil } diff --git a/x/btcbridge/types/message_transfer_vault.go b/x/btcbridge/types/message_transfer_vault.go index 002084a4..ab020883 100644 --- a/x/btcbridge/types/message_transfer_vault.go +++ b/x/btcbridge/types/message_transfer_vault.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "strconv" "github.com/btcsuite/btcd/btcutil/psbt" @@ -46,17 +47,13 @@ func (m *MsgTransferVault) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid asset type") } - if len(m.Psbts) == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "psbt not provided") - } - for _, p := range m.Psbts { packet, err := psbt.NewFromRawBytes(bytes.NewReader([]byte(p)), true) if err != nil { return err } - if err := CheckTransactionWeight(packet.UnsignedTx); err != nil { + if err := CheckTransactionWeight(packet.UnsignedTx, nil); err != nil { return err } @@ -77,5 +74,15 @@ func (m *MsgTransferVault) ValidateBasic() error { } } + if len(m.Psbts) == 0 { + if m.TargetUtxoNum == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "target number of utxos must be greater than 0") + } + + if feeRate, err := strconv.ParseInt(m.FeeRate, 10, 64); err != nil || feeRate <= 0 { + return ErrInvalidFeeRate + } + } + return nil } diff --git a/x/btcbridge/types/query.pb.go b/x/btcbridge/types/query.pb.go index 0edf783a..6599c161 100644 --- a/x/btcbridge/types/query.pb.go +++ b/x/btcbridge/types/query.pb.go @@ -965,6 +965,120 @@ func (m *QueryUTXOsByAddressResponse) GetUtxos() []*UTXO { return nil } +// QueryUTXOCountAndBalancesByAddressRequest is the request type for the Query/UTXOCountAndBalancesByAddress RPC method. +type QueryUTXOCountAndBalancesByAddressRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryUTXOCountAndBalancesByAddressRequest) Reset() { + *m = QueryUTXOCountAndBalancesByAddressRequest{} +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryUTXOCountAndBalancesByAddressRequest) ProtoMessage() {} +func (*QueryUTXOCountAndBalancesByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{20} +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUTXOCountAndBalancesByAddressRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUTXOCountAndBalancesByAddressRequest.Merge(m, src) +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUTXOCountAndBalancesByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUTXOCountAndBalancesByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUTXOCountAndBalancesByAddressRequest proto.InternalMessageInfo + +func (m *QueryUTXOCountAndBalancesByAddressRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// QueryUTXOCountAndBalancesByAddressResponse is the response type for the Query/UTXOCountAndBalancesByAddress RPC method. +type QueryUTXOCountAndBalancesByAddressResponse struct { + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + RuneBalances []*RuneBalance `protobuf:"bytes,3,rep,name=runeBalances,proto3" json:"runeBalances,omitempty"` +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) Reset() { + *m = QueryUTXOCountAndBalancesByAddressResponse{} +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryUTXOCountAndBalancesByAddressResponse) ProtoMessage() {} +func (*QueryUTXOCountAndBalancesByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{21} +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUTXOCountAndBalancesByAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUTXOCountAndBalancesByAddressResponse.Merge(m, src) +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUTXOCountAndBalancesByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUTXOCountAndBalancesByAddressResponse proto.InternalMessageInfo + +func (m *QueryUTXOCountAndBalancesByAddressResponse) GetCount() uint32 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) GetValue() int64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) GetRuneBalances() []*RuneBalance { + if m != nil { + return m.RuneBalances + } + return nil +} + // QueryDKGRequestRequest is the request type for the Query/DKGRequest RPC method. type QueryDKGRequestRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -974,7 +1088,7 @@ func (m *QueryDKGRequestRequest) Reset() { *m = QueryDKGRequestRequest{} func (m *QueryDKGRequestRequest) String() string { return proto.CompactTextString(m) } func (*QueryDKGRequestRequest) ProtoMessage() {} func (*QueryDKGRequestRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{20} + return fileDescriptor_fb547edb49d5502d, []int{22} } func (m *QueryDKGRequestRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1019,7 +1133,7 @@ func (m *QueryDKGRequestResponse) Reset() { *m = QueryDKGRequestResponse func (m *QueryDKGRequestResponse) String() string { return proto.CompactTextString(m) } func (*QueryDKGRequestResponse) ProtoMessage() {} func (*QueryDKGRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{21} + return fileDescriptor_fb547edb49d5502d, []int{23} } func (m *QueryDKGRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1064,7 +1178,7 @@ func (m *QueryDKGRequestsRequest) Reset() { *m = QueryDKGRequestsRequest func (m *QueryDKGRequestsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDKGRequestsRequest) ProtoMessage() {} func (*QueryDKGRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{22} + return fileDescriptor_fb547edb49d5502d, []int{24} } func (m *QueryDKGRequestsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1109,7 +1223,7 @@ func (m *QueryDKGRequestsResponse) Reset() { *m = QueryDKGRequestsRespon func (m *QueryDKGRequestsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDKGRequestsResponse) ProtoMessage() {} func (*QueryDKGRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{23} + return fileDescriptor_fb547edb49d5502d, []int{25} } func (m *QueryDKGRequestsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1153,7 +1267,7 @@ func (m *QueryAllDKGRequestsRequest) Reset() { *m = QueryAllDKGRequestsR func (m *QueryAllDKGRequestsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllDKGRequestsRequest) ProtoMessage() {} func (*QueryAllDKGRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{24} + return fileDescriptor_fb547edb49d5502d, []int{26} } func (m *QueryAllDKGRequestsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1191,7 +1305,7 @@ func (m *QueryAllDKGRequestsResponse) Reset() { *m = QueryAllDKGRequests func (m *QueryAllDKGRequestsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllDKGRequestsResponse) ProtoMessage() {} func (*QueryAllDKGRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{25} + return fileDescriptor_fb547edb49d5502d, []int{27} } func (m *QueryAllDKGRequestsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1236,7 +1350,7 @@ func (m *QueryDKGCompletionRequestsRequest) Reset() { *m = QueryDKGCompl func (m *QueryDKGCompletionRequestsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDKGCompletionRequestsRequest) ProtoMessage() {} func (*QueryDKGCompletionRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{26} + return fileDescriptor_fb547edb49d5502d, []int{28} } func (m *QueryDKGCompletionRequestsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1281,7 +1395,7 @@ func (m *QueryDKGCompletionRequestsResponse) Reset() { *m = QueryDKGComp func (m *QueryDKGCompletionRequestsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDKGCompletionRequestsResponse) ProtoMessage() {} func (*QueryDKGCompletionRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb547edb49d5502d, []int{27} + return fileDescriptor_fb547edb49d5502d, []int{29} } func (m *QueryDKGCompletionRequestsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1338,6 +1452,8 @@ func init() { proto.RegisterType((*QueryUTXOsResponse)(nil), "side.btcbridge.QueryUTXOsResponse") proto.RegisterType((*QueryUTXOsByAddressRequest)(nil), "side.btcbridge.QueryUTXOsByAddressRequest") proto.RegisterType((*QueryUTXOsByAddressResponse)(nil), "side.btcbridge.QueryUTXOsByAddressResponse") + proto.RegisterType((*QueryUTXOCountAndBalancesByAddressRequest)(nil), "side.btcbridge.QueryUTXOCountAndBalancesByAddressRequest") + proto.RegisterType((*QueryUTXOCountAndBalancesByAddressResponse)(nil), "side.btcbridge.QueryUTXOCountAndBalancesByAddressResponse") proto.RegisterType((*QueryDKGRequestRequest)(nil), "side.btcbridge.QueryDKGRequestRequest") proto.RegisterType((*QueryDKGRequestResponse)(nil), "side.btcbridge.QueryDKGRequestResponse") proto.RegisterType((*QueryDKGRequestsRequest)(nil), "side.btcbridge.QueryDKGRequestsRequest") @@ -1351,87 +1467,94 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/query.proto", fileDescriptor_fb547edb49d5502d) } var fileDescriptor_fb547edb49d5502d = []byte{ - // 1276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0x4f, 0x6f, 0xdc, 0x44, - 0x14, 0xc0, 0xe3, 0x24, 0x4d, 0xdb, 0x09, 0x94, 0xf6, 0x35, 0x4d, 0x17, 0x27, 0x71, 0x36, 0x93, - 0x34, 0x59, 0xa5, 0x8d, 0x4d, 0xb2, 0x21, 0xa2, 0x12, 0x42, 0xed, 0x06, 0xd1, 0xa0, 0x4a, 0xb4, - 0xb8, 0xa9, 0x40, 0x5c, 0x8a, 0x77, 0x77, 0xb2, 0x6b, 0x65, 0xb3, 0xde, 0xda, 0xde, 0x26, 0xab, - 0x28, 0x17, 0x8e, 0x15, 0x07, 0x24, 0x90, 0xe0, 0x80, 0x04, 0xe2, 0xc0, 0x89, 0x2b, 0x12, 0x37, - 0xae, 0xbd, 0x20, 0x55, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x0f, 0x82, 0x3c, 0x7e, 0xf6, 0xae, 0xc7, - 0xf6, 0xae, 0x03, 0x39, 0x70, 0xe9, 0xda, 0x33, 0xef, 0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xa2, 0x47, 0xf0, 0x83, 0x84, 0xb7, - 0x46, 0x7c, 0x6a, 0x03, 0xb5, 0x2f, 0x47, 0x6c, 0x96, 0x94, 0xb5, 0xcc, 0xf2, 0x88, 0xbc, 0xc8, - 0x91, 0xf3, 0xa0, 0xf4, 0x41, 0xde, 0x61, 0x0c, 0x6c, 0x42, 0xba, 0xf7, 0x33, 0xcc, 0x25, 0xba, - 0xe9, 0x1d, 0x25, 0x64, 0xda, 0x4f, 0x04, 0x9d, 0xcf, 0x70, 0xe7, 0xd7, 0xe1, 0x9a, 0xe8, 0x9c, - 0x5f, 0xe4, 0xf0, 0xb5, 0x84, 0x33, 0x68, 0x74, 0x28, 0x80, 0xe5, 0x74, 0xd3, 0xb1, 0xa2, 0xbc, - 0x99, 0x49, 0x76, 0x50, 0x1b, 0xe2, 0x3c, 0x3d, 0x45, 0xf7, 0xb9, 0x44, 0x5e, 0x13, 0xee, 0x64, - 0x58, 0x4c, 0xf4, 0x14, 0x1b, 0x42, 0xe4, 0xa5, 0x81, 0x72, 0x48, 0x53, 0xe0, 0x34, 0x14, 0xf2, - 0x22, 0x4d, 0x75, 0xb7, 0x16, 0x96, 0xd1, 0xa1, 0x57, 0x41, 0xcf, 0x25, 0x72, 0x59, 0x1c, 0x11, - 0x60, 0x90, 0x9f, 0x30, 0x45, 0x85, 0xc1, 0x82, 0x83, 0x7a, 0x60, 0x0f, 0x11, 0x7c, 0x15, 0x9c, - 0x5a, 0x74, 0x7a, 0x48, 0x39, 0xb5, 0xc4, 0x01, 0x24, 0xe5, 0xd4, 0x92, 0xc7, 0x11, 0xba, 0xc0, - 0xa9, 0x14, 0x98, 0xee, 0x43, 0xe5, 0xc0, 0x2f, 0x12, 0x8e, 0x3c, 0x89, 0x83, 0x04, 0xac, 0xa6, - 0x25, 0x21, 0x75, 0x52, 0x91, 0xd7, 0x4e, 0xa3, 0x82, 0xac, 0x45, 0xce, 0xba, 0x02, 0x37, 0x93, - 0x58, 0x2b, 0xa1, 0x5e, 0xe4, 0x78, 0x4b, 0x5b, 0x2f, 0x8e, 0x15, 0xe9, 0xe5, 0xb1, 0x22, 0xfd, - 0x75, 0xac, 0x48, 0x5f, 0x9c, 0x28, 0x43, 0x2f, 0x4f, 0x94, 0xa1, 0x3f, 0x4e, 0x94, 0xa1, 0x4f, - 0xd4, 0x9a, 0xe9, 0xd6, 0xdb, 0x65, 0xb5, 0x62, 0xed, 0x71, 0x83, 0xfc, 0xaf, 0x35, 0x15, 0xab, - 0xe1, 0x5b, 0x3f, 0xe8, 0xbd, 0xe5, 0x3b, 0x2d, 0xe6, 0x94, 0xc7, 0xb8, 0x40, 0xf1, 0x9f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xc7, 0x85, 0xbe, 0x13, 0x99, 0x12, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0xdb, 0x97, 0xb6, 0x94, 0xd7, 0x34, 0x5d, 0x9c, 0x74, 0xbb, 0x9d, + 0xa6, 0x49, 0x48, 0x1b, 0x9b, 0x26, 0x21, 0xa2, 0x08, 0x41, 0xbb, 0x01, 0x1a, 0x54, 0x89, 0x16, + 0xb7, 0x15, 0x88, 0x4b, 0x99, 0xdd, 0x9d, 0xec, 0x5a, 0xd9, 0xac, 0xb7, 0xb6, 0xb7, 0x4d, 0x14, + 0xe5, 0xc2, 0xb1, 0xe2, 0x80, 0x04, 0x12, 0x42, 0x42, 0x02, 0x71, 0xe0, 0xc4, 0x15, 0x89, 0x1b, + 0xd7, 0x0a, 0x09, 0xa9, 0x12, 0x17, 0x4e, 0x08, 0xb5, 0xf0, 0x7f, 0x20, 0x8f, 0x9f, 0xbd, 0xbb, + 0x63, 0x7b, 0x77, 0x53, 0x7a, 0xe0, 0xd2, 0xd8, 0x9e, 0xf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x73, 0xab, 0x49, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1466,6 +1589,8 @@ type QueryClient interface { QueryUTXOs(ctx context.Context, in *QueryUTXOsRequest, opts ...grpc.CallOption) (*QueryUTXOsResponse, error) // QueryUTXOsByAddress queries the utxos of the given address. QueryUTXOsByAddress(ctx context.Context, in *QueryUTXOsByAddressRequest, opts ...grpc.CallOption) (*QueryUTXOsByAddressResponse, error) + // QueryUTXOCountAndBalancesByAddress queries the total count and balances of the unlocked utxos by the given address. + QueryUTXOCountAndBalancesByAddress(ctx context.Context, in *QueryUTXOCountAndBalancesByAddressRequest, opts ...grpc.CallOption) (*QueryUTXOCountAndBalancesByAddressResponse, error) // QueryDKGRequest queries the DKG request by the given id. QueryDKGRequest(ctx context.Context, in *QueryDKGRequestRequest, opts ...grpc.CallOption) (*QueryDKGRequestResponse, error) // QueryDKGRequests queries the DKG requests by the given status @@ -1574,6 +1699,15 @@ func (c *queryClient) QueryUTXOsByAddress(ctx context.Context, in *QueryUTXOsByA return out, nil } +func (c *queryClient) QueryUTXOCountAndBalancesByAddress(ctx context.Context, in *QueryUTXOCountAndBalancesByAddressRequest, opts ...grpc.CallOption) (*QueryUTXOCountAndBalancesByAddressResponse, error) { + out := new(QueryUTXOCountAndBalancesByAddressResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryUTXOCountAndBalancesByAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueryDKGRequest(ctx context.Context, in *QueryDKGRequestRequest, opts ...grpc.CallOption) (*QueryDKGRequestResponse, error) { out := new(QueryDKGRequestResponse) err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryDKGRequest", in, out, opts...) @@ -1632,6 +1766,8 @@ type QueryServer interface { QueryUTXOs(context.Context, *QueryUTXOsRequest) (*QueryUTXOsResponse, error) // QueryUTXOsByAddress queries the utxos of the given address. QueryUTXOsByAddress(context.Context, *QueryUTXOsByAddressRequest) (*QueryUTXOsByAddressResponse, error) + // QueryUTXOCountAndBalancesByAddress queries the total count and balances of the unlocked utxos by the given address. + QueryUTXOCountAndBalancesByAddress(context.Context, *QueryUTXOCountAndBalancesByAddressRequest) (*QueryUTXOCountAndBalancesByAddressResponse, error) // QueryDKGRequest queries the DKG request by the given id. QueryDKGRequest(context.Context, *QueryDKGRequestRequest) (*QueryDKGRequestResponse, error) // QueryDKGRequests queries the DKG requests by the given status @@ -1676,6 +1812,9 @@ func (*UnimplementedQueryServer) QueryUTXOs(ctx context.Context, req *QueryUTXOs func (*UnimplementedQueryServer) QueryUTXOsByAddress(ctx context.Context, req *QueryUTXOsByAddressRequest) (*QueryUTXOsByAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryUTXOsByAddress not implemented") } +func (*UnimplementedQueryServer) QueryUTXOCountAndBalancesByAddress(ctx context.Context, req *QueryUTXOCountAndBalancesByAddressRequest) (*QueryUTXOCountAndBalancesByAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUTXOCountAndBalancesByAddress not implemented") +} func (*UnimplementedQueryServer) QueryDKGRequest(ctx context.Context, req *QueryDKGRequestRequest) (*QueryDKGRequestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryDKGRequest not implemented") } @@ -1873,6 +2012,24 @@ func _Query_QueryUTXOsByAddress_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Query_QueryUTXOCountAndBalancesByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUTXOCountAndBalancesByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryUTXOCountAndBalancesByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Query/QueryUTXOCountAndBalancesByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryUTXOCountAndBalancesByAddress(ctx, req.(*QueryUTXOCountAndBalancesByAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_QueryDKGRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryDKGRequestRequest) if err := dec(in); err != nil { @@ -1989,6 +2146,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryUTXOsByAddress", Handler: _Query_QueryUTXOsByAddress_Handler, }, + { + MethodName: "QueryUTXOCountAndBalancesByAddress", + Handler: _Query_QueryUTXOCountAndBalancesByAddress_Handler, + }, { MethodName: "QueryDKGRequest", Handler: _Query_QueryDKGRequest_Handler, @@ -2696,6 +2857,83 @@ func (m *QueryUTXOsByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryUTXOCountAndBalancesByAddressRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryUTXOCountAndBalancesByAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUTXOCountAndBalancesByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RuneBalances) > 0 { + for iNdEx := len(m.RuneBalances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RuneBalances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Value != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 + } + if m.Count != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *QueryDKGRequestRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3238,6 +3476,40 @@ func (m *QueryUTXOsByAddressResponse) Size() (n int) { return n } +func (m *QueryUTXOCountAndBalancesByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryUTXOCountAndBalancesByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Count != 0 { + n += 1 + sovQuery(uint64(m.Count)) + } + if m.Value != 0 { + n += 1 + sovQuery(uint64(m.Value)) + } + if len(m.RuneBalances) > 0 { + for _, e := range m.RuneBalances { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryDKGRequestRequest) Size() (n int) { if m == nil { return 0 @@ -5100,6 +5372,210 @@ func (m *QueryUTXOsByAddressResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryUTXOCountAndBalancesByAddressRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryUTXOCountAndBalancesByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUTXOCountAndBalancesByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryUTXOCountAndBalancesByAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryUTXOCountAndBalancesByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUTXOCountAndBalancesByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuneBalances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuneBalances = append(m.RuneBalances, &RuneBalance{}) + if err := m.RuneBalances[len(m.RuneBalances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryDKGRequestRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/btcbridge/types/query.pb.gw.go b/x/btcbridge/types/query.pb.gw.go index ec854420..aedce448 100644 --- a/x/btcbridge/types/query.pb.gw.go +++ b/x/btcbridge/types/query.pb.gw.go @@ -447,6 +447,60 @@ func local_request_Query_QueryUTXOsByAddress_0(ctx context.Context, marshaler ru } +func request_Query_QueryUTXOCountAndBalancesByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUTXOCountAndBalancesByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.QueryUTXOCountAndBalancesByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUTXOCountAndBalancesByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUTXOCountAndBalancesByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.QueryUTXOCountAndBalancesByAddress(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_QueryDKGRequest_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDKGRequestRequest var metadata runtime.ServerMetadata @@ -845,6 +899,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryUTXOCountAndBalancesByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryUTXOCountAndBalancesByAddress_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUTXOCountAndBalancesByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryDKGRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1178,6 +1255,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryUTXOCountAndBalancesByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryUTXOCountAndBalancesByAddress_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUTXOCountAndBalancesByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryDKGRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1282,6 +1379,8 @@ var ( pattern_Query_QueryUTXOsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"side", "btcbridge", "utxos", "address"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_QueryUTXOCountAndBalancesByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"side", "btcbridge", "utxos", "address", "stats"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_QueryDKGRequest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"side", "btcbridge", "dkg", "request", "id"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_QueryDKGRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"side", "btcbridge", "dkg", "request"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1312,6 +1411,8 @@ var ( forward_Query_QueryUTXOsByAddress_0 = runtime.ForwardResponseMessage + forward_Query_QueryUTXOCountAndBalancesByAddress_0 = runtime.ForwardResponseMessage + forward_Query_QueryDKGRequest_0 = runtime.ForwardResponseMessage forward_Query_QueryDKGRequests_0 = runtime.ForwardResponseMessage diff --git a/x/btcbridge/types/tx.pb.go b/x/btcbridge/types/tx.pb.go index c28f893c..b6eba732 100644 --- a/x/btcbridge/types/tx.pb.go +++ b/x/btcbridge/types/tx.pb.go @@ -642,6 +642,14 @@ type MsgInitiateDKG struct { Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` // asset types of vaults to be generated VaultTypes []AssetType `protobuf:"varint,4,rep,packed,name=vault_types,json=vaultTypes,proto3,enum=side.btcbridge.AssetType" json:"vault_types,omitempty"` + // indicates if disabling bridge functionalities including deposit and withdrawal + DisableBridge bool `protobuf:"varint,5,opt,name=disable_bridge,json=disableBridge,proto3" json:"disable_bridge,omitempty"` + // indicates if transferring the current vaults to the newly generated vaults when the DKG request is completed + EnableTransfer bool `protobuf:"varint,6,opt,name=enable_transfer,json=enableTransfer,proto3" json:"enable_transfer,omitempty"` + // target number of the UTXOs to be transferred each time + TargetUtxoNum uint32 `protobuf:"varint,7,opt,name=target_utxo_num,json=targetUtxoNum,proto3" json:"target_utxo_num,omitempty"` + // fee rate for vault transfer + FeeRate string `protobuf:"bytes,8,opt,name=fee_rate,json=feeRate,proto3" json:"fee_rate,omitempty"` } func (m *MsgInitiateDKG) Reset() { *m = MsgInitiateDKG{} } @@ -705,6 +713,34 @@ func (m *MsgInitiateDKG) GetVaultTypes() []AssetType { return nil } +func (m *MsgInitiateDKG) GetDisableBridge() bool { + if m != nil { + return m.DisableBridge + } + return false +} + +func (m *MsgInitiateDKG) GetEnableTransfer() bool { + if m != nil { + return m.EnableTransfer + } + return false +} + +func (m *MsgInitiateDKG) GetTargetUtxoNum() uint32 { + if m != nil { + return m.TargetUtxoNum + } + return 0 +} + +func (m *MsgInitiateDKG) GetFeeRate() string { + if m != nil { + return m.FeeRate + } + return "" +} + // MsgInitiateDKGResponse defines the Msg/InitiateDKG response type. type MsgInitiateDKGResponse struct { } @@ -871,8 +907,12 @@ type MsgTransferVault struct { DestVersion uint64 `protobuf:"varint,3,opt,name=dest_version,json=destVersion,proto3" json:"dest_version,omitempty"` // asset type AssetType AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=side.btcbridge.AssetType" json:"asset_type,omitempty"` - // a set of pre-built PSBTs to perform the asset transfer + // a set of optional pre-built PSBTs to perform the asset transfer Psbts []string `protobuf:"bytes,5,rep,name=psbts,proto3" json:"psbts,omitempty"` + // target number of the UTXOs to be transferred; only take effect when psbt not provided + TargetUtxoNum uint32 `protobuf:"varint,6,opt,name=target_utxo_num,json=targetUtxoNum,proto3" json:"target_utxo_num,omitempty"` + // fee rate; only take effect when psbt not provided + FeeRate string `protobuf:"bytes,7,opt,name=fee_rate,json=feeRate,proto3" json:"fee_rate,omitempty"` } func (m *MsgTransferVault) Reset() { *m = MsgTransferVault{} } @@ -943,6 +983,20 @@ func (m *MsgTransferVault) GetPsbts() []string { return nil } +func (m *MsgTransferVault) GetTargetUtxoNum() uint32 { + if m != nil { + return m.TargetUtxoNum + } + return 0 +} + +func (m *MsgTransferVault) GetFeeRate() string { + if m != nil { + return m.FeeRate + } + return "" +} + // MsgTransferVaultResponse defines the Msg/TransferVault response type. type MsgTransferVaultResponse struct { } @@ -1104,69 +1158,74 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/tx.proto", fileDescriptor_785ca8e1e4227068) } var fileDescriptor_785ca8e1e4227068 = []byte{ - // 979 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0x8e, 0x63, 0x27, 0x24, 0xcf, 0xb1, 0x69, 0x57, 0x21, 0x75, 0x36, 0x65, 0x93, 0x2e, 0x4d, - 0x1b, 0x29, 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d, 0x3a, - 0x68, 0x49, 0x32, 0xf5, 0xf7, 0xeb, 0xd1, 0xbe, 0xda, 0xb4, 0x46, 0xd9, 0xbf, 0x6f, 0x39, 0xb7, - 0xdc, 0x75, 0x05, 0x78, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa4, 0xea, 0x53, 0xab, 0x9c, - 0x0b, 0x00, 0x00, + // 1062 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xb6, 0x24, 0x5b, 0xb6, 0x47, 0x96, 0x9c, 0x10, 0xae, 0x43, 0xd3, 0xa9, 0xec, 0xa8, 0xf1, + 0x0f, 0xe0, 0x54, 0x02, 0x9c, 0x1c, 0x8a, 0x9e, 0x1a, 0xd5, 0x40, 0x52, 0x04, 0x0a, 0x02, 0xc6, + 0x4e, 0x8b, 0x16, 0x85, 0xb0, 0x14, 0xd7, 0x14, 0x5b, 0x89, 0xcb, 0xee, 0x2e, 0x5d, 0x09, 0x28, + 0xd0, 0x53, 0x8f, 0x05, 0x7a, 0xef, 0x0b, 0xf4, 0xd4, 0xe7, 0xc8, 0x31, 0xc7, 0x9e, 0xda, 0xc2, + 0x7e, 0x91, 0x62, 0x97, 0xe4, 0x8a, 0x94, 0x48, 0xc9, 0x41, 0x6f, 0xbb, 0x33, 0x1f, 0xbf, 0xf9, + 0x76, 0x66, 0x76, 0x47, 0x82, 0x7b, 0xcc, 0xb5, 0x71, 0xcb, 0xe2, 0x3d, 0x8b, 0xba, 0xb6, 0x83, + 0x5b, 0x7c, 0xd4, 0xf4, 0x29, 0xe1, 0x44, 0xab, 0x09, 0x47, 0x53, 0x39, 0x8c, 0x2d, 0x87, 0x38, + 0x44, 0xba, 0x5a, 0x62, 0x15, 0xa2, 0x8c, 0xdd, 0xa9, 0xcf, 0x7d, 0x44, 0xd1, 0x90, 0x45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0xff, 0x9b, 0xb1, + 0x3c, 0x87, 0x72, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2041,6 +2100,38 @@ func (m *MsgInitiateDKG) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FeeRate) > 0 { + i -= len(m.FeeRate) + copy(dAtA[i:], m.FeeRate) + i = encodeVarintTx(dAtA, i, uint64(len(m.FeeRate))) + i-- + dAtA[i] = 0x42 + } + if m.TargetUtxoNum != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TargetUtxoNum)) + i-- + dAtA[i] = 0x38 + } + if m.EnableTransfer { + i-- + if m.EnableTransfer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.DisableBridge { + i-- + if m.DisableBridge { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } if len(m.VaultTypes) > 0 { dAtA2 := make([]byte, len(m.VaultTypes)*10) var j1 int @@ -2212,6 +2303,18 @@ func (m *MsgTransferVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FeeRate) > 0 { + i -= len(m.FeeRate) + copy(dAtA[i:], m.FeeRate) + i = encodeVarintTx(dAtA, i, uint64(len(m.FeeRate))) + i-- + dAtA[i] = 0x3a + } + if m.TargetUtxoNum != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TargetUtxoNum)) + i-- + dAtA[i] = 0x30 + } if len(m.Psbts) > 0 { for iNdEx := len(m.Psbts) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Psbts[iNdEx]) @@ -2561,6 +2664,19 @@ func (m *MsgInitiateDKG) Size() (n int) { } n += 1 + sovTx(uint64(l)) + l } + if m.DisableBridge { + n += 2 + } + if m.EnableTransfer { + n += 2 + } + if m.TargetUtxoNum != 0 { + n += 1 + sovTx(uint64(m.TargetUtxoNum)) + } + l = len(m.FeeRate) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2637,6 +2753,13 @@ func (m *MsgTransferVault) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + if m.TargetUtxoNum != 0 { + n += 1 + sovTx(uint64(m.TargetUtxoNum)) + } + l = len(m.FeeRate) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -4072,6 +4195,97 @@ func (m *MsgInitiateDKG) Unmarshal(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field VaultTypes", wireType) } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableBridge", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableBridge = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableTransfer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableTransfer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetUtxoNum", wireType) + } + m.TargetUtxoNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetUtxoNum |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4540,6 +4754,57 @@ func (m *MsgTransferVault) Unmarshal(dAtA []byte) error { } m.Psbts = append(m.Psbts, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetUtxoNum", wireType) + } + m.TargetUtxoNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetUtxoNum |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])