cosmos/bank

Table of Contents

cosmos/bank/module/v1/module.proto

Top

Module

Module is the config object of the bank module.

FieldTypeLabelDescription
blocked_module_accounts_override string repeated

blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving funds. If left empty it defaults to the list of account names supplied in the auth module configuration as module_account_permissions

authority string

authority defines the custom module authority. If not set, defaults to the governance module.

restrictions_order string repeated

restrictions_order specifies the order of send restrictions and should be a list of module names which provide a send restriction instance. If no order is provided, then restrictions will be applied in alphabetical order of module names.

cosmos/bank/v1beta1/authz.proto

Top

SendAuthorization

SendAuthorization allows the grantee to spend up to spend_limit coins from

the granter's account.

Since: cosmos-sdk 0.43

FieldTypeLabelDescription
spend_limit cosmos.base.v1beta1.Coin repeated

allow_list string repeated

allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the granter. If omitted, any recipient is allowed. Since: cosmos-sdk 0.47

cosmos/bank/v1beta1/bank.proto

Top

DenomUnit

DenomUnit represents a struct that describes a given

denomination unit of the basic token.

FieldTypeLabelDescription
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 = 10^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.

FieldTypeLabelDescription
address string

coins cosmos.base.v1beta1.Coin repeated

Metadata

Metadata represents a struct that describes

a basic token.

FieldTypeLabelDescription
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

uri string

URI to a document (on or off-chain) that contains additional information. Optional. Since: cosmos-sdk 0.46

uri_hash string

URIHash is a sha256 hash of a document pointed by URI. It's used to verify that the document didn't change. Optional. Since: cosmos-sdk 0.46

Output

Output models transaction outputs.

FieldTypeLabelDescription
address string

coins cosmos.base.v1beta1.Coin repeated

Params

Params defines the parameters for the bank module.

FieldTypeLabelDescription
send_enabled SendEnabled repeated

Deprecated. Deprecated: Use of SendEnabled in params is deprecated. For genesis, use the newly added send_enabled field in the genesis object. Storage, lookup, and manipulation of this information is now in the keeper. As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files.

default_send_enabled bool

Fields with deprecated option

Name Option
send_enabled

true

SendEnabled

SendEnabled maps coin denom to a send_enabled status (whether a denom is

sendable).

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
total cosmos.base.v1beta1.Coin repeated

cosmos/bank/v1beta1/genesis.proto

Top

Balance

Balance defines an account address and balance pair used in the bank module's

genesis state.

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
params Params

params defines all the parameters 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 different coins.

send_enabled SendEnabled repeated

send_enabled defines the denoms where send is enabled or disabled. Since: cosmos-sdk 0.47

cosmos/bank/v1beta1/query.proto

Top

DenomOwner

DenomOwner defines structure representing an account that owns or holds a

particular denominated token. It contains the account address and account

balance of the denominated token.

Since: cosmos-sdk 0.46

FieldTypeLabelDescription
address string

address defines the address that owns a particular denomination.

balance cosmos.base.v1beta1.Coin

balance is the balance of the denominated coin for an account.

QueryAllBalancesRequest

QueryBalanceRequest is the request type for the Query/AllBalances RPC method.

FieldTypeLabelDescription
address string

address is the address to query balances for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

resolve_denom bool

resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. Since: cosmos-sdk 0.50

QueryAllBalancesResponse

QueryAllBalancesResponse is the response type for the Query/AllBalances RPC

method.

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
balance cosmos.base.v1beta1.Coin

balance is the balance of the coin.

QueryDenomMetadataByQueryStringRequest

QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method.

Identical with QueryDenomMetadataRequest but receives denom as query string.

FieldTypeLabelDescription
denom string

denom is the coin denom to query the metadata for.

QueryDenomMetadataByQueryStringResponse

QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC

method. Identical with QueryDenomMetadataResponse but receives denom as query string in request.

FieldTypeLabelDescription
metadata Metadata

