Skip to content

Commit

Permalink
Updated dist files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 2, 2021
1 parent 27a981c commit fd0cf2c
Show file tree
Hide file tree
Showing 40 changed files with 425 additions and 122 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Changelog

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

ethers/v5.0.28 (2021-02-02 17:12)
---------------------------------

- Added load balancer support to PocketProvider. ([#1052](https://github.com/ethers-io/ethers.js/issues/1052); [27a981c](https://github.com/ethers-io/ethers.js/commit/27a981c84b578feb762fdb37dd5325d9c335bd59))

ethers/v5.0.27 (2021-02-01 15:55)
---------------------------------

Expand Down Expand Up @@ -219,4 +224,4 @@ ethers/v5.0.0 (2020-06-12 19:58)
--------------------------------

- Preserve config canary string. ([7157816](https://github.com/ethers-io/ethers.js/commit/7157816fa53f660d750811b293e3b1d5a2f70bd4))
- Updated docs. ([9e4c7e6](https://github.com/ethers-io/ethers.js/commit/9e4c7e609d9eeb5f2a11d6a90bfa9d32ee696431))
- Updated docs. ([9e4c7e6](https://github.com/ethers-io/ethers.js/commit/9e4c7e609d9eeb5f2a11d6a90bfa9d32ee696431))
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 65 additions & 11 deletions packages/ethers/dist/ethers.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -17630,7 +17630,7 @@ var bech32 = {
fromWords: fromWords
};

const version$m = "providers/5.0.20";
const version$m = "providers/5.0.21";

"use strict";
const logger$s = new Logger(version$m);
Expand Down Expand Up @@ -21499,16 +21499,50 @@ class NodesmithProvider extends UrlJsonRpcProvider {

"use strict";
const logger$D = new Logger(version$m);
const defaultApplicationId = "5f7f8547b90218002e9ce9dd";
// These are load-balancer-based applicatoin IDs
const defaultApplicationIds = {
homestead: "6004bcd10040261633ade990",
ropsten: "6004bd4d0040261633ade991",
rinkeby: "6004bda20040261633ade994",
goerli: "6004bd860040261633ade992",
};
class PocketProvider extends UrlJsonRpcProvider {
constructor(network, apiKey) {
// We need a bit of creativity in the constructor because
// Pocket uses different default API keys based on the network
if (apiKey == null) {
const n = getStatic((new.target), "getNetwork")(network);
if (n) {
const applicationId = defaultApplicationIds[n.name];
if (applicationId) {
apiKey = {
applicationId: applicationId,
loadBalancer: true
};
}
}
// If there was any issue above, we don't know this network
if (apiKey == null) {
logger$D.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
argument: "network",
value: network
});
}
}
super(network, apiKey);
}
static getApiKey(apiKey) {
// Most API Providers allow null to get the default configuration, but
// Pocket requires the network to decide the default provider, so we
// rely on hijacking the constructor to add a sensible default for us
if (apiKey == null) {
logger$D.throwArgumentError("PocketProvider.getApiKey does not support null apiKey", "apiKey", apiKey);
}
const apiKeyObj = {
applicationId: defaultApplicationId,
applicationId: null,
loadBalancer: false,
applicationSecretKey: null
};
if (apiKey == null) {
return apiKeyObj;
}
// Parse applicationId and applicationSecretKey
if (typeof (apiKey) === "string") {
apiKeyObj.applicationId = apiKey;
Expand All @@ -21518,9 +21552,15 @@ class PocketProvider extends UrlJsonRpcProvider {
logger$D.assertArgument((typeof (apiKey.applicationSecretKey) === "string"), "invalid applicationSecretKey", "applicationSecretKey", "[REDACTED]");
apiKeyObj.applicationId = apiKey.applicationId;
apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey;
apiKeyObj.loadBalancer = !!apiKey.loadBalancer;
}
else if (apiKey.applicationId) {
logger$D.assertArgument((typeof (apiKey.applicationId) === "string"), "apiKey.applicationId must be a string", "apiKey.applicationId", apiKey.applicationId);
apiKeyObj.applicationId = apiKey.applicationId;
apiKeyObj.loadBalancer = !!apiKey.loadBalancer;
}
else {
logger$D.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
}
return apiKeyObj;
}
Expand All @@ -21530,15 +21570,29 @@ class PocketProvider extends UrlJsonRpcProvider {
case "homestead":
host = "eth-mainnet.gateway.pokt.network";
break;
case "ropsten":
host = "eth-ropsten.gateway.pokt.network";
break;
case "rinkeby":
host = "eth-rinkeby.gateway.pokt.network";
break;
case "goerli":
host = "eth-goerli.gateway.pokt.network";
break;
default:
logger$D.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
argument: "network",
value: network
});
}
const connection = {
url: (`https:/\/${host}/v1/${apiKey.applicationId}`),
};
let url = null;
if (apiKey.loadBalancer) {
url = `https:/\/${host}/v1/lb/${apiKey.applicationId}`;
}
else {
url = `https:/\/${host}/v1/${apiKey.applicationId}`;
}
const connection = { url };
// Initialize empty headers
connection.headers = {};
// Apply application secret key
Expand All @@ -21549,7 +21603,7 @@ class PocketProvider extends UrlJsonRpcProvider {
return connection;
}
isCommunityResource() {
return (this.applicationId === defaultApplicationId);
return (this.applicationId === defaultApplicationIds[this.network.name]);
}
}

Expand Down Expand Up @@ -21986,7 +22040,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed
});

const version$o = "ethers/5.0.27";
const version$o = "ethers/5.0.28";

"use strict";
const logger$H = new Logger(version$o);
Expand Down
2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.esm.min.js.map

Large diffs are not rendered by default.

81 changes: 68 additions & 13 deletions packages/ethers/dist/ethers.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -19701,7 +19701,7 @@
var _version$I = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.20";
exports.version = "providers/5.0.21";

});

Expand Down Expand Up @@ -24752,22 +24752,57 @@
Object.defineProperty(exports, "__esModule", { value: true });



var logger = new lib.Logger(_version$I.version);

var defaultApplicationId = "5f7f8547b90218002e9ce9dd";
// These are load-balancer-based applicatoin IDs
var defaultApplicationIds = {
homestead: "6004bcd10040261633ade990",
ropsten: "6004bd4d0040261633ade991",
rinkeby: "6004bda20040261633ade994",
goerli: "6004bd860040261633ade992",
};
var PocketProvider = /** @class */ (function (_super) {
__extends(PocketProvider, _super);
function PocketProvider() {
return _super !== null && _super.apply(this, arguments) || this;
function PocketProvider(network, apiKey) {
// We need a bit of creativity in the constructor because
// Pocket uses different default API keys based on the network
var _newTarget = this.constructor;
var _this = this;
if (apiKey == null) {
var n = lib$3.getStatic((_newTarget), "getNetwork")(network);
if (n) {
var applicationId = defaultApplicationIds[n.name];
if (applicationId) {
apiKey = {
applicationId: applicationId,
loadBalancer: true
};
}
}
// If there was any issue above, we don't know this network
if (apiKey == null) {
logger.throwError("unsupported network", lib.Logger.errors.INVALID_ARGUMENT, {
argument: "network",
value: network
});
}
}
_this = _super.call(this, network, apiKey) || this;
return _this;
}
PocketProvider.getApiKey = function (apiKey) {
// Most API Providers allow null to get the default configuration, but
// Pocket requires the network to decide the default provider, so we
// rely on hijacking the constructor to add a sensible default for us
if (apiKey == null) {
logger.throwArgumentError("PocketProvider.getApiKey does not support null apiKey", "apiKey", apiKey);
}
var apiKeyObj = {
applicationId: defaultApplicationId,
applicationId: null,
loadBalancer: false,
applicationSecretKey: null
};
if (apiKey == null) {
return apiKeyObj;
}
// Parse applicationId and applicationSecretKey
if (typeof (apiKey) === "string") {
apiKeyObj.applicationId = apiKey;
Expand All @@ -24777,9 +24812,15 @@
logger.assertArgument((typeof (apiKey.applicationSecretKey) === "string"), "invalid applicationSecretKey", "applicationSecretKey", "[REDACTED]");
apiKeyObj.applicationId = apiKey.applicationId;
apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey;
apiKeyObj.loadBalancer = !!apiKey.loadBalancer;
}
else if (apiKey.applicationId) {
logger.assertArgument((typeof (apiKey.applicationId) === "string"), "apiKey.applicationId must be a string", "apiKey.applicationId", apiKey.applicationId);
apiKeyObj.applicationId = apiKey.applicationId;
apiKeyObj.loadBalancer = !!apiKey.loadBalancer;
}
else {
logger.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
}
return apiKeyObj;
};
Expand All @@ -24789,15 +24830,29 @@
case "homestead":
host = "eth-mainnet.gateway.pokt.network";
break;
case "ropsten":
host = "eth-ropsten.gateway.pokt.network";
break;
case "rinkeby":
host = "eth-rinkeby.gateway.pokt.network";
break;
case "goerli":
host = "eth-goerli.gateway.pokt.network";
break;
default:
logger.throwError("unsupported network", lib.Logger.errors.INVALID_ARGUMENT, {
argument: "network",
value: network
});
}
var connection = {
url: ("https://" + host + "/v1/" + apiKey.applicationId),
};
var url = null;
if (apiKey.loadBalancer) {
url = "https://" + host + "/v1/lb/" + apiKey.applicationId;
}
else {
url = "https://" + host + "/v1/" + apiKey.applicationId;
}
var connection = { url: url };
// Initialize empty headers
connection.headers = {};
// Apply application secret key
Expand All @@ -24808,7 +24863,7 @@
return connection;
};
PocketProvider.prototype.isCommunityResource = function () {
return (this.applicationId === defaultApplicationId);
return (this.applicationId === defaultApplicationIds[this.network.name]);
};
return PocketProvider;
}(urlJsonRpcProvider.UrlJsonRpcProvider));
Expand Down Expand Up @@ -25372,7 +25427,7 @@
var _version$M = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.27";
exports.version = "ethers/5.0.28";

});

