Skip to main content

Overview

TransactionIndex is a branded number type representing a transaction’s position within a block. Indices start at 0 for the first transaction in a block.

Type Definition

Creating TransactionIndexes

from

Create from number or bigint.
Validation: Must be non-negative integer.

Converting TransactionIndexes

toNumber

Convert to number (zero-cost).

Comparing TransactionIndexes

equals

Check equality.

Usage in Receipts

TransactionIndex appears in transaction receipts to indicate position within a block:

Errors

InvalidTransactionIndexError: Invalid value (negative, non-integer, wrong type).

See Also