Skip to main content

Interface: IndexedTx

A transaction that is indexed as part of the transaction history

Properties

code

Readonly code: number

Transaction execution error code. 0 on success.

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:38


events

Readonly events: readonly Event[]

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:39


gasUsed

Readonly gasUsed: number

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:72


gasWanted

Readonly gasWanted: number

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:73


hash

Readonly hash: string

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

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:36


height

Readonly height: number

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:32


msgResponses

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

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:68


rawLog

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

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:47


tx

Readonly tx: Uint8Array

Raw transaction bytes stored in Tendermint.

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

import { sha256 } from "@cosmjs/crypto";
import { toHex } from "@cosmjs/encoding";

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

Use decodeTxRaw from @cosmjs/proto-signing to decode this.

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:62


txIndex

Readonly txIndex: number

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

Defined in

node_modules/@cosmjs/stargate/build/stargateclient.d.ts:34