Skip to content

Network / RPC

rpc.Api.isSimulationError

Checks if a simulation response indicates an error.

isSimulationError(sim: SimulateTransactionResponse): sim is SimulateTransactionErrorResponse

Parameters

  • simSimulateTransactionResponse (required) — The simulation response to check.

Returns

True if the response indicates an error, false otherwise.

Source: src/rpc/api.ts:468

rpc.Api.isSimulationRaw

Checks if a simulation response is in raw (unparsed) form.

isSimulationRaw(sim: SimulateTransactionResponse | RawSimulateTransactionResponse): sim is RawSimulateTransactionResponse

Parameters

  • simSimulateTransactionResponse | RawSimulateTransactionResponse (required) — The simulation response to check.

Returns

True if the response is raw, false otherwise.

Source: src/rpc/api.ts:505

rpc.Api.isSimulationRestore

Checks if a simulation response indicates that a restoration is needed.

isSimulationRestore(sim: SimulateTransactionResponse): sim is SimulateTransactionRestoreResponse

Parameters

  • simSimulateTransactionResponse (required) — The simulation response to check.

Returns

True if the response indicates a restoration is needed, false otherwise.

Source: src/rpc/api.ts:490

rpc.Api.isSimulationSuccess

Checks if a simulation response indicates success.

isSimulationSuccess(sim: SimulateTransactionResponse): sim is SimulateTransactionSuccessResponse

Parameters

  • simSimulateTransactionResponse (required) — The simulation response to check.

Returns

True if the response indicates success, false otherwise.

Source: src/rpc/api.ts:479

rpc.BasicSleepStrategy

const BasicSleepStrategy: SleepStrategy

Source: src/rpc/server.ts:90

rpc.LinearSleepStrategy

const LinearSleepStrategy: SleepStrategy

Source: src/rpc/server.ts:93

rpc.Server

Handles the network connection to a Soroban 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, friendbotUrl?: 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">, friendbotUrl?: string): Promise<Account>;
sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<SendTransactionResponse>;
simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<SimulateTransactionResponse>;
}

See also

  • API reference docs

Source: src/rpc/server.ts:53

new Server(serverURL, opts)

constructor(serverURL: string, opts: Options = {});

Parameters

  • serverURLstring (required)
  • optsOptions (optional) (default: {})

Source: src/rpc/server.ts:170

server.httpClient

HTTP client instance for making requests to Horizon. Exposes interceptors, defaults, and other configuration options.

readonly httpClient: HttpClient;

Example

// Add authentication header
server.httpClient.defaults.headers['Authorization'] = 'Bearer token';
// Add request interceptor
server.httpClient.interceptors.request.use((config) => {
console.log('Request:', config.url);
return config;
});

Source: src/rpc/server.ts:169

server.serverURL

readonly serverURL: URL;

Source: src/rpc/server.ts:152

server._getEvents(request)

_getEvents(request: GetEventsRequest): Promise<RawGetEventsResponse>;

Parameters

  • requestGetEventsRequest (required)

Source: src/rpc/server.ts:896

server._getLatestLedger()

_getLatestLedger(): Promise<RawGetLatestLedgerResponse>;

Source: src/rpc/server.ts:967

server._getLedgerEntries(keys)

_getLedgerEntries(...keys: LedgerKey[]): Promise<RawGetLedgerEntriesResponse>;

Parameters

  • ...keysLedgerKey[] (required)

Source: src/rpc/server.ts:661

server._getLedgers(request)

_getLedgers(request: GetLedgersRequest): Promise<RawGetLedgersResponse>;

Parameters

  • requestGetLedgersRequest (required)

Source: src/rpc/server.ts:1558

server._getTransaction(hash)

_getTransaction(hash: string): Promise<RawGetTransactionResponse>;

Parameters

  • hashstring (required)

Source: src/rpc/server.ts:784

server._getTransactions(request)

_getTransactions(request: GetTransactionsRequest): Promise<RawGetTransactionsResponse>;

Parameters

  • requestGetTransactionsRequest (required)

Source: src/rpc/server.ts:835

server._sendTransaction(transaction)

_sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<RawSendTransactionResponse>;

Parameters

  • transactionTransaction | FeeBumpTransaction (required)

Source: src/rpc/server.ts:1194

server._simulateTransaction(transaction, addlResources, authMode)

_simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise<RawSimulateTransactionResponse>;

Parameters

  • transactionTransaction | FeeBumpTransaction (required)
  • addlResourcesResourceLeeway (optional)
  • authModeSimulationAuthMode (optional)

Source: src/rpc/server.ts:1041

server.fundAddress(address, friendbotUrl)

Fund an address using the network’s Friendbot faucet, if any.

This method supports both account (G…) and contract (C…) addresses.

fundAddress(address: string, friendbotUrl?: string): Promise<GetSuccessfulTransactionResponse>;

Parameters

  • addressstring (required) — The address to fund. Can be either a Stellar account (G…) or contract (C…) address.
  • friendbotUrlstring (optional) — (optional) Optionally, an explicit Friendbot URL (by default: this calls the Stellar RPC getNetwork method to try to discover this network’s Friendbot url).

Returns

The transaction response from the Friendbot funding transaction.

Throws

  • If Friendbot 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);

See also

  • Friendbot docs

Source: src/rpc/server.ts:1317

server.getAccount(address)

Fetch a minimal set of current info about a Stellar 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

  • addressstring (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);
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:203

server.getAccountEntry(address)

Fetch the full account entry for a Stellar account.

getAccountEntry(address: string): Promise<AccountEntry>;

