Skip to main content
Prerequisite Readings

Abstract

This document specifies the x/auth/tx package of the Cosmos SDK. This package represents the Cosmos SDK implementation of the client.TxConfig, client.TxBuilder, client.TxEncoder and client.TxDecoder interfaces.

Contents

Transactions

TxConfig

client.TxConfig defines an interface a client can utilize to generate an application-defined concrete transaction type. The interface defines a set of methods for creating a client.TxBuilder.
The default implementation of client.TxConfig is instantiated by NewTxConfig in x/auth/tx module.

TxBuilder

The client.TxBuilder interface is as well implemented by x/auth/tx. A client.TxBuilder can be accessed with TxConfig.NewTxBuilder().

TxEncoder/ TxDecoder

More information about TxEncoder and TxDecoder can be found here.

Client

CLI

Query

The x/auth/tx module provides a CLI command to query any transaction, given its hash, transaction sequence or signature. Without any argument, the command will query the transaction using the transaction hash.
When querying a transaction from an account given its sequence, use the --type=acc_seq flag:
When querying a transaction given its signature, use the --type=signature flag:
When querying a transaction given its events, use the --type=events flag:
The x/auth/block module provides a CLI command to query any block, given its hash, height, or events. When querying a block by its hash, use the --type=hash flag:
When querying a block by its height, use the --type=height flag:
When querying a block by its events, use the --query flag:

Transactions

The x/auth/tx module provides a convenient CLI command for decoding and encoding transactions.

encode

The encode command encodes a transaction created with the --generate-only flag or signed with the sign command. The transaction is serialized to Protobuf and returned as base64.
More information about the encode command can be found running simd tx encode --help.

decode

The decode command decodes a transaction encoded with the encode command.
More information about the decode command can be found running simd tx decode --help.

gRPC

A user can query the x/auth/tx module using gRPC endpoints.

TxDecode

The TxDecode endpoint allows to decode a transaction.
Example:
Example Output:

TxEncode

The TxEncode endpoint allows to encode a transaction.
Example:
Example Output:

TxDecodeAmino

The TxDecode endpoint allows to decode an amino transaction.
Example:
Example Output:

TxEncodeAmino

The TxEncodeAmino endpoint allows to encode an amino transaction.
Example:
Example Output: