Skip to main content

Overview

LogIndex is a branded number type representing a log’s position within a transaction receipt. Indices start at 0 for the first log emitted.

Type Definition

Creating LogIndexes

from

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

Converting LogIndexes

toNumber

Convert to number (zero-cost).

Comparing LogIndexes

equals

Check equality.

Usage in Event Logs

LogIndex appears in event logs to indicate position within a receipt:

Errors

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

See Also