Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions docs/sdk-and-tools/rest-api/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,16 @@ Example response for cross-shard transactions:

`https://gateway.multiversx.com/transaction/cost`

This endpoint allows one to estimate the cost of a transaction.

:::note
This endpoint estimates the **gas cost** of a transaction. Use this value to determine the appropriate `gasLimit` before sending a transaction.

In the background, this endpoint simulates the transaction in a read-only environment to estimate its gas cost. Any resulting smart contract results and events will also be returned.
:::

:::warning
As the transaction is executed in a simulated environment, `providing the correct nonce is mandatory`.
:::

<Tabs
defaultValue="Request"
Expand All @@ -364,10 +373,12 @@ Body Parameters
| value | <span class="text-danger">REQUIRED</span> | `string` | The Value to transfer, as a string representation of a Big Integer (can be "0"). |
| receiver | <span class="text-danger">REQUIRED</span> | `string` | The Address (bech32) of the Receiver. |
| sender | <span class="text-danger">REQUIRED</span> | `string` | The Address (bech32) of the Sender. |
| data | <span class="text-normal">OPTIONAL</span> | `string` | The base64 string representation of the Transaction's message (data). |
| chainID | <span class="text-danger">REQUIRED</span> | `string` | The Chain identifier. |
| version | <span class="text-danger">REQUIRED</span> | `number` | The Version of the Transaction (e.g. 1). |
| nonce | <span class="text-normal">OPTIONAL</span> | `number` | The Sender nonce. |
| nonce | <span class="text-danger">REQUIRED</span> | `number` | The Sender nonce. |
| options | <span class="text-normal">OPTIONAL</span> | `number` | The Options of the Transaction (e.g. 1). |
| data | <span class="text-normal">OPTIONAL</span> | `string` | The base64 string representation of the Transaction's message (data). |


</TabItem>
<TabItem value="Response">
Expand All @@ -390,7 +401,12 @@ The cost is estimated successfully.
</Tabs>

:::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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase should be "nonce of the transaction" or "transaction nonce" for proper grammar.

Suggested change
- Make sure to provide the correct `nonce` of transaction
- Make sure to provide the correct `nonce` of the transaction

Copilot uses AI. Check for mistakes.

Copilot AI Jul 29, 2025

Copy link

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').

Suggested change
- Make sure to provide the correct `nonce` of transaction
- Make sure to provide the correct `nonce` of the transaction

Copilot uses AI. Check for mistakes.
:::

:::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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon should be outside the backticks for proper markdown formatting: "Best practice: when sending..." or simply "Best practice: when sending..."

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.

Copilot uses AI. Check for mistakes.

Copilot AI Jul 29, 2025

Copy link

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.

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.

Copilot uses AI. Check for mistakes.
:::

Here's an example of a request:
Expand Down
Loading