UNPKG

@magiceden/magiceden-sdk

Version:

A TypeScript SDK for interacting with Magic Eden's API across multiple chains.

44 lines (43 loc) 1.52 kB
import { RetryConfig } from 'ts-retry-promise'; /** * A Promise wrapper that allows for optional retry behavior */ export declare class RetryablePromise<T> implements PromiseLike<T> { private operation; private retryEnabled; private retryOptions?; /** * Creates a new RetryablePromise * * @param operation The async operation to potentially retry */ constructor(operation: () => Promise<T>); private getPromise; /** * Enables retry behavior with optional configuration * * @param options Optional retry configuration * @returns This RetryablePromise instance for chaining */ withRetries(options?: Partial<RetryConfig>): RetryablePromise<T>; /** * Implementation of PromiseLike interface */ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>; /** * Adds a catch handler to the promise */ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>; /** * Adds a finally handler to the promise */ finally(onfinally?: (() => void) | null): Promise<T>; /** * Converts to a standard Promise */ toPromise(): Promise<T>; /** * Creates a RetryablePromise from an operation */ static from<T>(operation: () => Promise<T>): RetryablePromise<T>; }