Skip to main content

getEvents RPC Method

Returns the filtered list of events emitted by a given ledger range.

Updated on
Feb 21, 2024

getEvents RPC Method

Parameters

startLedger
string
REQUIRED
The ledger sequence number after which the events is to be fetched
filters
object
The list of filters for the returned events. A maximum of 5 filters are allowed per request
type
string
A list of event type (system, contract, or diagnostic) used to filter events. If omitted, all event types will be included
contractIds
array
A list of contract ids to query for events. A maximum of 5 contract IDs are allowed per request
topics
array
A list of topic filters. A maximum of 5 filters are allowed per request
pagination
object
The pagination object which contains the following fields:
cursor
string
When provided it excludes the element with an ID matching the cursor and only includes elements appearing after it in the response
limit
integer
The maximum number of records returned. By default, it is set to 100

Returns

result
object
A result object with the following field:
latestLedger
string
The latest observed ledger number by the node at the time of response generation
events
array
An array of event object which contains the following fields:
type
string
The type of event
ledger
string
The ledger number associated with the event
ledgerClosedAt
string
The timestamp when the ledger was closed in ISO 8601 format
contractId
string
The unique identifier of the contract associated with the event
id
string
A unique identifier for the event
pagingToken
string
A paging token associated with the event
inSuccessfulContractCall
boolean
A boolean indicating whether the contract call was successful or not
topic
string
An array of topic strings related to the event
value
object
An object containing an xdr field, which appears to be a serialized value associated with the event
xdr
string
The emitted body value of the event (serialized in a base64 string)
Request
1
curl --location 'https://docs-demo.stellar-mainnet.quiknode.pro/' \
2
--header 'Content-Type: application/json' \
3
--data '{
4
"jsonrpc": "2.0",
5
"id": 8675309,
6
"method": "getEvents",
7
"params": {
8
"startLedger": "LEDGER_SEQUENCE",
9
"pagination": {
10
"limit": 100
11
}
12
}
13
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free