metadata describes and provides all the client information for the requested token.

QueryDenomMetadataRequest

QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.

FieldTypeLabelDescription
denom string

denom is the coin denom to query the metadata for.

QueryDenomMetadataResponse

QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC

method.

FieldTypeLabelDescription
metadata Metadata

metadata describes and provides all the client information for the requested token.

QueryDenomOwnersByQueryRequest

QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query,

which queries for a paginated set of all account holders of a particular

denomination.

Since: cosmos-sdk 0.50.3

FieldTypeLabelDescription
denom string

denom defines the coin denomination to query all account holders for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDenomOwnersByQueryResponse

QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query.

Since: cosmos-sdk 0.50.3

FieldTypeLabelDescription
denom_owners DenomOwner repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryDenomOwnersRequest

QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query,

which queries for a paginated set of all account holders of a particular

denomination.

FieldTypeLabelDescription
denom string

denom defines the coin denomination to query all account holders for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDenomOwnersResponse

QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query.

Since: cosmos-sdk 0.46

FieldTypeLabelDescription
denom_owners DenomOwner repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryDenomsMetadataRequest

QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
params Params

params provides the parameters of the bank module.

QuerySendEnabledRequest

QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
denoms string repeated

denoms is the specific denoms you want look up. Leave empty to get all entries.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request. This field is only read if the denoms field is empty.

QuerySendEnabledResponse

QuerySendEnabledResponse defines the RPC response of a SendEnable query.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
send_enabled SendEnabled repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response. This field is only populated if the denoms field in the request is empty.

QuerySpendableBalanceByDenomRequest

QuerySpendableBalanceByDenomRequest defines the gRPC request structure for

querying an account's spendable balance for a specific denom.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
address string

address is the address to query balances for.

denom string

denom is the coin denom to query balances for.

QuerySpendableBalanceByDenomResponse

QuerySpendableBalanceByDenomResponse defines the gRPC response structure for

querying an account's spendable balance for a specific denom.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
balance cosmos.base.v1beta1.Coin

balance is the balance of the coin.

QuerySpendableBalancesRequest

QuerySpendableBalancesRequest defines the gRPC request structure for querying

an account's spendable balances.

Since: cosmos-sdk 0.46

FieldTypeLabelDescription
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.

Since: cosmos-sdk 0.46

FieldTypeLabelDescription
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.

FieldTypeLabelDescription
denom string

denom is the coin denom to query balances for.

QuerySupplyOfResponse

QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.

FieldTypeLabelDescription
amount cosmos.base.v1beta1.Coin

amount is the supply of the coin.

QueryTotalSupplyRequest

QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC

method.

FieldTypeLabelDescription
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

FieldTypeLabelDescription
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 NameRequest TypeResponse TypeDescription
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. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set.

SpendableBalances QuerySpendableBalancesRequest QuerySpendableBalancesResponse

SpendableBalances queries the spendable balance of all coins for a single account. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.46

SpendableBalanceByDenom QuerySpendableBalanceByDenomRequest QuerySpendableBalanceByDenomResponse

SpendableBalanceByDenom queries the spendable balance of a single denom for a single account. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.47

TotalSupply QueryTotalSupplyRequest QueryTotalSupplyResponse

TotalSupply queries the total supply of all coins. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set.

SupplyOf QuerySupplyOfRequest QuerySupplyOfResponse

SupplyOf queries the supply of a single coin. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set.

Params QueryParamsRequest QueryParamsResponse

Params queries the parameters of x/bank module.

DenomMetadata QueryDenomMetadataRequest QueryDenomMetadataResponse

DenomMetadata queries the client metadata of a given coin denomination.

DenomMetadataByQueryString QueryDenomMetadataByQueryStringRequest QueryDenomMetadataByQueryStringResponse

DenomMetadataByQueryString queries the client metadata of a given coin denomination.

DenomsMetadata QueryDenomsMetadataRequest QueryDenomsMetadataResponse

