β‘Execution
Chain
RouterV2
Using Calldata from the Route API
const response = await fetch(
'https://api.liqd.ag/v2/route?tokenIn=0x5555...&tokenOut=0xB8CE...&amountIn=100&chainId=999'
);
const routeData = await response.json();
if (routeData.success && routeData.execution) {
const transaction = {
to: routeData.execution.to,
data: routeData.execution.calldata,
value: 0, // set if swapping from the chain's native token
};
const result = await signer.sendTransaction(transaction);
}executeSwaps
Name
Type
Description
executeSwapsWithData
Native Token Unwrapping
Last updated