ethers-io / ethers.js

Complete Ethereum library and wallet implementation in JavaScript.
https://ethers.org/
MIT License
7.93k stars 1.84k forks source link

Supporting Klaytn network #2504

Open hwnahm opened 2 years ago

hwnahm commented 2 years ago

According to Klaytn network manual (https://docs.klaytn.com/bapp/json-rpc/api-references/klay/transaction) they returns the transaction type value as a string.

Because of this when get receipt this error happens: Unhandled Rejection (Error): invalid BigNumber string (argument="value", value="TxTypeLegacyTransaction", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

I think just adding a line of code which is not perfect but mitigates the error:

At 195 line of providers/src.ts/formatter.ts if (typeof(number) === "string") { return 0; }

and 126 line need to be: cumulativeGasUsed: Formatter.allowNull(bigNumber);

benjioh5 commented 2 years ago

On #644 , there was a some discussion. And Klaybank made some fork of ethersjs for klaytn.

https://github.com/klaybank/ethers_providers_klaytn

ricmoo commented 2 years ago

FYI: This is coming in v6, which is far more flexible in its network support. :)