Closed aaronmgdr closed 6 months ago
Additional context from Jean at Valora on Slack:
I noticed viem supports a custom estimateFeesPerGas per chain https://github.com/wagmi-dev/viem/blob/5c95fafceffe7f399b5b5ee32119e2d78a0c8acd/src/actions/public/estimateFeesPerGas.ts#L130-L137 Looks like this could be used to avoid having to manually call a custom function to take the feeCurrency into account like recommended here: https://docs.celo.org/developer/viem#gas-price
Additiona context in viem repo:
status is that I need to see what the best design is for when you want to use a custom chain fee estimator only on certain conditions and then use standard one if not as the standard one is where the custom is called.
1 option is adding a param to say skip the custom even if it exists
2 option is to refactor inside of function to be able to reuse parts
3 would be to just duplicate the code
waiting on help from viem
This issue is related to viem and might benefit from being done around the same time (while you have your head in viem):
Test values from alfajores:
Symbol | maxFeePerGas | maxPriorityFeePerGas |
---|---|---|
CELO | 8000000000n | 2000000000n |
cREAL | 63940958968n | 12788191793n |
cEUR | 11755155930n | 2351031186n |
cUSD | 12672525950n | 2534505190n |
USDC | 12672525950n | 2534505190n |
Is there an existing issue for this?
Package Version
1.0.0
Current Behavior
when using feeCurrency it is necessary to lookup gasPrice by hand as the automatic way does not factor in feeCurrency
Expected Behavior
Add a celo
estimateFeesPerGas
functioninternally this should call eth_gasPrice with feeCurrency as a param
should return
https://github.com/wagmi-dev/viem/blob/5c95fafceffe7f399b5b5ee32119e2d78a0c8acd/src/actions/public/estimateFeesPerGas.ts#L130-L137
Steps To Reproduce
No response
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response