Hi. Is it possible in web3.js to approve and send tokens in one call? Now I do it like this: tokenContract.methods.approve(address, numberToWei(amount)).send({ from: user })
First, metamask ask me to approve the amount and after the approval opens the next window but it has an error message "We were not able to estimate gas." because my approval is pending. I can click on "I want to proceed anyway" and it will transfer tokens anyway but from the user's point it is not user friendly.
May 10, 2023, 10:58 AM
u can manually set those limits
May 10, 2023, 11:01 AM
could you give an example?
May 10, 2023, 11:04 AM
manually set gas limit, price, etc
May 10, 2023, 11:09 AM
I guess it is impossible to approve and send in one method call. I have to wait till approve will be minted and then call to send
May 10, 2023, 11:13 AM