New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: invalid BigNumber string from PancakeSwap trading bot #58
Comments
same here |
Okay, so I got this error because if this line I had to use '1' or larger amount on approve. But now I get this error instead:
Which I dont understand either because wbnb.approve returns bool so tx = true, there is no function called wait |
I already solved my previous problem above, but I got this error
|
I have same problem , What can we do? (node:15408) UnhandledPromiseRejectionWarning: Error: invalid BigNumber string (argument="value", value="replace by amount covering several trades", code=INVALID_ARGUMENT, version=bignumber/5.0.15) |
You need to replace "replace by amount covering several trades" with value, put "1" or more. We need to set gas price and limit manual.
|
Yea this is the error where I am stuck too !! Hope this helps 🤘 |
Try it and let know |
Promise {
I have this error, how I can solve it? |
Hello Everyone.. Getting this error.. any idea how to fix this? events.js:174 throw er; // unhandled 'error' event |
Can you share your code? |
Can you share code? |
const provider = new ethers.providers.WebSocketProvider('my url here in https not wss') const wbnb = new ethers.Contract( const init = async () => { factory.on('PairCreated', async (token0, token1, pairAddress) => { //The quote currency needs to be WBNB (we will pay with WBNB) if(token1 == addresses.WBNB) { //The quote currency is not WBNB //We buy for 0.1 BNB of the new token init(); |
Hi @ivekivek, It is pretty much the stock code.. just commented out a few lines as I dont want to make a purchase or approve WBNB.. added logs.. to see where it is failing.. let me know if u r able to get it to work const ethers = require('ethers'); const addresses = { //First address of this mnemonic must have enough BNB to pay for tx fess const provider = new ethers.providers.WebSocketProvider('wss://apis.ankr.com/wss/....'); //Ankr websocket url to mainnet console.log('Transaction receipt11'); factory.on('error', function(err){ factory.on('PairCreated', async (token0, token1, pairAddress) => {
console.log( //The quote currency needs to be WBNB (we will pay with WBNB) if(token1 == addresses.WBNB) { //The quote currency is not WBNB //We buy for 0.1 BNB of the new token /* const tx = await router.swapExactTokensForTokens( const receipt = await tx.wait(); init(); |
this doesn't work dude! still issue persist |
Really looking forward to hopefully fixing this issue guys :) |
add nounce inside the tx object |
It is working like that? |
Code example? |
// i added the line below this comment to solve my issues for the approve. Now I need help with setting gas limit and gas because estimation isn't working and i don't know where to put them for the transaction |
Hi All, Can anyone advise here? transaction failed (transactionHash="", transaction={"nonce":,"gasPrice":{"type":"BigNumber","hex":""},"gasLimit":{"type":"BigNumber","hex":"0x061a80"},"to":"","value":{"type":"BigNumber","hex":"0x00"},"data":"0xa5be382e000000000000000000000000000000000000000000000000000009184e72a000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000b083653f11a5133868d56dacd723b837e27b7d17000000000000000000000000000000000000000000000000000001799a15a8690000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000b3225ac90b741f762beca76dea1ead278ef26a96","chainId":56,"v":148,"r":"","s":"","from":"","hash":""}, receipt={"to":"","from":"","contractAddress":null,"transactionIndex":324,"gasUsed":{"type":"BigNumber","hex":"0x5a8b"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x2ee5c5c282a605193f282aa34e31fa18c62ff3fdc6cd996e1592be49cdb60e03","transactionHash":"0x35bb3f987f4f99fab4572db341886220a400f791cb68bce401dcf00fd5099396","logs":[],"blockNumber":7663738,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x02bf7565"},"status":0,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.0.24) |
Hey After Fixing all the above issues I am getting error Unexpected server response: 200 |
you can try hardcode the gasLimit it will solve the issue const tx = await wbnb.approve( |
you can try hardcode the gasLimit |
i have same error how did you fix this? |
Hehe got it all sorted now
…On Sat, 12 Nov 2022, 3:15 am Henry Kariuki Nyagah, ***@***.***> wrote:
Okay, so I got this error because if this line
https://github.com/jklepatch/eattheblocks/blob/master/screencast/348-pancakeswap-trading-bot/bot.js#L41
I had to use '1' or larger amount on approve. But now I get this error
instead:
(node:21550) UnhandledPromiseRejectionWarning: TypeError: tx.wait is not a function
at init (/home/pancake-trading-bot/bot.js:44:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:21550) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21550) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Which I dont understand either because wbnb.approve returns bool so tx =
true, there is no function called wait
I already solved my previous problem above, but I got this error
UnhandledPromiseRejectionWarning: Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"cannot estimate gas; transaction may fail or may require manual gas limit","code":"UNPREDICTABLE_GAS_LIMIT"
you can try hardcode the gasLimit it will solve the issue
const tx = await wbnb.approve(
router.address,
valueToapprove,
{
gasLimit:100000
}
);
—
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATGNCO443IWD5F3P7NCJARLWHZWLPANCNFSM443IC7LQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Did you get through the blocker?
On Mon, Nov 21, 2022 at 5:58 AM SloboZjalic ***@***.***>
wrote:
… Hehe got it all sorted now
On Sat, 12 Nov 2022, 3:15 am Henry Kariuki Nyagah, ***@***.***>
wrote:
> Okay, so I got this error because if this line
>
>
https://github.com/jklepatch/eattheblocks/blob/master/screencast/348-pancakeswap-trading-bot/bot.js#L41
> I had to use '1' or larger amount on approve. But now I get this error
> instead:
>
> (node:21550) UnhandledPromiseRejectionWarning: TypeError: tx.wait is not
a function
> at init (/home/pancake-trading-bot/bot.js:44:28)
> at process._tickCallback (internal/process/next_tick.js:68:7)
> (node:21550) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was not
handled with .catch(). (rejection id: 1)
> (node:21550) [DEP0018] DeprecationWarning: Unhandled promise rejections
are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
>
> Which I dont understand either because wbnb.approve returns bool so tx =
> true, there is no function called wait
>
> I already solved my previous problem above, but I got this error
>
> UnhandledPromiseRejectionWarning: Error: cannot estimate gas;
transaction may fail or may require manual gas limit
(error={"reason":"cannot estimate gas; transaction may fail or may require
manual gas limit","code":"UNPREDICTABLE_GAS_LIMIT"
>
> you can try hardcode the gasLimit it will solve the issue
>
> const tx = await wbnb.approve(
> router.address,
> valueToapprove,
> {
> gasLimit:100000
> }
> );
>
> —
> Reply to this email directly, view it on GitHub
> <
#58 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ATGNCO443IWD5F3P7NCJARLWHZWLPANCNFSM443IC7LQ
>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLLIIYJAH6G3I6EHTBLJQ3WJLQONANCNFSM443IC7LQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
All the errors are there
…On Sat, 12 Nov 2022, 3:15 am Henry Kariuki Nyagah, ***@***.***> wrote:
Okay, so I got this error because if this line
https://github.com/jklepatch/eattheblocks/blob/master/screencast/348-pancakeswap-trading-bot/bot.js#L41
I had to use '1' or larger amount on approve. But now I get this error
instead:
(node:21550) UnhandledPromiseRejectionWarning: TypeError: tx.wait is not a function
at init (/home/pancake-trading-bot/bot.js:44:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:21550) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21550) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Which I dont understand either because wbnb.approve returns bool so tx =
true, there is no function called wait
I already solved my previous problem above, but I got this error
UnhandledPromiseRejectionWarning: Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"cannot estimate gas; transaction may fail or may require manual gas limit","code":"UNPREDICTABLE_GAS_LIMIT"
you can try hardcode the gasLimit it will solve the issue
const tx = await wbnb.approve(
router.address,
valueToapprove,
{
gasLimit:100000
}
);
—
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATGNCO443IWD5F3P7NCJARLWHZWLPANCNFSM443IC7LQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Ok, I will check.
On Mon, Nov 21, 2022 at 12:13 PM SloboZjalic ***@***.***>
wrote:
… All the errors are there
On Sat, 12 Nov 2022, 3:15 am Henry Kariuki Nyagah, ***@***.***>
wrote:
> Okay, so I got this error because if this line
>
>
https://github.com/jklepatch/eattheblocks/blob/master/screencast/348-pancakeswap-trading-bot/bot.js#L41
> I had to use '1' or larger amount on approve. But now I get this error
> instead:
>
> (node:21550) UnhandledPromiseRejectionWarning: TypeError: tx.wait is not
a function
> at init (/home/pancake-trading-bot/bot.js:44:28)
> at process._tickCallback (internal/process/next_tick.js:68:7)
> (node:21550) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was not
handled with .catch(). (rejection id: 1)
> (node:21550) [DEP0018] DeprecationWarning: Unhandled promise rejections
are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
>
> Which I dont understand either because wbnb.approve returns bool so tx =
> true, there is no function called wait
>
> I already solved my previous problem above, but I got this error
>
> UnhandledPromiseRejectionWarning: Error: cannot estimate gas;
transaction may fail or may require manual gas limit
(error={"reason":"cannot estimate gas; transaction may fail or may require
manual gas limit","code":"UNPREDICTABLE_GAS_LIMIT"
>
> you can try hardcode the gasLimit it will solve the issue
>
> const tx = await wbnb.approve(
> router.address,
> valueToapprove,
> {
> gasLimit:100000
> }
> );
>
> —
> Reply to this email directly, view it on GitHub
> <
#58 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ATGNCO443IWD5F3P7NCJARLWHZWLPANCNFSM443IC7LQ
>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLLII5HSBJRCFHMMQQHKC3WJM4MRANCNFSM443IC7LQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Alright so instead of using wait( ) function you can use the waitForTransaction function from ethers, which takes in the transaction hash of the transaction broadcasted , number of confirmation and timeout in milliseconds ...assuming that the tx returns a successful transaction hash and that it's accessed as tx.data : you can do the following example
|
Hi,
Following your latest youtube video with PancakeSwap trading bot, I get this error and can't seem to find why or where it happens:
Any idea?
The text was updated successfully, but these errors were encountered: