shora-ai-payment-sdk
Version:
The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible
24 lines • 741 B
TypeScript
/**
* Retry logic and circuit breaker implementation
*/
export interface RetryOptions {
maxAttempts?: number;
baseDelay?: number;
maxDelay?: number;
backoffMultiplier?: number;
retryCondition?: (error: any) => boolean;
}
export declare class CircuitBreaker {
private failureCount;
private lastFailureTime;
private state;
private readonly failureThreshold;
private readonly timeout;
execute<T>(fn: () => Promise<T>): Promise<T>;
private onSuccess;
private onFailure;
getState(): string;
}
export declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
export declare function delay(ms: number): Promise<void>;
//# sourceMappingURL=retry-logic.d.ts.map