β Set Allowance
Before the SWAP transaction, you need to get permission from the user for the amount of tokens equal to the transaction amount.
import Swapper from "swapper"
const service = new Swapper({ apiKey: 'YOUR_API_KEY' });
service.setAllowance({
ownerAddress: '0x123', // your web3 wallet address
sellTokenAddress: '0x3019bf2a2ef8040c242c9a4c5c4bd4c81678b2a1', // token address to create allowance for
});
Last updated