Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed May 22, 2023
1 parent 1f10067 commit f7c0a1e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions api/methods/simulateTransaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
sidebar_position: 8
---

Submit a trial contract invocation to get back return values, expected transaction data, expected costs and recommended minimum transaction fee due to resource usage.

Submit a trial contract invocation to simulate how it would be executed by the network. This endpoint calculates the effective transaction data, required authorizations, and minimal resource fee. It provides a way to test and analyze the potential outcomes of a transaction without actually submitting it to the network.
## Parameters

- `<xdr.TransactionEnvelope>` - The transaction to be simulated (serialized in base64)
Expand All @@ -15,11 +14,11 @@ Submit a trial contract invocation to get back return values, expected transacti
- `cost`: `<object>` - Information about instructions used, etc.
- `cpuInsns`: `<string>` - Stringified-number of the total cpu instructions consumed by this transaction
- `memBytes`: `<string>` - Stringified-number of the total memory bytes allocated by this transaction
- `results`: `<object[]>` - If error is present then results will not be in the response. There will be one results object for each Host Function invocation in the transaction.
- `results`: `<object[]>` - If `error` is present then results will not be in the response. There will be one results object for each Host Function invocation in the transaction.
- `xdr`: `<xdr.ScVal>` - (optional) Only present on success. xdr-encoded return value of the Host Function call.
- `auth`: `<xdr.ContractAuth[]>` - Per-address authorizations recorded when simulating this Host Function call. (an array of serialized base64 strings)
- `transactionData`: `<xdr.SorobanTransactionData>` - The Soroban Transaction Data used when simulating this operation. (serialized in a base64 string).
- `events`: `<xdr.DiagnosticEvent[]>` - Events emitted during all of the contract invocation(s). (an array of serialized base64 strings)
- `transactionData`: `<xdr.SorobanTransactionData>` - The recommended Soroban Transaction Data to use when submitting the simulated transaction. This data contains the refundable fee and resource usage information such as the ledger footprint and IO access data (serialized in a base64 string).
- `events`: `<xdr.DiagnosticEvent[]>` - Array of the events emitted during the contract invocation(s). The events are sorted by the time on which they where were generated. (an array of serialized base64 strings)
- `latestLedger`: `<string>` - Stringified-number of the current latest ledger observed by the node when this response was generated.
- `error`: `<string>` - (optional) only present if the transaction failed. This field will include more details from `stellar-core` about why the invoke host function call failed.

Expand Down

0 comments on commit f7c0a1e

Please sign in to comment.