POST /v1/shortcuts/bundle
Request
Query Parameters:
Query Param | Description | Example |
---|---|---|
fromAddress | Ethereum address of the wallet to send the transaction from (It could be an EoA, or a Smart Wallet) | tokenIn=0x6b175474e8909... |
chainId | (Optional) The chainId of the network. Default value is 1 for Mainnet | chainId=1 |
Body:
An array of objects (specific actions) with the following structure:
[
{
"protocol": "", // protocol name (e.g. "yearn")
"action": "", // action name (e.g. "deposit")
"args": {} // Arguments of the action
}
]
Args are action specific and you can find them in the Actions section. A simple example for the route actions can be:
{
"tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH
"tokenOut": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", // stETH
"amountIn": 10000000000
}
Examples
Bundle multiple route actions in a single transaction. Route specific amounts of Ether into stEth and steCrv (a Curve LP token)
Both transactions are bundled together in a single one.
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer 1e02632d-6feb-4a75-a157-documentation' \
-d '[
{
"protocol": "enso",
"action": "route",
"args": {
"tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"tokenOut": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"amountIn": "1000000000"
}
},
{
"protocol": "enso",
"action": "route",
"args": {
"tokenIn": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"tokenOut": "0x06325440d014e39736583c165c2963ba99faf14e",
"amountIn": "1000000000"
}
}
]' \
'https://api.enso.finance/api/v1/shortcuts/bundle?chainId=1&fromAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'