'./artifacts/contracts/token_swap.sol/AeroSwap.json'Ĭonst file = fs.readFileSync(dir, 'utf8')Įxport const createTokenSwapInstance = new ethers. My API for buy_token: import from 'ethers' Įxport const provider = new (infuraId)Ĭonst signer = new ethers.Wallet('', provider) I want to know how to implement that.(My code below works for 1 user because I am using private key of my address directly) what I want : Use the same code for different users But my requirement is that the signer changes based on the user. The syntax of the forEach () method is: array. My API works when I use the signer with a predefined private address. I have also created an API to buy my token. I have also created frontend with next.js and ethers.js everything works perfectly. I have a ERC20 token and I have created smart contract to buy and sell the token.
0 Comments
Leave a Reply. |