ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Error with effectiveGasPrice using Rabby wallet on BNB chain

Open cosullivan opened this issue 8 months ago • 0 comments

Ethers Version

6.13.0

Search Terms

effectiveGasPrice

Describe the Problem

I am getting the following error under specific conditions;

Error: invalid value for value.index (invalid numeric value (argument="value", value=null, code=INVALID_ARGUMENT, version=6.12.1)) (value={ "effectiveGasPrice": "0x4190ab00", "id": 3045221368, "jsonrpc": "2.0", "result": null }, code=BAD_DATA, version=6.12.1)
    at makeError (ethers.js?v=b7347e42:361:15)
    at assert (ethers.js?v=b7347e42:374:11)
    at ethers.js?v=b7347e42:16132:9
    at formatTransactionReceipt (ethers.js?v=b7347e42:16245:10)
    at BrowserProvider._wrapTransactionReceipt (ethers.js?v=b7347e42:17368:35)
    at BrowserProvider.getTransactionReceipt (ethers.js?v=b7347e42:17727:17)
    at async _TransactionResponse.wait (ethers.js?v=b7347e42:14329:21)

It is ocurring when using the Rabby wallet extenion and the BNB Chain RPC. MetaMask works fine, and Rabby works fine on Arbitrum.

const transactionResponse = await provider.getTransaction(transaction.txHash);

// the error is thrown on the call to wait
await transactionResponse.wait(1);

Note that if I put a delay of 2 seconds before calling wait() then it seems to work fine. I can also fetch the transaction receipt from the RPC afterwards using the eth_getTransactionReceipt call and the effectiveGasPrice does come back.

"effectiveGasPrice": "0x4190ab00",

My only thoughts are that the effectiveGasPrice value isnt being returned immediately and that ethers is always expecting it to exist?

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

cosullivan avatar Jun 12 '24 03:06 cosullivan