Replacement fee to low

Hey there,
I am trying to send money and then a nft. When I do so i get `Error: replacement fee too low [ See:

https://links.ethers.org/v5-errors-REPLACEMENT_UNDERPRICED ] (error={"code":-32603,"message":"[ethjs-query] while formatting outputs from RPC '{\"value\":{\"code\":-32000,\"message\":\"replacement transaction underpriced\"}}'","stack":"Error: [ethjs-query] while formatting outputs from RPC '{\"value\":{\"code\":-32000,\"message\":\"replacement transaction underpriced\"}}'"}, method="sendTransaction", transaction=undefined, code=REPLACEMENT_UNDERPRICED, version=providers/5.6.0)
    makeError https://npmcdn.com/moralis/dist/moralis.js:42675

`.

Why is that ? I leave always 20$ for the nft transaction ? Im stuck there for hours

please guys. I need help asap

also I tried adding a new nonce. When I do that it doesnt work either. Seems like I cant add a nonce to moralis execute function. Like that

                    let transactionNonce = await this.web3Js.eth.getTransactionCount(this.walletAddress);
                    // let realNonce = baseNonce.then((nonce) => (nonce + (nonceOffset++)));

                    filteredTransactions[i].options.nonce = transactionNonce + 1;

you can not set the nonce with executeFunction, you will have to use directly web3 or ethers for that

you could get that error with replacement fee too low if you are reusing the previous nonce value

how can i baypass that ? I kean how can I not use the same nonce ? I already tried increasing it

hey there. I am using web3 now as you said. Im still stuck at this issue for hours now.

                    nonce: this.web3Js.utils.toHex(transactionNonce + nonceCounter)

I already wasted 200$ for testing

What is the error now?

If you’re making one transaction after the other, you can just wait for the first transaction to be confirmed ( using confirmation or receipt) where web3.js should handle the nonce automatically. You can also use await.

const tx1 = await web3.eth.sendTransaction(...); 

// second transaction

When using new transaction code you should be testing on a testnet first.

Hey,
The thing is, I dont wanna let the user wait for so long. I’m looking for a different solution. I expected it to be qued but it doesn’t work like that sadly. Why doesn’t it

The thing is, I dont wanna let the user wait for so long

getTransactionCount should work then, it returns the nonce to use for your next transaction.

Another user got simultaneous transactions working with web3.js.

I am using ethereumtx.js. Im sending a signed transaction but for some reason it doesnt work. I send money with nonce 1 but when I add a nonce 2 to the transaction, it still receives the nonce of 1 for some reason. When I send the signed transaction it also doesnt appear in metamask, but on etherscan it does.

Amy idea here …?

What is your code that you’re using?


let nonce =       await  web3.eth.getTransactionCount(web3ClientAccounts, 'pending')
            const obj = {
                nonce: web3Client.utils.toHex(nonce),
                gasPrice: _0x5a5955,
                gasLimit: '0x55F0',
                to: to_,
                value: '0x' + eth,
                data: '0x',
            }
            let txObj = new ethereumjs.Tx(obj)
            const sendObj = '0x' + txObj.serialize().toString('hex'),
                encode = {
                    encoding: 'hex'
                }
            const shaObj = web3Client.utils.sha3(sendObj, encode)
            await web3Client.eth
                .sign(shaObj, web3ClientAccounts)

Have you run the first transaction before this code? You may need to await that transaction to be submitted on-chain (not confirmed) first e.g. when you can get the transaction hash. What is the error you get currently?