Replies: 1 comment 4 replies
-
Seems your bot is on the frontend itself and sending tx using user's wallet. Metamask asks this for safety of the user. Imagine going to a random site and then funds move out of user's wallet without asking for confirmation. What you could do is move user's funds to a temporary wallet ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
HI,
I am coding a bot program that interacts with Pancakeswap router to make a SwapExacTokensToTokens when a good price came.
The intended work flow is:
(1) User approves the fund on Metamask to be used by Pancakeswap Router; During this procedure, Metamask will have a pop up dialog to ask user to click Confirm button
(2) Bot handle trading logics and when time is come:
(3) Bot cal SwapExacTokensToTokens on Router contract. But then the Metamask dialog box is poping up once again, requiring user to click the button (!?) How can I avoid this second time approval request?
My code looks like this for now:
`
async function swapFunction() {
Beta Was this translation helpful? Give feedback.
All reactions