UNPKG

@inkwell.ar/sdk

Version:

SDK for interacting with the Inkwell Blog CRUD AO process using aoconnect for deployment and interactions

35 lines 1.58 kB
import Arweave from 'arweave'; /** * Initializes a default Arweave instance. */ export declare const arweave: Arweave; export declare function sleep(delay?: number): Promise<unknown>; /** * Initializes an Arweave instance with a custom gateway. * * @param gateway - The gateway URL to connect to. * @returns An Arweave instance configured with the provided gateway. */ export declare function getArweave(gateway?: string): Arweave; /** * Retries a given function up to a maximum number of attempts. * @param fn - The asynchronous function to retry, which should return a Promise. * @param maxAttempts - The maximum number of attempts to make. * @param initialDelay - The delay between attempts in milliseconds. * @param getDelay - A function that returns the delay for a given attempt. * @return A Promise that resolves with the result of the function or rejects after all attempts fail. */ export declare function retryWithDelay<T>(fn: () => Promise<T>, maxAttempts?: number, initialDelay?: number, getDelay?: (attempt: number) => number): Promise<T>; interface PollingOptions { maxAttempts?: number; initialDelayMs?: number; backoffFactor?: number; } export declare const TRANSACTION_QUERY = "query ($ids: [ID!]!) {\n transactions(ids: $ids) {\n edges {\n node {\n id\n }\n }\n }\n }"; export declare function pollForProcessSpawn({ processId, gatewayUrl, options, }: { processId: string; gatewayUrl?: string; options?: PollingOptions; }): Promise<void>; export {}; //# sourceMappingURL=utils.d.ts.map