Overview
Before submitting any transaction, the SDK should optionally simulate it against the Soroban RPC to get fee estimates, resource usage, and detect errors — without consuming sequence numbers or broadcasting. Add a simulate option to all mutating SDK methods.
Requirements
- Add
{ simulate: true } option to createInvoice, pay, release, refund, approveRelease
- When
simulate: true, call simulateTransaction RPC instead of submitting
- Return
SimulationResult { success: boolean, error?: string, fee: bigint, cpuInsns: bigint, memBytes: bigint, footprint: LedgerFootprint }
- Add
client.simulate(method, params) generic simulation method
- Write tests using a mock RPC that returns simulation responses
- Document simulation usage in
README.md with a code example
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Before submitting any transaction, the SDK should optionally simulate it against the Soroban RPC to get fee estimates, resource usage, and detect errors — without consuming sequence numbers or broadcasting. Add a
simulateoption to all mutating SDK methods.Requirements
{ simulate: true }option tocreateInvoice,pay,release,refund,approveReleasesimulate: true, callsimulateTransactionRPC instead of submittingSimulationResult { success: boolean, error?: string, fee: bigint, cpuInsns: bigint, memBytes: bigint, footprint: LedgerFootprint }client.simulate(method, params)generic simulation methodREADME.mdwith a code exampleAcceptance Criteria
simulateoption works on all 5 mutating methodsSimulationResulttype exported from packageclient.simulate()method worksREADME.mdupdated with simulation examplenpm testpasses with zero failuresDefinition of Done
All CI checks must pass before the PR is reviewed.