Parameters

  • addressstring (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());
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:226

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

  • addressstring | Address | Contract (required) — The account or contract whose balance should be fetched.
  • assetAsset (required) — The asset whose balance you want to inspect.
  • networkPassphrasestring (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 (see getNetwork), since contract IDs for assets are specific to a network. You can refer to Networks for a list of built-in passphrases, e.g., Networks.TESTNET.

Returns

Resolves with balance entry details when available.

Throws

  • If the supplied address is 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:376

server.getClaimableBalance(id)

Fetch the full claimable balance entry for a Stellar account.

getClaimableBalance(id: string): Promise<ClaimableBalanceEntry>;

Parameters

  • idstring (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()}`;
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:308

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

  • contractstring | Address | Contract (required) — The contract ID containing the data to load as a strkey (C... form), a Contract, or an Address instance
  • keyScVal (required) — The key of the contract data to load
  • durabilityDurability (optional) (default: Durability.Persistent) — (optional) The “durability keyspace” that this ledger key belongs to, which is either ‘temporary’ or ‘persistent’ (the default), see rpc.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);
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:477

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 Soroban network. The WASM bytecode represents the executable code of the contract.

getContractWasmByContractId(contractId: string): Promise<Buffer<ArrayBufferLike>>;

Parameters

  • contractIdstring (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:551

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

  • wasmHashstring | Buffer<ArrayBufferLike> (required) — The WASM hash of the contract
  • format"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:596

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

  • requestGetEventsRequest (required) — Event filters Api.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,
});

See also

  • getEvents docs

Source: src/rpc/server.ts:890

server.getFeeStats()

Provides an analysis of the recent fee stats for regular and smart contract operations.

getFeeStats(): Promise<GetFeeStatsResponse>;

Returns

the fee stats

See also

Source: src/rpc/server.ts:1363

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);
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:435

server.getLatestLedger()

Fetch the latest ledger meta info from network which this Soroban 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);
});

See also

  • getLatestLedger docs

Source: src/rpc/server.ts:963

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

  • ...keysLedgerKey[] (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

    • getLedgerEntries docs
  • RpcServer._getLedgerEntries

Source: src/rpc/server.ts:657

server.getLedgerEntry(key)

getLedgerEntry(key: LedgerKey): Promise<LedgerEntryResult>;

Parameters

  • keyLedgerKey (required)

Source: src/rpc/server.ts:672

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

  • requestGetLedgersRequest (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 number
server.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 cursor
const firstPage = await server.getLedgers({
startLedger: 36233,
pagination: {
limit: 5
}
});
const nextPage = await server.getLedgers({
pagination: {
cursor: firstPage.cursor,
limit: 5
}
});

See also

  • getLedgers docs

Source: src/rpc/server.ts:1542

server.getNetwork()

Fetch metadata about the network this Soroban 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("friendbotUrl:", network.friendbotUrl);
console.log("passphrase:", network.passphrase);
console.log("protocolVersion:", network.protocolVersion);
});

See also

  • getNetwork docs

Source: src/rpc/server.ts:937

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

  • addressstring | Address (required) — the contract (string C...) whose balance of sac you want to know
  • sacAsset (required) — the built-in SAC token (e.g. USDC:GABC...) that you are querying from the given contract.
  • networkPassphrasestring (optional) — (optional) optionally, the network passphrase to which this token applies. If omitted, a request about network information will be made (see getNetwork), since contract IDs for assets are specific to a network. You can refer to Networks for 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 address is not a valid contract ID (C…).

Example

// assume `address` is some contract or account with an XLM 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 XLM");

See also

Source: src/rpc/server.ts:1427

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

  • hashstring (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);
});

See also

  • getTransaction docs

Source: src/rpc/server.ts:757

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

  • requestGetTransactionsRequest (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);
});

See also

Source: src/rpc/server.ts:817

server.getTrustline(account, asset)

Deprecated. Use getAssetBalance, instead

Fetch the full trustline entry for a Stellar account.

getTrustline(account: string, asset: Asset): Promise<TrustLineEntry>;

Parameters

  • accountstring (required) — The public address of the account whose trustline it is
  • assetAsset (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());
});

See also

  • getLedgerEntries docs

Source: src/rpc/server.ts:265

server.getVersionInfo()

Provides information about the current version details of the Soroban RPC and captive-core

getVersionInfo(): Promise<GetVersionInfoResponse>;

Returns

the version info

See also

Source: src/rpc/server.ts:1377

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

  • hashstring (required) — the transaction you’re polling for
  • optsPollingOptions (optional) — (optional) polling options
    • attempts (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 complete

Source: src/rpc/server.ts:710

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

  • txTransaction | FeeBumpTransaction (required) — the transaction to prepare. It should include exactly one operation, which must be one of xdr.InvokeHostFunctionOp, xdr.ExtendFootprintTtlOp, or xdr.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 StellarSdk.Contract(contractId);
// Right now, this is just the default fee for this example.
const fee = StellarSdk.BASE_FEE;
const transaction = new StellarSdk.TransactionBuilder(account, { fee })
// Uncomment the following line to build transactions for the live network. Be
// sure to also change the horizon hostname.
//.setNetworkPassphrase(StellarSdk.Networks.PUBLIC)
.setNetworkPassphrase(StellarSdk.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 StellarSdk.Network).
const sourceKeypair = StellarSdk.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
  • simulateTransaction docs

Source: src/rpc/server.ts:1133

server.requestAirdrop(address, friendbotUrl)

Deprecated. Use Server.fundAddress instead, which supports both account (G…) and contract (C…) addresses.

Fund a new account using the network’s Friendbot faucet, if any.

requestAirdrop(address: string | Pick<Account, "accountId">, friendbotUrl?: string): Promise<Account>;

Parameters

  • addressstring | Pick<Account, "accountId"> (required) — The address or account instance that we want to create and fund with Friendbot
  • friendbotUrlstring (optional) — (optional) Optionally, an explicit address for friendbot (by default: this calls the Soroban RPC getNetwork method to try to discover this network’s Friendbot 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 Friendbot 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

    • Friendbot docs
  • Friendbot.Api.Response

Source: src/rpc/server.ts:1239

server.sendTransaction(transaction)

Submit a real transaction to the Stellar network.

Unlike Horizon, 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

  • transactionTransaction | FeeBumpTransaction (required) — to submit

Returns

the transaction id, status, and any error if available

Example

const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
const contract = new StellarSdk.Contract(contractId);
// Right now, this is just the default fee for this example.
const fee = StellarSdk.BASE_FEE;
const transaction = new StellarSdk.TransactionBuilder(account, { fee })
// Uncomment the following line to build transactions for the live network. Be
// sure to also change the horizon hostname.
//.setNetworkPassphrase(StellarSdk.Networks.PUBLIC)
.setNetworkPassphrase(StellarSdk.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 StellarSdk.Network).
const sourceKeypair = StellarSdk.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);
});

See also

    • transaction docs
  • sendTransaction docs

Source: src/rpc/server.ts:1188

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

  • txTransaction | FeeBumpTransaction (required) — the transaction to simulate, which should include exactly one operation (one of xdr.InvokeHostFunctionOp, xdr.ExtendFootprintTtlOp, or xdr.RestoreFootprintOp). Any provided footprint or auth information will be ignored.
  • addlResourcesResourceLeeway (optional) — (optional) any additional resources to add to the simulation-provided ones, for example if you know you will need extra CPU instructions
  • authModeSimulationAuthMode (optional) — (optional) optionally, specify the type of auth mode to use for simulation: enforce for enforcement mode, record for recording mode, or record_allow_nonroot for 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 StellarSdk.Contract(contractId);
// Right now, this is just the default fee for this example.
const fee = StellarSdk.BASE_FEE;
const transaction = new StellarSdk.TransactionBuilder(account, { fee })
// Uncomment the following line to build transactions for the live network. Be
// sure to also change the horizon hostname.
//.setNetworkPassphrase(StellarSdk.Networks.PUBLIC)
.setNetworkPassphrase(StellarSdk.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

    • transaction docs
  • simulateTransaction docs
  • authorization modes
  • module:rpc.Server#prepareTransaction
  • module:rpc.assembleTransaction

Source: src/rpc/server.ts:1031

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

Parameters

  • rawTransaction | FeeBumpTransaction (required) — the initial transaction, w/o simulation applied
  • simulationSimulateTransactionResponse | RawSimulateTransactionResponse (required) — the Soroban RPC simulation result (see rpc.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): GetEventsResponse

Parameters

  • rawRawGetEventsResponse (required) — the raw getEvents response 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): SimulateTransactionResponse

Parameters

  • simSimulateTransactionResponse | 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:586

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

balanceResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:587

rpc.Api.BaseSendTransactionResponse

interface BaseSendTransactionResponse {
hash: string;
latestLedger: number;
latestLedgerCloseTime: number;
status: SendTransactionStatus;
}

Source: src/rpc/api.ts:376

baseSendTransactionResponse.hash

hash: string;

Source: src/rpc/api.ts:378

baseSendTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:379

baseSendTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:380

baseSendTransactionResponse.status

status: SendTransactionStatus;

Source: src/rpc/api.ts:377

rpc.Api.BaseSimulateTransactionResponse

interface BaseSimulateTransactionResponse {
_parsed: boolean;
events: DiagnosticEvent[];
id: string;
latestLedger: number;
}

Source: src/rpc/api.ts:410

baseSimulateTransactionResponse._parsed

a private field to mark the schema as parsed

_parsed: boolean;

Source: src/rpc/api.ts:425

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

baseSimulateTransactionResponse.id

always present: the JSON-RPC request ID

id: string;

Source: src/rpc/api.ts:412

baseSimulateTransactionResponse.latestLedger

always present: the LCL known to the server when responding

latestLedger: number;

Source: src/rpc/api.ts:415

rpc.Api.EventFilter

interface EventFilter {
contractIds?: string[];
topics?: string[][];
type?: EventType;
}

Source: src/rpc/api.ts:228

eventFilter.contractIds

contractIds?: string[];

Source: src/rpc/api.ts:230

eventFilter.topics

topics?: string[][];

Source: src/rpc/api.ts:231

eventFilter.type

type?: EventType;

Source: src/rpc/api.ts:229

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

eventResponse.contractId

contractId?: Contract;

Source: src/rpc/api.ts:305

eventResponse.id

id: string;

Source: src/rpc/api.ts:316

eventResponse.inSuccessfulContractCall

inSuccessfulContractCall: boolean;

Source: src/rpc/api.ts:322

eventResponse.ledger

ledger: number;

Source: src/rpc/api.ts:318

eventResponse.ledgerClosedAt

ledgerClosedAt: string;

Source: src/rpc/api.ts:319

eventResponse.operationIndex

operationIndex: number;

Source: src/rpc/api.ts:321

eventResponse.topic

topic: ScVal[];

Source: src/rpc/api.ts:306

eventResponse.transactionIndex

transactionIndex: number;

Source: src/rpc/api.ts:320

eventResponse.txHash

txHash: string;

Source: src/rpc/api.ts:323

eventResponse.type

type: EventType;

Source: src/rpc/api.ts:317

eventResponse.value

value: ScVal;

Source: src/rpc/api.ts:307

rpc.Api.EventType

type EventType = "contract" | "system"

Source: src/rpc/api.ts:226

rpc.Api.GetEventsRequest

Request parameters for fetching events from the Stellar network.

Important: This type enforces mutually exclusive pagination modes:

  • Ledger range mode: Use startLedger and endLedger (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 mode
const rangeRequest: GetEventsRequest = {
filters: [],
startLedger: 1000,
endLedger: 2000,
limit: 100
};

Example

// ✅ Correct: Cursor pagination mode
const cursorRequest: GetEventsRequest = {
filters: [],
cursor: "some-cursor-value",
limit: 100
};

Example

// ❌ Invalid: Cannot mix cursor with ledger range
const invalidRequest = {
filters: [],
startLedger: 1000, // ❌ Cannot use with cursor
endLedger: 2000, // ❌ Cannot use with cursor
cursor: "cursor", // ❌ Cannot use with ledger range
limit: 100
};

See also

  • getEvents API reference

Source: src/rpc/api.ts:283

rpc.Api.GetEventsResponse

interface GetEventsResponse extends RetentionState {
cursor: string;
events: EventResponse[];
latestLedger: number;
latestLedgerCloseTime: string;
oldestLedger: number;
oldestLedgerCloseTime: string;
}

Source: src/rpc/api.ts:299

getEventsResponse.cursor

cursor: string;

Source: src/rpc/api.ts:301

getEventsResponse.events

events: EventResponse[];

Source: src/rpc/api.ts:300

getEventsResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:235

getEventsResponse.latestLedgerCloseTime

latestLedgerCloseTime: string;

Source: src/rpc/api.ts:237

getEventsResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:236

getEventsResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: string;

Source: src/rpc/api.ts:238

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

getFailedTransactionResponse.applicationOrder

applicationOrder: number;

Source: src/rpc/api.ts:102

getFailedTransactionResponse.createdAt

createdAt: number;

Source: src/rpc/api.ts:101

getFailedTransactionResponse.diagnosticEventsXdr

diagnosticEventsXdr?: DiagnosticEvent[];

Source: src/rpc/api.ts:107

getFailedTransactionResponse.envelopeXdr

envelopeXdr: TransactionEnvelope;

Source: src/rpc/api.ts:104

getFailedTransactionResponse.events

events: TransactionEvents;

Source: src/rpc/api.ts:108

getFailedTransactionResponse.feeBump

feeBump: boolean;

Source: src/rpc/api.ts:103

getFailedTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:87

getFailedTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:88

getFailedTransactionResponse.ledger

ledger: number;

Source: src/rpc/api.ts:100

getFailedTransactionResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:89

getFailedTransactionResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:90

getFailedTransactionResponse.resultMetaXdr

resultMetaXdr: TransactionMeta;

Source: src/rpc/api.ts:106

getFailedTransactionResponse.resultXdr

resultXdr: TransactionResult;

Source: src/rpc/api.ts:105

getFailedTransactionResponse.status

status: FAILED;

Source: src/rpc/api.ts:98

getFailedTransactionResponse.txHash

txHash: string;

Source: src/rpc/api.ts:86

rpc.Api.GetFeeStatsResponse

interface GetFeeStatsResponse {
inclusionFee: FeeDistribution;
latestLedger: number;
sorobanInclusionFee: FeeDistribution;
}

Source: src/rpc/api.ts:560

getFeeStatsResponse.inclusionFee

inclusionFee: FeeDistribution;

Source: src/rpc/api.ts:562

getFeeStatsResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:563

getFeeStatsResponse.sorobanInclusionFee

sorobanInclusionFee: FeeDistribution;

Source: src/rpc/api.ts:561

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;
}

See also

Source: src/rpc/api.ts:52

getLatestLedgerResponse.closeTime

closeTime: string;

Source: src/rpc/api.ts:56

getLatestLedgerResponse.headerXdr

headerXdr: LedgerHeader;

Source: src/rpc/api.ts:57

getLatestLedgerResponse.id

id: string;

Source: src/rpc/api.ts:53

getLatestLedgerResponse.metadataXdr

metadataXdr: LedgerCloseMeta;

Source: src/rpc/api.ts:58

getLatestLedgerResponse.protocolVersion

protocolVersion: string;

Source: src/rpc/api.ts:55

getLatestLedgerResponse.sequence

sequence: number;

Source: src/rpc/api.ts:54

rpc.Api.GetLedgerEntriesResponse

An XDR-parsed version of RawLedgerEntryResult

interface GetLedgerEntriesResponse {
entries: LedgerEntryResult[];
latestLedger: number;
}

Source: src/rpc/api.ts:33

getLedgerEntriesResponse.entries

entries: LedgerEntryResult[];

Source: src/rpc/api.ts:34

getLedgerEntriesResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:35

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 startLedger to begin fetching from a specific ledger sequence
  • Cursor-based pagination: Use cursor to 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 ledger
const ledgerRequest: GetLedgersRequest = {
startLedger: 36233,
pagination: {
limit: 10
}
};

Example

// Cursor-based pagination - continue from previous response
const cursorRequest: GetLedgersRequest = {
pagination: {
cursor: "36234",
limit: 5
}
};

See also

  • getLedgers API reference

Source: src/rpc/api.ts:633

rpc.Api.GetLedgersResponse

interface GetLedgersResponse {
cursor: string;
latestLedger: number;
latestLedgerCloseTime: number;
ledgers: LedgerResponse[];
oldestLedger: number;
oldestLedgerCloseTime: number;
}

See also

Source: src/rpc/api.ts:669

getLedgersResponse.cursor

cursor: string;

Source: src/rpc/api.ts:675

getLedgersResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:671

getLedgersResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:672

getLedgersResponse.ledgers

ledgers: LedgerResponse[];

Source: src/rpc/api.ts:670

getLedgersResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:673

getLedgersResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:674

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

getMissingTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:87

getMissingTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:88

getMissingTransactionResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:89

getMissingTransactionResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:90

getMissingTransactionResponse.status

status: NOT_FOUND;

Source: src/rpc/api.ts:94

getMissingTransactionResponse.txHash

txHash: string;

Source: src/rpc/api.ts:86

rpc.Api.GetNetworkResponse

interface GetNetworkResponse {
friendbotUrl?: string;
passphrase: string;
protocolVersion: string;
}

See also

Source: src/rpc/api.ts:45

getNetworkResponse.friendbotUrl

friendbotUrl?: string;

Source: src/rpc/api.ts:46

getNetworkResponse.passphrase

passphrase: string;

Source: src/rpc/api.ts:47

getNetworkResponse.protocolVersion

protocolVersion: string;

Source: src/rpc/api.ts:48

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

getSuccessfulTransactionResponse.applicationOrder

applicationOrder: number;

Source: src/rpc/api.ts:116

getSuccessfulTransactionResponse.createdAt

createdAt: number;

Source: src/rpc/api.ts:115

getSuccessfulTransactionResponse.diagnosticEventsXdr

diagnosticEventsXdr?: DiagnosticEvent[];

Source: src/rpc/api.ts:121

getSuccessfulTransactionResponse.envelopeXdr

envelopeXdr: TransactionEnvelope;

Source: src/rpc/api.ts:118

getSuccessfulTransactionResponse.events

events: TransactionEvents;

Source: src/rpc/api.ts:124

getSuccessfulTransactionResponse.feeBump

feeBump: boolean;

Source: src/rpc/api.ts:117

getSuccessfulTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:87

getSuccessfulTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:88

getSuccessfulTransactionResponse.ledger

ledger: number;

Source: src/rpc/api.ts:114

getSuccessfulTransactionResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:89

getSuccessfulTransactionResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:90

getSuccessfulTransactionResponse.resultMetaXdr

resultMetaXdr: TransactionMeta;

Source: src/rpc/api.ts:120

getSuccessfulTransactionResponse.resultXdr

resultXdr: TransactionResult;

Source: src/rpc/api.ts:119

getSuccessfulTransactionResponse.returnValue

returnValue?: ScVal;

Source: src/rpc/api.ts:123

getSuccessfulTransactionResponse.status

status: SUCCESS;

Source: src/rpc/api.ts:112

getSuccessfulTransactionResponse.txHash

txHash: string;

Source: src/rpc/api.ts:86

rpc.Api.GetTransactionResponse

type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse

See also

Source: src/rpc/api.ts:79

rpc.Api.GetTransactionStatus

enum GetTransactionStatus

Source: src/rpc/api.ts:72

rpc.Api.GetTransactionsRequest

type GetTransactionsRequest = { pagination?: { cursor?: never; limit?: number }; startLedger: number } | { pagination: { cursor: string; limit?: number }; startLedger?: never }

Source: src/rpc/api.ts:149

rpc.Api.GetTransactionsResponse

interface GetTransactionsResponse {
cursor: string;
latestLedger: number;
latestLedgerCloseTimestamp: number;
oldestLedger: number;
oldestLedgerCloseTimestamp: number;
transactions: TransactionInfo[];
}

Source: src/rpc/api.ts:208

getTransactionsResponse.cursor

cursor: string;

Source: src/rpc/api.ts:214

getTransactionsResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:210

getTransactionsResponse.latestLedgerCloseTimestamp

latestLedgerCloseTimestamp: number;

Source: src/rpc/api.ts:211

getTransactionsResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:212

getTransactionsResponse.oldestLedgerCloseTimestamp

oldestLedgerCloseTimestamp: number;

Source: src/rpc/api.ts:213

getTransactionsResponse.transactions

transactions: TransactionInfo[];

Source: src/rpc/api.ts:209

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

getVersionInfoResponse.build_timestamp

build_timestamp: string;

Source: src/rpc/api.ts:553

getVersionInfoResponse.buildTimestamp

buildTimestamp: string;

Source: src/rpc/api.ts:546

getVersionInfoResponse.captive_core_version

captive_core_version: string;

Source: src/rpc/api.ts:555

getVersionInfoResponse.captiveCoreVersion

captiveCoreVersion: string;

Source: src/rpc/api.ts:547

getVersionInfoResponse.commit_hash

commit_hash: string;

Source: src/rpc/api.ts:551

getVersionInfoResponse.commitHash

commitHash: string;

Source: src/rpc/api.ts:545

getVersionInfoResponse.protocol_version

protocol_version: number;

Source: src/rpc/api.ts:557

getVersionInfoResponse.protocolVersion

protocolVersion: number;

Source: src/rpc/api.ts:548

getVersionInfoResponse.version

version: string;

Source: src/rpc/api.ts:544

rpc.Api.LedgerEntryChange

interface LedgerEntryChange {
after: LedgerEntry | null;
before: LedgerEntry | null;
key: LedgerKey;
type: number;
}

Source: src/rpc/api.ts:342

ledgerEntryChange.after

after: LedgerEntry | null;

Source: src/rpc/api.ts:346

ledgerEntryChange.before

before: LedgerEntry | null;

Source: src/rpc/api.ts:345

ledgerEntryChange.key

key: LedgerKey;

Source: src/rpc/api.ts:344

ledgerEntryChange.type

type: number;

Source: src/rpc/api.ts:343

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

ledgerResponse.hash

hash: string;

Source: src/rpc/api.ts:688

ledgerResponse.headerXdr

headerXdr: LedgerHeaderHistoryEntry;

Source: src/rpc/api.ts:691

ledgerResponse.ledgerCloseTime

ledgerCloseTime: string;

Source: src/rpc/api.ts:690

ledgerResponse.metadataXdr

metadataXdr: LedgerCloseMeta;

Source: src/rpc/api.ts:692

ledgerResponse.sequence

sequence: number;

Source: src/rpc/api.ts:689

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

rawEventResponse.contractId

contractId: string;

Source: src/rpc/api.ts:327

rawEventResponse.id

id: string;

Source: src/rpc/api.ts:316

rawEventResponse.inSuccessfulContractCall

inSuccessfulContractCall: boolean;

Source: src/rpc/api.ts:322

rawEventResponse.ledger

ledger: number;

Source: src/rpc/api.ts:318

rawEventResponse.ledgerClosedAt

ledgerClosedAt: string;

Source: src/rpc/api.ts:319

rawEventResponse.operationIndex

operationIndex: number;

Source: src/rpc/api.ts:321

rawEventResponse.topic

topic?: string[];

Source: src/rpc/api.ts:328

rawEventResponse.transactionIndex

transactionIndex: number;

Source: src/rpc/api.ts:320

rawEventResponse.txHash

txHash: string;

Source: src/rpc/api.ts:323

rawEventResponse.type

type: EventType;

Source: src/rpc/api.ts:317

rawEventResponse.value

value: string;

Source: src/rpc/api.ts:329

rpc.Api.RawGetEventsResponse

interface RawGetEventsResponse extends RetentionState {
cursor: string;
events: RawEventResponse[];
latestLedger: number;
latestLedgerCloseTime: string;
oldestLedger: number;
oldestLedgerCloseTime: string;
}

Source: src/rpc/api.ts:310

rawGetEventsResponse.cursor

cursor: string;

Source: src/rpc/api.ts:312

rawGetEventsResponse.events

events: RawEventResponse[];

Source: src/rpc/api.ts:311

rawGetEventsResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:235

rawGetEventsResponse.latestLedgerCloseTime

latestLedgerCloseTime: string;

Source: src/rpc/api.ts:237

rawGetEventsResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:236

rawGetEventsResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: string;

Source: src/rpc/api.ts:238

rpc.Api.RawGetLatestLedgerResponse

interface RawGetLatestLedgerResponse {
closeTime: string;
headerXdr: string;
id: string;
metadataXdr: string;
protocolVersion: string;
sequence: number;
}

Source: src/rpc/api.ts:61

rawGetLatestLedgerResponse.closeTime

closeTime: string;

Source: src/rpc/api.ts:65

rawGetLatestLedgerResponse.headerXdr

a base-64 encoded xdr.LedgerHeader instance

headerXdr: string;

Source: src/rpc/api.ts:67

rawGetLatestLedgerResponse.id

id: string;

Source: src/rpc/api.ts:62

rawGetLatestLedgerResponse.metadataXdr

a base-64 encoded xdr.LedgerCloseMeta instance

metadataXdr: string;

Source: src/rpc/api.ts:69

rawGetLatestLedgerResponse.protocolVersion

protocolVersion: string;

Source: src/rpc/api.ts:64

rawGetLatestLedgerResponse.sequence

sequence: number;

Source: src/rpc/api.ts:63

rpc.Api.RawGetLedgerEntriesResponse

interface RawGetLedgerEntriesResponse {
entries?: RawLedgerEntryResult[];
latestLedger: number;
}

See also

Source: src/rpc/api.ts:39

rawGetLedgerEntriesResponse.entries

entries?: RawLedgerEntryResult[];

Source: src/rpc/api.ts:40

rawGetLedgerEntriesResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:41

rpc.Api.RawGetLedgersResponse

interface RawGetLedgersResponse {
cursor: string;
latestLedger: number;
latestLedgerCloseTime: number;
ledgers: RawLedgerResponse[];
oldestLedger: number;
oldestLedgerCloseTime: number;
}

Source: src/rpc/api.ts:678

rawGetLedgersResponse.cursor

cursor: string;

Source: src/rpc/api.ts:684

rawGetLedgersResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:680

rawGetLedgersResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:681

rawGetLedgersResponse.ledgers

ledgers: RawLedgerResponse[];

Source: src/rpc/api.ts:679

rawGetLedgersResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:682

rawGetLedgersResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:683

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

rawGetTransactionResponse.applicationOrder

applicationOrder?: number;

Source: src/rpc/api.ts:136

rawGetTransactionResponse.createdAt

createdAt?: number;

Source: src/rpc/api.ts:139

rawGetTransactionResponse.diagnosticEventsXdr

diagnosticEventsXdr?: string[];

Source: src/rpc/api.ts:144

rawGetTransactionResponse.envelopeXdr

envelopeXdr?: string;

Source: src/rpc/api.ts:141

rawGetTransactionResponse.events

events?: RawTransactionEvents;

Source: src/rpc/api.ts:146

rawGetTransactionResponse.feeBump

feeBump?: boolean;

Source: src/rpc/api.ts:137

rawGetTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:129

rawGetTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:130

rawGetTransactionResponse.ledger

ledger?: number;

Source: src/rpc/api.ts:138

rawGetTransactionResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:131

rawGetTransactionResponse.oldestLedgerCloseTime

oldestLedgerCloseTime: number;

Source: src/rpc/api.ts:132

rawGetTransactionResponse.resultMetaXdr

resultMetaXdr?: string;

Source: src/rpc/api.ts:143

rawGetTransactionResponse.resultXdr

resultXdr?: string;

Source: src/rpc/api.ts:142

rawGetTransactionResponse.status

status: GetTransactionStatus;

Source: src/rpc/api.ts:128

rawGetTransactionResponse.txHash

txHash: string;

Source: src/rpc/api.ts:133

rpc.Api.RawGetTransactionsResponse

interface RawGetTransactionsResponse {
cursor: string;
latestLedger: number;
latestLedgerCloseTimestamp: number;
oldestLedger: number;
oldestLedgerCloseTimestamp: number;
transactions: RawTransactionInfo[] | null;
}

Source: src/rpc/api.ts:217

rawGetTransactionsResponse.cursor

cursor: string;

Source: src/rpc/api.ts:223

rawGetTransactionsResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:219

rawGetTransactionsResponse.latestLedgerCloseTimestamp

latestLedgerCloseTimestamp: number;

Source: src/rpc/api.ts:220

rawGetTransactionsResponse.oldestLedger

oldestLedger: number;

Source: src/rpc/api.ts:221

rawGetTransactionsResponse.oldestLedgerCloseTimestamp

oldestLedgerCloseTimestamp: number;

Source: src/rpc/api.ts:222

rawGetTransactionsResponse.transactions

transactions: RawTransactionInfo[] | null;

Source: src/rpc/api.ts:218

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 based on https://github.com/stellar/soroban-tools/issues/1010

liveUntilLedgerSeq?: number;

Source: src/rpc/api.ts:29

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

rawLedgerResponse.hash

hash: string;

Source: src/rpc/api.ts:696

rawLedgerResponse.headerXdr

a base-64 encoded xdr.LedgerHeaderHistoryEntry instance

headerXdr: string;

Source: src/rpc/api.ts:700

rawLedgerResponse.ledgerCloseTime

ledgerCloseTime: string;

Source: src/rpc/api.ts:698

rawLedgerResponse.metadataXdr

a base-64 encoded xdr.LedgerCloseMeta instance

metadataXdr: string;

Source: src/rpc/api.ts:702

rawLedgerResponse.sequence

sequence: number;

Source: src/rpc/api.ts:697

rpc.Api.RawSendTransactionResponse

interface RawSendTransactionResponse extends BaseSendTransactionResponse {
diagnosticEventsXdr?: string[];
errorResultXdr?: string;
hash: string;
latestLedger: number;
latestLedgerCloseTime: number;
status: SendTransactionStatus;
}

Source: src/rpc/api.ts:360

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

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

rawSendTransactionResponse.hash

hash: string;

Source: src/rpc/api.ts:378

rawSendTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:379

rawSendTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:380

rawSendTransactionResponse.status

status: SendTransactionStatus;

Source: src/rpc/api.ts:377

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;
}

See also

Source: src/rpc/api.ts:519

rawSimulateTransactionResponse.error

error?: string;

Source: src/rpc/api.ts:522

rawSimulateTransactionResponse.events

These are xdr.DiagnosticEvents in base64

events?: string[];

Source: src/rpc/api.ts:526

rawSimulateTransactionResponse.id

id: string;

Source: src/rpc/api.ts:520

rawSimulateTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:521

rawSimulateTransactionResponse.minResourceFee

minResourceFee?: string;

Source: src/rpc/api.ts:527

rawSimulateTransactionResponse.restorePreamble

Present if succeeded but has expired ledger entries

restorePreamble?: { minResourceFee: string; transactionData: string };

Source: src/rpc/api.ts:534

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

rawSimulateTransactionResponse.stateChanges

State difference information

stateChanges?: RawLedgerEntryChange[];

Source: src/rpc/api.ts:540

rawSimulateTransactionResponse.transactionData

This is an xdr.SorobanTransactionData in base64

transactionData?: string;

Source: src/rpc/api.ts:524

rpc.Api.RawTransactionEvents

interface RawTransactionEvents {
contractEventsXdr?: string[][];
transactionEventsXdr?: string[];
}

Source: src/rpc/api.ts:165

rawTransactionEvents.contractEventsXdr

contractEventsXdr?: string[][];

Source: src/rpc/api.ts:167

rawTransactionEvents.transactionEventsXdr

transactionEventsXdr?: string[];

Source: src/rpc/api.ts:166

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

rawTransactionInfo.applicationOrder

applicationOrder: number;

Source: src/rpc/api.ts:174

rawTransactionInfo.createdAt

createdAt: number;

Source: src/rpc/api.ts:173

rawTransactionInfo.diagnosticEventsXdr

diagnosticEventsXdr?: string[];

Source: src/rpc/api.ts:181

rawTransactionInfo.envelopeXdr

envelopeXdr?: string;

Source: src/rpc/api.ts:178

rawTransactionInfo.events

events?: RawTransactionEvents;

Source: src/rpc/api.ts:183

rawTransactionInfo.feeBump

feeBump: boolean;

Source: src/rpc/api.ts:175

rawTransactionInfo.ledger

ledger: number;

Source: src/rpc/api.ts:172

rawTransactionInfo.resultMetaXdr

resultMetaXdr?: string;

Source: src/rpc/api.ts:180

rawTransactionInfo.resultXdr

resultXdr?: string;

Source: src/rpc/api.ts:179

rawTransactionInfo.status

status: GetTransactionStatus;

Source: src/rpc/api.ts:171

rawTransactionInfo.txHash

txHash: string;

Source: src/rpc/api.ts:176

rpc.Api.SendTransactionResponse

interface SendTransactionResponse extends BaseSendTransactionResponse {
diagnosticEvents?: DiagnosticEvent[];
errorResult?: TransactionResult;
hash: string;
latestLedger: number;
latestLedgerCloseTime: number;
status: SendTransactionStatus;
}

Source: src/rpc/api.ts:355

sendTransactionResponse.diagnosticEvents

diagnosticEvents?: DiagnosticEvent[];

Source: src/rpc/api.ts:357

sendTransactionResponse.errorResult

errorResult?: TransactionResult;

Source: src/rpc/api.ts:356

sendTransactionResponse.hash

hash: string;

Source: src/rpc/api.ts:378

sendTransactionResponse.latestLedger

latestLedger: number;

Source: src/rpc/api.ts:379

sendTransactionResponse.latestLedgerCloseTime

latestLedgerCloseTime: number;

Source: src/rpc/api.ts:380

sendTransactionResponse.status

status: SendTransactionStatus;

Source: src/rpc/api.ts:377

rpc.Api.SendTransactionStatus

type SendTransactionStatus = "PENDING" | "DUPLICATE" | "TRY_AGAIN_LATER" | "ERROR"

Source: src/rpc/api.ts:349

rpc.Api.SimulateHostFunctionResult

interface SimulateHostFunctionResult {
auth: SorobanAuthorizationEntry[];
retval: ScVal;
}

Source: src/rpc/api.ts:383

simulateHostFunctionResult.auth

auth: SorobanAuthorizationEntry[];

Source: src/rpc/api.ts:384

simulateHostFunctionResult.retval

retval: ScVal;

Source: src/rpc/api.ts:385

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

simulateTransactionErrorResponse._parsed

a private field to mark the schema as parsed

_parsed: boolean;

Source: src/rpc/api.ts:425

simulateTransactionErrorResponse.error

error: string;

Source: src/rpc/api.ts:442

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

simulateTransactionErrorResponse.id

always present: the JSON-RPC request ID

id: string;

Source: src/rpc/api.ts:412

simulateTransactionErrorResponse.latestLedger

always present: the LCL known to the server when responding

latestLedger: number;

Source: src/rpc/api.ts:415

rpc.Api.SimulateTransactionResponse

Simplifies RawSimulateTransactionResponse into separate interfaces based on status:

  • on success, this includes all fields, though result is 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 | SimulateTransactionErrorResponse

See also

Source: src/rpc/api.ts:405

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: SorobanDataBuilder };
result: SimulateHostFunctionResult;
stateChanges?: LedgerEntryChange[];
transactionData: SorobanDataBuilder;
}

Source: src/rpc/api.ts:446

simulateTransactionRestoreResponse._parsed

a private field to mark the schema as parsed

_parsed: boolean;

Source: src/rpc/api.ts:425

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

simulateTransactionRestoreResponse.id

always present: the JSON-RPC request ID

id: string;

Source: src/rpc/api.ts:412

simulateTransactionRestoreResponse.latestLedger

always present: the LCL known to the server when responding

latestLedger: number;

Source: src/rpc/api.ts:415

simulateTransactionRestoreResponse.minResourceFee

minResourceFee: string;

Source: src/rpc/api.ts:431

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: SorobanDataBuilder };

Source: src/rpc/api.ts:457

simulateTransactionRestoreResponse.result

present only for invocation simulation

result: SimulateHostFunctionResult;

Source: src/rpc/api.ts:447

simulateTransactionRestoreResponse.stateChanges

State Difference information

stateChanges?: LedgerEntryChange[];

Source: src/rpc/api.ts:437

simulateTransactionRestoreResponse.transactionData

transactionData: SorobanDataBuilder;

Source: src/rpc/api.ts:430

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: SorobanDataBuilder;
}

Source: src/rpc/api.ts:429

simulateTransactionSuccessResponse._parsed

a private field to mark the schema as parsed

_parsed: boolean;

Source: src/rpc/api.ts:425

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

simulateTransactionSuccessResponse.id

always present: the JSON-RPC request ID

id: string;

Source: src/rpc/api.ts:412

simulateTransactionSuccessResponse.latestLedger

always present: the LCL known to the server when responding

latestLedger: number;

Source: src/rpc/api.ts:415

simulateTransactionSuccessResponse.minResourceFee

minResourceFee: string;

Source: src/rpc/api.ts:431

simulateTransactionSuccessResponse.result

present only for invocation simulation

result?: SimulateHostFunctionResult;

Source: src/rpc/api.ts:434

simulateTransactionSuccessResponse.stateChanges

State Difference information

stateChanges?: LedgerEntryChange[];

Source: src/rpc/api.ts:437

simulateTransactionSuccessResponse.transactionData

transactionData: SorobanDataBuilder;

Source: src/rpc/api.ts:430

rpc.Api.SimulationAuthMode

type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot"

Source: src/rpc/api.ts:388

rpc.Api.TransactionEvents

interface TransactionEvents {
contractEventsXdr: ContractEvent[][];
transactionEventsXdr: TransactionEvent[];
}

Source: src/rpc/api.ts:186

transactionEvents.contractEventsXdr

contractEventsXdr: ContractEvent[][];

Source: src/rpc/api.ts:188

transactionEvents.transactionEventsXdr

transactionEventsXdr: TransactionEvent[];

Source: src/rpc/api.ts:187

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

transactionInfo.applicationOrder

applicationOrder: number;

Source: src/rpc/api.ts:195

transactionInfo.createdAt

createdAt: number;

Source: src/rpc/api.ts:194

transactionInfo.diagnosticEventsXdr

diagnosticEventsXdr?: DiagnosticEvent[];

Source: src/rpc/api.ts:203

transactionInfo.envelopeXdr

envelopeXdr: TransactionEnvelope;

Source: src/rpc/api.ts:199

transactionInfo.events

events: TransactionEvents;

Source: src/rpc/api.ts:205

transactionInfo.feeBump

feeBump: boolean;

Source: src/rpc/api.ts:196

transactionInfo.ledger

ledger: number;

Source: src/rpc/api.ts:193

transactionInfo.resultMetaXdr

resultMetaXdr: TransactionMeta;

Source: src/rpc/api.ts:201

transactionInfo.resultXdr

resultXdr: TransactionResult;

Source: src/rpc/api.ts:200

transactionInfo.returnValue

returnValue?: ScVal;

Source: src/rpc/api.ts:202

transactionInfo.status

status: GetTransactionStatus;

Source: src/rpc/api.ts:192

transactionInfo.txHash

txHash: string;

Source: src/rpc/api.ts:197

rpc.Durability

Specifies the durability namespace of contract-related ledger entries.

enum Durability

See also

    • State Archival docs
  • Rust SDK Storage docs

Source: src/rpc/server.ts:48

rpc.Server.GetEventsRequest

Deprecated. Use Api.GetEventsRequest instead.

type GetEventsRequest = Api.GetEventsRequest

See also

  • Api.GetEventsRequest

Source: src/rpc/server.ts:58

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

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

options.headers

Additional headers that should be added to any requests to the RPC server.

headers?: Record<string, string>;

Source: src/rpc/server.ts:82

options.timeout

Allow a timeout, default: 0. Allows user to avoid nasty lag.

timeout?: number;

Source: src/rpc/server.ts:80

rpc.Server.PollingOptions

interface PollingOptions {
attempts?: number;
sleepStrategy?: SleepStrategy;
}

Source: src/rpc/server.ts:60

pollingOptions.attempts

attempts?: number;

Source: src/rpc/server.ts:61

pollingOptions.sleepStrategy

sleepStrategy?: SleepStrategy;

Source: src/rpc/server.ts:62

rpc.Server.ResourceLeeway

Describes additional resource leeways for transaction simulation.

interface ResourceLeeway {
cpuInstructions: number;
}

Source: src/rpc/server.ts:68

resourceLeeway.cpuInstructions

Simulate the transaction with more CPU instructions available.

cpuInstructions: number;

Source: src/rpc/server.ts:70