Wrap an async function with retry logic and exponential backoff.
Only retries transient errors (network disconnects, temporary RPC failures). Deterministic errors (TxDispatchError, TxBatchError), user rejections (TxSigningRejectedError), and timeouts (TxTimeoutError) are rethrown immediately without retry.
The async function to retry.
Optional
Retry configuration.
The result of the first successful call.
const result = await withRetry( () => submitAndWatch(tx, signer), { maxAttempts: 3, baseDelayMs: 1_000 },); Copy
const result = await withRetry( () => submitAndWatch(tx, signer), { maxAttempts: 3, baseDelayMs: 1_000 },);
Wrap an async function with retry logic and exponential backoff.
Only retries transient errors (network disconnects, temporary RPC failures). Deterministic errors (TxDispatchError, TxBatchError), user rejections (TxSigningRejectedError), and timeouts (TxTimeoutError) are rethrown immediately without retry.