Overview
There is no way for an app to verify that the SDK can reach the configured RPC endpoint before making real calls. Add a healthCheck() method that probes connectivity and returns a diagnostic report.
Acceptance Criteria
sdk.healthCheck() returns Promise<HealthCheckResult>
HealthCheckResult: { rpcReachable: boolean, latencyMs: number, network: string, contractDeployed: boolean, error?: string }
rpcReachable: whether the RPC endpoint responded to a getLatestLedger call
latencyMs: round-trip time for the probe call
contractDeployed: whether get_contract_data returns a result for the configured contract ID
error: human-readable message if any check failed
healthCheck() has a 5-second timeout; times out with HealthCheckTimeoutError
- Useful for app startup checks and connection debugging
- Does not throw on failure — returns the result object with
rpcReachable: false
Overview
There is no way for an app to verify that the SDK can reach the configured RPC endpoint before making real calls. Add a
healthCheck()method that probes connectivity and returns a diagnostic report.Acceptance Criteria
sdk.healthCheck()returnsPromise<HealthCheckResult>HealthCheckResult:{ rpcReachable: boolean, latencyMs: number, network: string, contractDeployed: boolean, error?: string }rpcReachable: whether the RPC endpoint responded to agetLatestLedgercalllatencyMs: round-trip time for the probe callcontractDeployed: whetherget_contract_datareturns a result for the configured contract IDerror: human-readable message if any check failedhealthCheck()has a 5-second timeout; times out withHealthCheckTimeoutErrorrpcReachable: false