A transaction that is indexed as part of the transaction history

interface IndexedTx {
    code: number;
    events: readonly Event[];
    gasUsed: number;
    gasWanted: number;
    hash: string;
    height: number;
    msgResponses: {
        typeUrl: string;
        value: Uint8Array;
    }[];
    rawLog: string;
    tx: Uint8Array;
    txIndex: number;
}

Properties

code: number

Transaction execution error code. 0 on success.

events: readonly Event[]
gasUsed: number
gasWanted: number
hash: string

Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex

height: number
msgResponses: {
    typeUrl: string;
    value: Uint8Array;
}[]

The message responses of the TxMsgData as Anys. This field is an empty list for chains running Cosmos SDK < 0.46.

Type declaration

  • Readonly typeUrl: string
  • Readonly value: Uint8Array
rawLog: string

A string-based log document.

This currently seems to merge attributes of multiple events into one event per type (https://github.com/tendermint/tendermint/issues/9595). You might want to use the events field instead.

tx: Uint8Array

Raw transaction bytes stored in Tendermint.

If you hash this, you get the transaction hash (= transaction ID):

import { sha256 } from "../lib/crypto";
import { toHex } from "../lib/encoding";

const transactionId = toHex(sha256(indexTx.tx)).toUpperCase();

Use decodeTxRaw from ../lib/proto-signing to decode this.

txIndex: number

The position of the transaction within the block. This is a 0-based index.

Generated using TypeDoc