/** * RPC resilience for the Helius client: a per-call timeout plus retry-with-backoff * for transient failures (HTTP 429/502/503/504 and network resets). * * Only idempotent reads are wrapped — methods whose name matches `READ_METHOD_RE` * (`get*` / `search*` / `simulate*`). Everything else passes through untouched: * sends (`sendTransactionWithSender`, `sendSmartTransaction`, `broadcastTransaction`), * webhook `create`/`update`/`delete`, `pollTransactionConfirmation`, and streaming * (`ws`). This guarantees we never retry a non-idempotent write or abandon a * transaction that is still confirming — sends self-bound via the SDK's poll timeout. * * Client-side timeouts fail fast (no retry): retrying a hung call just hangs again. * Only fast-failing transients (429/5xx/network reset) are retried. */ /** Default per-attempt timeout for idempotent reads. */ export declare const READ_TIMEOUT_MS = 30000; export interface ResilienceOptions { /** Total attempts including the first. */ attempts?: number; baseDelayMs?: number; factor?: number; maxDelayMs?: number; /** Fractional jitter, 0..1. */ jitter?: number; /** Per-attempt timeout in ms. 0 disables the timeout race. */ timeoutMs?: number; } /** True when an error is a transient failure worth retrying. */ export declare function isRetryable(err: unknown): boolean; /** Race a promise-returning fn against a timeout. `ms <= 0` disables the race. */ export declare function withTimeout(fn: () => Promise, ms: number, label?: string): Promise; /** Run `fn` with a timeout and exponential backoff on transient errors. */ export declare function withResilience(fn: () => Promise, label?: string, opts?: ResilienceOptions): Promise; /** * Wrap a Helius client so idempotent reads get timeout + retry. Recurses into the * `enhanced`/`webhooks`/`tx`/`wallet`/`zk` namespaces; leaves `ws` (streaming) and * all non-read methods (sends, webhook mutations) untouched. */ export declare function wrapClientWithResilience(client: T, opts?: ResilienceOptions): T;