On this page

Enable GasFree Trace Streaming

API-v2stream::gasless_trace::enable

Streams live status updates for TRON GasFree (gasless) TRC20 transfers of a given token. Once enabled, every gasless transfer submitted for that coin via send_raw_transaction is tracked automatically, and the stream emits an event each time a tracked transfer changes state, until it reaches a terminal state (confirmed or failed).

Parameter* = requiredTypeDescription
coin*
string
Ticker of the TRON GasFree TRC20 token to stream transfer-status updates for. The token must be activated with a GasFree provider first.
client_id
integer
default: `0`
Optional. In the case of a single client, this defaults to 0. This ID can be used to access data via http://localhost:7783/event-stream?id=1

The coin must be an activated TRON GasFree TRC20 token (i.e. activated with a tron_gasless_provider). The polling interval follows the provider's status_poll_interval_ms set at activation. Disable the stream with stream::disable.

Parameter* = requiredTypeDescription
streamer_id
string
Optional. An identifier for the data stream, of the form GASLESS_TRACE:<COIN>. This can be used later to disable streaming for the event with stream::disable.

Gasless Trace Enable

POST
stream::gasless_trace::enable
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "stream::gasless_trace::enable",
  "mmrpc": "2.0",
  "params": {
    "coin": "USDT-TRC20",
    "client_id": 1
  }
}
{
    "mmrpc": "2.0",
    "result": {
        "streamer_id": "GASLESS_TRACE:USDT-TRC20"
    },
    "id": null
}

Each event carries the tracked transfer's trace_id and its current status. The status fields are described below.

Parameter* = requiredTypeDescription
coin*
string
Ticker of the token the tracked transfer belongs to.
state*
string
Lifecycle state of the transfer. One of pending, submitted, on_chain, confirmed, or failed. confirmed and failed are terminal states.
trace_id*
string
Identifier of the tracked GasFree transfer (returned as fee_details.trace_id by a gasless withdraw).
block_height
integer
Optional. Block height the transfer was included in, once on chain.
confirmed_at
integer
Optional. Unix timestamp (seconds) of block inclusion, once on chain.
failure_reason
string
Optional. Reason for failure, present only when state is failed.
final_fee
numeric string
Optional. Total fee charged in the token, available once the transfer is on chain.
tx_hash_on_chain
string
Optional. On-chain transaction hash, present once the transfer reaches the on_chain state.

Example of the stream data visible at http://localhost:7783/event-stream?id=1 as a transfer progresses:

data: {"_type":"GASLESS_TRACE:USDT-TRC20","message":{"coin":"USDT-TRC20","trace_id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0","state":"on_chain","tx_hash_on_chain":"2222222222222222222222222222222222222222222222222222222222222222","block_height":57175988,"confirmed_at":1747909638,"final_fee":"2.000000","failure_reason":null}}

When polling the provider fails, an error event is emitted instead, carrying the coin, trace_id, and an error message:

data: {"_type":"GASLESS_TRACE:USDT-TRC20","message":{"coin":"USDT-TRC20","trace_id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0","error":"Request to GasFree provider timed out"}}

The same status fields are returned synchronously (without a stream) by the gasless::trace_status method, which is useful for one-off polling.

Parameter* = requiredTypeDescription
CoinNotFound
string
Optional. The specified coin was not found or is not activated yet.
CoinNotSupported
string
Optional. The coin does not support GasFree trace streaming (only TRON GasFree TRC20 tokens do).
EnableError
string
Optional. Failed to enable the GasFree trace streamer.
GaslessNotConfigured
string
Optional. The coin has no GasFree provider configured. Activate it with a tron_gasless_provider first.
Internal
string
Optional. An internal error occurred while enabling the streamer.
{
    "mmrpc": "2.0",
    "error": "Coin 'KMD' does not support GasFree trace streaming",
    "error_path": "gasless_trace",
    "error_trace": "gasless_trace:67]",
    "error_type": "CoinNotSupported",
    "error_data": "KMD",
    "id": null
}
{
    "mmrpc": "2.0",
    "error": "Coin 'USDT-TRC20' has no GasFree provider configured",
    "error_path": "gasless_trace",
    "error_trace": "gasless_trace:74]",
    "error_type": "GaslessNotConfigured",
    "error_data": "USDT-TRC20",
    "id": null
}