UNPKG

@samouraiwallet/electrum-client

Version:
18 lines 1.05 kB
import type { ElectrumRequestParams } from "../types"; export declare const makeRequest: <T>(method: string, params: ElectrumRequestParams<T>, id: number) => string; export declare const createRecursiveParser: (max_depth: number, delimiter: string) => (n: number, buffer: string, callback: (xs: string | undefined, n: number) => void) => { code: number; buffer: string; }; export declare const createPromiseResult: (resolve: (value?: any) => void, reject: (reason?: any) => void) => (err: Error | null, result?: any) => void; export declare const createPromiseResultBatch: (resolve: (value?: any) => void, reject: (reason?: any) => void, argz: Record<number, any>) => (err: Error | null, result?: Array<any>) => void; type MessageParserCallback = (body: string | undefined, n: number) => void; export declare class MessageParser { private buffer; private readonly callback; private readonly recursiveParser; constructor(callback: MessageParserCallback); run(chunk: Buffer): void; } export {}; //# sourceMappingURL=util.d.ts.map