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

Invalid object key when sending transaction #53

Open
4xMafole opened this issue Dec 26, 2022 · 0 comments
Open

Invalid object key when sending transaction #53

4xMafole opened this issue Dec 26, 2022 · 0 comments

Comments

@4xMafole
Copy link

Describe the bug
I get this problem when I create a custom transaction request and try to send it using the provider's signer.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom transaction request
     final TransactionRequest transactionRequest = TransactionRequest(
      to: null,
      from: await provider!.getSigner().getAddress(),
      data: data,
      gasLimit: BigInt.from(2000000),
      maxFeePerGas: null,
      maxPriorityFeePerGas: null,
    );
  1. send the transaction using the current provider's signer
    final transaction =
        await provider!.getSigner().sendTransaction(transactionRequest);

    final signature = await transaction.wait();

    return signature.transactionHash;
  1. Error
    You'll end up having this error on the console:
Error: EthersException: INVALID_ARGUMENT invalid object key - maxFeePerGas
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49  throw_
packages/flutter_web3/src/ethers/signer.dart 72:13                                                                         sendTransaction

Expected behavior
The expectation is to send the transaction and return the appropriate transaction hash.

Additional context
I did a research about the problem and found out this issue here on ethers.js repository. As the solution is to add a field named type but seems the TransactionRequest class does not have that field.

@4xMafole 4xMafole changed the title INVALID_ARGUMENT invalid object key - maxFeePerGas Invalid object key when sending transaction Dec 26, 2022
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

1 participant