Skip to content

Commit b024b02

Browse files
simulateTransaction allows executing read-only functions for free (#1664)
* Clarify that simulateTransaction allows executing read-only functions for free * Add a note to the RPC specfile, as well --------- Co-authored-by: Elliot <elliot@stellar.org>
1 parent c336bf6 commit b024b02

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/data/apis/rpc/api-reference/methods/simulateTransaction.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import rpcSpec from "@site/static/stellar-rpc.openrpc.json";
1212
}
1313
/>
1414

15+
:::note
16+
17+
`simulateTransaction` can also invoke read-only functions for free.
18+
19+
:::
20+
1521
### Using the Lab
1622

1723
The `simulateTransaction` method allows you to **simulate a smart contract invocation** without actually submitting it to the network. It’s a powerful tool for testing and debugging transactions safely.

openrpc/src/stellar-rpc/methods/simulateTransaction.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "simulateTransaction",
33
"summary": "submits a trial contract invocation transaction",
4-
"description": "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.",
4+
"description": "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.\n\nThis method can also be used to invoke read-only smart contract functions for free.",
55
"externalDocs": {
66
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/simulateTransaction"
77
},

static/stellar-rpc.openrpc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@
11841184
},
11851185
"events": {
11861186
"type": "object",
1187-
"description": "Contains all events emitted during transaction execution.\n\n_Note: Available only on Protocol 23+ (currently testnet only)._",
1187+
"description": "Contains all events emitted during transaction execution.\n\n_Note: Available only on RPC v23.x (currently testnet only)._",
11881188
"properties": {
11891189
"transactionEventsXdr": {
11901190
"type": "array",
@@ -1429,7 +1429,7 @@
14291429
},
14301430
"events": {
14311431
"type": "object",
1432-
"description": "Contains all events emitted during transaction execution.\n\n_Note: Available only on Protocol 23+ (currently testnet only)._",
1432+
"description": "Contains all events emitted during transaction execution.\n\n_Note: Available only on RPC v23.x (currently testnet only)._",
14331433
"properties": {
14341434
"transactionEventsXdr": {
14351435
"type": "array",
@@ -2134,7 +2134,7 @@
21342134
{
21352135
"name": "simulateTransaction",
21362136
"summary": "submits a trial contract invocation transaction",
2137-
"description": "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.",
2137+
"description": "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.\n\nThis method can also be used to invoke read-only smart contract functions for free.",
21382138
"externalDocs": {
21392139
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/simulateTransaction"
21402140
},

0 commit comments

Comments
 (0)