Stellar — Transactions, Soroban JSON-RPC methods
API reference for Stellar. All methods ->
GET /transactions/{transaction_hash}/effects
Retrieves all effects of a particular transaction.
This endpoint returns the effects of a specific transaction.
Parameters
transaction_hash(string; path; required): transactions are commands that modify the ledger state and consist of one or more operations.cursor(integer; query): a number that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record.order(string; query): a designation of the order in which records should appear. Options includeasc(ascending) ordesc(descending). If this argument isn’t set, it defaults toasc.limit(integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
Returns
{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"account": "string",
"type": "Account Created",
"type_i": 1,
"created_at": "string"
}
]
}
}
Request example
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/effects{?cursor,order,limit}
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/effects{?cursor,order,limit} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-1\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-1\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "https://rpc.ankr.com/operations/121628667754319873"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=121628667754319873-1"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=121628667754319873-1"
}
},
"id": "0121628667754319873-0000000001",
"paging_token": "121628667754319873-1",
"account": "GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A",
"type": "account_credited",
"type_i": 2,
"created_at": "2020-02-20T21:18:33Z",
"asset_type": "native",
"amount": "1573.5112616"
}
]
}
}
Soroban JSON-RPC methods
getEvents— retrieves contract events.getFeeStats— retrieves statistics for charged inclusion fees.getHealth— retrieves node health.getLatestLedger— retrieves the latest known ledgers.getLedgerEntries— retrieves ledger entries.getLedgers— retrieves list of ledgers.getNetwork— retrieves network config.getTransaction— retrieves transaction details.getTransactions— retrieves list of transactions.getVersionInfo— retrieves version info.sendTransaction— submits a transaction.simulateTransaction— submits a trial contract invocation transaction.
getEvents
Retrieves contract events.
Clients can request a filtered list of events emitted by a given ledger range.
Soroban RPC will support querying within a maximum 24 hours of recent ledgers.
Note, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to "ingest" events into their own database for querying and serving.
If making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.
By default, Soroban RPC retains the most recent 24 hours of events.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):-
startLedger(number, required): Ledger sequence number to fetch events after (inclusive). This method will return an error if startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request,startLedgermust be omitted. -
filters(array of objects; optional): List of filters for the returned events. Events matching any of the filters are included. To match a filter, an event must match both acontractIdand atopic. Maximum 5 filters are allowed per request:type(string): A comma separated list of event types (system, contract, or diagnostic) used to filter events. If omitted, all event types are included.contractIds(array of strings): List of contract IDs to query for events. If omitted, return events for all contracts. Maximum 5 contract IDs are allowed per request.topics(array): List of topic filters. If omitted, query for all events. If multiple filters are specified, events will be included if they match any of the filters. Maximum 5 filters are allowed per request.- A
TopicFilterisSegmentMatcher[]— The list can be 1-4SegmentMatcherslong. - A
SegmentMatcheris one of the following:- For an exact segment match, a string containing a base64-encoded ScVal.
- For a wildcard single-segment match, the string "*", matches exactly one segment.
- A
-
pagination(object; optional): Pagination in Soroban RPC is similar to pagination in Horizon. See Pagination.cursor(string): A string ID that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record. When a cursor is provided Soroban RPC will not include the element whose id matches the cursor in the response. Only elements which appear after the cursor are included.number(number): The maximum number of records returned. The limit forgetEventscan range from 1 to 10000 — an upper limit that is hardcoded in Soroban RPC for performance reasons. If this argument isn't designated, it defaults to 100.
-
Returns
latestLedger(number): The sequence number of the latest ledger known to Soroban RPC at the time it handled the request.events(array of objects):type(string): The type of event emission (enum:contract,diagnostic,system)ledger(number): Sequence number of the ledger in which this event was emitted.ledgerClosedAt(string): ISO-8601 timestamp of the ledger closing timecontractId(string): StrKey representation of the contract address that emitted this event.id(string): Unique identifier for this event. - The event's unique id field is based on atoidfrom Horizon as used in Horizon's /effects endpoint. - https://github.com/stellar/go/blob/master/services/horizon/internal/db2/history/effect.go#L58 - Specifically, it is a string containing: - bigint(32 bit ledger sequence + 20 bit txn number + 12 bit operation) +<hyphen>+ number for the event within the operation. - For example:1234-1pagingToken(string): Duplicate ofidfield, but in the standard place for pagination tokens.inSuccessfulContractCall(boolean): If true the event was emitted during a successful contract call.topic(array of strings): List containing the topic this event was emitted with:SegmentMatcher(string): ASegmentMatcheris one of the following:- For an exact segment match, a string containing a base64-encoded ScVal.
- For a wildcard single-segment match, the string "*", matches exactly one segment.
value(object): The data the event was broadcasting in the emitted event:xdr(string): The emitted body value of the event (serialized in a base64 string).
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getEvents",
"params": {
"startLedger": 1051743,
"pagination": {
"limit": 2
}
}
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"events": [
{
"type": "contract",
"ledger": 180118,
"ledgerClosedAt": "2024-01-22T16:13:07Z",
"contractId": "CB22KRA3YZVCNCQI64JQ5WE7UY2VAV7WFLK6A2JN3HEX56T2EDAFO7QF",
"id": "0000773600919453696-0000000000",
"pagingToken": "0000773600919453696-0000000000",
"topic": [
"AAAADwAAAAh0cmFuc2Zlcg==",
"AAAAEgAAAAEmtLQQgiJ5guKLxbQdFEQ8qF20pUVTAcvU9RfF4mln5g==",
"AAAAEgAAAAAAAAAAbLAgdrWIvo9rNehnYdwy70gTNnWQ4rP2Ffvq1rYk0sw=",
"AAAADgAAAD1CTE5EOkdBVEFMVEdUV0lPVDZCVURCQ1pNM1E0T1E0Qk8yQ09MT0FaN0lZU0tQTEMyUE1TT1BQR0Y1VjU2AAAA"
],
"value": "AAAACgAAAAAAAAAAAAAABkNdp0E=",
"inSuccessfulContractCall": true
},
{
"type": "contract",
"ledger": 180118,
"ledgerClosedAt": "2024-01-22T16:13:07Z",
"contractId": "CABFXDAA5BILXZPD7Y25QQPO77M5JHCCC3HWUBDGU52HNUHL4Z6YCTAC",
"id": "0000773600919453696-0000000001",
"pagingToken": "0000773600919453696-0000000001",
"topic": [
"AAAADwAAAAVjbGFpbQAAAA==",
"AAAAEgAAAAAAAAAAbLAgdrWIvo9rNehnYdwy70gTNnWQ4rP2Ffvq1rYk0sw="
],
"value": "AAAAEAAAAAEAAAACAAAAEAAAAAEAAAACAAAAAwAAAAAAAAADAAAAAwAAAAoAAAAAAAAAAAAAAAZDXadB",
"inSuccessfulContractCall": true
}
],
"latestLedger": 192067
}
}
getFeeStats
Retrieves statistics for charged inclusion fees.
Statistics for charged inclusion fees. The inclusion fee statistics are calculated from the inclusion fees that were paid for the transactions to be included onto the ledger. For Soroban transactions and Stellar transactions, they each have their own inclusion fees and own surge pricing. Inclusion fees are used to prevent spam and prioritize transactions during network traffic surge.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.
Returns
sorobanInclusionFee(object; required): Inclusion-fee distribution statistics for Soroban transactions, measured per transaction.min(string): Minimum inclusion fee observed.max(string): Maximum inclusion fee observed.mode(string): Most frequently occurring inclusion fee.p10(string): 10th percentile inclusion fee (nearest-rank method).p20(string): 20th percentile inclusion fee (nearest-rank method).p30(string): 30th percentile inclusion fee (nearest-rank method).p40(string): 40th percentile inclusion fee (nearest-rank method).p50(string): 50th percentile inclusion fee (median, nearest-rank method).p60(string): 60th percentile inclusion fee (nearest-rank method).p70(string): 70th percentile inclusion fee (nearest-rank method).p80(string): 80th percentile inclusion fee (nearest-rank method).p90(string): 90th percentile inclusion fee (nearest-rank method).p95(string): 95th percentile inclusion fee (nearest-rank method).p99(string): 99th percentile inclusion fee (nearest-rank method).transactionCount(number): Number of Soroban transactions included in this distribution.ledgerCount(number): Number of consecutive ledgers analyzed to produce the statistics.
inclusionFee(object; required): Inclusion-fee distribution statistics for classic Stellar transactions, normalized per operation.min(string): Minimum inclusion fee observed per operation.max(string): Maximum inclusion fee observed per operation.mode(string): Most frequently occurring inclusion fee per operation.p10(string): 10th percentile inclusion fee per operation (nearest-rank method).p20(string): 20th percentile inclusion fee per operation (nearest-rank method).p30(string): 30th percentile inclusion fee per operation (nearest-rank method).p40(string): 40th percentile inclusion fee per operation (nearest-rank method).p50(string): 50th percentile inclusion fee per operation (median, nearest-rank method).p60(string): 60th percentile inclusion fee per operation (nearest-rank method).p70(string): 70th percentile inclusion fee per operation (nearest-rank method).p80(string): 80th percentile inclusion fee per operation (nearest-rank method).p90(string): 90th percentile inclusion fee per operation (nearest-rank method).p95(string): 95th percentile inclusion fee per operation (nearest-rank method).p99(string): 99th percentile inclusion fee per operation (nearest-rank method).transactionCount(number): Number of classic transactions included in this distribution.ledgerCount(number): Number of consecutive ledgers analyzed to produce the statistics.
latestLedger(number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeStats"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"sorobanInclusionFee": {
"max": "100",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "100",
"transactionCount": "14",
"ledgerCount": 50
},
"inclusionFee": {
"max": "108",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "108",
"p99": "108",
"transactionCount": "13",
"ledgerCount": 10
},
"latestLedger": 1051780
}
}
getHealth
Retrieves node health.
General node health check.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.
Returns
status(string): node status (example: "healthy").
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getHealth"
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "healthy"
}
}
getLatestLedger
Retrieves the latest known ledger.
For finding out the current latest known ledger of this node. This is a subset of the ledger info from Horizon.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.
Returns
id(string): hash identifier of the latest ledger (as a hex-encoded string) known to Soroban RPC at the time it handles the request (pattern:^[a-f\d]{64}$).protocolVersion(number): Stellar Core protocol version associated with the latest ledger.sequence(number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLatestLedger"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"id": "c73c5eac58a441d4eb733c352...",
"protocolVersion": 20,
"sequence": 2539605
}
}
getLedgerEntries
Retrieves ledger entries.
For reading the current value of ledger entries directly.
Allows you to directly inspect the current state of a contract, a contract's code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or simulateTransaction.
To fetch contract wasm byte-code, use the ContractCode ledger entry key.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):keys(array of strings; required): an array containing the keys of the ledger entries you wish to retrieve (an array of serialized base64 strings).
Returns
latestLedger(number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request.entries(array): an array of objects containing all found ledger entries:key(string): the key of the ledger entry (base64 string).xdr(string): the current value of the given ledger entry (base64 string).lastModifiedLedgerSeq(number): the ledger sequence number of the last time this entry was updated.liveUntilLedgerSeq(number): sequence number of the ledger.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgerEntries",
"params": {
"keys": [
0: "AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE="
]
}
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"entries": [
0: {
"key": "AAAAB+qfy4GuVKKfazvyk4R9P9fpo2n9HICsr+xqvVcTF+DC",
"xdr": "AAAABgAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAQAAAAAQAAAAIAAAAPAAAAB0NvdW50ZXIAAAAAEgAAAAAAAAAAIOHWwMbBgBiAnwRt4k9nChmEOoSuLCVs2eqK9Qub+hgAAAABAAAAAwAAAAw=",
"lastModifiedLedgerSeq": 2552504
}
],
"latestLedger": 2552990
}
}
getLedgers
Retrieves list of ledgers.
The getLedgers method returns a detailed list of ledgers starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(object; required):startLedger(number; optional): ledger sequence number to start fetching from (inclusive). This must not be less than the oldest ledger stored in the node or greater than the latest ledger seen by the node. If acursoris included,startLedgermust be omitted.pagination(object; optional): pagination options, similar to Horizon pagination.cursor(string; optional): opaque string acting as a paging token. To fetch the next page of results, set this value to thecursorfield returned in the previous response.limit(number; optional): maximum number of records to return. Valid range is1–10000. Defaults to100if not specified.
xdrFormat(string; optional): output format for the response. Acceptsbase64(default) orjson. Ifjsonis used, note that the schema may change with underlying XDR updates.
Returns
ledgers(array[object]; required): List of ledger entries returned by the query.hash(string): Hash of the ledger header that was included in the chain.sequence(number): Sequence number of the ledger (also referred to as the block height).ledgerCloseTime(string): Timestamp at which the ledger was closed.headerXdr(string): Base64-encodedLedgerHeaderstructure for this ledger.metadataXdr(string): Base64-encodedLedgerCloseMetaunion for this ledger.
latestLedger(number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request.latestLedgerCloseTime(number; required): Unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request.oldestLedger(number; required): Sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.oldestLedgerCloseTime(number; required): Unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request.cursor(string; optional): Paging token to be included in a subsequent request to obtain the next page of results.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgers",
"params": {
"startLedger": 1052244,
"pagination": {
"limit": 2
}
}
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"ledgers": [
{
"hash": "318ce21369ba24f8332bd14babdb09889f24dce1bc089db067ab2af47d7aea0a",
"sequence": 1052244,
"ledgerCloseTime": "1760459309",
"headerXdr": "MYziE2m6JPgzK9FLq9sJiJ8k3OG8CJ2wZ6sq9H166goAAAAXqhYfNK6HfdyFen5WLUKzBrk4fqj2VgOFqA/e3Q0UBETV3k/2lliqEEleXCOJyLA7tEo+w6HoGUVmk9D1sibuxwAAAABo7notAAAAAAAAAAEAAAAAtV0Qsrt9KE7VwDpHpeG1kMkPV4NVRxzEUHu+ggTSPIsAAABAeBGYsdJuZvlPM7eIn7JrDrYrbTCGmMPYbMEKJtt7R8wJ2T8cjqH539FA7R8+WwwkH6aXeYnL7PGLFDprjVkHDmuVnjV3jJGH2Xbn8cE4ggoGSGNwv/kQZAVp4k9vqQu5/gq1fwb04v/lrWxbDVlQNcQczExnupW7OF5COtCaJYkAEA5UDeC2s6dkAAAAAAA6wJhozQAAAAAAAAAAAAAolQAAAGQATEtAAAAAyAtzObU3PsJWeTkdkBDOyExMTol0rEV7SX0oar2zxLtYDneB8P56sIYAP871glDb/k8XmSekQUzwCUQmkpViI6jDzf6BDMFFWKRAYhEqTq9VipuOz3SuiIzqdfMQdaLqhHjfX/XfBYxAEzDm6pGn2/xshRwOT3D56ojadgOLJjaYAAAAAAAAAAA=",
"metadataXdr": "AAAAAgAAAAAxjOITabok+DMr0Uur2wmInyTc4bw..."
},
{
"hash": "f8a3fc2f5a48f6c45a8a135f73ef6c818ec609b12b0e2a0a9ce8af73c0d4458d",
"sequence": 1052245,
"ledgerCloseTime": "1760459314",
"headerXdr": "+KP8L1pI9sRaihNfc+9sgY7GCbErDioKnOivc8DURY0AAAAXMYziE2m6JPgzK9FLq9sJiJ8k3OG8CJ2wZ6sq9H166gp533EGZ5PUMkezV8dRbxfBvkP+FWZ+DjgLLP+NYx2HzgAAAABo7noyAAAAAAAAAAEAAAAAtV0Qsrt9KE7VwDpHpeG1kMkPV4NVRxzEUHu+ggTSPIsAAABAJFqX2dyeZKxyFDk0H8uLiBqAkjnfnI/zCN43cLn26phZAivqFn+ZcURQTbPNLbMgx7Do59GWnkHZjpgFnrlDDNKlI/RUA1dq+H7EHtDzxOJuUk3iUMYSLimzRsEr3D+hRj35YE8eQRxWWnoiFL5qJnnRZG7pl6tByRySoa2a/mUAEA5VDeC2s6dkAAAAAAA6wJhplQAAAAAAAAAAAAAolQAAAGQATEtAAAAAyAtzObU3PsJWeTkdkBDOyExMTol0rEV7SX0oar2zxLtYDneB8P56sIYAP871glDb/k8XmSekQUzwCUQmkpViI6jDzf6BDMFFWKRAYhEqTq9VipuOz3SuiIzqdfMQdaLqhHjfX/XfBYxAEzDm6pGn2/xshRwOT3D56ojadgOLJjaYAAAAAAAAAAA=",
"metadataXdr": "AAAAAgAAAAD4o/wvWkj2xFqKE19z72yBjsYJsSsO..."
}
],
"latestLedger": 1052247,
"latestLedgerCloseTime": 1760459324,
"oldestLedger": 931288,
"oldestLedgerCloseTime": 1759853894,
"cursor": "1052245"
}
}
getNetwork
Retrieves network config.
General information about the currently configured network. This response will contain all the information needed to successfully submit transactions to the network this node serves.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.
Returns
passphrase(string): the network passphrase configured for this Soroban RPC node.protocolVersion(number): Stellar Core protocol version associated with the latest ledger.friendbotUrl(string): the URL of this network's "friendbot" faucet.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getNetwork"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"friendbotUrl": "https://friendbot-testnet.stellar.org/",
"passphrase": "Test SDF Network ; September 2015",
"protocolVersion": 20
}
}
getTransaction
Retrieves transaction details.
The getTransaction method provides details about the specified transaction. Clients are expected to periodically query this method to ascertain when a transaction has been successfully recorded on the blockchain. The soroban-rpc system maintains a restricted history of recently processed transactions, with the default retention window set at 1440 ledgers, approximately equivalent to a 2-hour timeframe. For private soroban-rpc instances, it is possible to modify the retention window value by adjusting the transaction-retention-window configuration setting. For comprehensive debugging needs that extend beyond the 2-hour timeframe, it is advisable to retrieve transaction information from Horizon, as it provides a lasting and persistent record.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):hash(string; required): a transaction hash to query (hex-encoded string); This transaction hash should correspond to the transaction that has been previously submitted to the network (pattern:^[a-f\d]{64}$).
Returns
status(string): the current status of the transaction specified by hash (enum:SUCCESS,NOT_FOUND,FAILED).latestLedger(number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request.latestLedgerCloseTime(string): the unix stamp of the close time of the latest ledger known to Soroban RPC at the time it handles the request.oldestLedger(number): the sequence number of the oldest ledger ingested by Soroban RPC at the time it handles the request.oldestLedgerCloseTime(string): the unix stamp of the close time of the oldest ledger ingested by Soroban RPC at the time it handles the request.ledger(number): the sequence number of the ledger which included the transaction. This field is only present ifstatusisSUCCESSorFAILED.createdAt(string): the unix timestamp of when the transaction was included in the ledger. This field is only present ifstatusisSUCCESSorFAILED.applicationOrder(number): the index of the transaction among all transactions included in the ledger. This field is only present ifstatusisSUCCESSorFAILED.feeBump(boolean): indicates whether the transaction was fee bumped. This field is only present ifstatusisSUCCESSorFAILED.envelopeXdr(string): a base64-encoded string of the raw TransactionEnvelope XDR struct for this transaction.resultXdr(string): a base64-encoded string of the raw TransactionResult XDR struct for this transaction. This field is only present ifstatusisSUCCESSorFAILED.resultMetaXdr(string): a base64-encoded string of the raw TransactionResultMeta XDR struct for this transaction.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": {
"hash": "6bc97bddc21811c626839baf4ab574f4f9f7ddbebb44d286ae504396d4e752da"
}
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": "SUCCESS",
"latestLedger": 2540076,
"latestLedgerCloseTime": "1700086333",
"oldestLedger": 2538637,
"oldestLedgerCloseTime": "1700078796",
"applic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gAAI6oAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAmwiAAAAAAZVVB/AAAAAAAAAABAAAAAgAAAAMAJsIfAAAABgAAAAAAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAAUAAAAAQAAABMAAAAAjjTy9Ve4tTeavLz3tN8+liOOxI3ufjZESizbjVF11h0AAAABAAAABQAAABAAAAABAAAAAQAAAA8AAAAJQ29yZVN0YXRlAAAAAAAAEQAAAAEAAAAGAAAADwAAAAVhZG1pbgAAAAAAABIAAAAAAAAAADn1LT+CCK/HiHMChoEi/AtPrkos4XRR2E45Pr25lb3/AAAADwAAAAljb2xfdG9rZW4AAAAAAAASAAAAAdeSi3LCcDzP6vfrn",
"ledger": 2540064,
"createdAt": "1700086268"
}
}
getTransactions
Retrieves list of transactions.
The getTransactions method return a detailed list of transactions starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(object; required): Method-specific parameters, passed by name (not by position):startLedger(number; optional): Ledger sequence number to start fetching from (inclusive). This method returns an error ifstartLedgeris less than the oldest ledger stored in this node or greater than the latest ledger seen by this node. If acursoris included,startLedgermust be omitted.pagination(object; optional): Pagination options, similar to Horizon pagination.cursor(string; optional): Opaque string acting as a paging token. To obtain the next page of results, set this value to thecursorfield from the previous response.limit(number; optional): Maximum number of records to return. Valid range:1–10000. Defaults to100if not specified.
xdrFormat(string; optional): Output format for the response — eitherbase64(default) orjson. Thejsonschema may change as underlying XDR definitions evolve.
Returns
transactions(array[object]; required): List of transactions included in the queried ledger range.status(string): Indicates whether the transaction was successful or not.applicationOrder(number): 1-based index of the transaction among all transactions included in the ledger.feeBump(boolean): Indicates whether the transaction was fee-bumped.envelopeXdr(string): Base64-encodedTransactionEnvelopestructure for this transaction.resultXdr(string): Base64-encodedTransactionResultstructure for this transaction.resultMetaXdr(string): Base64-encoded metadata structure associated with this transaction.diagnosticEventsXdr(array[string]; optional): Base64-encoded list ofxdr.DiagnosticEvententries. Present only ifENABLE_SOROBAN_DIAGNOSTIC_EVENTSis enabled on the RPC server.events(object): All events emitted during transaction execution.ledger(number): Sequence number of the ledger that included this transaction.createdAt(number): Unix timestamp of when the transaction was included in the ledger.
latestLedger(number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request.latestLedgerCloseTimestamp(number; required): Unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request.oldestLedger(number; required): Sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.oldestLedgerCloseTimestamp(number; required): Unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request.cursor(string; optional): Paging token that can be included in a subsequent request to obtain the next page of results.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransactions",
"params": {
"startLedger": 1052434,
"pagination": {
"limit": 5
}
}
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"transactions": [
{
"status": "SUCCESS",
"txHash": "b1cb82270d381ff5ba487fad50c00e3fb9cd3601bcce75253b157718a7890a91",
"applicationOrder": 1,
"feeBump": false,
"envelopeXdr": "AAAAAgAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAAGQAEA8QAAAAAgAAAAEAAAAAAAAAAAAAAABo7n3+AAAAAAAAAAEAAAAAAAAAAQAAAADu1x0Fy+Tl8JHtHUIdg4jDsT4PQY/JU50psZ2KOHv3FAAAAAAAAAAAATEtAAAAAAAAAAABj4FeEgAAAEC6Xlxcw/REbj+iodVG5PIk158ZZjziTwnQxWKLwXFD2zHKnByITkybE1EQIanPG8YD7htTAowDPoCHw4IKr4gF",
"resultXdr": "AAAAAAAAAGQAAAAAAAAAAQAA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ABAPDwAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAdeSi3LCcDzP6vfrn/TvTVBKVai5efybRQ6iyEK00c5hAAAAAQAAAAAAAAAEAAAADwAAAAh0cmFuc2ZlcgAAABIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAAEgAAAAAAAAAA7tcdBcvk5fCR7R1CHYOIw7E+D0GPyVOdKbGdijh79xQAAAAOAAAABm5hdGl2ZQAAAAAACgAAAAAAAAAAAAAAAAExLQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAAEAAAAAAAAAAgAAAA8AAAADZmVlAAAAABIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAACgAAAAAAAAAAAAAAAAAAAGQAAAAA",
"events": {
"transactionEventsXdr": [
"AAAAAAAAAAAAAAAB15KLcsJwPM/q9+uf9O9NUEpVqLl5/JtFDqLIQrTRzmEAAAABAAAAAAAAAAIAAAAPAAAAA2ZlZQAAAAASAAAAAAAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAAAoAAAAAAAAAAAAAAAAAAABk"
],
"contractEventsXdr": [
[
"AAAAAAAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAAEAAAAAAAAABAAAAA8AAAAIdHJhbnNmZXIAAAASAAAAAAAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAABIAAAAAAAAAAO7XHQXL5OXwke0dQh2DiMOxPg9Bj8lTnSmxnYo4e/cUAAAADgAAAAZuYXRpdmUAAAAAAAoAAAAAAAAAAAAAAAABMS0A"
]
]
},
"ledger": 1052434,
"createdAt": 1760460260
}
],
"latestLedger": 1052436,
"latestLedgerCloseTimestamp": 1760460270,
"oldestLedger": 931477,
"oldestLedgerCloseTimestamp": 1759854840,
"cursor": "4520178201137153"
}
}
getVersionInfo
Retrieves version info.
Version information about the RPC and Captive core. RPC manages its own, pared-down version of Stellar Core optimized for its own subset of needs. we'll refer to this as a "Captive Core" instance.
Parameters
id(integer; required): a request ID (example: 1).jsonrpc(string; required): a JSON RPC spec used (example: 2.0).method(string; required): a method used for the request.
Returns
version(string; required): Version of the RPC server. Example:23.0.1.commitHash(string; required): Commit hash of the RPC server build. Example:fcd2f0523f04279bae4502f3e3fa00ca627e6f6a.buildTimestamp(string; required): Build timestamp of the RPC server. Example:2025-05-10T11:18:38.captiveCoreVersion(string; required): Version of the Captive Core used by the RPC server. Example:stellar-core 23.0.1 (050eacf11a15afb2e95560dfb5723dfdcf78070f).protocolVersion(integer; required): Stellar protocol version supported by the RPC server. Example:23.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getVersionInfo"
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"version": "23.0.0-67bf8456a32c74e1fe189ec8d0321614d07944d5",
"commitHash": "67bf8456a32c74e1fe189ec8d0321614d07944d5",
"buildTimestamp": "2025-08-14T15:20:26",
"captiveCoreVersion": "stellar-core 23.0.0 (d5cbc0793d6eab25eac886969c5bc0f7da69d6ea)",
"protocolVersion": 23
}
}
sendTransaction
Submits a transaction.
Submit a real transaction to the Stellar network. This is the only way to make changes on-chain.
Unlike Horizon, this does not wait for transaction completion. It simply validates and enqueues the transaction. Clients should call getTransaction to learn about transaction success/failure.
This supports all transactions, not only smart contract-related transactions.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):transaction(string; required): the signed transaction to broadcast for inclusion in a ledger (base64 string).
Returns
hash(string): a transaction hash (hex-encoded string); pattern:^[a-f\d]{64}$.status(string): the current status of the transaction specified by hash (enum:PENDING,DUPLICATE,TRY_AGAIN_LATER,ERROR).latestLedger(number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request.latestLedgerCloseTime(string): the unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request.errorResultXdr(string): if the transactionstatusisERROR, this will be a base64-encoded string of the raw TransactionResult XDR struct containing details on why Stellar Core rejected the transaction.diagnosticEventsXdr(array): if the transactionstatusisERROR, this field may be present with an array of base64-encoded strings. Each string will decode to a raw DiagnosticEvent XDR struct containing details on why Stellar Core rejected the transaction.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sendTransaction",
"params": {
"transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAACgAAAAVIZWxsbwAAAAAAAAEAAAAMU29yb2JhbiBEb2NzAAAAAAAAAAELm/oYAAAAQATr6Ghp/DNO7S6JjEFwcJ9a+dvI6NJr7I/2eQttvoovjQ8te4zKKaapC3mbmx6ld6YKL5T81mxs45TjzdG5zw0="
}
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": "PENDING",
"hash": "d8ec9b68780314ffdfdfc2194b1b35dd27d7303c3bceaef6447e31631a1419dc",
"latestLedger": 2553978,
"latestLedgerCloseTime": "1700159337"
}
}
simulateTransaction
Submits a trial contract invocation transaction.
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
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):transaction(base64 string; required): in order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the typeinvokeHostFunction.resourceConfig(object; optional): configuration for how resources will be calculated:instructionLeeway(number): allow extra instructions when budgeting resources.
Returns
latestLedger(number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request.minResourceFee(string): stringified number — a recommended minimum resource fee to add when submitting a transaction. This fee is to be added on top of the Stellar network fee. Not present in case of error.cost(object): information about instructions used, etc. Not present in case of error:cpuInsns(string): stringified number — total cpu instructions consumed by this transaction.memBytes(string): stringified number — total memory bytes allocated by this transaction.
results(array of objects with properties): this array will only have one element: the result for the Host function invocation. Only present on successful simulation (no error) of theInvokeHostFunctionoperations:xdr(string): serialized base64 string — return value of the Host Function call.auth(array of strings): array of serialized base64 strings — per-address authorizations recorded when simulating this Host Function call.
transactionData(string): serialized base64 string — 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). Not present in case of error.events(arrays of strings): array of serialized base64 strings — array of the events emitted during the contract invocation. The events are ordered by their emission time. Only present when simulating ofInvokeHostFunctionoperations, note that it can be present on error, providing extra content about what failed.restorePreamble(object): it can be only present on successful simulation (no error) ofInvokeHostFunctionoperations. If present, it indicates that the simulation detected archived ledger entries which need to be restored before the submission of theInvokeHostFunctionoperation. TheminResourceFeeandtransactionDatafields should be used to submit a transaction containing aRestoreFootprintoperation. Properties:minResourceFee(string): stringified number — recommended minimum resource fee to add when submitting theRestoreFootprintoperation. This fee is to be added on top of the Stellar network fee.transactionData(string): serialized base64 string — the recommended Soroban Transaction Data to use when submitting theRestoreFootprintoperation.
error(string): this field will include details about why the invoke host function call failed. Only present if the transaction simulation failed.
Request example
curl 'https://rpc.ankr.com/stellar_testnet_soroban' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": {
"transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAJaW5jcmVtZW50AAAAAAAAAgAAABIAAAAAAAAAACDh1sDGwYAYgJ8EbeJPZwoZhDqEriwlbNnqivULm/oYAAAAAwAAAAMAAAAAAAAAAAAAAAA=",
"resourceConfig": {
"instructionLeeway": 3000000
}
}
}'
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"transactionData": "AAAAAAAAAAIAAAAGAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAFAAAAAEAAAAHy8vNUZ8vyZ2ybPHW0XbSrRtP7gEWsJ6zDzcfY9P8z88AAAABAAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAEAHfKyAAAFiAAAAIgAAAAAAAAAAw==",
"minResourceFee": "90353",
"events": [
"AAAAAQAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAPAAAACWluY3JlbWVudAAAAAAAABAAAAABAAAAAgAAABIAAAAAAAAAACDh1sDGwYAYgJ8EbeJPZwoZhDqEriwlbNnqivULm/oYAAAAAwAAAAM=",
"AAAAAQAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAACAAAAAAAAAAIAAAAPAAAACWZuX3JldHVybgAAAAAAAA8AAAAJaW5jcmVtZW50AAAAAAAAAwAAAAw="
],
"results": [
{
"auth": [],
"xdr": "AAAAAwAAAAw="
}
],
"cost": {
"cpuInsns": "1635562",
"memBytes": "1295756"
},
"latestLedger": 2552139
}
}