Closed Erreth-Akbe closed 2 years ago
We can not get correct gas price in polygon network.
Can easily reproduce by publishing or any other transcation.
web3.js's contract type has an option value for gas price, we should set this when it is constructed. https://web3js.readthedocs.io/en/v1.7.3/web3-eth-contract.html But now I have not figured out when it is constructed. And for get gas price we need get it from provider. So we need add a method in ProviderBase class. And maybe we need turn it to an abstrct class. https://metamask.github.io/api-playground/api-documentation/#eth_gasPrice But I have not seen wallet connect's provider has this API. https://docs.walletconnect.com/json-rpc-api-methods/ethereum Maybe we need a class which we can give different chainID to get different gas price on different chain.
refactor branch.
Roger that, I'll add a workaround recently.
What's going wrong?
We can not get correct gas price in polygon network.
How to reproduce?
Can easily reproduce by publishing or any other transcation.
Expected behavior
web3.js's contract type has an option value for gas price, we should set this when it is constructed. https://web3js.readthedocs.io/en/v1.7.3/web3-eth-contract.html But now I have not figured out when it is constructed. And for get gas price we need get it from provider. So we need add a method in ProviderBase class. And maybe we need turn it to an abstrct class. https://metamask.github.io/api-playground/api-documentation/#eth_gasPrice But I have not seen wallet connect's provider has this API. https://docs.walletconnect.com/json-rpc-api-methods/ethereum Maybe we need a class which we can give different chainID to get different gas price on different chain.
Context
refactor branch.