Build path¶
POST /build-path
Quote the pair and return an executable transaction for the top route in a single call. The response contains the target contract, calldata, gas limit, and the allowanceTarget the input token must be approved for before sending. Note the deliberately capitalized Amount and Sender request fields.
Authentication
Send your API key in the api-key header.
Request body (application/json)
{
"fromChain": 8453,
"toChain": 8453,
"fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"toToken": "0x4200000000000000000000000000000000000006",
"Amount": "1000000000",
"Sender": "0x1a2B3c4D5e6F7a8B9c0D1e2F3a4B5c6D7e8F9a0B",
"slippage": 0.5,
"acquisitionMode": 0
}
Responses
| Status | Description |
|---|---|
200 |
Executable transaction for the best route. |
400 |
Invalid request or no route available for the pair. Plausible catalog codes behind the numeric status include VALIDATION_001 (invalid input) and VALIDATION_002 (invalid address format). |
401 |
Missing or invalid API key. Plausible catalog codes behind the numeric status are AUTH_001 (unauthorized access) and AUTH_002 (invalid API key). |
500 |
Unexpected server-side failure. Plausible catalog codes behind the numeric status include SYSTEM_002 (internal server error) and SYSTEM_001 (database operation failed). |
200 response
{
"code": 0,
"message": "success",
"data": {
"allowanceTarget": "0x2B4c6E9A1d3F5b7C9E0a2C4E6a8B0d2F4A6C8E01",
"chain": 8453,
"data": "0x38ed1739000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000420000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000003b9aca00",
"expiry": 1785283500,
"gasLimit": "250000",
"simulation": false,
"to": "0x2B4c6E9A1d3F5b7C9E0a2C4E6a8B0d2F4A6C8E01",
"value": "0"
}
}