exchange
payable
Use this function in your app
const response = await fetch('https://api.thirdweb.com/v1/contracts/write', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-secret-key': '<YOUR_SECRET_KEY>'
},
body: JSON.stringify({
calls: [
{
contractAddress: "0x0E9B5B092caD6F1c5E6bc7f89Ffe1abb5c95F1C2",
method: "function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy) payable returns (uint256)",
params: [i, j, dx, min_dy]
}
],
chainId: 1,
from: "<YOUR_WALLET_ADDRESS>"
})
});
const data = await response.json();