Skip to content

pedrouid/rpc-stream-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpc-stream-router

RPC Stream Router

Install

npm install --save rpc-stream-router

# OR

yarn add rpc-stream-router

Setup

import { RpcStreamRouter } from 'rpc-stream-router';

const rpcRouter = new RpcStreamRouter(rpcStream);

const result = await rpcRouter.send(payload);

Typings

export type JsonRpcRequest = {
  id: number;
  jsonrpc: string;
  method: string;
  params: any;
};

export interface IRpcStream {
  on: (event: string, listener: Listener) => void;
  write: (payload: JsonRpcRequest) => void;
}

export interface IRpcStreamRouter {
  send: (payload: JsonRpcRequest) => Promise<any>;
}

About

RPC Stream Router

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published