SCA UserOperation Gas Estimation calculation #976
Unanswered
AbhishekCDN
asked this question in
Issues
Replies: 1 comment 1 reply
-
Hi @AbhishekCDN - you should not need to do any additional estimates. What do you mean by "show on UI"? You can use the sendUserOperation call directly to estimate gas and send the UO. The values will fluctuate each time estimates are run depending on network activity. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
We are using the buildUserOperation function of the modular account client to fetch the Gas Estimation for a UserOperation.
We get three fields
What calculations should we perform on these to get a single-value network fee estimate for UO to show on UI?
Current Implementation
We add up all three
let network_fee = (callGasLimit + verificationGasLimit + preVerificationGas) * gasPrice
Inference
Sometimes using the above method gives a much lower value, than what we get when sending the UO.
Beta Was this translation helpful? Give feedback.
All reactions