How to use the web3-core-helpers.errors.InvalidConnection function in web3-core-helpers

To help you get started, we’ve selected a few web3-core-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MCROEngineering / zoom / test / web3 / HttpProviderCache.js View on Github external
_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) {
github MCROEngineering / zoom / test / web3 / WsProviderCache.ts View on Github external
public doTimeout() {
        for (const key in this.responseCallbacks) {
            if (this.responseCallbacks.hasOwnProperty(key)) {
                this.responseCallbacks[key](errors.InvalidConnection('on WS'));
                delete this.responseCallbacks[key];
            }
        }
    }
github MCROEngineering / zoom / test / web3 / WsProviderCache.js View on Github external
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) {
github MyEtherWallet / MyEtherWallet / src / wallets / web3-provider / providers / ws-web3-provider.js View on Github external
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) {
github ninabreznik / voting-ethereum-contract / node_modules / web3-providers-ws / src / index.js View on Github external
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];
        }
    }
};
github MCROEngineering / zoom / dist / lib / utils / HttpProvider.js View on Github external
_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));
        }
    };
    /**
github ethereum / web3.js / packages / web3-providers-ws / src / index.js View on Github external
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];
        }
    }
};
github ethereum / web3.js / packages / web3-providers-http / src / index.js View on Github external
_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));
    }
};
github MCROEngineering / zoom / src / utils / WsProvider.ts View on Github external
public doTimeout() {
        for (const key in this.responseCallbacks) {
            if (this.responseCallbacks.hasOwnProperty(key)) {
                this.responseCallbacks[key](errors.InvalidConnection('on WS'));
                delete this.responseCallbacks[key];
            }
        }
    }