stream.sse
Server-sent events for transactions, events, checkpoints, balances or objects, with replay from any checkpoint.
Details
- Endpoint
- GET /v1/stream
- Credits
- Free
- Rate class
- Stream. Counts against stream opens.
Opens a text/event-stream. Every event has id = cursor (checkpoint:txIndex[:eventIndex]); reconnect with Last-Event-ID or fromCheckpoint to resume with no gap and no duplicate. fromCheckpoint replays from the index in order, then joins the live tail at a checkpoint boundary; how far back depends on your plan (GET /v0/stream/replay-info). Sui filters (objectIds, eventTypes, packages, balanceAddresses) match live and in replay, and matching transactions carry a matched field with the object versions, balance deltas or calls that matched. A heartbeat arrives every 15 seconds and carries id = the last checkpoint fully delivered, so a resume skips what was already scanned. pending=true on the checkpoints topic adds event: pending for each checkpoint before it is certified (marked pending: true, no id; the certified one follows). event: reconnect means the server is restarting: reconnect with Last-Event-ID. Costs 1 credit per 10 delivered events.
Parameters
| Name | Type | Description |
|---|---|---|
| topic | string | What to stream. Default transactions.One of "transactions", "events", "checkpoints", "balances", "objects". |
| filter | string | The filter as a JSON object (or pass the fields below as flat query parameters). |
| accounts | array of string | Match transactions that touch any of these addresses (sender, gas owner, balance owner, object owner, event sender). Comma-separated in the query string. |
| accountsRequired | array of string | Match only transactions that touch all of these addresses. |
| coinTypes | array of string | Coin types with a balance change, for example 0x2::sui::SUI. |
| eventTypes | array of string | Move event types: a full type with or without type parameters, a module prefix (0xpackage::module) or a package prefix (0xpackage). Up to 100 entries on Free, 1,000 on paid plans. |
| packages | array of string | Match transactions whose PTB called these packages: 0xpackage, 0xpackage::module or 0xpackage::module::function. Any version of the package matches, so pass the original id and upgrades are covered. Up to 100 entries on Free, 1,000 on paid plans. |
| objectIds | array of string | Match any change to these object ids: created, mutated, deleted, wrapped or unwrapped. The objects topic delivers one item per change with version and kind; other topics carry matched.objects. Up to 100 entries on Free, 1,000 on paid plans. |
| balanceAddresses | array of string | Match a balance change of these addresses, narrowed by coinTypes when given (transactions and balances topics). Items carry the signed delta in the coin's smallest unit. Up to 100 entries on Free, 1,000 on paid plans. |
| types | array of string | Transaction types (SWAP, TRANSFER, ...). Objects topic: object type prefixes. |
| status | string | Transaction status. Default all.One of "all", "success", "failed". |
| senders | array of string | events topic: event senders. |
| view | string | ids = digest, checkpoint, txIndex. raw = balance changes, events, object changes. enhanced = the full parsed transaction. Default ids for transactions, raw for the rest.One of "ids", "raw", "enhanced". |
| fromCheckpoint | integer | Start (or resume) at this checkpoint. Omit to stream live only. |
| cursor | string | Resume after this cursor (same as the Last-Event-ID header). |
| pending | boolean | checkpoints topic: also send each checkpoint before it is certified, as event: pending with pending: true. Default false. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl "https://api.tide.ad/v1/stream?topic=transactions&coinTypes=0x2::sui::SUI&view=ids" \
-H "x-api-key: YOUR_API_KEY"const res = await fetch("https://api.tide.ad/v1/stream?topic=transactions&coinTypes=0x2::sui::SUI&view=ids", {
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
},
});
const data = await res.json();Response
No example response is available for this method yet.