Network / RPC
rpc.Api.isSimulationError
Checks if a simulation response indicates an error.
isSimulationError(sim: SimulateTransactionResponse): sim is SimulateTransactionErrorResponseParameters
sim—SimulateTransactionResponse(required) — The simulation response to check.
Returns
True if the response indicates an error, false otherwise.
Source: src/rpc/api.ts:461
rpc.Api.isSimulationRaw
Checks if a simulation response is in raw (unparsed) form.
isSimulationRaw(sim: SimulateTransactionResponse | RawSimulateTransactionResponse): sim is RawSimulateTransactionResponseParameters
sim—SimulateTransactionResponse | RawSimulateTransactionResponse(required) — The simulation response to check.
Returns
True if the response is raw, false otherwise.
Source: src/rpc/api.ts:498
rpc.Api.isSimulationRestore
Checks if a simulation response indicates that a restoration is needed.
isSimulationRestore(sim: SimulateTransactionResponse): sim is SimulateTransactionRestoreResponseParameters
sim—SimulateTransactionResponse(required) — The simulation response to check.
Returns
True if the response indicates a restoration is needed, false otherwise.
Source: src/rpc/api.ts:483
rpc.Api.isSimulationSuccess
Checks if a simulation response indicates success.
isSimulationSuccess(sim: SimulateTransactionResponse): sim is SimulateTransactionSuccessResponseParameters
sim—SimulateTransactionResponse(required) — The simulation response to check.
Returns
True if the response indicates success, false otherwise.
Source: src/rpc/api.ts:472
rpc.BasicSleepStrategy
const BasicSleepStrategy: SleepStrategySource: src/rpc/server.ts:88
rpc.LinearSleepStrategy
const LinearSleepStrategy: SleepStrategySource: src/rpc/server.ts:91
rpc.Server
Handles the network connection to a Dwsa RPC instance, exposing an interface for requests to that instance.
class Server { constructor(serverURL: string, opts: Options = {}); readonly httpClient: HttpClient; readonly serverURL: URL; _getEvents(request: GetEventsRequest): Promise<RawGetEventsResponse>; _getLatestLedger(): Promise<RawGetLatestLedgerResponse>; _getLedgerEntries(...keys: LedgerKey[]): Promise<RawGetLedgerEntriesResponse>; _getLedgers(request: GetLedgersRequest): Promise<RawGetLedgersResponse>; _getTransaction(hash: string): Promise<RawGetTransactionResponse>; _getTransactions(request: GetTransactionsRequest): Promise<RawGetTransactionsResponse>; _sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<RawSendTransactionResponse>; _simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<RawSimulateTransactionResponse>; fundAddress(address: string, faucetUrl?: string): Promise<GetSuccessfulTransactionResponse>; getAccount(address: string): Promise<Account>; getAccountEntry(address: string): Promise<AccountEntry>; getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise<BalanceResponse>; getClaimableBalance(id: string): Promise<ClaimableBalanceEntry>; getContractData(contract: string | Address | Contract, key: ScVal, durability: Durability = Durability.Persistent): Promise<LedgerEntryResult>; getContractWasmByContractId(contractId: string): Promise<Buffer<ArrayBufferLike>>; getContractWasmByHash(wasmHash: string | Buffer<ArrayBufferLike>, format: "base64" | "hex" | undefined = undefined): Promise<Buffer<ArrayBufferLike>>; getEvents(request: GetEventsRequest): Promise<GetEventsResponse>; getFeeStats(): Promise<GetFeeStatsResponse>; getHealth(): Promise<GetHealthResponse>; getLatestLedger(): Promise<GetLatestLedgerResponse>; getLedgerEntries(...keys: LedgerKey[]): Promise<GetLedgerEntriesResponse>; getLedgerEntry(key: LedgerKey): Promise<LedgerEntryResult>; getLedgers(request: GetLedgersRequest): Promise<GetLedgersResponse>; getNetwork(): Promise<GetNetworkResponse>; getSACBalance(address: string | Address, sac: Asset, networkPassphrase?: string): Promise<BalanceResponse>; getTransaction(hash: string): Promise<GetTransactionResponse>; getTransactions(request: GetTransactionsRequest): Promise<GetTransactionsResponse>; getTrustline(account: string, asset: Asset): Promise<TrustLineEntry>; getVersionInfo(): Promise<GetVersionInfoResponse>; pollTransaction(hash: string, opts?: PollingOptions): Promise<GetTransactionResponse>; prepareTransaction(tx: Transaction | FeeBumpTransaction): Promise<Transaction>; requestAirdrop(address: string | Pick<Account, "accountId">, faucetUrl?: string): Promise<Account>; sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<SendTransactionResponse>; simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<SimulateTransactionResponse>;}Source: src/rpc/server.ts:51
new Server(serverURL, opts)
constructor(serverURL: string, opts: Options = {});Parameters
serverURL—string(required)opts—Options(optional) (default:{})
Source: src/rpc/server.ts:167
server.httpClient
HTTP client instance for making requests to Gateway. Exposes interceptors, defaults, and other configuration options.
readonly httpClient: HttpClient;Example
// Add authentication headerserver.httpClient.defaults.headers['Authorization'] = 'Bearer token';
// Add request interceptorserver.httpClient.interceptors.request.use((config) => { console.log('Request:', config.url); return config;});Source: src/rpc/server.ts:166
server.serverURL
readonly serverURL: URL;Source: src/rpc/server.ts:149
server._getEvents(request)
_getEvents(request: GetEventsRequest): Promise<RawGetEventsResponse>;Parameters
request—GetEventsRequest(required)
Source: src/rpc/server.ts:883
server._getLatestLedger()
_getLatestLedger(): Promise<RawGetLatestLedgerResponse>;Source: src/rpc/server.ts:952
server._getLedgerEntries(keys)
_getLedgerEntries(...keys: LedgerKey[]): Promise<RawGetLedgerEntriesResponse>;Parameters
...keys—LedgerKey[](required)
Source: src/rpc/server.ts:651
server._getLedgers(request)
_getLedgers(request: GetLedgersRequest): Promise<RawGetLedgersResponse>;Parameters
request—GetLedgersRequest(required)
Source: src/rpc/server.ts:1538
server._getTransaction(hash)
_getTransaction(hash: string): Promise<RawGetTransactionResponse>;Parameters
hash—string(required)
Source: src/rpc/server.ts:773
server._getTransactions(request)
_getTransactions(request: GetTransactionsRequest): Promise<RawGetTransactionsResponse>;Parameters
request—GetTransactionsRequest(required)
Source: src/rpc/server.ts:823
server._sendTransaction(transaction)
_sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<RawSendTransactionResponse>;Parameters
transaction—Transaction | FeeBumpTransaction(required)
Source: src/rpc/server.ts:1173
server._simulateTransaction(transaction, addlResources, authMode)
_simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<RawSimulateTransactionResponse>;Parameters
transaction—Transaction | FeeBumpTransaction(required)addlResources—ResourceLeeway(optional)authMode—SimulationAuthMode(optional)
Source: src/rpc/server.ts:1023
server.fundAddress(address, faucetUrl)
Fund an address using the network’s Faucet, if any.
This method supports both account (G…) and contract (C…) addresses.
fundAddress(address: string, faucetUrl?: string): Promise<GetSuccessfulTransactionResponse>;Parameters
address—string(required) — The address to fund. Can be either a Digital World account (G…) or contract (C…) address.faucetUrl—string(optional) — (optional) Optionally, an explicit faucet URL (by default: this calls the Digital World RPCgetNetworkmethod to try to discover this network’s faucet url).
Returns
The transaction response from the faucet funding transaction.
Throws
- If the faucet is not configured on this network or the funding transaction fails.
Example
// Funding an account (G... address)const tx = await server.fundAddress("GBZC6Y2Y7...");console.log("Funded! Hash:", tx.txHash);// If you need the Account object:const account = await server.getAccount("GBZC6Y2Y7...");Example
// Funding a contract (C... address)const tx = await server.fundAddress("CBZC6Y2Y7...");console.log("Contract funded! Hash:", tx.txHash);Source: src/rpc/server.ts:1301
server.getAccount(address)
Fetch a minimal set of current info about a Digital World account.
Needed to get the current sequence number for the account so you can build
a successful transaction with TransactionBuilder.
getAccount(address: string): Promise<Account>;Parameters
address—string(required) — The public address of the account to load.
Returns
A promise which resolves to the Account
object with a populated sequence number
Example
const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";server.getAccount(accountId).then((account) => { console.log("sequence:", account.sequence);});Source: src/rpc/server.ts:199
server.getAccountEntry(address)
Fetch the full account entry for a Digital World account.
getAccountEntry(address: string): Promise<AccountEntry>;Parameters
address—string(required) — The public address of the account to load.
Returns
Resolves to the full on-chain account entry
Example
const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";server.getAccountEntry(accountId).then((account) => { console.log("sequence:", account.balance().toString());});Source: src/rpc/server.ts:221
server.getAssetBalance(address, asset, networkPassphrase)
Fetch the balance of an asset held by an account or contract.
The address argument may be provided as a string (as a StrKey),
Address, or Contract.
getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise<BalanceResponse>;Parameters
address—string | Address | Contract(required) — The account or contract whose balance should be fetched.asset—Asset(required) — The asset whose balance you want to inspect.networkPassphrase—string(optional) — (optional) optionally, when requesting the balance of a contract, the network passphrase to which this token applies. If omitted and necessary, a request about network information will be made (seegetNetwork), since contract IDs for assets are specific to a network. You can refer toNetworksfor a list of built-in passphrases, e.g.,Networks.TESTNET.
Returns
Resolves with balance entry details when available.
Throws
- If the supplied
addressis not a valid account or contract strkey.
Example
const usdc = new Asset( "USDC", "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5");const balance = await server.getAssetBalance("GD...", usdc);console.log(balance.balanceEntry?.amount);Source: src/rpc/server.ts:369
server.getClaimableBalance(id)
Fetch the full claimable balance entry for a Digital World account.
getClaimableBalance(id: string): Promise<ClaimableBalanceEntry>;Parameters
id—string(required) — The strkey (B...) or hex (00000000abcde...) (both IDs with and without the 000… version prefix are accepted) of the claimable balance to load
Returns
Resolves to the full on-chain claimable balance entry
Example
const id = "00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9";server.getClaimableBalance(id).then((entry) => { console.log(`Claimable balance {id.substr(0, 12)} has:`); console.log(` asset: ${Asset.fromXDRObject(entry.asset()).toString()}`; console.log(` amount: ${entry.amount().toString()}`;});Source: src/rpc/server.ts:301
server.getContractData(contract, key, durability)
Reads the current value of contract data ledger entries directly.
Allows you to directly inspect the current state of a contract. This is a
backup way to access your contract data which may not be available via
events or rpc.Server.simulateTransaction.
getContractData(contract: string | Address | Contract, key: ScVal, durability: Durability = Durability.Persistent): Promise<LedgerEntryResult>;Parameters
contract—string | Address | Contract(required) — The contract ID containing the data to load as a strkey (C...form), aContract, or anAddressinstancekey—ScVal(required) — The key of the contract data to loaddurability—Durability(optional) (default:Durability.Persistent) — (optional) The “durability keyspace” that this ledger key belongs to, which is either ‘temporary’ or ‘persistent’ (the default), seerpc.Durability.
Returns
The current data value
Warning: If the data entry in question is a ‘temporary’ entry, it’s entirely possible that it has expired out of existence.
Example
const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";const key = xdr.ScVal.scvSymbol("counter");server.getContractData(contractId, key, Durability.Temporary).then(data => { console.log("value:", data.val); console.log("liveUntilLedgerSeq:", data.liveUntilLedgerSeq); console.log("lastModified:", data.lastModifiedLedgerSeq); console.log("latestLedger:", data.latestLedger);});Source: src/rpc/server.ts:468
server.getContractWasmByContractId(contractId)
Retrieves the WASM bytecode for a given contract.
This method allows you to fetch the WASM bytecode associated with a contract deployed on the Dwsa network. The WASM bytecode represents the executable code of the contract.
getContractWasmByContractId(contractId: string): Promise<Buffer<ArrayBufferLike>>;Parameters
contractId—string(required) — The contract ID containing the WASM bytecode to retrieve
Returns
A Buffer containing the WASM bytecode
Throws
- If the contract or its associated WASM bytecode cannot be found on the network.
Example
const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";server.getContractWasmByContractId(contractId).then(wasmBuffer => { console.log("WASM bytecode length:", wasmBuffer.length); // ... do something with the WASM bytecode ...}).catch(err => { console.error("Error fetching WASM bytecode:", err);});Source: src/rpc/server.ts:542
server.getContractWasmByHash(wasmHash, format)
Retrieves the WASM bytecode for a given contract hash.
This method allows you to fetch the WASM bytecode associated with a contract deployed on the Dwsa network using the contract’s WASM hash. The WASM bytecode represents the executable code of the contract.
getContractWasmByHash(wasmHash: string | Buffer<ArrayBufferLike>, format: "base64" | "hex" | undefined = undefined): Promise<Buffer<ArrayBufferLike>>;Parameters
wasmHash—string | Buffer<ArrayBufferLike>(required) — The WASM hash of the contractformat—"base64" | "hex" | undefined(optional) (default:undefined)
Returns
A Buffer containing the WASM bytecode
Throws
- If the contract or its associated WASM bytecode cannot be found on the network.
Example
const wasmHash = Buffer.from("...");server.getContractWasmByHash(wasmHash).then(wasmBuffer => { console.log("WASM bytecode length:", wasmBuffer.length); // ... do something with the WASM bytecode ...}).catch(err => { console.error("Error fetching WASM bytecode:", err);});Source: src/rpc/server.ts:587
server.getEvents(request)
Fetch all events that match a given set of filters.
The given filters (see Api.EventFilter
for detailed fields) are combined only in a logical OR fashion, and all of
the fields in each filter are optional.
To page through events, use the pagingToken field on the relevant
Api.EventResponse object to set the cursor parameter.
getEvents(request: GetEventsRequest): Promise<GetEventsResponse>;Parameters
request—GetEventsRequest(required) — Event filtersApi.GetEventsRequest,
Returns
A paginatable set of the events matching the given event filters
Example
server.getEvents({ startLedger: 1000, endLedger: 2000, filters: [ { type: "contract", contractIds: [ "deadb33f..." ], topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc=", "*" ]] }, { type: "system", contractIds: [ "...c4f3b4b3..." ], topics: [[ "*" ], [ "*", "AAAAAQB6Mcc=" ]] }, { contractIds: [ "...c4f3b4b3..." ], topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==" ]] }, { type: "diagnostic", topics: [[ "AAAAAQB6Mcc=" ]] } ], limit: 10,});Source: src/rpc/server.ts:877
server.getFeeStats()
Provides an analysis of the recent fee stats for regular and smart contract operations.
getFeeStats(): Promise<GetFeeStatsResponse>;Returns
the fee stats
Source: src/rpc/server.ts:1346
server.getHealth()
General node health check.
getHealth(): Promise<GetHealthResponse>;Returns
A promise which resolves to the
Api.GetHealthResponse object with the status of the
server (e.g. “healthy”).
Example
server.getHealth().then((health) => { console.log("status:", health.status);});Source: src/rpc/server.ts:427
server.getLatestLedger()
Fetch the latest ledger meta info from network which this Dwsa RPC server is connected to.
getLatestLedger(): Promise<GetLatestLedgerResponse>;Returns
metadata about the latest ledger on the network that this RPC server is connected to
Example
server.getLatestLedger().then((response) => { console.log("hash:", response.id); console.log("sequence:", response.sequence); console.log("protocolVersion:", response.protocolVersion);});Source: src/rpc/server.ts:948
server.getLedgerEntries(keys)
Reads the current value of arbitrary ledger entries directly.
Allows you to directly inspect the current state of contracts, contract’s code, accounts, or any other ledger entries.
To fetch a contract’s WASM byte-code, built the appropriate
xdr.LedgerKeyContractCode ledger entry key (or see
Contract.getFootprint).
getLedgerEntries(...keys: LedgerKey[]): Promise<GetLedgerEntriesResponse>;Parameters
...keys—LedgerKey[](required) — One or more ledger entry keys to load
Returns
The current on-chain values for the given ledger keys
Example
const contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM";const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({ contractId: StrKey.decodeContract(contractId), key: xdr.ScVal.scvSymbol("counter"),}));
server.getLedgerEntries([key]).then(response => { const ledgerData = response.entries[0]; console.log("key:", ledgerData.key); console.log("value:", ledgerData.val); console.log("liveUntilLedgerSeq:", ledgerData.liveUntilLedgerSeq); console.log("lastModified:", ledgerData.lastModifiedLedgerSeq); console.log("latestLedger:", response.latestLedger);});See also
- RpcServer._getLedgerEntries
Source: src/rpc/server.ts:647
server.getLedgerEntry(key)
getLedgerEntry(key: LedgerKey): Promise<LedgerEntryResult>;Parameters
key—LedgerKey(required)
Source: src/rpc/server.ts:662
server.getLedgers(request)
Fetch a detailed list of ledgers starting from a specified point.
Returns ledger data with support for pagination as long as the requested pages fall within the history retention of the RPC provider.
getLedgers(request: GetLedgersRequest): Promise<GetLedgersResponse>;Parameters
request—GetLedgersRequest(required) — The request parameters for fetching ledgers.Api.GetLedgersRequest
Returns
A promise that resolves to the
ledgers response containing an array of ledger data and pagination info. Api.GetLedgersResponse
Throws
- If startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node.
Example
// Fetch ledgers starting from a specific sequence numberserver.getLedgers({ startLedger: 36233, pagination: { limit: 10 }}).then((response) => { console.log("Ledgers:", response.ledgers); console.log("Latest Ledger:", response.latestLedger); console.log("Cursor:", response.cursor);});Example
// Paginate through ledgers using cursorconst firstPage = await server.getLedgers({ startLedger: 36233, pagination: { limit: 5 }});
const nextPage = await server.getLedgers({ pagination: { cursor: firstPage.cursor, limit: 5 }});Source: src/rpc/server.ts:1522
server.getNetwork()
Fetch metadata about the network this Dwsa RPC server is connected to.
getNetwork(): Promise<GetNetworkResponse>;Returns
Metadata about the current network this RPC server is connected to
Example
server.getNetwork().then((network) => { console.log("faucetUrl:", network.faucetUrl); console.log("passphrase:", network.passphrase); console.log("protocolVersion:", network.protocolVersion);});Source: src/rpc/server.ts:923
server.getSACBalance(address, sac, networkPassphrase)
Deprecated. Use getAssetBalance, instead
Returns a contract’s balance of a particular SAC asset, if any.
This is a convenience wrapper around Server.getLedgerEntries.
getSACBalance(address: string | Address, sac: Asset, networkPassphrase?: string): Promise<BalanceResponse>;Parameters
address—string | Address(required) — the contract (stringC...) whose balance ofsacyou want to knowsac—Asset(required) — the built-in SAC token (e.g.USDC:GABC...) that you are querying from the givencontract.networkPassphrase—string(optional) — (optional) optionally, the network passphrase to which this token applies. If omitted, a request about network information will be made (seegetNetwork), since contract IDs for assets are specific to a network. You can refer toNetworksfor a list of built-in passphrases, e.g.,Networks.TESTNET.
Returns
, which will contain the balance
entry details if and only if the request returned a valid balance ledger
entry. If it doesn’t, the balanceEntry field will not exist.
Throws
- If
addressis not a valid contract ID (C…).
Example
// assume `address` is some contract or account with an NATIVE balance// assume server is an instantiated `Server` instance.const entry = (await server.getSACBalance( new Address(address), Asset.native(), Networks.PUBLIC));
// assumes BigInt support:console.log( entry.balanceEntry ? BigInt(entry.balanceEntry.amount) : "Address has no NATIVE");See also
- getLedgerEntries
Source: src/rpc/server.ts:1408
server.getTransaction(hash)
Fetch the details of a submitted transaction.
After submitting a transaction, clients should poll this to tell when the transaction has completed.
getTransaction(hash: string): Promise<GetTransactionResponse>;Parameters
hash—string(required) — Hex-encoded hash of the transaction to check
Returns
The status, result, and other details about the transaction
Example
const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";server.getTransaction(transactionHash).then((tx) => { console.log("status:", tx.status); console.log("envelopeXdr:", tx.envelopeXdr); console.log("resultMetaXdr:", tx.resultMetaXdr); console.log("resultXdr:", tx.resultXdr);});Source: src/rpc/server.ts:746
server.getTransactions(request)
Fetch transactions starting from a given start ledger or a cursor. The end ledger is the latest ledger in that RPC instance.
getTransactions(request: GetTransactionsRequest): Promise<GetTransactionsResponse>;Parameters
request—GetTransactionsRequest(required) — The request parameters.
Returns
- A promise that resolves to the transactions response.
Example
server.getTransactions({ startLedger: 10000, limit: 10,}).then((response) => { console.log("Transactions:", response.transactions); console.log("Latest Ledger:", response.latestLedger); console.log("Cursor:", response.cursor);});Source: src/rpc/server.ts:805
server.getTrustline(account, asset)
Deprecated. Use getAssetBalance, instead
Fetch the full trustline entry for a Digital World account.
getTrustline(account: string, asset: Asset): Promise<TrustLineEntry>;Parameters
account—string(required) — The public address of the account whose trustline it isasset—Asset(required) — The trustline’s asset
Returns
Resolves to the full on-chain trustline entry
Example
const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";const asset = new Asset( "USDC", "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5");server.getTrustline(accountId, asset).then((entry) => { console.log(`{asset.toString()} balance for ${accountId}:", entry.balance().toString());});Source: src/rpc/server.ts:259
server.getVersionInfo()
Provides information about the current version details of the Dwsa RPC and captive-core
getVersionInfo(): Promise<GetVersionInfoResponse>;Returns
the version info
Source: src/rpc/server.ts:1359
server.pollTransaction(hash, opts)
Poll for a particular transaction with certain parameters.
After submitting a transaction, clients can use this to poll for transaction completion and return a definitive state of success or failure.
pollTransaction(hash: string, opts?: PollingOptions): Promise<GetTransactionResponse>;Parameters
hash—string(required) — the transaction you’re polling foropts—PollingOptions(optional) — (optional) polling optionsattempts(optional): (optional) the number of attempts to make before returning the last-seen status. By default or on invalid inputs, try 5 times.sleepStrategy(optional): (optional) the amount of time to wait for between each attempt. By default, sleep for 1 second between each attempt.
Returns
the response after a “found” response (which may be success or failure) or the last response obtained after polling the maximum number of specified attempts.
Example
const h = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";const txStatus = await server.pollTransaction(h, { attempts: 100, // I'm a maniac sleepStrategy: rpc.LinearSleepStrategy}); // this will take 5,050 seconds to completeSource: src/rpc/server.ts:700
server.prepareTransaction(tx)
Submit a trial contract invocation, first run a simulation of the contract invocation as defined on the incoming transaction, and apply the results to a new copy of the transaction which is then returned. Setting the ledger footprint and authorization, so the resulting transaction is ready for signing & sending.
The returned transaction will also have an updated fee that is the sum of fee set on incoming transaction with the contract resource fees estimated from simulation. It is advisable to check the fee on returned transaction and validate or take appropriate measures for interaction with user to confirm it is acceptable.
You can call the rpc.Server.simulateTransaction method
directly first if you want to inspect estimated fees for a given
transaction in detail first, then re-assemble it manually or via
rpc.assembleTransaction.
prepareTransaction(tx: Transaction | FeeBumpTransaction): Promise<Transaction>;Parameters
-
tx—Transaction | FeeBumpTransaction(required) — the transaction to prepare. It should include exactly one operation, which must be one ofxdr.InvokeHostFunctionOp,xdr.ExtendFootprintTtlOp, orxdr.RestoreFootprintOp.Any provided footprint will be overwritten. However, if your operation has existing auth entries, they will be preferred over ALL auth entries from the simulation. In other words, if you include auth entries, you don’t care about the auth returned from the simulation. Other fields (footprint, etc.) will be filled as normal.
Returns
A copy of the transaction with the expected authorizations (in the case of invocation), resources, and ledger footprints added. The transaction fee will also automatically be padded with the contract’s minimum resource fees discovered from the simulation.
Throws
-
- If simulation fails
Example
const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';const contract = new DigitalWorldSdk.Contract(contractId);
// Right now, this is just the default fee for this example.const fee = DigitalWorldSdk.BASE_FEE;const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the gateway hostname. //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC) .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build();
const preparedTransaction = await server.prepareTransaction(transaction);
// Sign this transaction with the secret key// NOTE: signing is transaction is network specific. Test network transactions// won't work in the public network. To switch networks, use the Network object// as explained above (look for DigitalWorldSdk.Network).const sourceKeypair = DigitalWorldSdk.Keypair.fromSecret(sourceSecretKey);preparedTransaction.sign(sourceKeypair);
server.sendTransaction(transaction).then(result => { console.log("hash:", result.hash); console.log("status:", result.status); console.log("errorResultXdr:", result.errorResultXdr);});See also
- module:rpc.assembleTransaction
Source: src/rpc/server.ts:1114
server.requestAirdrop(address, faucetUrl)
Deprecated. Use Server.fundAddress instead, which supports both
account (G…) and contract (C…) addresses.
Fund a new account using the network’s Faucet, if any.
requestAirdrop(address: string | Pick<Account, "accountId">, faucetUrl?: string): Promise<Account>;Parameters
address—string | Pick<Account, "accountId">(required) — The address or account instance that we want to create and fund with the FaucetfaucetUrl—string(optional) — (optional) Optionally, an explicit address for the faucet (by default: this calls the Dwsa RPCgetNetworkmethod to try to discover this network’s faucet url).
Returns
An Account object for the created
account, or the existing account if it’s already funded with the
populated sequence number (note that the account will not be “topped
off” if it already exists)
Throws
- If the faucet is not configured on this network or request failure
Example
server .requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4") .then((accountCreated) => { console.log("accountCreated:", accountCreated); }).catch((error) => { console.error("error:", error); });See also
Faucet.Api.Response
Source: src/rpc/server.ts:1217
server.sendTransaction(transaction)
Submit a real transaction to the Digital World network.
Unlike Gateway, RPC does not wait for transaction completion. It
simply validates the transaction and enqueues it. Clients should call
rpc.Server.getTransaction to learn about transaction
success/failure.
sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<SendTransactionResponse>;Parameters
transaction—Transaction | FeeBumpTransaction(required) — to submit
Returns
the transaction id, status, and any error if available
Example
const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';const contract = new DigitalWorldSdk.Contract(contractId);
// Right now, this is just the default fee for this example.const fee = DigitalWorldSdk.BASE_FEE;const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the gateway hostname. //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC) .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build();
// Sign this transaction with the secret key// NOTE: signing is transaction is network specific. Test network transactions// won't work in the public network. To switch networks, use the Network object// as explained above (look for DigitalWorldSdk.Network).const sourceKeypair = DigitalWorldSdk.Keypair.fromSecret(sourceSecretKey);transaction.sign(sourceKeypair);
server.sendTransaction(transaction).then((result) => { console.log("hash:", result.hash); console.log("status:", result.status); console.log("errorResultXdr:", result.errorResultXdr);});Source: src/rpc/server.ts:1167
server.simulateTransaction(tx, addlResources, authMode)
Submit a trial contract invocation to get back return values, expected ledger footprint, expected authorizations, and expected costs.
simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<SimulateTransactionResponse>;Parameters
tx—Transaction | FeeBumpTransaction(required) — the transaction to simulate, which should include exactly one operation (one ofxdr.InvokeHostFunctionOp,xdr.ExtendFootprintTtlOp, orxdr.RestoreFootprintOp). Any provided footprint or auth information will be ignored.addlResources—ResourceLeeway(optional) — (optional) any additional resources to add to the simulation-provided ones, for example if you know you will need extra CPU instructionsauthMode—SimulationAuthMode(optional) — (optional) optionally, specify the type of auth mode to use for simulation:enforcefor enforcement mode,recordfor recording mode, orrecord_allow_nonrootfor recording mode that allows non-root authorization
Returns
An object with the cost, footprint, result/auth requirements (if applicable), and error of the transaction
Example
const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';const contract = new DigitalWorldSdk.Contract(contractId);
// Right now, this is just the default fee for this example.const fee = DigitalWorldSdk.BASE_FEE;const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the gateway hostname. //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC) .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build();
server.simulateTransaction(transaction).then((sim) => { console.log("cost:", sim.cost); console.log("result:", sim.result); console.log("error:", sim.error); console.log("latestLedger:", sim.latestLedger);});See also
-
- module:rpc.Server#prepareTransaction
- module:rpc.assembleTransaction
Source: src/rpc/server.ts:1013
rpc.assembleTransaction
Combines the given raw transaction alongside the simulation results.
If the given transaction already has authorization entries in a host
function invocation (see Operation.invokeHostFunction), the
simulation entries are ignored.
If the given transaction already has authorization entries in a host function
invocation (see Operation.invokeHostFunction), the simulation
entries are ignored.
assembleTransaction(raw: Transaction | FeeBumpTransaction, simulation: SimulateTransactionResponse | RawSimulateTransactionResponse): TransactionBuilderParameters
raw—Transaction | FeeBumpTransaction(required) — the initial transaction, w/o simulation appliedsimulation—SimulateTransactionResponse | RawSimulateTransactionResponse(required) — the Dwsa RPC simulation result (seerpc.Server.simulateTransaction)
Returns
a new, cloned transaction with the proper auth and resource (fee, footprint) simulation data applied
See also
-
rpc.Server.simulateTransaction
rpc.Server.prepareTransaction
Source: src/rpc/transaction.ts:44
rpc.parseRawEvents
Parse and return the retrieved events, if any, from a raw response from a RPC server.
parseRawEvents(raw: RawGetEventsResponse): GetEventsResponseParameters
raw—RawGetEventsResponse(required) — the rawgetEventsresponse from the RPC server to parse
Returns
events parsed from the RPC server’s response
Source: src/rpc/parsers.ts:96
rpc.parseRawSimulation
Converts a raw response schema into one with parsed XDR fields and a simplified interface.
Warning: This API is only exported for testing purposes and should not be relied on or considered “stable”.
parseRawSimulation(sim: SimulateTransactionResponse | RawSimulateTransactionResponse): SimulateTransactionResponseParameters
sim—SimulateTransactionResponse | RawSimulateTransactionResponse(required) — the raw response schema (parsed ones are allowed, best-effort detected, and returned untouched)
Returns
the original parameter (if already parsed), parsed otherwise
Source: src/rpc/parsers.ts:236
Types
rpc.Api.BalanceResponse
interface BalanceResponse { balanceEntry?: { amount: string; authorized: boolean; authorizedToMaintainLiabilities?: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; revocable?: boolean }; latestLedger: number;}Source: src/rpc/api.ts:578
balanceResponse.balanceEntry
present only on success, otherwise request malformed or no balance
balanceEntry?: { amount: string; authorized: boolean; authorizedToMaintainLiabilities?: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; revocable?: boolean };Source: src/rpc/api.ts:581
balanceResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:579
rpc.Api.BaseSendTransactionResponse
interface BaseSendTransactionResponse { hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus;}Source: src/rpc/api.ts:370
baseSendTransactionResponse.hash
hash: string;Source: src/rpc/api.ts:372
baseSendTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:373
baseSendTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:374
baseSendTransactionResponse.status
status: SendTransactionStatus;Source: src/rpc/api.ts:371
rpc.Api.BaseSimulateTransactionResponse
interface BaseSimulateTransactionResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number;}Source: src/rpc/api.ts:403
baseSimulateTransactionResponse._parsed
a private field to mark the schema as parsed
_parsed: boolean;Source: src/rpc/api.ts:418
baseSimulateTransactionResponse.events
The field is always present, but may be empty in cases where:
- you didn’t simulate an invocation or
- there were no events
events: DiagnosticEvent[];Source: src/rpc/api.ts:415
baseSimulateTransactionResponse.id
always present: the JSON-RPC request ID
id: string;Source: src/rpc/api.ts:405
baseSimulateTransactionResponse.latestLedger
always present: the LCL known to the server when responding
latestLedger: number;Source: src/rpc/api.ts:408
rpc.Api.EventFilter
interface EventFilter { contractIds?: string[]; topics?: string[][]; type?: EventType;}Source: src/rpc/api.ts:223
eventFilter.contractIds
contractIds?: string[];Source: src/rpc/api.ts:225
eventFilter.topics
topics?: string[][];Source: src/rpc/api.ts:226
eventFilter.type
type?: EventType;Source: src/rpc/api.ts:224
rpc.Api.EventResponse
interface EventResponse extends BaseEventResponse { contractId?: Contract; id: string; inSuccessfulContractCall: boolean; ledger: number; ledgerClosedAt: string; operationIndex: number; topic: ScVal[]; transactionIndex: number; txHash: string; type: EventType; value: ScVal;}Source: src/rpc/api.ts:298
eventResponse.contractId
contractId?: Contract;Source: src/rpc/api.ts:299
eventResponse.id
id: string;Source: src/rpc/api.ts:310
eventResponse.inSuccessfulContractCall
inSuccessfulContractCall: boolean;Source: src/rpc/api.ts:316
eventResponse.ledger
ledger: number;Source: src/rpc/api.ts:312
eventResponse.ledgerClosedAt
ledgerClosedAt: string;Source: src/rpc/api.ts:313
eventResponse.operationIndex
operationIndex: number;Source: src/rpc/api.ts:315
eventResponse.topic
topic: ScVal[];Source: src/rpc/api.ts:300
eventResponse.transactionIndex
transactionIndex: number;Source: src/rpc/api.ts:314
eventResponse.txHash
txHash: string;Source: src/rpc/api.ts:317
eventResponse.type
type: EventType;Source: src/rpc/api.ts:311
eventResponse.value
value: ScVal;Source: src/rpc/api.ts:301
rpc.Api.EventType
type EventType = "contract" | "system"Source: src/rpc/api.ts:221
rpc.Api.GetEventsRequest
Request parameters for fetching events from the Digital World network.
Important: This type enforces mutually exclusive pagination modes:
- Ledger range mode: Use
startLedgerandendLedger(cursor must be omitted) - Cursor pagination mode: Use
cursor(startLedger and endLedger must be omitted)
type GetEventsRequest = { cursor?: never; endLedger?: number; filters: Api.EventFilter[]; limit?: number; startLedger: number } | { cursor: string; endLedger?: never; filters: Api.EventFilter[]; limit?: number; startLedger?: never }Example
// ✅ Correct: Ledger range modeconst rangeRequest: GetEventsRequest = { filters: [], startLedger: 1000, endLedger: 2000, limit: 100};Example
// ✅ Correct: Cursor pagination modeconst cursorRequest: GetEventsRequest = { filters: [], cursor: "some-cursor-value", limit: 100};Example
// ❌ Invalid: Cannot mix cursor with ledger rangeconst invalidRequest = { filters: [], startLedger: 1000, // ❌ Cannot use with cursor endLedger: 2000, // ❌ Cannot use with cursor cursor: "cursor", // ❌ Cannot use with ledger range limit: 100};Source: src/rpc/api.ts:277
rpc.Api.GetEventsResponse
interface GetEventsResponse extends RetentionState { cursor: string; events: EventResponse[]; latestLedger: number; latestLedgerCloseTime: string; oldestLedger: number; oldestLedgerCloseTime: string;}Source: src/rpc/api.ts:293
getEventsResponse.cursor
cursor: string;Source: src/rpc/api.ts:295
getEventsResponse.events
events: EventResponse[];Source: src/rpc/api.ts:294
getEventsResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:230
getEventsResponse.latestLedgerCloseTime
latestLedgerCloseTime: string;Source: src/rpc/api.ts:232
getEventsResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:231
getEventsResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: string;Source: src/rpc/api.ts:233
rpc.Api.GetFailedTransactionResponse
interface GetFailedTransactionResponse extends GetAnyTransactionResponse { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; status: FAILED; txHash: string;}Source: src/rpc/api.ts:92
getFailedTransactionResponse.applicationOrder
applicationOrder: number;Source: src/rpc/api.ts:97
getFailedTransactionResponse.createdAt
createdAt: number;Source: src/rpc/api.ts:96
getFailedTransactionResponse.diagnosticEventsXdr
diagnosticEventsXdr?: DiagnosticEvent[];Source: src/rpc/api.ts:102
getFailedTransactionResponse.envelopeXdr
envelopeXdr: TransactionEnvelope;Source: src/rpc/api.ts:99
getFailedTransactionResponse.events
events: TransactionEvents;Source: src/rpc/api.ts:103
getFailedTransactionResponse.feeBump
feeBump: boolean;Source: src/rpc/api.ts:98
getFailedTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:82
getFailedTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:83
getFailedTransactionResponse.ledger
ledger: number;Source: src/rpc/api.ts:95
getFailedTransactionResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:84
getFailedTransactionResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:85
getFailedTransactionResponse.resultMetaXdr
resultMetaXdr: TransactionMeta;Source: src/rpc/api.ts:101
getFailedTransactionResponse.resultXdr
resultXdr: TransactionResult;Source: src/rpc/api.ts:100
getFailedTransactionResponse.status
status: FAILED;Source: src/rpc/api.ts:93
getFailedTransactionResponse.txHash
txHash: string;Source: src/rpc/api.ts:81
rpc.Api.GetFeeStatsResponse
interface GetFeeStatsResponse { dwsaInclusionFee: FeeDistribution; inclusionFee: FeeDistribution; latestLedger: number;}Source: src/rpc/api.ts:552
getFeeStatsResponse.dwsaInclusionFee
dwsaInclusionFee: FeeDistribution;Source: src/rpc/api.ts:553
getFeeStatsResponse.inclusionFee
inclusionFee: FeeDistribution;Source: src/rpc/api.ts:554
getFeeStatsResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:555
rpc.Api.GetHealthResponse
interface GetHealthResponse { latestLedger: number; ledgerRetentionWindow: number; oldestLedger: number; status: "healthy";}Source: src/rpc/api.ts:5
getHealthResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:6
getHealthResponse.ledgerRetentionWindow
ledgerRetentionWindow: number;Source: src/rpc/api.ts:7
getHealthResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:8
getHealthResponse.status
status: "healthy";Source: src/rpc/api.ts:9
rpc.Api.GetLatestLedgerResponse
interface GetLatestLedgerResponse { closeTime: string; headerXdr: LedgerHeader; id: string; metadataXdr: LedgerCloseMeta; protocolVersion: string; sequence: number;}Source: src/rpc/api.ts:48
getLatestLedgerResponse.closeTime
closeTime: string;Source: src/rpc/api.ts:52
getLatestLedgerResponse.headerXdr
headerXdr: LedgerHeader;Source: src/rpc/api.ts:53
getLatestLedgerResponse.id
id: string;Source: src/rpc/api.ts:49
getLatestLedgerResponse.metadataXdr
metadataXdr: LedgerCloseMeta;Source: src/rpc/api.ts:54
getLatestLedgerResponse.protocolVersion
protocolVersion: string;Source: src/rpc/api.ts:51
getLatestLedgerResponse.sequence
sequence: number;Source: src/rpc/api.ts:50
rpc.Api.GetLedgerEntriesResponse
An XDR-parsed version of RawLedgerEntryResult
interface GetLedgerEntriesResponse { entries: LedgerEntryResult[]; latestLedger: number;}Source: src/rpc/api.ts:32
getLedgerEntriesResponse.entries
entries: LedgerEntryResult[];Source: src/rpc/api.ts:33
getLedgerEntriesResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:34
rpc.Api.GetLedgersRequest
Request parameters for fetching a sequential list of ledgers.
This type supports two distinct pagination modes that are mutually exclusive:
- Ledger-based pagination: Use
startLedgerto begin fetching from a specific ledger sequence - Cursor-based pagination: Use
cursorto continue from a previous response’s pagination token
type GetLedgersRequest = { pagination?: { cursor?: never; limit?: number }; startLedger: number } | { pagination: { cursor: string; limit?: number }; startLedger?: never }Example
// Ledger-based pagination - start from specific ledgerconst ledgerRequest: GetLedgersRequest = { startLedger: 36233, pagination: { limit: 10 }};Example
// Cursor-based pagination - continue from previous responseconst cursorRequest: GetLedgersRequest = { pagination: { cursor: "36234", limit: 5 }};Source: src/rpc/api.ts:624
rpc.Api.GetLedgersResponse
interface GetLedgersResponse { cursor: string; latestLedger: number; latestLedgerCloseTime: number; ledgers: LedgerResponse[]; oldestLedger: number; oldestLedgerCloseTime: number;}Source: src/rpc/api.ts:659
getLedgersResponse.cursor
cursor: string;Source: src/rpc/api.ts:665
getLedgersResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:661
getLedgersResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:662
getLedgersResponse.ledgers
ledgers: LedgerResponse[];Source: src/rpc/api.ts:660
getLedgersResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:663
getLedgersResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:664
rpc.Api.GetMissingTransactionResponse
interface GetMissingTransactionResponse extends GetAnyTransactionResponse { latestLedger: number; latestLedgerCloseTime: number; oldestLedger: number; oldestLedgerCloseTime: number; status: NOT_FOUND; txHash: string;}Source: src/rpc/api.ts:88
getMissingTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:82
getMissingTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:83
getMissingTransactionResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:84
getMissingTransactionResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:85
getMissingTransactionResponse.status
status: NOT_FOUND;Source: src/rpc/api.ts:89
getMissingTransactionResponse.txHash
txHash: string;Source: src/rpc/api.ts:81
rpc.Api.GetNetworkResponse
interface GetNetworkResponse { faucetUrl?: string; passphrase: string; protocolVersion: string;}Source: src/rpc/api.ts:42
getNetworkResponse.faucetUrl
faucetUrl?: string;Source: src/rpc/api.ts:43
getNetworkResponse.passphrase
passphrase: string;Source: src/rpc/api.ts:44
getNetworkResponse.protocolVersion
protocolVersion: string;Source: src/rpc/api.ts:45
rpc.Api.GetSuccessfulTransactionResponse
interface GetSuccessfulTransactionResponse extends GetAnyTransactionResponse { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; returnValue?: ScVal; status: SUCCESS; txHash: string;}Source: src/rpc/api.ts:106
getSuccessfulTransactionResponse.applicationOrder
applicationOrder: number;Source: src/rpc/api.ts:111
getSuccessfulTransactionResponse.createdAt
createdAt: number;Source: src/rpc/api.ts:110
getSuccessfulTransactionResponse.diagnosticEventsXdr
diagnosticEventsXdr?: DiagnosticEvent[];Source: src/rpc/api.ts:116
getSuccessfulTransactionResponse.envelopeXdr
envelopeXdr: TransactionEnvelope;Source: src/rpc/api.ts:113
getSuccessfulTransactionResponse.events
events: TransactionEvents;Source: src/rpc/api.ts:119
getSuccessfulTransactionResponse.feeBump
feeBump: boolean;Source: src/rpc/api.ts:112
getSuccessfulTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:82
getSuccessfulTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:83
getSuccessfulTransactionResponse.ledger
ledger: number;Source: src/rpc/api.ts:109
getSuccessfulTransactionResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:84
getSuccessfulTransactionResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:85
getSuccessfulTransactionResponse.resultMetaXdr
resultMetaXdr: TransactionMeta;Source: src/rpc/api.ts:115
getSuccessfulTransactionResponse.resultXdr
resultXdr: TransactionResult;Source: src/rpc/api.ts:114
getSuccessfulTransactionResponse.returnValue
returnValue?: ScVal;Source: src/rpc/api.ts:118
getSuccessfulTransactionResponse.status
status: SUCCESS;Source: src/rpc/api.ts:107
getSuccessfulTransactionResponse.txHash
txHash: string;Source: src/rpc/api.ts:81
rpc.Api.GetTransactionResponse
type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponseSource: src/rpc/api.ts:74
rpc.Api.GetTransactionStatus
enum GetTransactionStatusSource: src/rpc/api.ts:68
rpc.Api.GetTransactionsRequest
type GetTransactionsRequest = { pagination?: { cursor?: never; limit?: number }; startLedger: number } | { pagination: { cursor: string; limit?: number }; startLedger?: never }Source: src/rpc/api.ts:144
rpc.Api.GetTransactionsResponse
interface GetTransactionsResponse { cursor: string; latestLedger: number; latestLedgerCloseTimestamp: number; oldestLedger: number; oldestLedgerCloseTimestamp: number; transactions: TransactionInfo[];}Source: src/rpc/api.ts:203
getTransactionsResponse.cursor
cursor: string;Source: src/rpc/api.ts:209
getTransactionsResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:205
getTransactionsResponse.latestLedgerCloseTimestamp
latestLedgerCloseTimestamp: number;Source: src/rpc/api.ts:206
getTransactionsResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:207
getTransactionsResponse.oldestLedgerCloseTimestamp
oldestLedgerCloseTimestamp: number;Source: src/rpc/api.ts:208
getTransactionsResponse.transactions
transactions: TransactionInfo[];Source: src/rpc/api.ts:204
rpc.Api.GetVersionInfoResponse
interface GetVersionInfoResponse { build_timestamp: string; buildTimestamp: string; captive_core_version: string; captiveCoreVersion: string; commit_hash: string; commitHash: string; protocol_version: number; protocolVersion: number; version: string;}Source: src/rpc/api.ts:535
getVersionInfoResponse.build_timestamp
build_timestamp: string;Source: src/rpc/api.ts:545
getVersionInfoResponse.buildTimestamp
buildTimestamp: string;Source: src/rpc/api.ts:538
getVersionInfoResponse.captive_core_version
captive_core_version: string;Source: src/rpc/api.ts:547
getVersionInfoResponse.captiveCoreVersion
captiveCoreVersion: string;Source: src/rpc/api.ts:539
getVersionInfoResponse.commit_hash
commit_hash: string;Source: src/rpc/api.ts:543
getVersionInfoResponse.commitHash
commitHash: string;Source: src/rpc/api.ts:537
getVersionInfoResponse.protocol_version
protocol_version: number;Source: src/rpc/api.ts:549
getVersionInfoResponse.protocolVersion
protocolVersion: number;Source: src/rpc/api.ts:540
getVersionInfoResponse.version
version: string;Source: src/rpc/api.ts:536
rpc.Api.LedgerEntryChange
interface LedgerEntryChange { after: LedgerEntry | null; before: LedgerEntry | null; key: LedgerKey; type: number;}Source: src/rpc/api.ts:336
ledgerEntryChange.after
after: LedgerEntry | null;Source: src/rpc/api.ts:340
ledgerEntryChange.before
before: LedgerEntry | null;Source: src/rpc/api.ts:339
ledgerEntryChange.key
key: LedgerKey;Source: src/rpc/api.ts:338
ledgerEntryChange.type
type: number;Source: src/rpc/api.ts:337
rpc.Api.LedgerEntryResult
interface LedgerEntryResult { key: LedgerKey; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; val: LedgerEntryData;}Source: src/rpc/api.ts:12
ledgerEntryResult.key
key: LedgerKey;Source: src/rpc/api.ts:14
ledgerEntryResult.lastModifiedLedgerSeq
lastModifiedLedgerSeq?: number;Source: src/rpc/api.ts:13
ledgerEntryResult.liveUntilLedgerSeq
liveUntilLedgerSeq?: number;Source: src/rpc/api.ts:16
ledgerEntryResult.val
val: LedgerEntryData;Source: src/rpc/api.ts:15
rpc.Api.LedgerResponse
interface LedgerResponse { hash: string; headerXdr: LedgerHeaderHistoryEntry; ledgerCloseTime: string; metadataXdr: LedgerCloseMeta; sequence: number;}Source: src/rpc/api.ts:677
ledgerResponse.hash
hash: string;Source: src/rpc/api.ts:678
ledgerResponse.headerXdr
headerXdr: LedgerHeaderHistoryEntry;Source: src/rpc/api.ts:681
ledgerResponse.ledgerCloseTime
ledgerCloseTime: string;Source: src/rpc/api.ts:680
ledgerResponse.metadataXdr
metadataXdr: LedgerCloseMeta;Source: src/rpc/api.ts:682
ledgerResponse.sequence
sequence: number;Source: src/rpc/api.ts:679
rpc.Api.RawEventResponse
interface RawEventResponse extends BaseEventResponse { contractId: string; id: string; inSuccessfulContractCall: boolean; ledger: number; ledgerClosedAt: string; operationIndex: number; topic?: string[]; transactionIndex: number; txHash: string; type: EventType; value: string;}Source: src/rpc/api.ts:320
rawEventResponse.contractId
contractId: string;Source: src/rpc/api.ts:321
rawEventResponse.id
id: string;Source: src/rpc/api.ts:310
rawEventResponse.inSuccessfulContractCall
inSuccessfulContractCall: boolean;Source: src/rpc/api.ts:316
rawEventResponse.ledger
ledger: number;Source: src/rpc/api.ts:312
rawEventResponse.ledgerClosedAt
ledgerClosedAt: string;Source: src/rpc/api.ts:313
rawEventResponse.operationIndex
operationIndex: number;Source: src/rpc/api.ts:315
rawEventResponse.topic
topic?: string[];Source: src/rpc/api.ts:322
rawEventResponse.transactionIndex
transactionIndex: number;Source: src/rpc/api.ts:314
rawEventResponse.txHash
txHash: string;Source: src/rpc/api.ts:317
rawEventResponse.type
type: EventType;Source: src/rpc/api.ts:311
rawEventResponse.value
value: string;Source: src/rpc/api.ts:323
rpc.Api.RawGetEventsResponse
interface RawGetEventsResponse extends RetentionState { cursor: string; events: RawEventResponse[]; latestLedger: number; latestLedgerCloseTime: string; oldestLedger: number; oldestLedgerCloseTime: string;}Source: src/rpc/api.ts:304
rawGetEventsResponse.cursor
cursor: string;Source: src/rpc/api.ts:306
rawGetEventsResponse.events
events: RawEventResponse[];Source: src/rpc/api.ts:305
rawGetEventsResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:230
rawGetEventsResponse.latestLedgerCloseTime
latestLedgerCloseTime: string;Source: src/rpc/api.ts:232
rawGetEventsResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:231
rawGetEventsResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: string;Source: src/rpc/api.ts:233
rpc.Api.RawGetLatestLedgerResponse
interface RawGetLatestLedgerResponse { closeTime: string; headerXdr: string; id: string; metadataXdr: string; protocolVersion: string; sequence: number;}Source: src/rpc/api.ts:57
rawGetLatestLedgerResponse.closeTime
closeTime: string;Source: src/rpc/api.ts:61
rawGetLatestLedgerResponse.headerXdr
a base-64 encoded xdr.LedgerHeader instance
headerXdr: string;Source: src/rpc/api.ts:63
rawGetLatestLedgerResponse.id
id: string;Source: src/rpc/api.ts:58
rawGetLatestLedgerResponse.metadataXdr
a base-64 encoded xdr.LedgerCloseMeta instance
metadataXdr: string;Source: src/rpc/api.ts:65
rawGetLatestLedgerResponse.protocolVersion
protocolVersion: string;Source: src/rpc/api.ts:60
rawGetLatestLedgerResponse.sequence
sequence: number;Source: src/rpc/api.ts:59
rpc.Api.RawGetLedgerEntriesResponse
interface RawGetLedgerEntriesResponse { entries?: RawLedgerEntryResult[]; latestLedger: number;}Source: src/rpc/api.ts:37
rawGetLedgerEntriesResponse.entries
entries?: RawLedgerEntryResult[];Source: src/rpc/api.ts:38
rawGetLedgerEntriesResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:39
rpc.Api.RawGetLedgersResponse
interface RawGetLedgersResponse { cursor: string; latestLedger: number; latestLedgerCloseTime: number; ledgers: RawLedgerResponse[]; oldestLedger: number; oldestLedgerCloseTime: number;}Source: src/rpc/api.ts:668
rawGetLedgersResponse.cursor
cursor: string;Source: src/rpc/api.ts:674
rawGetLedgersResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:670
rawGetLedgersResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:671
rawGetLedgersResponse.ledgers
ledgers: RawLedgerResponse[];Source: src/rpc/api.ts:669
rawGetLedgersResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:672
rawGetLedgersResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:673
rpc.Api.RawGetTransactionResponse
interface RawGetTransactionResponse { applicationOrder?: number; createdAt?: number; diagnosticEventsXdr?: string[]; envelopeXdr?: string; events?: RawTransactionEvents; feeBump?: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger?: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr?: string; resultXdr?: string; status: GetTransactionStatus; txHash: string;}Source: src/rpc/api.ts:122
rawGetTransactionResponse.applicationOrder
applicationOrder?: number;Source: src/rpc/api.ts:131
rawGetTransactionResponse.createdAt
createdAt?: number;Source: src/rpc/api.ts:134
rawGetTransactionResponse.diagnosticEventsXdr
diagnosticEventsXdr?: string[];Source: src/rpc/api.ts:139
rawGetTransactionResponse.envelopeXdr
envelopeXdr?: string;Source: src/rpc/api.ts:136
rawGetTransactionResponse.events
events?: RawTransactionEvents;Source: src/rpc/api.ts:141
rawGetTransactionResponse.feeBump
feeBump?: boolean;Source: src/rpc/api.ts:132
rawGetTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:124
rawGetTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:125
rawGetTransactionResponse.ledger
ledger?: number;Source: src/rpc/api.ts:133
rawGetTransactionResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:126
rawGetTransactionResponse.oldestLedgerCloseTime
oldestLedgerCloseTime: number;Source: src/rpc/api.ts:127
rawGetTransactionResponse.resultMetaXdr
resultMetaXdr?: string;Source: src/rpc/api.ts:138
rawGetTransactionResponse.resultXdr
resultXdr?: string;Source: src/rpc/api.ts:137
rawGetTransactionResponse.status
status: GetTransactionStatus;Source: src/rpc/api.ts:123
rawGetTransactionResponse.txHash
txHash: string;Source: src/rpc/api.ts:128
rpc.Api.RawGetTransactionsResponse
interface RawGetTransactionsResponse { cursor: string; latestLedger: number; latestLedgerCloseTimestamp: number; oldestLedger: number; oldestLedgerCloseTimestamp: number; transactions: RawTransactionInfo[] | null;}Source: src/rpc/api.ts:212
rawGetTransactionsResponse.cursor
cursor: string;Source: src/rpc/api.ts:218
rawGetTransactionsResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:214
rawGetTransactionsResponse.latestLedgerCloseTimestamp
latestLedgerCloseTimestamp: number;Source: src/rpc/api.ts:215
rawGetTransactionsResponse.oldestLedger
oldestLedger: number;Source: src/rpc/api.ts:216
rawGetTransactionsResponse.oldestLedgerCloseTimestamp
oldestLedgerCloseTimestamp: number;Source: src/rpc/api.ts:217
rawGetTransactionsResponse.transactions
transactions: RawTransactionInfo[] | null;Source: src/rpc/api.ts:213
rpc.Api.RawLedgerEntryResult
interface RawLedgerEntryResult { key: string; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; xdr: string;}Source: src/rpc/api.ts:19
rawLedgerEntryResult.key
a base-64 encoded xdr.LedgerKey instance
key: string;Source: src/rpc/api.ts:22
rawLedgerEntryResult.lastModifiedLedgerSeq
lastModifiedLedgerSeq?: number;Source: src/rpc/api.ts:20
rawLedgerEntryResult.liveUntilLedgerSeq
optional, a future ledger number upon which this entry will expire
liveUntilLedgerSeq?: number;Source: src/rpc/api.ts:28
rawLedgerEntryResult.xdr
a base-64 encoded xdr.LedgerEntryData instance
xdr: string;Source: src/rpc/api.ts:24
rpc.Api.RawLedgerResponse
interface RawLedgerResponse { hash: string; headerXdr: string; ledgerCloseTime: string; metadataXdr: string; sequence: number;}Source: src/rpc/api.ts:685
rawLedgerResponse.hash
hash: string;Source: src/rpc/api.ts:686
rawLedgerResponse.headerXdr
a base-64 encoded xdr.LedgerHeaderHistoryEntry instance
headerXdr: string;Source: src/rpc/api.ts:690
rawLedgerResponse.ledgerCloseTime
ledgerCloseTime: string;Source: src/rpc/api.ts:688
rawLedgerResponse.metadataXdr
a base-64 encoded xdr.LedgerCloseMeta instance
metadataXdr: string;Source: src/rpc/api.ts:692
rawLedgerResponse.sequence
sequence: number;Source: src/rpc/api.ts:687
rpc.Api.RawSendTransactionResponse
interface RawSendTransactionResponse extends BaseSendTransactionResponse { diagnosticEventsXdr?: string[]; errorResultXdr?: string; hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus;}Source: src/rpc/api.ts:354
rawSendTransactionResponse.diagnosticEventsXdr
This is a base64-encoded instance of an array of
xdr.DiagnosticEvents, set only when status is "ERROR" and
diagnostic events are enabled on the server.
diagnosticEventsXdr?: string[];Source: src/rpc/api.ts:367
rawSendTransactionResponse.errorResultXdr
This is a base64-encoded instance of xdr.TransactionResult, set
only when status is "ERROR".
It contains details on why the network rejected the transaction.
errorResultXdr?: string;Source: src/rpc/api.ts:361
rawSendTransactionResponse.hash
hash: string;Source: src/rpc/api.ts:372
rawSendTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:373
rawSendTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:374
rawSendTransactionResponse.status
status: SendTransactionStatus;Source: src/rpc/api.ts:371
rpc.Api.RawSimulateTransactionResponse
interface RawSimulateTransactionResponse { error?: string; events?: string[]; id: string; latestLedger: number; minResourceFee?: string; restorePreamble?: { minResourceFee: string; transactionData: string }; results?: RawSimulateHostFunctionResult[]; stateChanges?: RawLedgerEntryChange[]; transactionData?: string;}Source: src/rpc/api.ts:511
rawSimulateTransactionResponse.error
error?: string;Source: src/rpc/api.ts:514
rawSimulateTransactionResponse.events
These are xdr.DiagnosticEvents in base64
events?: string[];Source: src/rpc/api.ts:518
rawSimulateTransactionResponse.id
id: string;Source: src/rpc/api.ts:512
rawSimulateTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:513
rawSimulateTransactionResponse.minResourceFee
minResourceFee?: string;Source: src/rpc/api.ts:519
rawSimulateTransactionResponse.restorePreamble
Present if succeeded but has expired ledger entries
restorePreamble?: { minResourceFee: string; transactionData: string };Source: src/rpc/api.ts:526
rawSimulateTransactionResponse.results
This will only contain a single element if present, because only a single invokeHostFunctionOperation is supported per transaction.
results?: RawSimulateHostFunctionResult[];Source: src/rpc/api.ts:524
rawSimulateTransactionResponse.stateChanges
State difference information
stateChanges?: RawLedgerEntryChange[];Source: src/rpc/api.ts:532
rawSimulateTransactionResponse.transactionData
This is an xdr.DwsaTransactionData in base64
transactionData?: string;Source: src/rpc/api.ts:516
rpc.Api.RawTransactionEvents
interface RawTransactionEvents { contractEventsXdr?: string[][]; transactionEventsXdr?: string[];}Source: src/rpc/api.ts:160
rawTransactionEvents.contractEventsXdr
contractEventsXdr?: string[][];Source: src/rpc/api.ts:162
rawTransactionEvents.transactionEventsXdr
transactionEventsXdr?: string[];Source: src/rpc/api.ts:161
rpc.Api.RawTransactionInfo
interface RawTransactionInfo { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: string[]; envelopeXdr?: string; events?: RawTransactionEvents; feeBump: boolean; ledger: number; resultMetaXdr?: string; resultXdr?: string; status: GetTransactionStatus; txHash: string;}Source: src/rpc/api.ts:165
rawTransactionInfo.applicationOrder
applicationOrder: number;Source: src/rpc/api.ts:169
rawTransactionInfo.createdAt
createdAt: number;Source: src/rpc/api.ts:168
rawTransactionInfo.diagnosticEventsXdr
diagnosticEventsXdr?: string[];Source: src/rpc/api.ts:176
rawTransactionInfo.envelopeXdr
envelopeXdr?: string;Source: src/rpc/api.ts:173
rawTransactionInfo.events
events?: RawTransactionEvents;Source: src/rpc/api.ts:178
rawTransactionInfo.feeBump
feeBump: boolean;Source: src/rpc/api.ts:170
rawTransactionInfo.ledger
ledger: number;Source: src/rpc/api.ts:167
rawTransactionInfo.resultMetaXdr
resultMetaXdr?: string;Source: src/rpc/api.ts:175
rawTransactionInfo.resultXdr
resultXdr?: string;Source: src/rpc/api.ts:174
rawTransactionInfo.status
status: GetTransactionStatus;Source: src/rpc/api.ts:166
rawTransactionInfo.txHash
txHash: string;Source: src/rpc/api.ts:171
rpc.Api.SendTransactionResponse
interface SendTransactionResponse extends BaseSendTransactionResponse { diagnosticEvents?: DiagnosticEvent[]; errorResult?: TransactionResult; hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus;}Source: src/rpc/api.ts:349
sendTransactionResponse.diagnosticEvents
diagnosticEvents?: DiagnosticEvent[];Source: src/rpc/api.ts:351
sendTransactionResponse.errorResult
errorResult?: TransactionResult;Source: src/rpc/api.ts:350
sendTransactionResponse.hash
hash: string;Source: src/rpc/api.ts:372
sendTransactionResponse.latestLedger
latestLedger: number;Source: src/rpc/api.ts:373
sendTransactionResponse.latestLedgerCloseTime
latestLedgerCloseTime: number;Source: src/rpc/api.ts:374
sendTransactionResponse.status
status: SendTransactionStatus;Source: src/rpc/api.ts:371
rpc.Api.SendTransactionStatus
type SendTransactionStatus = "PENDING" | "DUPLICATE" | "TRY_AGAIN_LATER" | "ERROR"Source: src/rpc/api.ts:343
rpc.Api.SimulateHostFunctionResult
interface SimulateHostFunctionResult { auth: DwsaAuthorizationEntry[]; retval: ScVal;}Source: src/rpc/api.ts:377
simulateHostFunctionResult.auth
auth: DwsaAuthorizationEntry[];Source: src/rpc/api.ts:378
simulateHostFunctionResult.retval
retval: ScVal;Source: src/rpc/api.ts:379
rpc.Api.SimulateTransactionErrorResponse
Includes details about why the simulation failed
interface SimulateTransactionErrorResponse extends BaseSimulateTransactionResponse { _parsed: boolean; error: string; events: DiagnosticEvent[]; id: string; latestLedger: number;}Source: src/rpc/api.ts:434
simulateTransactionErrorResponse._parsed
a private field to mark the schema as parsed
_parsed: boolean;Source: src/rpc/api.ts:418
simulateTransactionErrorResponse.error
error: string;Source: src/rpc/api.ts:435
simulateTransactionErrorResponse.events
The field is always present, but may be empty in cases where:
- you didn’t simulate an invocation or
- there were no events
events: DiagnosticEvent[];Source: src/rpc/api.ts:436
simulateTransactionErrorResponse.id
always present: the JSON-RPC request ID
id: string;Source: src/rpc/api.ts:405
simulateTransactionErrorResponse.latestLedger
always present: the LCL known to the server when responding
latestLedger: number;Source: src/rpc/api.ts:408
rpc.Api.SimulateTransactionResponse
Simplifies RawSimulateTransactionResponse into separate interfaces
based on status:
- on success, this includes all fields, though
resultis only present if an invocation was simulated (since otherwise there’s nothing to “resultify”) - if there was an expiration error, this includes error and restoration fields
- for all other errors, this only includes error fields
type SimulateTransactionResponse = SimulateTransactionSuccessResponse | SimulateTransactionRestoreResponse | SimulateTransactionErrorResponseSource: src/rpc/api.ts:398
rpc.Api.SimulateTransactionRestoreResponse
Includes simplified fields only present on success.
interface SimulateTransactionRestoreResponse extends SimulateTransactionSuccessResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number; minResourceFee: string; restorePreamble: { minResourceFee: string; transactionData: DwsaDataBuilder }; result: SimulateHostFunctionResult; stateChanges?: LedgerEntryChange[]; transactionData: DwsaDataBuilder;}Source: src/rpc/api.ts:439
simulateTransactionRestoreResponse._parsed
a private field to mark the schema as parsed
_parsed: boolean;Source: src/rpc/api.ts:418
simulateTransactionRestoreResponse.events
The field is always present, but may be empty in cases where:
- you didn’t simulate an invocation or
- there were no events
events: DiagnosticEvent[];Source: src/rpc/api.ts:415
simulateTransactionRestoreResponse.id
always present: the JSON-RPC request ID
id: string;Source: src/rpc/api.ts:405
simulateTransactionRestoreResponse.latestLedger
always present: the LCL known to the server when responding
latestLedger: number;Source: src/rpc/api.ts:408
simulateTransactionRestoreResponse.minResourceFee
minResourceFee: string;Source: src/rpc/api.ts:424
simulateTransactionRestoreResponse.restorePreamble
Indicates that a restoration is necessary prior to submission.
In other words, seeing a restoration preamble means that your invocation was executed AS IF the required ledger entries were present, and this field includes information about what you need to restore for the simulation to succeed.
restorePreamble: { minResourceFee: string; transactionData: DwsaDataBuilder };Source: src/rpc/api.ts:450
simulateTransactionRestoreResponse.result
present only for invocation simulation
result: SimulateHostFunctionResult;Source: src/rpc/api.ts:440
simulateTransactionRestoreResponse.stateChanges
State Difference information
stateChanges?: LedgerEntryChange[];Source: src/rpc/api.ts:430
simulateTransactionRestoreResponse.transactionData
transactionData: DwsaDataBuilder;Source: src/rpc/api.ts:423
rpc.Api.SimulateTransactionSuccessResponse
Includes simplified fields only present on success.
interface SimulateTransactionSuccessResponse extends BaseSimulateTransactionResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number; minResourceFee: string; result?: SimulateHostFunctionResult; stateChanges?: LedgerEntryChange[]; transactionData: DwsaDataBuilder;}Source: src/rpc/api.ts:422
simulateTransactionSuccessResponse._parsed
a private field to mark the schema as parsed
_parsed: boolean;Source: src/rpc/api.ts:418
simulateTransactionSuccessResponse.events
The field is always present, but may be empty in cases where:
- you didn’t simulate an invocation or
- there were no events
events: DiagnosticEvent[];Source: src/rpc/api.ts:415
simulateTransactionSuccessResponse.id
always present: the JSON-RPC request ID
id: string;Source: src/rpc/api.ts:405
simulateTransactionSuccessResponse.latestLedger
always present: the LCL known to the server when responding
latestLedger: number;Source: src/rpc/api.ts:408
simulateTransactionSuccessResponse.minResourceFee
minResourceFee: string;Source: src/rpc/api.ts:424
simulateTransactionSuccessResponse.result
present only for invocation simulation
result?: SimulateHostFunctionResult;Source: src/rpc/api.ts:427
simulateTransactionSuccessResponse.stateChanges
State Difference information
stateChanges?: LedgerEntryChange[];Source: src/rpc/api.ts:430
simulateTransactionSuccessResponse.transactionData
transactionData: DwsaDataBuilder;Source: src/rpc/api.ts:423
rpc.Api.SimulationAuthMode
type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot"Source: src/rpc/api.ts:382
rpc.Api.TransactionEvents
interface TransactionEvents { contractEventsXdr: ContractEvent[][]; transactionEventsXdr: TransactionEvent[];}Source: src/rpc/api.ts:181
transactionEvents.contractEventsXdr
contractEventsXdr: ContractEvent[][];Source: src/rpc/api.ts:183
transactionEvents.transactionEventsXdr
transactionEventsXdr: TransactionEvent[];Source: src/rpc/api.ts:182
rpc.Api.TransactionInfo
interface TransactionInfo { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; ledger: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; returnValue?: ScVal; status: GetTransactionStatus; txHash: string;}Source: src/rpc/api.ts:186
transactionInfo.applicationOrder
applicationOrder: number;Source: src/rpc/api.ts:190
transactionInfo.createdAt
createdAt: number;Source: src/rpc/api.ts:189
transactionInfo.diagnosticEventsXdr
diagnosticEventsXdr?: DiagnosticEvent[];Source: src/rpc/api.ts:198
transactionInfo.envelopeXdr
envelopeXdr: TransactionEnvelope;Source: src/rpc/api.ts:194
transactionInfo.events
events: TransactionEvents;Source: src/rpc/api.ts:200
transactionInfo.feeBump
feeBump: boolean;Source: src/rpc/api.ts:191
transactionInfo.ledger
ledger: number;Source: src/rpc/api.ts:188
transactionInfo.resultMetaXdr
resultMetaXdr: TransactionMeta;Source: src/rpc/api.ts:196
transactionInfo.resultXdr
resultXdr: TransactionResult;Source: src/rpc/api.ts:195
transactionInfo.returnValue
returnValue?: ScVal;Source: src/rpc/api.ts:197
transactionInfo.status
status: GetTransactionStatus;Source: src/rpc/api.ts:187
transactionInfo.txHash
txHash: string;Source: src/rpc/api.ts:192
rpc.Durability
Specifies the durability namespace of contract-related ledger entries.
enum DurabilitySource: src/rpc/server.ts:46
rpc.Server.GetEventsRequest
Deprecated. Use Api.GetEventsRequest instead.
type GetEventsRequest = Api.GetEventsRequestSee also
Api.GetEventsRequest
Source: src/rpc/server.ts:56
rpc.Server.Options
Options for configuring connections to RPC servers.
interface Options { allowHttp?: boolean; headers?: Record<string, string>; timeout?: number;}Source: src/rpc/server.ts:74
options.allowHttp
Allow connecting to http servers, default: false. This must be set to false in production deployments!
allowHttp?: boolean;Source: src/rpc/server.ts:76
options.headers
Additional headers that should be added to any requests to the RPC server.
headers?: Record<string, string>;Source: src/rpc/server.ts:80
options.timeout
Allow a timeout, default: 0. Allows user to avoid nasty lag.
timeout?: number;Source: src/rpc/server.ts:78
rpc.Server.PollingOptions
interface PollingOptions { attempts?: number; sleepStrategy?: SleepStrategy;}Source: src/rpc/server.ts:58
pollingOptions.attempts
attempts?: number;Source: src/rpc/server.ts:59
pollingOptions.sleepStrategy
sleepStrategy?: SleepStrategy;Source: src/rpc/server.ts:60
rpc.Server.ResourceLeeway
Describes additional resource leeways for transaction simulation.
interface ResourceLeeway { cpuInstructions: number;}Source: src/rpc/server.ts:66
resourceLeeway.cpuInstructions
Simulate the transaction with more CPU instructions available.
cpuInstructions: number;Source: src/rpc/server.ts:68