DenomsMetadata queries the client metadata for all registered coin denominations.

DenomOwners QueryDenomOwnersRequest QueryDenomOwnersResponse

DenomOwners queries for all account addresses that own a particular token denomination. When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.46

DenomOwnersByQuery QueryDenomOwnersByQueryRequest QueryDenomOwnersByQueryResponse

DenomOwnersByQuery queries for all account addresses that own a particular token denomination. Since: cosmos-sdk 0.50.3

SendEnabled QuerySendEnabledRequest QuerySendEnabledResponse

SendEnabled queries for SendEnabled entries. This query only returns denominations that have specific SendEnabled settings. Any denomination that does not have a specific setting will use the default params.default_send_enabled, and will not be returned by this query. Since: cosmos-sdk 0.47

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}
SpendableBalanceByDenom GET /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom
TotalSupply GET /cosmos/bank/v1beta1/supply
SupplyOf GET /cosmos/bank/v1beta1/supply/by_denom
Params GET /cosmos/bank/v1beta1/params
DenomMetadata GET /cosmos/bank/v1beta1/denoms_metadata/{denom}
DenomMetadataByQueryString GET /cosmos/bank/v1beta1/denoms_metadata_by_query_string
DenomsMetadata GET /cosmos/bank/v1beta1/denoms_metadata
DenomOwners GET /cosmos/bank/v1beta1/denom_owners/{denom}
DenomOwnersByQuery GET /cosmos/bank/v1beta1/denom_owners_by_query
SendEnabled GET /cosmos/bank/v1beta1/send_enabled

cosmos/bank/v1beta1/tx.proto

Top

MsgMultiSend

MsgMultiSend represents an arbitrary multi-in, multi-out send message.

FieldTypeLabelDescription
inputs Input repeated

Inputs, despite being `repeated`, only allows one sender input. This is checked in MsgMultiSend's ValidateBasic.

outputs Output repeated

MsgMultiSendResponse

MsgMultiSendResponse defines the Msg/MultiSend response type.

MsgSend

MsgSend represents a message to send coins from one account to another.

FieldTypeLabelDescription
from_address string

to_address string

amount cosmos.base.v1beta1.Coin repeated

MsgSendResponse

MsgSendResponse defines the Msg/Send response type.

MsgSetSendEnabled

MsgSetSendEnabled is the Msg/SetSendEnabled request type.

Only entries to add/update/delete need to be included.

Existing SendEnabled entries that are not included in this

message are left unchanged.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
authority string

authority is the address that controls the module.

send_enabled SendEnabled repeated

send_enabled is the list of entries to add or update.

use_default_for string repeated

use_default_for is a list of denoms that should use the params.default_send_enabled value. Denoms listed here will have their SendEnabled entries deleted. If a denom is included that doesn't have a SendEnabled entry, it will be ignored.

MsgSetSendEnabledResponse

MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type.

Since: cosmos-sdk 0.47

MsgUpdateParams

MsgUpdateParams is the Msg/UpdateParams request type.

Since: cosmos-sdk 0.47

FieldTypeLabelDescription
authority string

authority is the address that controls the module (defaults to x/gov unless overwritten).

params Params

params defines the x/bank parameters to update. NOTE: All parameters must be supplied.

MsgUpdateParamsResponse

MsgUpdateParamsResponse defines the response structure for executing a

MsgUpdateParams message.

Since: cosmos-sdk 0.47

Msg

Msg defines the bank Msg service.

Method NameRequest TypeResponse TypeDescription
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.

UpdateParams MsgUpdateParams MsgUpdateParamsResponse

UpdateParams defines a governance operation for updating the x/bank module parameters. The authority is defined in the keeper. Since: cosmos-sdk 0.47

SetSendEnabled MsgSetSendEnabled MsgSetSendEnabledResponse

SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. Only the entries to add or update should be included. Entries that already exist in the store, but that aren't included in this message, will be left unchanged. Since: cosmos-sdk 0.47

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