Execute the route
// Execute the swap and deposit transaction
const tx = (await squid.executeRoute({
signer,
route,
})) as unknown as ethers.providers.TransactionResponse;
const txReceipt = await tx.wait();const transactionRequest = route.transactionRequest;
// Execute the swap transaction
const contract = new ethers.Contract(
transactionRequest.targetAddress,
[],
signer
);
const tx = await contract.send(transactionRequest.data, {
value: transactionRequest.value,
gasPrice: await provider.getGasPrice(),
gasLimit: transactionRequest.gasLimit,
});
const txReceipt = await tx.wait();Last updated