curl --request POST \
--url https://api.enso.finance/api/v1/shortcuts/route \
--header 'Content-Type: application/json' \
--data '{
"chainId": 1,
"fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"amountIn": [
"1000000000000000000"
],
"tokenIn": [
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
],
"tokenOut": [
"0x6b175474e89094c44da98b954eedeac495271d0f"
],
"routingStrategy": "router",
"toEoa": true,
"receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"minAmountOut": null,
"slippage": "300",
"fee": [
"100"
],
"feeReceiver": "0x220866B1A2219f40e72f5c628B65D54268cA3A9D",
"ignoreAggregators": [
"<string>"
],
"ignoreStandards": [
"<string>"
],
"variableEstimates": null,
"referralCode": "<string>",
"destinationChainId": 123,
"refundReceiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
}'
{
"gas": "<string>",
"amountOut": "<string>",
"priceImpact": 123,
"feeAmount": [
"<string>"
],
"createdAt": 123,
"tx": {
"data": "<string>",
"to": "<string>",
"from": "<string>",
"value": "<string>"
},
"route": [
{
"tokenIn": [
"<string>"
],
"tokenOut": [
"<string>"
],
"protocol": "<string>",
"action": "<string>",
"primary": "<string>",
"internalRoutes": [
"<string>"
],
"args": {},
"chainId": 123,
"sourceChainId": 123,
"destinationChainId": 123
}
],
"ensoFeeAmount": [
"<string>"
]
}
Calculates optimal transaction with the best route between two tokens, which may involve several actions that interact with various DeFi protocols.
/shortcuts/route/nontokenized
.curl --request POST \
--url https://api.enso.finance/api/v1/shortcuts/route \
--header 'Content-Type: application/json' \
--data '{
"chainId": 1,
"fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"amountIn": [
"1000000000000000000"
],
"tokenIn": [
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
],
"tokenOut": [
"0x6b175474e89094c44da98b954eedeac495271d0f"
],
"routingStrategy": "router",
"toEoa": true,
"receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"minAmountOut": null,
"slippage": "300",
"fee": [
"100"
],
"feeReceiver": "0x220866B1A2219f40e72f5c628B65D54268cA3A9D",
"ignoreAggregators": [
"<string>"
],
"ignoreStandards": [
"<string>"
],
"variableEstimates": null,
"referralCode": "<string>",
"destinationChainId": 123,
"refundReceiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
}'
{
"gas": "<string>",
"amountOut": "<string>",
"priceImpact": 123,
"feeAmount": [
"<string>"
],
"createdAt": 123,
"tx": {
"data": "<string>",
"to": "<string>",
"from": "<string>",
"value": "<string>"
},
"route": [
{
"tokenIn": [
"<string>"
],
"tokenOut": [
"<string>"
],
"protocol": "<string>",
"action": "<string>",
"primary": "<string>",
"internalRoutes": [
"<string>"
],
"args": {},
"chainId": 123,
"sourceChainId": 123,
"destinationChainId": 123
}
],
"ensoFeeAmount": [
"<string>"
]
}
The response is of type object
.
Was this page helpful?