Skip to content
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

RPCError: got code -32000 with msg "under min gas price". #131

Open
Asadu43 opened this issue Nov 21, 2023 · 1 comment
Open

RPCError: got code -32000 with msg "under min gas price". #131

Asadu43 opened this issue Nov 21, 2023 · 1 comment

Comments

@Asadu43
Copy link

Asadu43 commented Nov 21, 2023

I have Signed Transaction Like this

var response = await client.sendTransaction(
credentials,
chainId: chainId,
Transaction(
from: address,
to: EthereumAddress.fromHex(_recieverAddressController.text.trim()),
gasPrice: EtherAmount.inWei(BigInt.one),
maxGas: 100000,
value: EtherAmount.inWei(BigInt.from(weiUnit)),
),
);

@reasje
Copy link

reasje commented Feb 14, 2024

There are some problems with your code :

  1. gas price (Gas price per unit of gas) is not a static number, Please send that as null or try to get the gas price with getGasPrice() web3dart function.
  2. Amount of max gas is also static which is not recommended since that is going to differ from tx to tx depending on the kind of tx, You can also get gas estimation with estimateGas() function by passing tx details.
  3. Value also seems to be unknown type or value plz check that too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants