Skip to content

Event Log types #415

Closed
Closed
@epheph

Description

In abstract-provider, the type for a Log is defined as:

export interface Log {
    blockNumber?: number;
    blockHash?: string;
    transactionIndex?: number;

    removed?: boolean;

    transactionLogIndex?: number,

    address: string;
    data: string;

    topics: Array<string>;

    transactionHash?: string;
    logIndex?: number;
}

I see that many of these are marked as optional with a ? . Some, like transactionHash, seem like they would always have to be there and others, like blockHash should perhaps be nullable and not optional (only if you wanted to match the JSON-RPC API more closely).

It seems that there are two types of Logs that get returned, one from a getLogs of a mined transaction (including logIndex, blockHash, etc) and one from a getLogs of pending (or from eth_getFilterChanges?), which has Object keys that are nullable/undefined?

Does that sound right architecturally?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    discussionQuestions, feedback and general information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions