@liskhq/lisk-api-client
Advanced tools
Comparing version 6.0.0 to 6.0.1
import { EventCallback } from './types'; | ||
export declare const CONNECTION_TIMEOUT = 5000; | ||
export declare const RESPONSE_TIMEOUT = 10000; | ||
export declare class WSChannel { | ||
@@ -3,0 +5,0 @@ isAlive: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WSChannel = void 0; | ||
exports.WSChannel = exports.RESPONSE_TIMEOUT = exports.CONNECTION_TIMEOUT = void 0; | ||
const WebSocket = require("isomorphic-ws"); | ||
const events_1 = require("events"); | ||
const utils_1 = require("./utils"); | ||
const CONNECTION_TIMEOUT = 2000; | ||
const RESPONSE_TIMEOUT = 3000; | ||
exports.CONNECTION_TIMEOUT = 5000; | ||
exports.RESPONSE_TIMEOUT = 10000; | ||
class WSChannel { | ||
@@ -43,3 +43,3 @@ constructor(url) { | ||
try { | ||
await (0, utils_1.promiseWithTimeout)([connectHandler, errorHandler], CONNECTION_TIMEOUT, `Could not connect in ${CONNECTION_TIMEOUT}ms`); | ||
await (0, utils_1.promiseWithTimeout)([connectHandler, errorHandler], exports.CONNECTION_TIMEOUT, `Could not connect in ${exports.CONNECTION_TIMEOUT}ms`); | ||
} | ||
@@ -73,3 +73,3 @@ catch (err) { | ||
this._ws.close(); | ||
await (0, utils_1.promiseWithTimeout)([closeHandler], CONNECTION_TIMEOUT, `Could not disconnect in ${CONNECTION_TIMEOUT}ms`); | ||
await (0, utils_1.promiseWithTimeout)([closeHandler], exports.CONNECTION_TIMEOUT, `Could not disconnect in ${exports.CONNECTION_TIMEOUT}ms`); | ||
} | ||
@@ -91,3 +91,3 @@ async invoke(actionName, params) { | ||
this._requestCounter += 1; | ||
return (0, utils_1.promiseWithTimeout)([response.promise], RESPONSE_TIMEOUT, `Response not received in ${RESPONSE_TIMEOUT}ms`); | ||
return (0, utils_1.promiseWithTimeout)([response.promise], exports.RESPONSE_TIMEOUT, `Response not received in ${exports.RESPONSE_TIMEOUT}ms`); | ||
} | ||
@@ -94,0 +94,0 @@ subscribe(eventName, cb) { |
{ | ||
"name": "@liskhq/lisk-api-client", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "An API client for the Lisk network", | ||
@@ -66,4 +66,3 @@ "author": "Lisk Foundation <admin@lisk.com>, lightcurve GmbH <admin@lightcurve.io>", | ||
"typescript": "5.0.2" | ||
}, | ||
"gitHead": "87d6b877b35c5bf9d393e6720cd80bfcd4f5a08a" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102886
1339