ethers.js/packages/web/lib.esm/index.d.ts

32 lines
934 B
TypeScript
Raw Normal View History

2019-05-15 01:48:48 +03:00
export declare type ConnectionInfo = {
url: string;
user?: string;
password?: string;
2019-06-12 08:01:04 +03:00
allowInsecureAuthentication?: boolean;
throttleLimit?: number;
2019-05-15 01:48:48 +03:00
timeout?: number;
headers?: {
[key: string]: string | number;
};
};
export interface OnceBlockable {
once(eventName: "block", handler: () => void): void;
}
export declare type PollOptions = {
timeout?: number;
floor?: number;
ceiling?: number;
interval?: number;
retryLimit?: number;
onceBlock?: OnceBlockable;
};
2019-09-28 09:36:19 +03:00
export declare type FetchJsonResponse = {
statusCode: number;
status: string;
headers: {
[header: string]: string;
};
};
export declare function fetchJson(connection: string | ConnectionInfo, json?: string, processFunc?: (value: any, response: FetchJsonResponse) => any): Promise<any>;
2019-05-15 01:48:48 +03:00
export declare function poll(func: () => Promise<any>, options?: PollOptions): Promise<any>;