@polkadot-api/ws-provider

0.1.0 • Public • Published

@polkadot-api/ws-provider

JsonRpcProvider to connect to a chain via a WebSocket.

function WebSocketProvider(
  uri: string,
  protocols?: string | string[],
): JsonRpcProvider

This package doesn't have any export on the root. Instead it has 2 subpaths, each for a different environment.

For web runtimes, where the browser's WebSocket constructor can be used, import WebSocketProvider from @polkadot-api/ws-provider/web.

For other runtimes where the WebSocket from the module ws should be used instead, import WebSocketProvider from @polkadot-api/ws-provider/node.

Readme

Keywords

none

Package Sidebar

Install

npm i @polkadot-api/ws-provider

Weekly Downloads

1,526

Version

0.1.0

License

MIT

Unpacked Size

35.7 kB

Total Files

23

Last publish

Collaborators

  • voliva
  • josepot