@polkadot-api/ws-provider 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1 +1,16 @@
1
1
  # @polkadot-api/ws-provider
2
+
3
+ `JsonRpcProvider` to connect to a chain via a WebSocket.
4
+
5
+ ```ts
6
+ function WebSocketProvider(
7
+ uri: string,
8
+ protocols?: string | string[],
9
+ ): JsonRpcProvider
10
+ ```
11
+
12
+ This package doesn't have any export on the root. Instead it has 2 subpaths, each for a different environment.
13
+
14
+ For web runtimes, where the browser's `WebSocket` constructor can be used, import `WebSocketProvider` from `@polkadot-api/ws-provider/web`.
15
+
16
+ For other runtimes where the `WebSocket` from the module `ws` should be used instead, import `WebSocketProvider` from `@polkadot-api/ws-provider/node`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polkadot-api/ws-provider",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "author": "Josep M Sobrepere (https://github.com/josepot)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "ws": "^8.14.2",
40
40
  "@polkadot-api/json-rpc-provider": "0.0.1",
41
- "@polkadot-api/json-rpc-provider-proxy": "0.0.1"
41
+ "@polkadot-api/json-rpc-provider-proxy": "0.1.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsc --noEmit && pnpm run build:web && pnpm run build:node",