CodeChain-io/codechain-sdk-js

Support WebSocket connection

joojis opened this issue · 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