Skip to main content
POST
TypeScript

Path Parameters

blockchain
enum<string>
required

Blockchain served by this service.

Available options:
tron

Body

application/json
dstAddress
string
required

Wallet that signs the transaction and receives the output.

path
object
required

Quote path: data of the quote response can be passed as is. Only addressTokenIn, addressTokenOut and amountIn are used; the route is quoted again on the current pool state.

fromAddress
string | null

Source wallet. On Tron the signer receives the output, so when set it must be the same address as dstAddress.

slippageBps
integer<int32> | null

Slippage in bps for minReturnAmountOut (not below the service minimum, 50 bps).

Required range: x >= 0

Response

Swap call and unsigned transaction

amountOut
string
required

Expected output of the route the transaction was built for.

data
string
required

Calldata of the call (selector + ABI arguments), 0x-prefixed hex

feeLimit
integer<int64>
required

Fee limit of the transaction, in SUN

Required range: x >= 0
minReturnAmountOut
string
required

Minimum amount to receive in destination token's smallest units.

to
string
required

Contract called by the transaction (transaction to)

unsignedTx
any
required

Unsigned transaction from the node (/wallet/triggersmartcontract response, same as unsigned_tx of POST /api/swap): sign and broadcast its transaction.

value
string
required

TRX attached to the call (callValue), in SUN

tokenApprovalAddress
string | null

Address that the user must approve for TRC-20 spending. Null when the input token is native TRX or for TRX <-> WTRX.