This action demonstrates a common post-swap operation: transferring the newly acquired ERC20 tokens to a different address. The operation targets the ERC-20 token contract (target) and calls the transfer(address to, uint256 value) function. The recipient address is a static value, while the token amount is dynamically populated by setting populateDynamically: true and providing the token's contract address in balanceSourceToken. This effectively transfers the entire balance of the swapped token.
Request Body
{"actions":[{"target":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","functionSignature":"function transfer(address to, uint256 value)","args":[{"value":"0x718648C8c531F91b528A7757dD2bE813c3940608","populateDynamically":false},{"value":"0","populateDynamically":true,"balanceSourceToken":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}],"value":"0","isNativeTransfer":false}]}
Get Swap Approval Details
post
Retrieves the required checks, transaction data, and fee information to execute a crosschain swap. This endpoint is called before executing the actual swap transaction.
Query parameters
tradeTypestringRequired
The type of trade.
Example: exactInput
amountstringRequired
The amount of the input token to be swapped, in its smallest unit (e.g., wei for ETH).