Overview
Gasless transactions allow users to execute swaps without paying gas fees directly. Whengasless=true is passed to getAction, the API returns a set of signing steps (executions) instead of a raw transaction. The user signs each step and submits them to POST /submitTx, which handles relay and broadcast.
Supported Chains: Tron same-chain swaps only (cross-chain and EVM chains coming soon)
Requesting Gasless Execution
Add the optionalgasless query parameter to your getAction request:
Note: Omitgaslessor set it tofalsefor standard transactions.
Understanding the Response
Whengasless=true is requested and a relay provider is available for the source chain, the response includes:
| Field | Description |
|---|---|
executionsType | "GASLESS" — indicates relay execution |
executions | Ordered array of signing steps |
relayerFee | Fee charged by the relay, denominated in USDT. If non-zero, the user must hold USDT in addition to the source token |
txId | Unique action ID returned by getAction — required when calling POST /submitTx |
executionsType is "DEFAULT" (relay unavailable or gasless not set), broadcast tx directly as a standard transaction — see the swap guide.
Executing Gasless Transactions
Sign each execution in order
Iterate
executions and sign each step with the appropriate wallet method:Order matters. Fee approval steps (if present) must be signed and submitted before the swap step. The array is already in the correct order.
Complete Example
Notes
- Standard fallback: Always check
executionsType— if"DEFAULT", broadcasttxdirectly (see swap guide). - Error handling:
POST /submitTxvalidates signatures and simulates transactions before broadcasting. A400response indicates a bad signature or expiredtxId. - Relayer fee: The
relayerFeefield shows the fee deducted fromamountInto pay the relay. Display it to users alongside the swap quote.