ModuleEvent event_index
definition for 0,1,2?
#232
-
Discord user IDNo response Describe your question in detail.When exploring graphQl api for module events, what is the definition/meaning of event_index 0,1,2, how they are decided? ![]() What error, if any, are you getting?No response What have you tried or looked at? Or how can we reproduce the error?yes, use api https://cloud.hasura.io/public/graphiql?endpoint=https://api.testnet.aptoslabs.com/v1/graphql Which operating system are you using?macOS Which SDK or tool are you using? (if any)REST API Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Event indexThe indices indicate the order of emitted events during the TX. After an event is emitted, the event index is incremented. Hello World exampleFor your hello world example, the So, when you query against this TX, you'll see the first event ( Other examplesCheck out the docs-supplied example for a showcase of a TX with 4 events. |
Beta Was this translation helpful? Give feedback.
Event index
The indices indicate the order of emitted events during the TX. After an event is emitted, the event index is incremented.
Hello World example
For your hello world example, the
MessageChange
event was emitted first and the TX ended with theFeeStatement
event. Only two events were emitted.So, when you query against this TX, you'll see the first event (
MessageChange
) as being index 0, and the second/last event (FeeStatement
) as being index 1.Other examples
Check out the docs-supplied example for a showcase of a TX with 4 events.