@novasamatech/host-substrate-chain-connection 0.7.1-0 → 0.7.1
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.
- package/dist/wsProvider.d.ts +1 -0
- package/dist/wsProvider.js +6 -1
- package/package.json +2 -2
package/dist/wsProvider.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export declare const createWsJsonRpcProvider: (options: {
|
|
|
11
11
|
onStatusChanged?: (status: ConnectionStatus) => void;
|
|
12
12
|
websocketClass?: typeof WebSocket;
|
|
13
13
|
heartbeatTimeout?: number;
|
|
14
|
+
connectionTimeout?: number;
|
|
14
15
|
logger?: SocketLoggerFn;
|
|
15
16
|
}) => PausableJsonRpcProvider;
|
package/dist/wsProvider.js
CHANGED
|
@@ -23,7 +23,12 @@ export const createWsJsonRpcProvider = (options) => {
|
|
|
23
23
|
const pauseController = createPauseController();
|
|
24
24
|
const baseProvider = getWsProvider(options.endpoints, {
|
|
25
25
|
logger: options.logger,
|
|
26
|
-
|
|
26
|
+
// Forward only when defined: getWsProvider merges via `{...defaults, ...config}`,
|
|
27
|
+
// so an explicit `undefined` clobbers the library's 40 s default and Node's
|
|
28
|
+
// setTimeout clamps undefined/Infinity to 1 ms — which would kill every socket
|
|
29
|
+
// right after open and drive a reconnect loop.
|
|
30
|
+
...(options.heartbeatTimeout !== undefined && { heartbeatTimeout: options.heartbeatTimeout }),
|
|
31
|
+
...(options.connectionTimeout !== undefined && { timeout: options.connectionTimeout }),
|
|
27
32
|
middleware: inner => pauseController.middleware(inner),
|
|
28
33
|
websocketClass: options.websocketClass,
|
|
29
34
|
onStatusChanged: event => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-substrate-chain-connection",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.1
|
|
4
|
+
"version": "0.7.1",
|
|
5
5
|
"description": "Chain connection pool with ref counting and provider branching for Polkadot API",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@novasamatech/storage-adapter": "0.7.1
|
|
28
|
+
"@novasamatech/storage-adapter": "0.7.1",
|
|
29
29
|
"@polkadot-api/ws-provider": "^0.9.0",
|
|
30
30
|
"@polkadot-api/json-rpc-provider": "^0.2.0",
|
|
31
31
|
"@polkadot-api/json-rpc-provider-proxy": "^0.4.0",
|