UNPKG

1.03 kBTypeScriptView Raw
1import { IJSONRPCClient } from './internal/json-rpc-client';
2export interface IJSONRPCProtocolOptions {
3 url: string;
4 reconnectInterval?: number;
5 maxReconnects?: number;
6}
7/**
8 * Creates an RPC client for communicating with a Loom DAppChain based on the specified options.
9 * @param opts Options object
10 * @param opts.protocols
11 * @param opts.autoConnect If `true` the client will automatically connect after being created,
12 * defaults to `true` and shouldn't be changed.
13 * @param opts.requestTimeout Maximum number of milliseconds the client should wait for a request
14 * to receive a response.
15 * @param opts.generateRequestId Can be set to override the default JSON-RPC message ID generator.
16 */
17export declare function createJSONRPCClient(opts: {
18 protocols: IJSONRPCProtocolOptions[];
19 autoConnect?: boolean;
20 requestTimeout?: number;
21 generateRequestId?: (method: string, params: object | any[]) => string;
22}): IJSONRPCClient;