Get Swap Data
Returns the best available swap route, its calldata, and the expected output amount. Works for both EVM and Solana chains — for Solana it returns an OKX quote.
Read-only — requires an active session. Pass sessionId and nonce as query parameters and include x-hinkal-request-signature: secp256k1_sign(SHA256("GET /get-swap-data\n" + queryString)) in the headers.
Session identifier UUID from POST /create-session
ffd74231-0672-48c7-bd82-9f72a803578bPer-request UUID. Echoed back in the response.
ff3ce3a6-0808-4c94-a735-76dd415e4664Chain ID (e.g. 10 for Optimism, 501 for Solana mainnet, 728126428 for Tron mainnet)
10Token address to swap from
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85Token address to swap to
0x94b008aA00579c1307b0EF2c499aD98a8ce58e58Input amount as a decimal string (e.g. "1.2" for 1.2 USDC)
1.2Maximum allowed slippage as a percentage (e.g. 0.5 for 0.5%)
0.5Hex-encoded compact secp256k1 signature: secp256k1_sign(SHA256(binding + "\n" + payload)), where binding is "<METHOD> <routePath>" (this route's own method and path, e.g. "POST /refresh-cache" or "GET /balance") and payload is JSON.stringify(body) for POST requests or the raw query string for GET requests. Binding the route into the signed digest stops a signature captured for one endpoint from being replayed against another. See Authentication for the full signing scheme.
Swap quote
Validation error
Invalid signature or reused nonce
Server error
GET /get-swap-data?sessionId=ffd74231-0672-48c7-bd82-9f72a803578b&nonce=ff3ce3a6-0808-4c94-a735-76dd415e4664&chainId=10&inputTokenAddress=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&outputTokenAddress=0x94b008aA00579c1307b0EF2c499aD98a8ce58e58&amount=1.2 HTTP/1.1
Host: api.hinkal.io
x-hinkal-request-signature: text
Accept: */*
{
"success": true,
"swapData": "0x6af479b200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85...",
"externalActionId": "Lifi",
"outSwapAmount": "998500",
"nonce": "ff3ce3a6-0808-4c94-a735-76dd415e4664"
}Last updated