Extra info /transaction/cost endpoint#1139
Merged
raduchis merged 4 commits intodevelopmentfrom Jul 29, 2025
Merged
Conversation
schimih
previously approved these changes
Jul 29, 2025
schimih
previously approved these changes
Jul 29, 2025
Contributor
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Grammar error: should be "Make sure to provide the correct nonce of the transaction" (missing article 'the').
Suggested change
| - 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. |
There was a problem hiding this comment.
[nitpick] The markdown formatting for 'Best practice:' is inconsistent with typical documentation patterns. Consider using Best practice: instead of backticks for better visual consistency.
Suggested change
| `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. |
andreibancioiu
previously approved these changes
Jul 29, 2025
schimih
approved these changes
Jul 29, 2025
andreibancioiu
approved these changes
Jul 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?