Skip to content

Support new ink! contract events #5789

@ascjones

Description

@ascjones

I'm submitting a ...

  • Bug report
  • Feature request
  • Support request
  • Other

ink! events are changing in version 5.0. See use-ink/ink#1827, and https://use.ink/5.x/basics/events/.

The most important change is that there is a new field on each event definition in the metadata: signature_topic which must now be used to identify the type of event being received. Previously the index of the event i.e its position in the json array was used to determine which event to decode.

Now when handling an event, the first topic of the substrate event is matched to that signature topic in the metadata. If the event is anonymous, there is no signature topic in that case the raw hex bytes of the event can be returned and leave it up to the user what to do there.

Event decoding here:

#createEvent = (spec: ContractEventSpecLatest, index: number): AbiEvent => {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions