cosmos/tx
Table of Contents
- cosmos/tx/config/v1/config.proto
- cosmos/tx/signing/v1beta1/signing.proto
-
cosmos/tx/v1beta1/service.proto
- MBroadcastTxRequest
- MBroadcastTxResponse
- MGetBlockWithTxsRequest
- MGetBlockWithTxsResponse
- MGetTxRequest
- MGetTxResponse
- MGetTxsEventRequest
- MGetTxsEventResponse
- MSimulateRequest
- MSimulateResponse
- MTxDecodeAminoRequest
- MTxDecodeAminoResponse
- MTxDecodeRequest
- MTxDecodeResponse
- MTxEncodeAminoRequest
- MTxEncodeAminoResponse
- MTxEncodeRequest
- MTxEncodeResponse
- EBroadcastMode
- EOrderBy
- SService
- cosmos/tx/v1beta1/tx.proto
- Scalar Value Types
cosmos/tx/config/v1/config.proto
TopConfig
Config is the config object of the x/auth/tx package.
| Field | Type | Label | Description |
| skip_ante_handler | bool | skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override this functionality. |
|
| skip_post_handler | bool | skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override this functionality. |
cosmos/tx/signing/v1beta1/signing.proto
TopSignatureDescriptor
SignatureDescriptor is a convenience type which represents the full data for
a signature including the public key of the signer, signing modes and the
signature itself. It is primarily used for coordinating signatures between
clients.
| Field | Type | Label | Description |
| public_key | google.protobuf.Any | public_key is the public key of the signer |
|
| data | SignatureDescriptor.Data |
|
|
| sequence | uint64 | sequence is the sequence of the account, which describes the number of committed transactions signed by a given address. It is used to prevent replay attacks. |
SignatureDescriptor.Data
Data represents signature data
| Field | Type | Label | Description |
| single | SignatureDescriptor.Data.Single | single represents a single signer |
|
| multi | SignatureDescriptor.Data.Multi | multi represents a multisig signer |
SignatureDescriptor.Data.Multi
Multi is the signature data for a multisig public key
| Field | Type | Label | Description |
| bitarray | cosmos.crypto.multisig.v1beta1.CompactBitArray | bitarray specifies which keys within the multisig are signing |
|
| signatures | SignatureDescriptor.Data | repeated | signatures is the signatures of the multi-signature |
SignatureDescriptor.Data.Single
Single is the signature data for a single signer
| Field | Type | Label | Description |
| mode | SignMode | mode is the signing mode of the single signer |
|
| signature | bytes | signature is the raw signature bytes |
SignatureDescriptors
SignatureDescriptors wraps multiple SignatureDescriptor's.
| Field | Type | Label | Description |
| signatures | SignatureDescriptor | repeated | signatures are the signature descriptors |
SignMode
SignMode represents a signing mode with its own security guarantees.
This enum should be considered a registry of all known sign modes
in the Cosmos ecosystem. Apps are not expected to support all known
sign modes. Apps that would like to support custom sign modes are
encouraged to open a small PR against this file to add a new case
to this SignMode enum describing their sign mode so that different
apps have a consistent version of this enum.
| Name | Number | Description |
| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected. |
| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx. |
| SIGN_MODE_TEXTUAL | 2 | SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable textual representation on top of the binary representation from SIGN_MODE_DIRECT. Since: cosmos-sdk 0.50 |
| SIGN_MODE_DIRECT_AUX | 3 | SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not require signers signing over other signers' `signer_info`. Since: cosmos-sdk 0.46 |
| SIGN_MODE_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future. |
| SIGN_MODE_EIP_191 | 191 | SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, but is not implemented on the SDK by default. To enable EIP-191, you need to pass a custom `TxConfig` that has an implementation of `SignModeHandler` for EIP-191. The SDK may decide to fully support EIP-191 in the future. Since: cosmos-sdk 0.45.2 |
cosmos/tx/v1beta1/service.proto
TopBroadcastTxRequest
BroadcastTxRequest is the request type for the Service.BroadcastTxRequest
RPC method.
| Field | Type | Label | Description |
| tx_bytes | bytes | tx_bytes is the raw transaction. |
|
| mode | BroadcastMode |
|
BroadcastTxResponse
BroadcastTxResponse is the response type for the
Service.BroadcastTx method.
| Field | Type | Label | Description |
| tx_response | cosmos.base.abci.v1beta1.TxResponse | tx_response is the queried TxResponses. |
GetBlockWithTxsRequest
GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs
RPC method.
Since: cosmos-sdk 0.45.2
| Field | Type | Label | Description |
| height | int64 | height is the height of the block to query. |
|
| pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines a pagination for the request. |
GetBlockWithTxsResponse
GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs
method.
Since: cosmos-sdk 0.45.2
| Field | Type | Label | Description |
| txs | Tx | repeated | txs are the transactions in the block. |
| block_id | tendermint.types.BlockID |
|
|
| block | tendermint.types.Block |
|
|
| pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines a pagination for the response. |
GetTxRequest
GetTxRequest is the request type for the Service.GetTx
RPC method.
| Field | Type | Label | Description |
| hash | string | hash is the tx hash to query, encoded as a hex string. |
GetTxResponse
GetTxResponse is the response type for the Service.GetTx method.
| Field | Type | Label | Description |
| tx | Tx | tx is the queried transaction. |
|
| tx_response | cosmos.base.abci.v1beta1.TxResponse | tx_response is the queried TxResponses. |
GetTxsEventRequest
GetTxsEventRequest is the request type for the Service.TxsByEvents
RPC method.
| Field | Type | Label | Description |
| events | string | repeated | Deprecated. events is the list of transaction event type. Deprecated post v0.47.x: use query instead, which should contain a valid events query. |
| pagination | cosmos.base.query.v1beta1.PageRequest | Deprecated. pagination defines a pagination for the request. Deprecated post v0.46.x: use page and limit instead. |
|
| order_by | OrderBy |
|
|
| page | uint64 | page is the page number to query, starts at 1. If not provided, will default to first page. |
|
| limit | uint64 | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. |
|
| query | string | query defines the transaction event query that is proxied to Tendermint's TxSearch RPC method. The query must be valid. Since cosmos-sdk 0.50 |
Fields with deprecated option
| Name | Option |
| events | true |
| pagination | true |
GetTxsEventResponse
GetTxsEventResponse is the response type for the Service.TxsByEvents
RPC method.
| Field | Type | Label | Description |
| txs | Tx | repeated | txs is the list of queried transactions. |
| tx_responses | cosmos.base.abci.v1beta1.TxResponse | repeated | tx_responses is the list of queried TxResponses. |
| pagination | cosmos.base.query.v1beta1.PageResponse | Deprecated. pagination defines a pagination for the response. Deprecated post v0.46.x: use total instead. |
|
| total | uint64 | total is total number of results available |
Fields with deprecated option
| Name | Option |
| pagination | true |
SimulateRequest
SimulateRequest is the request type for the Service.Simulate
RPC method.
| Field | Type | Label | Description |
| tx | Tx | Deprecated. tx is the transaction to simulate. Deprecated. Send raw tx bytes instead. |
|
| tx_bytes | bytes | tx_bytes is the raw transaction. Since: cosmos-sdk 0.43 |
Fields with deprecated option
| Name | Option |
| tx | true |
SimulateResponse
SimulateResponse is the response type for the
Service.SimulateRPC method.
| Field | Type | Label | Description |
| gas_info | cosmos.base.abci.v1beta1.GasInfo | gas_info is the information about gas used in the simulation. |
|
| result | cosmos.base.abci.v1beta1.Result | result is the result of the simulation. |
TxDecodeAminoRequest
TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| amino_binary | bytes |
|
TxDecodeAminoResponse
TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| amino_json | string |
|
TxDecodeRequest
TxDecodeRequest is the request type for the Service.TxDecode
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| tx_bytes | bytes | tx_bytes is the raw transaction. |
TxDecodeResponse
TxDecodeResponse is the response type for the
Service.TxDecode method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| tx | Tx | tx is the decoded transaction. |
TxEncodeAminoRequest
TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| amino_json | string |
|
TxEncodeAminoResponse
TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| amino_binary | bytes |
|
TxEncodeRequest
TxEncodeRequest is the request type for the Service.TxEncode
RPC method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| tx | Tx | tx is the transaction to encode. |
TxEncodeResponse
TxEncodeResponse is the response type for the
Service.TxEncode method.
Since: cosmos-sdk 0.47
| Field | Type | Label | Description |
| tx_bytes | bytes | tx_bytes is the encoded transaction bytes. |
BroadcastMode
BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC
method.
| Name | Number | Description |
| BROADCAST_MODE_UNSPECIFIED | 0 | zero-value for mode ordering |
| BROADCAST_MODE_BLOCK | 1 | DEPRECATED: use BROADCAST_MODE_SYNC instead, BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. |
| BROADCAST_MODE_SYNC | 2 | BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. |
| BROADCAST_MODE_ASYNC | 3 | BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns immediately. |
OrderBy
OrderBy defines the sorting order
| Name | Number | Description |
| ORDER_BY_UNSPECIFIED | 0 | ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. |
| ORDER_BY_ASC | 1 | ORDER_BY_ASC defines ascending order |
| ORDER_BY_DESC | 2 | ORDER_BY_DESC defines descending order |
Service
Service defines a gRPC service for interacting with transactions.
| Method Name | Request Type | Response Type | Description |
| Simulate | SimulateRequest | SimulateResponse | Simulate simulates executing a transaction for estimating gas usage. |
| GetTx | GetTxRequest | GetTxResponse | GetTx fetches a tx by hash. |
| BroadcastTx | BroadcastTxRequest | BroadcastTxResponse | BroadcastTx broadcast transaction. |
| GetTxsEvent | GetTxsEventRequest | GetTxsEventResponse | GetTxsEvent fetches txs by event. |
| GetBlockWithTxs | GetBlockWithTxsRequest | GetBlockWithTxsResponse | GetBlockWithTxs fetches a block with decoded txs. Since: cosmos-sdk 0.45.2 |
| TxDecode | TxDecodeRequest | TxDecodeResponse | TxDecode decodes the transaction. Since: cosmos-sdk 0.47 |
| TxEncode | TxEncodeRequest | TxEncodeResponse | TxEncode encodes the transaction. Since: cosmos-sdk 0.47 |
| TxEncodeAmino | TxEncodeAminoRequest | TxEncodeAminoResponse | TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. Since: cosmos-sdk 0.47 |
| TxDecodeAmino | TxDecodeAminoRequest | TxDecodeAminoResponse | TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. Since: cosmos-sdk 0.47 |
Methods with HTTP bindings
| Method Name | Method | Pattern | Body |
| Simulate | POST | /cosmos/tx/v1beta1/simulate | * |
| GetTx | GET | /cosmos/tx/v1beta1/txs/{hash} | |
| BroadcastTx | POST | /cosmos/tx/v1beta1/txs | * |
| GetTxsEvent | GET | /cosmos/tx/v1beta1/txs | |
| GetBlockWithTxs | GET | /cosmos/tx/v1beta1/txs/block/{height} | |
| TxDecode | POST | /cosmos/tx/v1beta1/decode | * |
| TxEncode | POST | /cosmos/tx/v1beta1/encode | * |
| TxEncodeAmino | POST | /cosmos/tx/v1beta1/encode/amino | * |
| TxDecodeAmino | POST | /cosmos/tx/v1beta1/decode/amino | * |
cosmos/tx/v1beta1/tx.proto
TopAuthInfo
AuthInfo describes the fee and signer modes that are used to sign a
transaction.
| Field | Type | Label | Description |
| signer_infos | SignerInfo | repeated | signer_infos defines the signing modes for the required signers. The number and order of elements must match the required signers from TxBody's messages. The first element is the primary signer and the one which pays the fee. |
| fee | Fee | Fee is the fee and gas limit for the transaction. The first signer is the primary signer and the one which pays the fee. The fee can be calculated based on the cost of evaluating the body and doing signature verification of the signers. This can be estimated via simulation. |
|
| tip | Tip | Deprecated. Tip is the optional tip used for transactions fees paid in another denom. This field is ignored if the chain didn't enable tips, i.e. didn't add the `TipDecorator` in its posthandler. Since: cosmos-sdk 0.46 |
Fields with deprecated option
| Name | Option |
| tip | true |
AuxSignerData
AuxSignerData is the intermediary format that an auxiliary signer (e.g. a
tipper) builds and sends to the fee payer (who will build and broadcast the
actual tx). AuxSignerData is not a valid tx in itself, and will be rejected
by the node if sent directly as-is.
Since: cosmos-sdk 0.46
| Field | Type | Label | Description |
| address | string | address is the bech32-encoded address of the auxiliary signer. If using AuxSignerData across different chains, the bech32 prefix of the target chain (where the final transaction is broadcasted) should be used. |
|
| sign_doc | SignDocDirectAux | sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer signs. Note: we use the same sign doc even if we're signing with LEGACY_AMINO_JSON. |
|
| mode | cosmos.tx.signing.v1beta1.SignMode | mode is the signing mode of the single signer. |
|
| sig | bytes | sig is the signature of the sign doc. |
Fee
Fee includes the amount of coins paid in fees and the maximum
gas to be used by the transaction. The ratio yields an effective "gasprice",
which must be above some miminum to be accepted into the mempool.
| Field | Type | Label | Description |
| amount | cosmos.base.v1beta1.Coin | repeated | amount is the amount of coins to be paid as a fee |
| gas_limit | uint64 | gas_limit is the maximum gas that can be used in transaction processing before an out of gas error occurs |
|
| payer | string | if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. the payer must be a tx signer (and thus have signed this field in AuthInfo). setting this field does *not* change the ordering of required signers for the transaction. |
|
| granter | string | if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does not support fee grants, this will fail |
ModeInfo
ModeInfo describes the signing mode of a single or nested multisig signer.
| Field | Type | Label | Description |
| single | ModeInfo.Single | single represents a single signer |
|
| multi | ModeInfo.Multi | multi represents a nested multisig signer |
ModeInfo.Multi
Multi is the mode info for a multisig public key
| Field | Type | Label | Description |
| bitarray | cosmos.crypto.multisig.v1beta1.CompactBitArray | bitarray specifies which keys within the multisig are signing |
|
| mode_infos | ModeInfo | repeated | mode_infos is the corresponding modes of the signers of the multisig which could include nested multisig public keys |
ModeInfo.Single
Single is the mode info for a single signer. It is structured as a message
to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
future
| Field | Type | Label | Description |
| mode | cosmos.tx.signing.v1beta1.SignMode | mode is the signing mode of the single signer |
SignDoc
SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.
| Field | Type | Label | Description |
| body_bytes | bytes | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. |
|
| auth_info_bytes | bytes | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw. |
|
| chain_id | string | chain_id is the unique identifier of the chain this transaction targets. It prevents signed transactions from being used on another chain by an attacker |
|
| account_number | uint64 | account_number is the account number of the account in state |
SignDocDirectAux
SignDocDirectAux is the type used for generating sign bytes for
SIGN_MODE_DIRECT_AUX.
Since: cosmos-sdk 0.46
| Field | Type | Label | Description |
| body_bytes | bytes | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. |
|
| public_key | google.protobuf.Any | public_key is the public key of the signing account. |
|
| chain_id | string | chain_id is the identifier of the chain this transaction targets. It prevents signed transactions from being used on another chain by an attacker. |
|
| account_number | uint64 | account_number is the account number of the account in state. |
|
| sequence | uint64 | sequence is the sequence number of the signing account. |
|
| tip | Tip | Deprecated. tips have been depreacted and should not be used |
Fields with deprecated option
| Name | Option |
| tip | true |
SignerInfo
SignerInfo describes the public key and signing mode of a single top-level
signer.
| Field | Type | Label | Description |
| public_key | google.protobuf.Any | public_key is the public key of the signer. It is optional for accounts that already exist in state. If unset, the verifier can use the required \ signer address for this position and lookup the public key. |
|
| mode_info | ModeInfo | mode_info describes the signing mode of the signer and is a nested structure to support nested multisig pubkey's |
|
| sequence | uint64 | sequence is the sequence of the account, which describes the number of committed transactions signed by a given address. It is used to prevent replay attacks. |
Tip
Tip is the tip used for meta-transactions.
Since: cosmos-sdk 0.46
| Field | Type | Label | Description |
| amount | cosmos.base.v1beta1.Coin | repeated | amount is the amount of the tip |
| tipper | string | tipper is the address of the account paying for the tip |
Tx
Tx is the standard type used for broadcasting transactions.
| Field | Type | Label | Description |
| body | TxBody | body is the processable content of the transaction |
|
| auth_info | AuthInfo | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee |
|
| signatures | bytes | repeated | signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to allow connecting signature meta information like public key and signing mode by position. |
TxBody
TxBody is the body of a transaction that all signers sign over.
| Field | Type | Label | Description |
| messages | google.protobuf.Any | repeated | messages is a list of messages to be executed. The required signers of those messages define the number and order of elements in AuthInfo's signer_infos and Tx's signatures. Each required signer address is added to the list only the first time it occurs. By convention, the first required signer (usually from the first message) is referred to as the primary signer and pays the fee for the whole transaction. |
| memo | string | memo is any arbitrary note/comment to be added to the transaction. WARNING: in clients, any publicly exposed text should not be called memo, but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). |
|
| timeout_height | uint64 | timeout is the block height after which this transaction will not be processed by the chain |
|
| extension_options | google.protobuf.Any | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected |
| non_critical_extension_options | google.protobuf.Any | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, they will be ignored |
TxRaw
TxRaw is a variant of Tx that pins the signer's exact binary representation
of body and auth_info. This is used for signing, broadcasting and
verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
as the transaction ID.
| Field | Type | Label | Description |
| body_bytes | bytes | body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc. |
|
| auth_info_bytes | bytes | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc. |
|
| signatures | bytes | repeated | signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to allow connecting signature meta information like public key and signing mode by position. |
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 |