json-rpc-proxy
v0.8.0
Published
The helper functions for JSON-RPC 2.0 requests and notifications
Readme
json-rpc-proxy
The helper functions for JSON-RPC 2.0 requests and notifications.
This module does not check types, nor convert unsupported types (e.g., undefined to null).
This is intentional so you can extend JSON-RPC to values other than JSON.
Install
npm install --save json-rpc-proxy
# or
yarn add json-rpc-proxyAPI
createRequestProxy
function createRequestProxy<T extends object, U = unknown>(createId: () => string): RequestProxy<T, U>createNotificationProxy
function createNotificationProxy<T extends object, U = unknown>(): NotificationProxy<T, U>applyRequest
function applyRequest<T>(callables: object, request: JsonRpcRequest<T>): Promise<JsonRpcResponse<T>>applyNotification
function applyNotification<T>(callables: object, notification: JsonRpcNotification<T>): Promise<void>