Skip to content
Alchemy Logo

getEvents

POST
/{apiKey}

Clients can request a filtered list of events emitted by a given ledger range.

Stellar-RPC will support querying within a maximum 7 days of recent ledgers.

Note, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to "ingest" events into their own database for querying and serving.

If making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.

By default stellar-rpc retains the most recent 24 hours of events.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

numberoptional

Ledger sequence number to start fetching responses from (inclusive). This method will return an error if startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, startLedger must be omitted.

numberoptional

Ledger sequence number represents the end of search window (exclusive). If a cursor is included in the request, endLedger must be omitted.

object[]optional

List of filters for the returned events. Events matching any of the filters are included. To match a filter, an event must match both a contractId and a topic. Maximum 5 filters are allowed per request.

objectoptional

Pagination in stellar-rpc is similar to pagination in Horizon. See Pagination.

stringoptional

Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.

Responses

200

Was this page helpful?