Skip to content

Implement event listeners #121

@ryangoree

Description

@ryangoree

It would be useful if callbacks could be attached to contract events to do things like update a trading activity table in a UI when a Transfer event is emitted. An initial implementation could involve polling for new events starting from the block number of the latest fetched event, and firing registered callbacks if events with later block numbers are returned.

Additional listeners for the following events should also be considered:

  • block created
  • signer changed

Inspired by: https://github.com/flayerlabs/flaunch-sdk/blob/6e182c45e53f4f98cb00cec544bbe739a6738775/src/clients/FlaunchPositionManagerClient.ts#L144

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions