Skip to main content

Interface: IndexedTx

@shareledgerjs/client.IndexedTx

A transaction that is indexed as part of the transaction history

Properties

code

Readonly code: number

Transaction execution error code. 0 on success.


events

Readonly events: readonly Event[]


gasUsed

Readonly gasUsed: number


gasWanted

Readonly gasWanted: number


hash

Readonly hash: string

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


height

Readonly height: number


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.


tx

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