@pgchain/blockchain-libs
Version:
PGWallet Blockchain Libs
18 lines (17 loc) • 707 B
TypeScript
declare type JsonRpcParams = undefined | {
[p: string]: any;
} | Array<any>;
declare class JsonRPCRequest {
readonly url: string;
readonly timeout: number;
readonly headers: Record<string, string>;
constructor(url: string, headers?: Record<string, string>, timeout?: number);
private static parseRPCResponse;
private static normalizePayload;
call<T>(method: string, params?: JsonRpcParams, headers?: Record<string, string>, timeout?: number): Promise<T>;
batchCall<T>(calls: Array<[string, JsonRpcParams]>, headers?: {
[p: string]: string;
}, timeout?: number, ignoreSoloError?: boolean): Promise<T>;
private assembleHeaders;
}
export { JsonRPCRequest };