rpc-cli
A rpc client base on JSON-RPC 2.0 Specification.
Installation
npm install -save rpc-cli
Examples
;const options: Options =url: 'http://*.*.*:8001/rpc.endpoint'{console;};const client = options;const result = await client;console;
Client
const client = options;const result = await client;
new Client(options) -> client
Instantiate a rpc client
Options
// url is the rpc server URL that will be used for the request.url: string// version is the rpc server version, default is 2.0.version?: string// http cookie. eg. your can pass sessionid.cookies?: string// Fired when a request could not be processed due to an error.// eg. server throw a error or network error.onError?: onErrorType// Fired when a request is send.onRequest: onRequestType// Fired when a request is end.onResponse: onResponseType