Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_this.toCache(payload, result);
}
othis.connected = true;
callback(error, result);
}
};
request.ontimeout = function () {
othis.connected = false;
callback(errors.ConnectionTimeout(_this.timeout));
};
try {
request.send(JSON.stringify(payload));
}
catch (error) {
this.connected = false;
callback(errors.InvalidConnection(this.host));
}
};
HttpProviderCache.prototype.fromCache = function (payload) {
public doTimeout() {
for (const key in this.responseCallbacks) {
if (this.responseCallbacks.hasOwnProperty(key)) {
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
}
WsProviderCache.prototype.doTimeout = function () {
for (var key in this.responseCallbacks) {
if (this.responseCallbacks.hasOwnProperty(key)) {
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
};
WsProviderCache.prototype.send = function (payload, callback) {
WebsocketProvider.prototype._timeout = function() {
for (const key in this.responseCallbacks) {
if (this.responseCallbacks.hasOwnProperty(key)) {
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
};
WebsocketProvider.prototype.send = function(payload, callback) {
WebsocketProvider.prototype._timeout = function() {
for(var key in this.responseCallbacks) {
if(this.responseCallbacks.hasOwnProperty(key)){
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
};
_this.toCache(payload, result);
}
othis.connected = true;
callback(error, result);
}
};
request.ontimeout = function () {
othis.connected = false;
callback(errors.ConnectionTimeout(_this.timeout));
};
try {
request.send(JSON.stringify(payload));
}
catch (error) {
this.connected = false;
callback(errors.InvalidConnection(this.host));
}
};
/**
WebsocketProvider.prototype._timeout = function() {
for(var key in this.responseCallbacks) {
if(this.responseCallbacks.hasOwnProperty(key)){
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
};
_this.connected = true;
callback(error, result);
}
};
request.ontimeout = function() {
_this.connected = false;
callback(errors.ConnectionTimeout(this.timeout));
};
try {
request.send(JSON.stringify(payload));
} catch(error) {
this.connected = false;
callback(errors.InvalidConnection(this.host));
}
};
public doTimeout() {
for (const key in this.responseCallbacks) {
if (this.responseCallbacks.hasOwnProperty(key)) {
this.responseCallbacks[key](errors.InvalidConnection('on WS'));
delete this.responseCallbacks[key];
}
}
}