/** * Configuration for retry behavior on Solana RPC calls. */ export interface RpcRetryPolicy { /** Maximum number of retry attempts (default: 3) */ maxRetries: number; /** Base delay in ms for exponential backoff (default: 1000) */ baseDelayMs: number; /** Maximum delay cap in ms (default: 10000) */ maxDelayMs: number; } export declare const DEFAULT_RPC_RETRY: RpcRetryPolicy; /** * Execute an async function with retries on transient RPC failures. * * Retries on: BlockhashNotFound, HTTP 429/502/503/504, timeouts, connection resets. * Does NOT retry on: program errors (6xxx), signature verification failures, or other * deterministic errors that would fail again. * * @param fn The async operation to execute * @param policy Retry configuration (uses sensible defaults if omitted) * @returns The result of the async operation * * @example * ```ts * const txSig = await withRpcRetry( * () => program.methods.transact(...).accounts({...}).signers([...]).rpc(), * { maxRetries: 5 }, * ); * ``` */ export declare function withRpcRetry(fn: () => Promise, policy?: Partial): Promise;