Tronergydocs

Status stream

Follow one relay operation live with Server-Sent Events.

Stream an operation

Opens a Server-Sent Events stream that pushes status changes for one operation. Use it instead of polling when you want updates within a second. See Track status for full client code.

GET/api/chain_relayers/portal/stream
curl "https://apiv2.tronergy.io/api/chain_relayers/portal/stream?operationId=8d0f6a52-6a3b-4a43-b1b0-7f9c2f0b3c11" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
operationIdstringrequiredquery

UUID of an operation you own.

Response
data: {"id":"chain_relayers.operation.progressed","payload":{"operationId":"8d0f...","status":"executing","phase":"broadcasting_user_tx"},"timestamp":1792577260000}

data: {"id":"chain_relayers.operation.completed","payload":{"operationId":"8d0f...","status":"completed","txHash":"c0ffee..."},"timestamp":1792577267000}

:heartbeat

With curl, pass -N so output is not buffered.

Events

Each event is one data: line holding { id, payload, timestamp }.

idWhen
chain_relayers.operation.status_changedThe status moved, for example reserved to executing.
chain_relayers.operation.progressedA step inside a status finished, for example a broadcast.
chain_relayers.operation.completedFinal: success.
chain_relayers.operation.failedFinal: failure. payload.errorCode says why.
chain_relayers.operation.voidedFinal: cancelled.
chain_relayers.operation.expiredFinal: expired.

Every payload has operationId. Most also have status and, when known, txHash and errorCode. Ignore event ids and fields you do not know. A payload over 4 KB is cut down to the key fields with "truncated": true. A :heartbeat comment arrives every 30 seconds.

Good to know

  • The stream does not replay past events. Open it, then read the operation once with Get an operation so you miss nothing.
  • Close the stream after a final event. If it drops, reconnect and read the operation again.
  • Browser EventSource cannot send headers. Stream from your server with x-api-key and forward updates to your frontend.

Errors: 400 Invalid operationId. Expected UUID., 404 Operation not found (unknown or not yours).