Socket
Socket
Sign inDemoInstall

ethers-providers

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethers-providers - npm Package Compare versions

Comparing version 2.1.8 to 2.1.9

18

fallback-provider.js

@@ -17,14 +17,14 @@ 'use strict';

for (var i = 1; i < providers.length; i++) {
if (providers[0].chainId !== providers[i].chainId) {
throw new Error('incompatible providers - chainId mismatch');
var network = {};
['chainId', 'ensAddress', 'name', 'testnet'].forEach(function(key) {
for (var i = 1; i < providers.length; i++) {
if (providers[0][key] !== providers[i][key]) {
throw new Error('incompatible providers - ' + key + ' mismatch');
}
}
network[key] = providers[0][key];
});
if (providers[0].testnet !== providers[i].testnet) {
throw new Error('incompatible providers - testnet mismatch');
}
}
if (!(this instanceof FallbackProvider)) { throw new Error('missing new'); }
Provider.call(this, providers[0].testnet, providers[0].chainId);
Provider.call(this, network);

@@ -31,0 +31,0 @@ providers = providers.slice(0);

@@ -15,11 +15,5 @@ 'use strict';

// Legacy constructor (testnet, chainId, apiAccessToken)
// Legacy constructor (testnet, apiAccessToken)
// @TODO: Remove this in the next major release
if (arguments.length === 3) {
apiAccessToken = arguments[2];
network = Provider._legacyConstructor(network, 2, arguments[0], arguments[1]);
} else {
apiAccessToken = null;
network = Provider._legacyConstructor(network, arguments.length, arguments[0], arguments[1]);
}
network = Provider._legacyConstructor(network, 1, arguments[0]);

@@ -26,0 +20,0 @@ var host = null;

@@ -54,6 +54,27 @@ 'use strict';

network = Provider._legacyConstructor(network, arguments.length - 1, arguments[1], arguments[2]);
// Legacy Contructor (url, [ testnet, [ chainId ] ])
// @TODO: Remove this in the next major version
Provider.call(this, network);
var args = [];
// Legacy without a url
if (typeof(url) !== 'string' || Provider.networks[url] != null) {
// url => network
args.push(url);
// network => chainId
if (network != null) { args.push(network); }
url = null;
} else if (arguments.length === 2) {
args.push(arguments[1]);
} else if (arguments.length === 3) {
args.push(arguments[1]);
args.push(arguments[2]);
}
Provider.apply(this, args);
if (!url) { url = 'http://localhost:8545'; }

@@ -60,0 +81,0 @@

{
"name": "ethers-providers",
"version": "2.1.8",
"version": "2.1.9",
"description": "Service provider for Ethereum wallet library.",

@@ -5,0 +5,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc