cosmos/bank
Table of Contents
- cosmos/bank/v1beta1/bank.proto
-
cosmos/bank/v1beta1/query.proto
- MQueryAllBalancesRequest
- MQueryAllBalancesResponse
- MQueryBalanceRequest
- MQueryBalanceResponse
- MQueryDenomMetadataRequest
- MQueryDenomMetadataResponse
- MQueryDenomsMetadataRequest
- MQueryDenomsMetadataResponse
- MQueryParamsRequest
- MQueryParamsResponse
- MQuerySpendableBalancesRequest
- MQuerySpendableBalancesResponse
- MQuerySupplyOfRequest
- MQuerySupplyOfResponse
- MQueryTotalSupplyRequest
- MQueryTotalSupplyResponse
- SQuery
- cosmos/bank/v1beta1/genesis.proto
- cosmos/bank/v1beta1/authz.proto
- cosmos/bank/v1beta1/tx.proto
- Scalar Value Types
cosmos/bank/v1beta1/bank.proto
TopDenomUnit
DenomUnit represents a struct that describes a given
denomination unit of the basic token.
Field | Type | Label | Description |
denom | string | denom represents the string name of the given denom unit (e.g uatom). |
|
exponent | uint32 | exponent represents power of 10 exponent that one must raise the base_denom to in order to equal the given DenomUnit's denom 1 denom = 1^exponent base_denom (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with exponent = 6, thus: 1 atom = 10^6 uatom). |
|
aliases | string | repeated | aliases is a list of string aliases for the given denom |
Input
Input models transaction input.
Field | Type | Label | Description |
address | string |
|
|
coins | cosmos.base.v1beta1.Coin | repeated |
|
Metadata
Metadata represents a struct that describes
a basic token.
Field | Type | Label | Description |
description | string |
|
|
denom_units | DenomUnit | repeated | denom_units represents the list of DenomUnit's for a given coin |
base | string | base represents the base denom (should be the DenomUnit with exponent = 0). |
|
display | string | display indicates the suggested denom that should be displayed in clients. |
|
name | string | name defines the name of the token (eg: Cosmos Atom) Since: cosmos-sdk 0.43 |
|
symbol | string | symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display. Since: cosmos-sdk 0.43 |
Output
Output models transaction outputs.
Field | Type | Label | Description |
address | string |
|
|
coins | cosmos.base.v1beta1.Coin | repeated |
|
Params
Params defines the parameters for the bank module.
Field | Type | Label | Description |
send_enabled | SendEnabled | repeated |
|
default_send_enabled | bool |
|
SendEnabled
SendEnabled maps coin denom to a send_enabled status (whether a denom is
sendable).
Field | Type | Label | Description |
denom | string |
|
|
enabled | bool |
|
Supply
Supply represents a struct that passively keeps track of the total supply
amounts in the network.
This message is deprecated now that supply is indexed by denom.
Field | Type | Label | Description |
total | cosmos.base.v1beta1.Coin | repeated |
|
cosmos/bank/v1beta1/query.proto
TopQueryAllBalancesRequest
QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
Field | Type | Label | Description |
address | string | address is the address to query balances for. |
|
pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. |
QueryAllBalancesResponse
QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
method.
Field | Type | Label | Description |
balances | cosmos.base.v1beta1.Coin | repeated | balances is the balances of all the coins. |
pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. |
QueryBalanceRequest
QueryBalanceRequest is the request type for the Query/Balance RPC method.
Field | Type | Label | Description |
address | string | address is the address to query balances for. |
|
denom | string | denom is the coin denom to query balances for. |
QueryBalanceResponse
QueryBalanceResponse is the response type for the Query/Balance RPC method.
Field | Type | Label | Description |
balance | cosmos.base.v1beta1.Coin | balance is the balance of the coin. |
QueryDenomMetadataRequest
QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
Field | Type | Label | Description |
denom | string | denom is the coin denom to query the metadata for. |
QueryDenomMetadataResponse
QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
method.
Field | Type | Label | Description |
metadata | Metadata | metadata describes and provides all the client information for the requested token. |
QueryDenomsMetadataRequest
QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
Field | Type | Label | Description |
pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. |
QueryDenomsMetadataResponse
QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
method.
Field | Type | Label | Description |
metadatas | Metadata | repeated | metadata provides the client information for all the registered tokens. |
pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. |
QueryParamsRequest
QueryParamsRequest defines the request type for querying x/bank parameters.
QueryParamsResponse
QueryParamsResponse defines the response type for querying x/bank parameters.
Field | Type | Label | Description |
params | Params |
|
QuerySpendableBalancesRequest
QuerySpendableBalancesRequest defines the gRPC request structure for querying
an account's spendable balances.
Field | Type | Label | Description |
address | string | address is the address to query spendable balances for. |
|
pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. |
QuerySpendableBalancesResponse
QuerySpendableBalancesResponse defines the gRPC response structure for querying
an account's spendable balances.
Field | Type | Label | Description |
balances | cosmos.base.v1beta1.Coin | repeated | balances is the spendable balances of all the coins. |
pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. |
QuerySupplyOfRequest
QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
Field | Type | Label | Description |
denom | string | denom is the coin denom to query balances for. |
QuerySupplyOfResponse
QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
Field | Type | Label | Description |
amount | cosmos.base.v1beta1.Coin | amount is the supply of the coin. |
QueryTotalSupplyRequest
QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
method.
Field | Type | Label | Description |
pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. Since: cosmos-sdk 0.43 |
QueryTotalSupplyResponse
QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
method
Field | Type | Label | Description |
supply | cosmos.base.v1beta1.Coin | repeated | supply is the supply of the coins |
pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. Since: cosmos-sdk 0.43 |
Query
Query defines the gRPC querier service.
Method Name | Request Type | Response Type | Description |
Balance | QueryBalanceRequest | QueryBalanceResponse | Balance queries the balance of a single coin for a single account. |
AllBalances | QueryAllBalancesRequest | QueryAllBalancesResponse | AllBalances queries the balance of all coins for a single account. |
SpendableBalances | QuerySpendableBalancesRequest | QuerySpendableBalancesResponse | SpendableBalances queries the spenable balance of all coins for a single account. |
TotalSupply | QueryTotalSupplyRequest | QueryTotalSupplyResponse | TotalSupply queries the total supply of all coins. |
SupplyOf | QuerySupplyOfRequest | QuerySupplyOfResponse | SupplyOf queries the supply of a single coin. |
Params | QueryParamsRequest | QueryParamsResponse | Params queries the parameters of x/bank module. |
DenomMetadata | QueryDenomMetadataRequest | QueryDenomMetadataResponse | DenomsMetadata queries the client metadata of a given coin denomination. |
DenomsMetadata | QueryDenomsMetadataRequest | QueryDenomsMetadataResponse | DenomsMetadata queries the client metadata for all registered coin denominations. |
Methods with HTTP bindings
Method Name | Method | Pattern | Body |
Balance | GET | /cosmos/bank/v1beta1/balances/{address}/by_denom | |
AllBalances | GET | /cosmos/bank/v1beta1/balances/{address} | |
SpendableBalances | GET | /cosmos/bank/v1beta1/spendable_balances/{address} | |
TotalSupply | GET | /cosmos/bank/v1beta1/supply | |
SupplyOf | GET | /cosmos/bank/v1beta1/supply/{denom} | |
Params | GET | /cosmos/bank/v1beta1/params | |
DenomMetadata | GET | /cosmos/bank/v1beta1/denoms_metadata/{denom} | |
DenomsMetadata | GET | /cosmos/bank/v1beta1/denoms_metadata |
cosmos/bank/v1beta1/genesis.proto
TopBalance
Balance defines an account address and balance pair used in the bank module's
genesis state.
Field | Type | Label | Description |
address | string | address is the address of the balance holder. |
|
coins | cosmos.base.v1beta1.Coin | repeated | coins defines the different coins this balance holds. |
GenesisState
GenesisState defines the bank module's genesis state.
Field | Type | Label | Description |
params | Params | params defines all the paramaters of the module. |
|
balances | Balance | repeated | balances is an array containing the balances of all the accounts. |
supply | cosmos.base.v1beta1.Coin | repeated | supply represents the total supply. If it is left empty, then supply will be calculated based on the provided balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. |
denom_metadata | Metadata | repeated | denom_metadata defines the metadata of the differents coins. |
cosmos/bank/v1beta1/authz.proto
TopSendAuthorization
SendAuthorization allows the grantee to spend up to spend_limit coins from
the granter's account.
Since: cosmos-sdk 0.43
Field | Type | Label | Description |
spend_limit | cosmos.base.v1beta1.Coin | repeated |
|
cosmos/bank/v1beta1/tx.proto
TopMsgMultiSend
MsgMultiSend represents an arbitrary multi-in, multi-out send message.
Field | Type | Label | Description |
inputs | Input | repeated |
|
outputs | Output | repeated |
|
MsgMultiSendResponse
MsgMultiSendResponse defines the Msg/MultiSend response type.
MsgSend
MsgSend represents a message to send coins from one account to another.
Field | Type | Label | Description |
from_address | string |
|
|
to_address | string |
|
|
amount | cosmos.base.v1beta1.Coin | repeated |
|
MsgSendResponse
MsgSendResponse defines the Msg/Send response type.
Msg
Msg defines the bank Msg service.
Method Name | Request Type | Response Type | Description |
Send | MsgSend | MsgSendResponse | Send defines a method for sending coins from one account to another account. |
MultiSend | MsgMultiSend | MsgMultiSendResponse | MultiSend defines a method for sending coins from some accounts to other accounts. |
Scalar Value Types
.proto Type | Notes | Python Type |
double | float | |
float | float | |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long |
uint32 | Uses variable-length encoding. | int/long |
uint64 | Uses variable-length encoding. | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long |
sfixed32 | Always four bytes. | int |
sfixed64 | Always eight bytes. | int/long |
bool | boolean | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | str |