Catching events from promises

How does the frontend listen for contract events?

When reloading, or after a custom interaction from the user, the application performs queries to The Graph, and retrieves data from active node operators listening and indexing our selected contract events (Learn more).

Our subgraph on the Hosted Service.
The API to make queries to.

The subgraph, deployed on The Graph Network, is available for queries on the Hosted Service. It contains:

  • subgraph.yaml: a manifest that describes the data it's interested in ;

  • schema.graphql: a schema that defines the data entities, and how the queries should be performed ;

  • promise-factory.ts: a mapping that handles the custom actions, by translating the data it receives into understandable entities we defined in the schema.

Manifest

Schema

Mapping

Handling PromiseContractCreated

Handling ParticipantAdded

Handling TwitterAddVerifiedSuccessful

Resources

Last updated