TxResponse defines a structure containing relevant tx data and metadata. The tags are stringified and the log is JSON decoded.

interface TxResponse {
    code: number;
    codespace: string;
    data: string;
    events: Event[];
    gasUsed: bigint;
    gasWanted: bigint;
    height: bigint;
    info: string;
    logs: ABCIMessageLog[];
    rawLog: string;
    timestamp: string;
    tx?: Any;
    txhash: string;
}

Properties

code: number

Response code.

codespace: string

Namespace for the Code

data: string

Result bytes, if any.

events: Event[]

Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those emitted from the ante. Whereas Logs contains the events, with additional metadata, emitted only by processing the messages.

Since: cosmos-sdk 0.42.11, 0.44.5, 0.45

gasUsed: bigint

Amount of gas consumed by transaction.

gasWanted: bigint

Amount of gas requested for transaction.

height: bigint

The block height

info: string

Additional information. May be non-deterministic.

The output of the application's logger (typed). May be non-deterministic.

rawLog: string

The output of the application's logger (raw string). May be non-deterministic.

timestamp: string

Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time.

tx?: Any

The request transaction bytes.

txhash: string

The transaction hash.