Expand Down
2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/lib.esm/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const version = "ethers/5.0.27";
export declare const version = "ethers/5.0.28";
//# sourceMappingURL=_version.d.ts.map
2 changes: 1 addition & 1 deletion packages/ethers/lib.esm/_version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ethers/lib/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const version = "ethers/5.0.27";
export declare const version = "ethers/5.0.28";
//# sourceMappingURL=_version.d.ts.map
2 changes: 1 addition & 1 deletion packages/ethers/lib/_version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@ethersproject/networks": "5.0.8",
"@ethersproject/pbkdf2": "5.0.8",
"@ethersproject/properties": "5.0.8",
"@ethersproject/providers": "5.0.20",
"@ethersproject/providers": "5.0.21",
"@ethersproject/random": "5.0.8",
"@ethersproject/rlp": "5.0.8",
"@ethersproject/sha2": "5.0.8",
Expand Down Expand Up @@ -62,7 +62,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"sideEffects": false,
"tarballHash": "0x748356d89d024565baac6e8e91dbe39bc891908a80af06fc4fde2b1f8110dd8b",
"tarballHash": "0x800ebdb17ed136a1d3b7dffccfcac8b636c5aa7fe25daf97314b24a7346c9961",
"types": "./lib/index.d.ts",
"version": "5.0.27"
"version": "5.0.28"
}
2 changes: 1 addition & 1 deletion packages/ethers/src.ts/_version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "ethers/5.0.27";
export const version = "ethers/5.0.28";
2 changes: 1 addition & 1 deletion packages/providers/lib.esm/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const version = "providers/5.0.20";
export declare const version = "providers/5.0.21";
//# sourceMappingURL=_version.d.ts.map
2 changes: 1 addition & 1 deletion packages/providers/lib.esm/_version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fd0cf2c

Please # to comment.