codechain-sdk-js icon indicating copy to clipboard operation
codechain-sdk-js copied to clipboard

Support WebSocket connection

Open joojis opened this issue 6 years ago • 0 comments

Proposal:

const sdk = new SDK({ server: "ws://..." });

await sdk.rpc.node.ping(); // rejects with Error("Not connected");
await sdk.rpc.connect(); // open
await sdk.rpc.node.ping(); // pong
await sdk.rpc.disconnect(); // close

Any suggestions are welcome

joojis avatar Sep 21 '18 09:09 joojis