1. Contract Events
1.1 GET /events/by-ledger
Get events for all contracts in a ledger range.
Query params
from(i32, optional) – default0to(i32, optional) – defaulti32::MAXlimit(i64, optional) – default100offset(i64, optional) – default0cursor(i32, optional) – lastidfrom previous page; when set,offsetis ignored
Example
curl -X GET \
"$BASE/events/by-ledger?from=500000&to=500500&limit=50&offset=0" \
-H "Authorization: $AUTH" \
-H "Accept: application/json"1.2 GET /events/by-contract/{contract_id}
This route can do three things depending on the query string.
1.2.a just the contract
curl -X GET \
"$BASE/events/by-contract/CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA?limit=100&offset=0" \
-H "Authorization: $AUTH"1.2.b contract + ledger range
You can also do only from or only to.
1.2.c contract + topics
Topics are comma-separated in one param.
Precedence in this route:
if
fromorto→ ledger branchelse if
topics→ topics branchelse → plain
1.3 GET /events/by-contracts
Takes a comma-separated list of contracts.
Query params
contracts=ID1,ID2,...(required) – comma-separated contractIDslimit(i64, optional) – default100, max1000offset(i64, optional) – default0cursor(i32, optional) - lastidfrom previous page; when set,offsetis ignored
Example
1.4 GET /events/by-ledger/contracts
You can filter by multiple contracts AND a ledger range.
Query params
contracts=ID1,ID2,...(required) – comma-separated contractIDsfrom(i32, optional) – default0to(i32, optional) – defaulti32::MAXlimit(i64, optional) – default100, max1000offset(i64, optional) – default0cursor(i32, optional) – lastidfrom previous page; when set,offsetis ignored
Example
1.5 GET /events/by-tx/{tx_hex}
Get events tied to a single transaction.
Response shape
Every route above returns a JSON array of event objects:
id
i32
Mercury row id (opaque, monotonic; usable as a page cursor).
contract_id
string
Emitting contract (C...).
topic1…topic10
string | null
XDR-base64 event topics. Topics classify an event; they do not identify it.
data
string
XDR-base64 event data.
tx
string
Transaction hash (hex).
event_index
i32 | null
0-based position of the event within its transaction.
Last updated