Skip to content

Commit d78b7a3

Browse files
committed
Updated dist files.
1 parent 5abc2f3 commit d78b7a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+456
-134
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ Changelog
33

44
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
55

6+
ethers/v5.0.17 (2020-10-07 20:08)
7+
---------------------------------
8+
9+
- Better error message for parseUnits of non-strings. ([#981](https://github.com/ethers-io/ethers.js/issues/981); [5abc2f3](https://github.com/ethers-io/ethers.js/commit/5abc2f36e20eef79a935961f3dd8133b5528d9e5))
10+
- Add gzip support to AlchemyProivder and InfuraProvider fetching. ([#1085](https://github.com/ethers-io/ethers.js/issues/1085); [38a068b](https://github.com/ethers-io/ethers.js/commit/38a068bcea3f251c8f3a349a90fcb077a39d23ad))
11+
- Add gzip support to getUrl in node. ([#1085](https://github.com/ethers-io/ethers.js/issues/1085); [65772a8](https://github.com/ethers-io/ethers.js/commit/65772a8e1a55d663bdb67e3a2b160fecc9f986ef))
12+
- Added CommunityResourcable to mark Providers as highly throttled. ([a022093](https://github.com/ethers-io/ethers.js/commit/a022093ce03f55db7ba2cac36e365d1af39ac45b))
13+
- Added debug event info to WebSocketProvider. ([#1018](https://github.com/ethers-io/ethers.js/issues/1018); [8e682cc](https://github.com/ethers-io/ethers.js/commit/8e682cc8481c6051a6f8115b29d78f4996120ccd))
14+
615
ethers/v5.0.16 (2020-10-05 15:44)
716
---------------------------------
817

packages/ethers/dist/ethers-all.esm.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers-all.umd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethers/dist/ethers.esm.js

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17886,7 +17886,7 @@ var browser$2 = /*#__PURE__*/Object.freeze({
1788617886
encode: encode$1
1788717887
});
1788817888

17889-
const version$l = "web/5.0.8";
17889+
const version$l = "web/5.0.9";
1789017890

1789117891
"use strict";
1789217892
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -18010,6 +18010,7 @@ function _fetchData(connection, body, processFunc) {
1801018010
}
1801118011
}
1801218012
}
18013+
options.allowGzip = !!connection.allowGzip;
1801318014
if (connection.user != null && connection.password != null) {
1801418015
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
1801518016
logger$p.throwError("basic authentication requires a secure https url", Logger.errors.INVALID_ARGUMENT, { argument: "url", url: url, user: connection.user, password: "[REDACTED]" });
@@ -18849,6 +18850,12 @@ class Formatter {
1884918850
});
1885018851
}
1885118852
}
18853+
function isCommunityResourcable(value) {
18854+
return (value && typeof (value.isCommunityResource) === "function");
18855+
}
18856+
function isCommunityResource(value) {
18857+
return (isCommunityResourcable(value) && value.isCommunityResource());
18858+
}
1885218859
// Show the throttle message only once
1885318860
let throttleMessage = false;
1885418861
function showThrottleMessage() {
@@ -21016,6 +21023,9 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
2101621023
_startPending() {
2101721024
logger$u.warn("WARNING: API provider does not support pending filters");
2101821025
}
21026+
isCommunityResource() {
21027+
return false;
21028+
}
2101921029
getSigner(address) {
2102021030
return logger$u.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
2102121031
}
@@ -21043,12 +21053,21 @@ const logger$v = new Logger(version$m);
2104321053
// production environments, that you acquire your own API key at:
2104421054
// https://dashboard.alchemyapi.io
2104521055
const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
21046-
class AlchemyProvider extends UrlJsonRpcProvider {
21047-
static getWebSocketProvider(network, apiKey) {
21056+
class AlchemyWebSocketProvider extends WebSocketProvider {
21057+
constructor(network, apiKey) {
2104821058
const provider = new AlchemyProvider(network, apiKey);
2104921059
const url = provider.connection.url.replace(/^http/i, "ws")
2105021060
.replace(".alchemyapi.", ".ws.alchemyapi.");
21051-
return new WebSocketProvider(url, provider.network);
21061+
super(url, provider.network);
21062+
defineReadOnly(this, "apiKey", provider.apiKey);
21063+
}
21064+
isCommunityResource() {
21065+
return (this.apiKey === defaultApiKey);
21066+
}
21067+
}
21068+
class AlchemyProvider extends UrlJsonRpcProvider {
21069+
static getWebSocketProvider(network, apiKey) {
21070+
return new AlchemyWebSocketProvider(network, apiKey);
2105221071
}
2105321072
static getApiKey(apiKey) {
2105421073
if (apiKey == null) {
@@ -21081,6 +21100,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
2108121100
logger$v.throwArgumentError("unsupported network", "network", arguments[0]);
2108221101
}
2108321102
return {
21103+
allowGzip: true,
2108421104
url: ("https:/" + "/" + host + apiKey),
2108521105
throttleCallback: (attempt, url) => {
2108621106
if (apiKey === defaultApiKey) {
@@ -21090,6 +21110,9 @@ class AlchemyProvider extends UrlJsonRpcProvider {
2109021110
}
2109121111
};
2109221112
}
21113+
isCommunityResource() {
21114+
return (this.apiKey === defaultApiKey);
21115+
}
2109321116
}
2109421117

2109521118
"use strict";
@@ -21312,7 +21335,7 @@ class EtherscanProvider extends BaseProvider {
2131221335
url: url,
2131321336
throttleSlotInterval: 1000,
2131421337
throttleCallback: (attempt, url) => {
21315-
if (this.apiKey === defaultApiKey$1) {
21338+
if (this.isCommunityResource()) {
2131621339
showThrottleMessage();
2131721340
}
2131821341
return Promise.resolve(true);
@@ -21528,6 +21551,9 @@ class EtherscanProvider extends BaseProvider {
2152821551
});
2152921552
});
2153021553
}
21554+
isCommunityResource() {
21555+
return (this.apiKey === defaultApiKey$1);
21556+
}
2153121557
}
2153221558

2153321559
"use strict";
@@ -21877,14 +21903,16 @@ class FallbackProvider extends BaseProvider {
2187721903
}
2187821904
const providerConfigs = providers.map((configOrProvider, index) => {
2187921905
if (Provider.isProvider(configOrProvider)) {
21880-
return Object.freeze({ provider: configOrProvider, weight: 1, stallTimeout: 750, priority: 1 });
21906+
const stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;
21907+
const priority = 1;
21908+
return Object.freeze({ provider: configOrProvider, weight: 1, stallTimeout, priority });
2188121909
}
2188221910
const config = shallowCopy(configOrProvider);
2188321911
if (config.priority == null) {
2188421912
config.priority = 1;
2188521913
}
2188621914
if (config.stallTimeout == null) {
21887-
config.stallTimeout = 750;
21915+
config.stallTimeout = isCommunityResource(configOrProvider) ? 2000 : 750;
2188821916
}
2188921917
if (config.weight == null) {
2189021918
config.weight = 1;
@@ -22111,8 +22139,8 @@ var browserIpcProvider = {
2211122139
"use strict";
2211222140
const logger$z = new Logger(version$m);
2211322141
const defaultProjectId = "84842078b09946638c03157f83405213";
22114-
class InfuraProvider extends UrlJsonRpcProvider {
22115-
static getWebSocketProvider(network, apiKey) {
22142+
class InfuraWebSocketProvider extends WebSocketProvider {
22143+
constructor(network, apiKey) {
2211622144
const provider = new InfuraProvider(network, apiKey);
2211722145
const connection = provider.connection;
2211822146
if (connection.password) {
@@ -22121,7 +22149,18 @@ class InfuraProvider extends UrlJsonRpcProvider {
2212122149
});
2212222150
}
2212322151
const url = connection.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/");
22124-
return new WebSocketProvider(url, network);
22152+
super(url, network);
22153+
defineReadOnly(this, "apiKey", provider.projectId);
22154+
defineReadOnly(this, "projectId", provider.projectId);
22155+
defineReadOnly(this, "projectSecret", provider.projectSecret);
22156+
}
22157+
isCommunityResource() {
22158+
return (this.projectId === defaultProjectId);
22159+
}
22160+
}
22161+
class InfuraProvider extends UrlJsonRpcProvider {
22162+
static getWebSocketProvider(network, apiKey) {
22163+
return new InfuraWebSocketProvider(network, apiKey);
2212522164
}
2212622165
static getApiKey(apiKey) {
2212722166
const apiKeyObj = {
@@ -22172,6 +22211,7 @@ class InfuraProvider extends UrlJsonRpcProvider {
2217222211
});
2217322212
}
2217422213
const connection = {
22214+
allowGzip: true,
2217522215
url: ("https:/" + "/" + host + "/v3/" + apiKey.projectId),
2217622216
throttleCallback: (attempt, url) => {
2217722217
if (apiKey.projectId === defaultProjectId) {
@@ -22186,6 +22226,9 @@ class InfuraProvider extends UrlJsonRpcProvider {
2218622226
}
2218722227
return connection;
2218822228
}
22229+
isCommunityResource() {
22230+
return (this.projectId === defaultProjectId);
22231+
}
2218922232
}
2219022233

2219122234
/* istanbul ignore file */
@@ -22371,9 +22414,11 @@ var index$2 = /*#__PURE__*/Object.freeze({
2237122414
UrlJsonRpcProvider: UrlJsonRpcProvider,
2237222415
FallbackProvider: FallbackProvider,
2237322416
AlchemyProvider: AlchemyProvider,
22417+
AlchemyWebSocketProvider: AlchemyWebSocketProvider,
2237422418
CloudflareProvider: CloudflareProvider,
2237522419
EtherscanProvider: EtherscanProvider,
2237622420
InfuraProvider: InfuraProvider,
22421+
InfuraWebSocketProvider: InfuraWebSocketProvider,
2237722422
JsonRpcProvider: JsonRpcProvider,
2237822423
NodesmithProvider: NodesmithProvider,
2237922424
StaticJsonRpcProvider: StaticJsonRpcProvider,
@@ -22383,6 +22428,9 @@ var index$2 = /*#__PURE__*/Object.freeze({
2238322428
JsonRpcSigner: JsonRpcSigner,
2238422429
getDefaultProvider: getDefaultProvider,
2238522430
getNetwork: getNetwork,
22431+
isCommunityResource: isCommunityResource,
22432+
isCommunityResourcable: isCommunityResourcable,
22433+
showThrottleMessage: showThrottleMessage,
2238622434
Formatter: Formatter
2238722435
});
2238822436

@@ -22469,7 +22517,7 @@ function sha256$1(types, values) {
2246922517
return browser_3(pack$1(types, values));
2247022518
}
2247122519

22472-
const version$n = "units/5.0.5";
22520+
const version$n = "units/5.0.6";
2247322521

2247422522
"use strict";
2247522523
const logger$D = new Logger(version$n);
@@ -22534,6 +22582,9 @@ function formatUnits(value, unitName) {
2253422582
return formatFixed(value, (unitName != null) ? unitName : 18);
2253522583
}
2253622584
function parseUnits(value, unitName) {
22585+
if (typeof (value) !== "string") {
22586+
logger$D.throwArgumentError("value must be a string", "value", value);
22587+
}
2253722588
if (typeof (unitName) === "string") {
2253822589
const index = names.indexOf(unitName);
2253922590
if (index !== -1) {

packages/ethers/dist/ethers.esm.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)