For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Swap Data

Get a swap quote and calldata

get

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.

Query parameters
sessionIdstring · uuidRequired

Session identifier UUID from POST /create-session

Example: ffd74231-0672-48c7-bd82-9f72a803578b
noncestring · uuidRequired

Per-request UUID. Echoed back in the response.

Example: ff3ce3a6-0808-4c94-a735-76dd415e4664
chainIdstringRequired

Chain ID (e.g. 10 for Optimism, 501 for Solana mainnet, 728126428 for Tron mainnet)

Example: 10
inputTokenAddressstringRequired

Token address to swap from

Example: 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
outputTokenAddressstringRequired

Token address to swap to

Example: 0x94b008aA00579c1307b0EF2c499aD98a8ce58e58
amountstringRequired

Input amount as a decimal string (e.g. "1.2" for 1.2 USDC)

Example: 1.2
slippagePercentagenumberOptional

Maximum allowed slippage as a percentage (e.g. 0.5 for 0.5%)

Example: 0.5
Header parameters
x-hinkal-request-signaturestringRequired

Hex-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.

Responses
200

Swap quote

application/json
get/get-swap-data
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