Skip to main content

Subscribe to incoming events from the IOTA network.

If no filter is provided, all events will be returned.

Stream recovery

Events are streamed in transaction order, all events from a single transaction arrive contiguously before any events from the next one.

When start_after is provided with a transaction digest, the stream resumes from the transaction immediately after it.

Because a single transaction can emit multiple events, a disconnection may leave the client with only a partial set of events from the transaction it was last receiving. A transaction is considered fully received only once the client has seen an event from the following transaction (a digest change signals the previous transaction is complete).

On reconnect, clients should pass the digest of the last fully received transaction as start_after. The stream resumes from the next transaction, so no partial transaction is ever observed.

events(
startAfter: String
filter: SubscriptionEventFilter
): EventSubscriptionPayload!

Arguments

events.startAfter ● String scalar

events.filter ● SubscriptionEventFilter input

Type

EventSubscriptionPayload union

Possible responses from a subscription.

It could be one of the following:

  • A successful payload from the subscription stream.
  • A notice that the subscription has been lagged behind the network with the number of lost payloads.