Skip to main content

Function: createSorobanSimulator()

createSorobanSimulator(rpcUrl, fetchImpl?, simSource?): SorobanSimulator
Defined in: packages/core/src/soroban-rpc.ts:45 Concrete SorobanSimulator backed by a Soroban RPC simulateTransaction call. Builds the contract invocation, runs a recording simulation, and returns the recorded auth entries (base64) + the min resource fee. Raw fetch + zod (no rpc.Server/axios) keeps the browser bundle light and mirrors getLatestLedger. A reverting simulation maps to SIMULATION_FAILED; transport failure to RELAYER_UNREACHABLE. fetchImpl is injectable for tests.

Parameters

rpcUrl

string

fetchImpl?

RpcFetch = fetch

simSource?

string

Returns

SorobanSimulator