UNPKG

@bsv/sdk

Version:

BSV Blockchain Software Development Kit

14 lines 855 B
import TopicBroadcaster from './SHIPBroadcaster.js'; /** * Executes an operation with automatic retry logic for double-spend errors. * When a double-spend is detected, broadcasts the competing transaction to * update the overlay with missing state, then retries the operation. * * @param operation - The async operation to execute (e.g., createAction + signAction) * @param broadcaster - The TopicBroadcaster to use for syncing missing state * @param maxRetries - Maximum number of retry attempts (default: MAX_DOUBLE_SPEND_RETRIES) * @returns The result of the successful operation * @throws If max retries exceeded or non-double-spend error occurs */ export declare function withDoubleSpendRetry<T>(operation: () => Promise<T>, broadcaster: TopicBroadcaster, maxRetries?: number): Promise<T>; //# sourceMappingURL=withDoubleSpendRetry.d.ts.map