Skip to main content

Try it Live

Run EventLog examples in the interactive playground

    Usage Patterns

    From RPC Response

    Minimal Log (Testing)

    Complete Log with Metadata

    Anonymous Event

    Type Details

    EventLogParams

    Field Requirements

    Required:
    • address - Must be valid 20-byte address
    • topics - Array of 32-byte hashes (can be empty)
    • data - Event data as Uint8Array (can be empty)
    Optional:
    • blockNumber - Present for mined logs, undefined for pending
    • blockHash - Present for mined logs, undefined for pending
    • transactionHash - Present for mined logs, undefined for pending
    • transactionIndex - Transaction position in block
    • logIndex - Log position in block (used for sorting)
    • removed - Chain reorganization flag (defaults to false)

    Topics Array

    Maximum 4 topics:
    • Non-anonymous events: topic0 = signature, topic1-3 = indexed params (max 3)
    • Anonymous events: topic0-3 = indexed params (max 4)

    See Also

    • create - Explicit constructor (alias for from)
    • clone - Deep clone existing log
    • Fundamentals - Event log structure and topics