-
Notifications
You must be signed in to change notification settings - Fork 152
Extra info /transaction/cost endpoint #1139
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the documentation for the /transaction/cost REST API endpoint by providing comprehensive explanations of how gas estimation works. The changes add detailed context about the endpoint's functionality, smart contract interactions, and best practices for usage.
Key changes:
- Expanded explanation of how the gas estimation endpoint works including simulation details
- Added detailed FAQ-style sections covering smart contracts, variable gas usage, nonce requirements, and potential estimation differences
- Updated parameter requirements (nonce is now required) and added options parameter
| :::tip | ||
| This endpoint returns the cost on the transaction in **gas units**. The returned value can be used to fill in **gasLimit** field of the transaction. | ||
| - Use the returned `txGasUnits` value as the `gasLimit` in your actual transaction. | ||
| - Make sure to provide the correct `nonce` of transaction |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: should be "Make sure to provide the correct nonce of the transaction" (missing article 'the').
| - Make sure to provide the correct `nonce` of transaction | |
| - Make sure to provide the correct `nonce` of the transaction |
| ::: | ||
|
|
||
| :::tip | ||
| `Best practice:` when sending the transaction, add ~10% extra gas to the estimated value to avoid underestimation and failure due to insufficient gas. |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The markdown formatting for 'Best practice:' is inconsistent with typical documentation patterns. Consider using Best practice: instead of backticks for better visual consistency.
| `Best practice:` when sending the transaction, add ~10% extra gas to the estimated value to avoid underestimation and failure due to insufficient gas. | |
| **Best practice:** when sending the transaction, add ~10% extra gas to the estimated value to avoid underestimation and failure due to insufficient gas. |
Description of the pull request (what is new / what has changed)
Did you test the changes locally ?
Which category (categories) does this pull request belong to?