Router

Linea
EtherscanBlockscout

UNSAFE Swap Exact Tokens For Tokens

(UNSAFE_swapExactTokensForTokens)

nonpayable


amounts

Input should be passed in JSON format - Ex: ["0"]

routes

Input should be passed in JSON format - Ex: [{ "from": "0x...", "to": "0x...", "stable": true }]

to

deadline


Sign In

Use this function in your app


import { prepareContractCall, sendTransaction } from "thirdweb";
const transaction = await prepareContractCall({
contract,
method: "function UNSAFE_swapExactTokensForTokens(uint256[] amounts, (address from, address to, bool stable)[] routes, address to, uint256 deadline) returns (uint256[])",
params: [amounts, routes, to, deadline]
});
const { transactionHash } = await sendTransaction({
transaction,
account
});