Updated dist files.
This commit is contained in:
parent
8e7751f7df
commit
47e4655f6b
12
CHANGELOG.md
12
CHANGELOG.md
@ -3,13 +3,19 @@ Changelog
|
||||
|
||||
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
|
||||
|
||||
ethers/v5.0.0-beta.183 (2020-04-18 05:14)
|
||||
ethers/v5.0.0-beta.183 (2020-04-23 23:28)
|
||||
-----------------------------------------
|
||||
|
||||
- Fixed inconsistent log format in WebSocketProvider. ([#795](https://github.com/ethers-io/ethers.js/issues/795); [8e7751f](https://github.com/ethers-io/ethers.js/commit/8e7751f7dfb41e58f81c7918cf36c152c3209ae2))
|
||||
- Added WebSocketProvider support for ENS names in filters. ([6707754](https://github.com/ethers-io/ethers.js/commit/6707754580490c5a801d6205af0841794d20b3c9))
|
||||
- Fixed provider filtering by ENS name. ([aeeb75f](https://github.com/ethers-io/ethers.js/commit/aeeb75f74c3be11b9b3b2925fd73349070542e54))
|
||||
- Fixed ContractFactory.deploy ignoring overrides. ([#796](https://github.com/ethers-io/ethers.js/issues/796); [8bb2a0f](https://github.com/ethers-io/ethers.js/commit/8bb2a0fd08f6f128a80444e3fd90c29e4cd7edfb))
|
||||
- Fix median calculation for large block number deltas across FallbackProvider backends. ([fca5ccb](https://github.com/ethers-io/ethers.js/commit/fca5ccbc2052569e700a96dbb1de1c9cef7c966f))
|
||||
- Work-around for Cloudflare not offering eth_blockNumber. ([8cf4b3c](https://github.com/ethers-io/ethers.js/commit/8cf4b3cf4598f4f3643d5ebe9c366466d398cb83))
|
||||
- Added string spell-checking to library and fixed discovered typos. ([71d03c6](https://github.com/ethers-io/ethers.js/commit/71d03c6e3cab1aacb3e4e74d3966fbaa7db2ee06))
|
||||
- Fixed getUrl for node 8. ([560adea](https://github.com/ethers-io/ethers.js/commit/560adeabb06a2ab483bcad162f02ccef41ebc245))
|
||||
- Dependency security updates. ([da3b0bf](https://github.com/ethers-io/ethers.js/commit/da3b0bf0786fe8a95c68485d130ca59c597ffe4d))
|
||||
- Fixes for dist builds without injected XMLHttpRequest. ([#789](https://github.com/ethers-io/ethers.js/issues/789), [#506](https://github.com/ethers-io/ethers.js/issues/506); [9ae6b70](https://github.com/ethers-io/ethers.js/commit/9ae6b70efb9f3d3251820403597085cfa30ace05))
|
||||
- Added documentation. ([723249d](https://github.com/ethers-io/ethers.js/commit/723249d36c082894d98e12281085c70f4b4e0fe9))
|
||||
- Added npmignore for asm package. ([5b51549](https://github.com/ethers-io/ethers.js/commit/5b51549437125603793c3c0c4aca5794b8335690))
|
||||
|
||||
ethers/v5.0.0-beta.182 (2020-04-16 21:53)
|
||||
-----------------------------------------
|
||||
|
2
packages/abi/lib.esm/_version.d.ts
vendored
2
packages/abi/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "abi/5.0.0-beta.150";
|
||||
export declare const version = "abi/5.0.0-beta.151";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "abi/5.0.0-beta.150";
|
||||
export const version = "abi/5.0.0-beta.151";
|
||||
|
@ -459,7 +459,7 @@ function parseGas(value, params) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
|
||||
logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
@ -758,7 +758,7 @@ function splitNesting(value) {
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger.throwArgumentError("unbalanced parenthsis", "value", value);
|
||||
logger.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ export class Interface {
|
||||
format = FormatTypes.full;
|
||||
}
|
||||
if (format === FormatTypes.sighash) {
|
||||
logger.throwArgumentError("interface does not support formating sighash", "format", format);
|
||||
logger.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
const abi = this.fragments.map((fragment) => fragment.format(format));
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
|
2
packages/abi/lib/_version.d.ts
vendored
2
packages/abi/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "abi/5.0.0-beta.150";
|
||||
export declare const version = "abi/5.0.0-beta.151";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abi/5.0.0-beta.150";
|
||||
exports.version = "abi/5.0.0-beta.151";
|
||||
|
@ -483,7 +483,7 @@ function parseGas(value, params) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
|
||||
logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = bignumber_1.BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
@ -794,7 +794,7 @@ function splitNesting(value) {
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger.throwArgumentError("unbalanced parenthsis", "value", value);
|
||||
logger.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ var Interface = /** @class */ (function () {
|
||||
format = fragments_1.FormatTypes.full;
|
||||
}
|
||||
if (format === fragments_1.FormatTypes.sighash) {
|
||||
logger.throwArgumentError("interface does not support formating sighash", "format", format);
|
||||
logger.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
var abi = this.fragments.map(function (fragment) { return fragment.format(format); });
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
|
@ -31,7 +31,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x2e1c980d6089115e1936adc403a60c3131ad61225c3b11b8b9aacd41ca9c5db0",
|
||||
"tarballHash": "0x27055562994473b2784573277c107df883bc39663b9687488642478f49631d43",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.150"
|
||||
"version": "5.0.0-beta.151"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "abi/5.0.0-beta.150";
|
||||
export const version = "abi/5.0.0-beta.151";
|
||||
|
@ -169,7 +169,7 @@ export class Node {
|
||||
};
|
||||
const factory = Factories[options.type];
|
||||
if (!factory) {
|
||||
throwError("uknown type: " + options.type, options.loc);
|
||||
throwError("unknown type: " + options.type, options.loc);
|
||||
}
|
||||
return factory.from(options);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ var Node = /** @class */ (function () {
|
||||
};
|
||||
var factory = Factories[options.type];
|
||||
if (!factory) {
|
||||
throwError("uknown type: " + options.type, options.loc);
|
||||
throwError("unknown type: " + options.type, options.loc);
|
||||
}
|
||||
return factory.from(options);
|
||||
};
|
||||
|
@ -29,7 +29,7 @@
|
||||
"generate": "node ./generate.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x425d94635e3b460a866975fe310e38baf32bba93eaf7979b96c31e97f5a2a758",
|
||||
"tarballHash": "0x6943c3fd06b50971ff04aa2838ec0b7c8ae2c39c591ca8b2d1bcad4a0e8028f0",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.159"
|
||||
}
|
||||
|
2
packages/bignumber/lib.esm/_version.d.ts
vendored
2
packages/bignumber/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "bignumber/5.0.0-beta.137";
|
||||
export declare const version = "bignumber/5.0.0-beta.138";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "bignumber/5.0.0-beta.137";
|
||||
export const version = "bignumber/5.0.0-beta.138";
|
||||
|
@ -25,7 +25,7 @@ export class BigNumber {
|
||||
constructor(constructorGuard, hex) {
|
||||
logger.checkNew(new.target, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call consturtor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
logger.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ export class FixedNumber {
|
||||
decimals = 0;
|
||||
}
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal cound", "decimals", decimals);
|
||||
logger.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
let comps = this.toString().split(".");
|
||||
|
2
packages/bignumber/lib/_version.d.ts
vendored
2
packages/bignumber/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "bignumber/5.0.0-beta.137";
|
||||
export declare const version = "bignumber/5.0.0-beta.138";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "bignumber/5.0.0-beta.137";
|
||||
exports.version = "bignumber/5.0.0-beta.138";
|
||||
|
@ -28,7 +28,7 @@ var BigNumber = /** @class */ (function () {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call consturtor directly; use BigNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
logger.throwError("cannot call constructor directly; use BigNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ var FixedNumber = /** @class */ (function () {
|
||||
decimals = 0;
|
||||
}
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal cound", "decimals", decimals);
|
||||
logger.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
var comps = this.toString().split(".");
|
||||
|
@ -27,7 +27,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x7e4030fc7f7653023c094089c662dace0b3215880d407e06c5af0fc20dd4af4b",
|
||||
"tarballHash": "0x575623bd8eac66dd5099c809554c0e994db05434f834040bc84c08a2b2d98a31",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.137"
|
||||
"version": "5.0.0-beta.138"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "bignumber/5.0.0-beta.137";
|
||||
export const version = "bignumber/5.0.0-beta.138";
|
||||
|
2
packages/cli/lib.esm/_version.d.ts
vendored
2
packages/cli/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "cli/5.0.0-beta.153";
|
||||
export declare const version = "cli/5.0.0-beta.154";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "cli/5.0.0-beta.153";
|
||||
export const version = "cli/5.0.0-beta.154";
|
||||
|
@ -228,7 +228,7 @@ class LookupPlugin extends EnsPlugin {
|
||||
cli.addPlugin("lookup", LookupPlugin);
|
||||
class AccountPlugin extends EnsPlugin {
|
||||
static getHelp() {
|
||||
return logger.throwError("subclasses must implemetn this", ethers.errors.UNSUPPORTED_OPERATION, {
|
||||
return logger.throwError("subclasses must implement this", ethers.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "getHelp"
|
||||
});
|
||||
}
|
||||
@ -810,7 +810,7 @@ class ReclaimPlugin extends AddressAccountPlugin {
|
||||
ownerOf = yield registrar.ownerOf(ethers.utils.id(comps[0]));
|
||||
}
|
||||
catch (error) {
|
||||
this.throwError("Name not present in Permantent Registrar");
|
||||
this.throwError("Name not present in Permanent Registrar");
|
||||
}
|
||||
if (account !== ownerOf) {
|
||||
this.throwError("Only the registrant can call reclaim");
|
||||
|
@ -398,7 +398,7 @@ class SendPlugin extends Plugin {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield _super.prepareOptions.call(this, argParser);
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwUsageError("send requires exacly one account");
|
||||
this.throwUsageError("send requires exactly one account");
|
||||
}
|
||||
this.data = ethers.utils.hexlify(argParser.consumeOption("data") || "0x");
|
||||
this.allowZero = argParser.consumeFlag("allow-zero");
|
||||
@ -443,7 +443,7 @@ class SweepPlugin extends Plugin {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield _super.prepareOptions.call(this, argParser);
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwUsageError("sweep requires exacly one account");
|
||||
this.throwUsageError("sweep requires exactly one account");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -506,7 +506,7 @@ class SignMessagePlugin extends Plugin {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield _super.prepareOptions.call(this, argParser);
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwError("sign-message requires exacly one account");
|
||||
this.throwError("sign-message requires exactly one account");
|
||||
}
|
||||
this.hex = argParser.consumeFlag("hex");
|
||||
});
|
||||
@ -706,7 +706,7 @@ class UnwrapEtherPlugin extends Plugin {
|
||||
let address = yield this.accounts[0].getAddress();
|
||||
this.dump("Withdrawing Wrapped Ether", {
|
||||
"To": address,
|
||||
"Valiue": ethers.utils.formatEther(this.value)
|
||||
"Value": ethers.utils.formatEther(this.value)
|
||||
});
|
||||
let contract = new ethers.Contract(WethAddress, WethAbi, this.accounts[0]);
|
||||
yield contract.withdraw(this.value);
|
||||
|
@ -762,7 +762,7 @@ export class CLI {
|
||||
console.log(" --gasPrice GWEI Default gas price for transactions(in wei)");
|
||||
console.log(" --gasLimit GAS Default gas limit for transactions");
|
||||
console.log(" --nonce NONCE Initial nonce for the first transaction");
|
||||
console.log(" --yes Always accept Siging and Sending");
|
||||
console.log(" --yes Always accept Signing and Sending");
|
||||
console.log("");
|
||||
}
|
||||
console.log("OTHER OPTIONS");
|
||||
|
2
packages/cli/lib/_version.d.ts
vendored
2
packages/cli/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "cli/5.0.0-beta.153";
|
||||
export declare const version = "cli/5.0.0-beta.154";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "cli/5.0.0-beta.153";
|
||||
exports.version = "cli/5.0.0-beta.154";
|
||||
|
@ -386,7 +386,7 @@ var AccountPlugin = /** @class */ (function (_super) {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
AccountPlugin.getHelp = function () {
|
||||
return logger.throwError("subclasses must implemetn this", ethers_1.ethers.errors.UNSUPPORTED_OPERATION, {
|
||||
return logger.throwError("subclasses must implement this", ethers_1.ethers.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "getHelp"
|
||||
});
|
||||
};
|
||||
@ -1265,7 +1265,7 @@ var ReclaimPlugin = /** @class */ (function (_super) {
|
||||
return [3 /*break*/, 6];
|
||||
case 5:
|
||||
error_2 = _a.sent();
|
||||
this.throwError("Name not present in Permantent Registrar");
|
||||
this.throwError("Name not present in Permanent Registrar");
|
||||
return [3 /*break*/, 6];
|
||||
case 6:
|
||||
if (account !== ownerOf) {
|
||||
|
@ -546,7 +546,7 @@ var SendPlugin = /** @class */ (function (_super) {
|
||||
case 1:
|
||||
_a.sent();
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwUsageError("send requires exacly one account");
|
||||
this.throwUsageError("send requires exactly one account");
|
||||
}
|
||||
this.data = ethers_1.ethers.utils.hexlify(argParser.consumeOption("data") || "0x");
|
||||
this.allowZero = argParser.consumeFlag("allow-zero");
|
||||
@ -615,7 +615,7 @@ var SweepPlugin = /** @class */ (function (_super) {
|
||||
case 1:
|
||||
_a.sent();
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwUsageError("sweep requires exacly one account");
|
||||
this.throwUsageError("sweep requires exactly one account");
|
||||
}
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@ -705,7 +705,7 @@ var SignMessagePlugin = /** @class */ (function (_super) {
|
||||
case 1:
|
||||
_a.sent();
|
||||
if (this.accounts.length !== 1) {
|
||||
this.throwError("sign-message requires exacly one account");
|
||||
this.throwError("sign-message requires exactly one account");
|
||||
}
|
||||
this.hex = argParser.consumeFlag("hex");
|
||||
return [2 /*return*/];
|
||||
@ -1012,7 +1012,7 @@ var UnwrapEtherPlugin = /** @class */ (function (_super) {
|
||||
address = _a.sent();
|
||||
this.dump("Withdrawing Wrapped Ether", {
|
||||
"To": address,
|
||||
"Valiue": ethers_1.ethers.utils.formatEther(this.value)
|
||||
"Value": ethers_1.ethers.utils.formatEther(this.value)
|
||||
});
|
||||
contract = new ethers_1.ethers.Contract(WethAddress, WethAbi, this.accounts[0]);
|
||||
return [4 /*yield*/, contract.withdraw(this.value)];
|
||||
|
@ -972,7 +972,7 @@ var CLI = /** @class */ (function () {
|
||||
console.log(" --gasPrice GWEI Default gas price for transactions(in wei)");
|
||||
console.log(" --gasLimit GAS Default gas limit for transactions");
|
||||
console.log(" --nonce NONCE Initial nonce for the first transaction");
|
||||
console.log(" --yes Always accept Siging and Sending");
|
||||
console.log(" --yes Always accept Signing and Sending");
|
||||
console.log("");
|
||||
}
|
||||
console.log("OTHER OPTIONS");
|
||||
|
@ -41,7 +41,7 @@
|
||||
"scripts": {
|
||||
"test": "exit 1"
|
||||
},
|
||||
"tarballHash": "0xeb1226e0a588ca30e56985c8ad3258c6738a5816c36db571d331d7599d2635dc",
|
||||
"tarballHash": "0x2d6a8cc1828811b7930f6c664a444d0c1438783f2b94950398f228b998ad814d",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.153"
|
||||
"version": "5.0.0-beta.154"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "cli/5.0.0-beta.153";
|
||||
export const version = "cli/5.0.0-beta.154";
|
||||
|
2
packages/contracts/lib.esm/_version.d.ts
vendored
2
packages/contracts/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "contracts/5.0.0-beta.148";
|
||||
export declare const version = "contracts/5.0.0-beta.149";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "contracts/5.0.0-beta.148";
|
||||
export const version = "contracts/5.0.0-beta.149";
|
||||
|
@ -1,4 +1,13 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { Indexed, Interface } from "@ethersproject/abi";
|
||||
import { Provider } from "@ethersproject/abstract-provider";
|
||||
import { Signer, VoidSigner } from "@ethersproject/abstract-signer";
|
||||
@ -59,7 +68,7 @@ function runMethod(contract, functionName, options) {
|
||||
// Check for unexpected keys (e.g. using "gas" instead of "gasLimit")
|
||||
for (let key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
logger.throwError(("unknown transaxction override - " + key), "overrides", tx);
|
||||
logger.throwError(("unknown transaction override - " + key), "overrides", tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -713,7 +722,7 @@ export class ContractFactory {
|
||||
getDeployTransaction(...args) {
|
||||
let tx = {};
|
||||
// If we have 1 additional argument, we allow transaction overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
|
||||
tx = shallowCopy(args.pop());
|
||||
for (const key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
@ -738,16 +747,25 @@ export class ContractFactory {
|
||||
return tx;
|
||||
}
|
||||
deploy(...args) {
|
||||
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then((args) => {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let overrides = {};
|
||||
// If 1 extra parameter was passed in, it contains overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
overrides = args.pop();
|
||||
}
|
||||
// Make sure the call matches the constructor signature
|
||||
logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
||||
// Resolve ENS names and promises in the arguments
|
||||
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
||||
params.push(overrides);
|
||||
// Get the deployment transaction (with optional overrides)
|
||||
const tx = this.getDeployTransaction(...args);
|
||||
const unsignedTx = this.getDeployTransaction(...params);
|
||||
// Send the deployment transaction
|
||||
return this.signer.sendTransaction(tx).then((tx) => {
|
||||
const address = (this.constructor).getContractAddress(tx);
|
||||
const contract = (this.constructor).getContract(address, this.interface, this.signer);
|
||||
defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
});
|
||||
const tx = yield this.signer.sendTransaction(unsignedTx);
|
||||
const address = getStatic(this.constructor, "getContractAddress")(tx);
|
||||
const contract = getStatic(this.constructor, "getContract")(address, this.interface, this.signer);
|
||||
defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
});
|
||||
}
|
||||
attach(address) {
|
||||
|
2
packages/contracts/lib/_version.d.ts
vendored
2
packages/contracts/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "contracts/5.0.0-beta.148";
|
||||
export declare const version = "contracts/5.0.0-beta.149";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "contracts/5.0.0-beta.148";
|
||||
exports.version = "contracts/5.0.0-beta.149";
|
||||
|
@ -12,6 +12,42 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
@ -85,7 +121,7 @@ function runMethod(contract, functionName, options) {
|
||||
// Check for unexpected keys (e.g. using "gas" instead of "gasLimit")
|
||||
for (var key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
logger.throwError(("unknown transaxction override - " + key), "overrides", tx);
|
||||
logger.throwError(("unknown transaction override - " + key), "overrides", tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -774,7 +810,7 @@ var ContractFactory = /** @class */ (function () {
|
||||
}
|
||||
var tx = {};
|
||||
// If we have 1 additional argument, we allow transaction overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
|
||||
tx = properties_1.shallowCopy(args.pop());
|
||||
for (var key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
@ -799,20 +835,35 @@ var ContractFactory = /** @class */ (function () {
|
||||
return tx;
|
||||
};
|
||||
ContractFactory.prototype.deploy = function () {
|
||||
var _this = this;
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then(function (args) {
|
||||
// Get the deployment transaction (with optional overrides)
|
||||
var tx = _this.getDeployTransaction.apply(_this, args);
|
||||
// Send the deployment transaction
|
||||
return _this.signer.sendTransaction(tx).then(function (tx) {
|
||||
var address = (_this.constructor).getContractAddress(tx);
|
||||
var contract = (_this.constructor).getContract(address, _this.interface, _this.signer);
|
||||
properties_1.defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var overrides, params, unsignedTx, tx, address, contract;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
overrides = {};
|
||||
// If 1 extra parameter was passed in, it contains overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
overrides = args.pop();
|
||||
}
|
||||
// Make sure the call matches the constructor signature
|
||||
logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
||||
return [4 /*yield*/, resolveAddresses(this.signer, args, this.interface.deploy.inputs)];
|
||||
case 1:
|
||||
params = _a.sent();
|
||||
params.push(overrides);
|
||||
unsignedTx = this.getDeployTransaction.apply(this, params);
|
||||
return [4 /*yield*/, this.signer.sendTransaction(unsignedTx)];
|
||||
case 2:
|
||||
tx = _a.sent();
|
||||
address = properties_1.getStatic(this.constructor, "getContractAddress")(tx);
|
||||
contract = properties_1.getStatic(this.constructor, "getContract")(address, this.interface, this.signer);
|
||||
properties_1.defineReadOnly(contract, "deployTransaction", tx);
|
||||
return [2 /*return*/, contract];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -32,7 +32,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x4ff43d361fce2dcebd688d0f068197f8c95444c5a790620dd453119436c5db15",
|
||||
"tarballHash": "0x0831bbcb34338804b94a0f9a4d177f00308651b2e40e6648e8d6678299c2f0eb",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.148"
|
||||
"version": "5.0.0-beta.149"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "contracts/5.0.0-beta.148";
|
||||
export const version = "contracts/5.0.0-beta.149";
|
||||
|
2
packages/errors/lib.esm/_version.d.ts
vendored
2
packages/errors/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "errors/5.0.0-beta.132";
|
||||
export declare const version = "errors/5.0.0-beta.133";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "errors/5.0.0-beta.132";
|
||||
export const version = "errors/5.0.0-beta.133";
|
||||
|
@ -226,7 +226,7 @@ let LogLevel = LogLevels["default"];
|
||||
export function setLogLevel(logLevel) {
|
||||
let level = LogLevels[logLevel];
|
||||
if (level == null) {
|
||||
warn("invliad log level - " + logLevel);
|
||||
warn("invalid log level - " + logLevel);
|
||||
return;
|
||||
}
|
||||
LogLevel = level;
|
||||
|
2
packages/errors/lib/_version.d.ts
vendored
2
packages/errors/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "errors/5.0.0-beta.132";
|
||||
export declare const version = "errors/5.0.0-beta.133";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "errors/5.0.0-beta.132";
|
||||
exports.version = "errors/5.0.0-beta.133";
|
||||
|
@ -236,7 +236,7 @@ var LogLevel = LogLevels["default"];
|
||||
function setLogLevel(logLevel) {
|
||||
var level = LogLevels[logLevel];
|
||||
if (level == null) {
|
||||
warn("invliad log level - " + logLevel);
|
||||
warn("invalid log level - " + logLevel);
|
||||
return;
|
||||
}
|
||||
LogLevel = level;
|
||||
|
@ -20,7 +20,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x28c97ff0e0dc05d3b94a1d22bf6c64f9c44eec9120e325307ee09f183fe9e18f",
|
||||
"tarballHash": "0x5d8d44b46c0a1d43809d6971588884b42218878e6930e1e70a4266331236e9de",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.132"
|
||||
"version": "5.0.0-beta.133"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "errors/5.0.0-beta.132";
|
||||
export const version = "errors/5.0.0-beta.133";
|
||||
|
4
packages/ethers/dist/ethers-all.esm.min.js
vendored
4
packages/ethers/dist/ethers-all.esm.min.js
vendored
File diff suppressed because one or more lines are too long
4
packages/ethers/dist/ethers-all.umd.min.js
vendored
4
packages/ethers/dist/ethers-all.umd.min.js
vendored
File diff suppressed because one or more lines are too long
214
packages/ethers/dist/ethers.esm.js
vendored
214
packages/ethers/dist/ethers.esm.js
vendored
@ -4135,7 +4135,7 @@ var lib_esm$1 = /*#__PURE__*/Object.freeze({
|
||||
joinSignature: joinSignature
|
||||
});
|
||||
|
||||
const version$2 = "bignumber/5.0.0-beta.137";
|
||||
const version$2 = "bignumber/5.0.0-beta.138";
|
||||
|
||||
"use strict";
|
||||
const logger$1 = new Logger(version$2);
|
||||
@ -4153,7 +4153,7 @@ class BigNumber {
|
||||
constructor(constructorGuard, hex) {
|
||||
logger$1.checkNew(new.target, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger$1.throwError("cannot call consturtor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
logger$1.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
@ -4581,7 +4581,7 @@ class FixedNumber {
|
||||
decimals = 0;
|
||||
}
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger$2.throwArgumentError("invalid decimal cound", "decimals", decimals);
|
||||
logger$2.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
let comps = this.toString().split(".");
|
||||
@ -4795,7 +4795,7 @@ class Description {
|
||||
}
|
||||
}
|
||||
|
||||
const version$4 = "abi/5.0.0-beta.150";
|
||||
const version$4 = "abi/5.0.0-beta.151";
|
||||
|
||||
"use strict";
|
||||
const logger$4 = new Logger(version$4);
|
||||
@ -5254,7 +5254,7 @@ function parseGas(value, params) {
|
||||
logger$4.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger$4.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
|
||||
logger$4.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
@ -5553,7 +5553,7 @@ function splitNesting(value) {
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger$4.throwArgumentError("unbalanced parenthsis", "value", value);
|
||||
logger$4.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7388,7 +7388,7 @@ class Interface {
|
||||
format = FormatTypes.full;
|
||||
}
|
||||
if (format === FormatTypes.sighash) {
|
||||
logger$c.throwArgumentError("interface does not support formating sighash", "format", format);
|
||||
logger$c.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
const abi = this.fragments.map((fragment) => fragment.format(format));
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
@ -7969,9 +7969,18 @@ class VoidSigner extends Signer {
|
||||
}
|
||||
}
|
||||
|
||||
const version$b = "contracts/5.0.0-beta.148";
|
||||
const version$b = "contracts/5.0.0-beta.149";
|
||||
|
||||
"use strict";
|
||||
var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
const logger$f = new Logger(version$b);
|
||||
///////////////////////////////
|
||||
const allowedTransactionKeys$1 = {
|
||||
@ -8022,7 +8031,7 @@ function runMethod(contract, functionName, options) {
|
||||
// Check for unexpected keys (e.g. using "gas" instead of "gasLimit")
|
||||
for (let key in tx) {
|
||||
if (!allowedTransactionKeys$1[key]) {
|
||||
logger$f.throwError(("unknown transaxction override - " + key), "overrides", tx);
|
||||
logger$f.throwError(("unknown transaction override - " + key), "overrides", tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8676,7 +8685,7 @@ class ContractFactory {
|
||||
getDeployTransaction(...args) {
|
||||
let tx = {};
|
||||
// If we have 1 additional argument, we allow transaction overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
|
||||
tx = shallowCopy(args.pop());
|
||||
for (const key in tx) {
|
||||
if (!allowedTransactionKeys$1[key]) {
|
||||
@ -8701,16 +8710,25 @@ class ContractFactory {
|
||||
return tx;
|
||||
}
|
||||
deploy(...args) {
|
||||
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then((args) => {
|
||||
return __awaiter$1(this, void 0, void 0, function* () {
|
||||
let overrides = {};
|
||||
// If 1 extra parameter was passed in, it contains overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
overrides = args.pop();
|
||||
}
|
||||
// Make sure the call matches the constructor signature
|
||||
logger$f.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
||||
// Resolve ENS names and promises in the arguments
|
||||
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
||||
params.push(overrides);
|
||||
// Get the deployment transaction (with optional overrides)
|
||||
const tx = this.getDeployTransaction(...args);
|
||||
const unsignedTx = this.getDeployTransaction(...params);
|
||||
// Send the deployment transaction
|
||||
return this.signer.sendTransaction(tx).then((tx) => {
|
||||
const address = (this.constructor).getContractAddress(tx);
|
||||
const contract = (this.constructor).getContract(address, this.interface, this.signer);
|
||||
defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
});
|
||||
const tx = yield this.signer.sendTransaction(unsignedTx);
|
||||
const address = getStatic(this.constructor, "getContractAddress")(tx);
|
||||
const contract = getStatic(this.constructor, "getContract")(address, this.interface, this.signer);
|
||||
defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
});
|
||||
}
|
||||
attach(address) {
|
||||
@ -12567,7 +12585,7 @@ function computePublicKey(key, compressed) {
|
||||
return logger$g.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
||||
}
|
||||
|
||||
const version$e = "transactions/5.0.0-beta.134";
|
||||
const version$e = "transactions/5.0.0-beta.135";
|
||||
|
||||
"use strict";
|
||||
const logger$h = new Logger(version$e);
|
||||
@ -12673,7 +12691,7 @@ function serialize(transaction, signature) {
|
||||
function parse(rawTransaction) {
|
||||
const transaction = decode(rawTransaction);
|
||||
if (transaction.length !== 9 && transaction.length !== 6) {
|
||||
logger$h.throwArgumentError("invalid raw transaction", "rawTransactin", rawTransaction);
|
||||
logger$h.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
|
||||
}
|
||||
const tx = {
|
||||
nonce: handleNumber(transaction[0]).toNumber(),
|
||||
@ -14816,7 +14834,7 @@ uuid.unparse = unparse;
|
||||
var uuid_1 = uuid;
|
||||
|
||||
"use strict";
|
||||
var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -14962,7 +14980,7 @@ function decryptSync(json, password) {
|
||||
return _getAccount(data, key);
|
||||
}
|
||||
function decrypt$1(json, password, progressCallback) {
|
||||
return __awaiter$1(this, void 0, void 0, function* () {
|
||||
return __awaiter$2(this, void 0, void 0, function* () {
|
||||
const data = JSON.parse(json);
|
||||
const key = yield _computeKdfKey(data, password, pbkdf2$1, scrypt_1, progressCallback);
|
||||
return _getAccount(data, key);
|
||||
@ -15145,7 +15163,7 @@ function decryptJsonWalletSync(json, password) {
|
||||
throw new Error("invalid JSON wallet");
|
||||
}
|
||||
|
||||
const version$j = "wallet/5.0.0-beta.139";
|
||||
const version$j = "wallet/5.0.0-beta.140";
|
||||
|
||||
"use strict";
|
||||
const logger$n = new Logger(version$j);
|
||||
@ -15165,7 +15183,7 @@ class Wallet extends Signer {
|
||||
defineReadOnly(this, "_signingKey", () => signingKey);
|
||||
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
||||
if (this.address !== getAddress(privateKey.address)) {
|
||||
logger$n.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDCACTED]");
|
||||
logger$n.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
||||
}
|
||||
if (hasMnemonic$1(privateKey)) {
|
||||
const srcMnemonic = privateKey.mnemonic;
|
||||
@ -15177,7 +15195,7 @@ class Wallet extends Signer {
|
||||
const mnemonic = this.mnemonic;
|
||||
const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
||||
if (computeAddress(node.privateKey) !== this.address) {
|
||||
logger$n.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDCACTED]");
|
||||
logger$n.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -15483,7 +15501,7 @@ var browser$2 = /*#__PURE__*/Object.freeze({
|
||||
const version$l = "web/5.0.0-beta.137";
|
||||
|
||||
"use strict";
|
||||
var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -15493,7 +15511,7 @@ var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments,
|
||||
});
|
||||
};
|
||||
function getUrl(href, options) {
|
||||
return __awaiter$2(this, void 0, void 0, function* () {
|
||||
return __awaiter$3(this, void 0, void 0, function* () {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
@ -15530,7 +15548,7 @@ function getUrl(href, options) {
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -15613,7 +15631,7 @@ function fetchJson(connection, json, processFunc) {
|
||||
return { promise, cancel };
|
||||
})();
|
||||
const runningFetch = (function () {
|
||||
return __awaiter$3(this, void 0, void 0, function* () {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
let response = null;
|
||||
try {
|
||||
response = yield getUrl(url, options);
|
||||
@ -15873,7 +15891,7 @@ class Formatter {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
throw new Error("invaid boolean - " + value);
|
||||
throw new Error("invalid boolean - " + value);
|
||||
}
|
||||
hex(value, strict) {
|
||||
if (typeof (value) === "string") {
|
||||
@ -16120,7 +16138,7 @@ class Formatter {
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -16300,7 +16318,7 @@ class BaseProvider extends Provider {
|
||||
return getNetwork((network == null) ? "homestead" : network);
|
||||
}
|
||||
_getInternalBlockNumber(maxAge) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const internalBlockNumber = this._internalBlockNumber;
|
||||
if (maxAge > 0 && this._internalBlockNumber) {
|
||||
@ -16324,7 +16342,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
poll() {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
const pollId = nextPollId++;
|
||||
this.emit("willPoll", pollId);
|
||||
// Track all running promises, so we can trigger a post-poll once they are complete
|
||||
@ -16485,7 +16503,7 @@ class BaseProvider extends Provider {
|
||||
// @TODO: Add .poller which must be an event emitter with a 'start', 'stop' and 'block' event;
|
||||
// this will be used once we move to the WebSocket or other alternatives to polling
|
||||
waitForTransaction(transactionHash, confirmations, timeout) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
if (confirmations == null) {
|
||||
confirmations = 1;
|
||||
}
|
||||
@ -16534,13 +16552,13 @@ class BaseProvider extends Provider {
|
||||
return this._getInternalBlockNumber(0);
|
||||
}
|
||||
getGasPrice() {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
return BigNumber.from(yield this.perform("getGasPrice", {}));
|
||||
});
|
||||
}
|
||||
getBalance(addressOrName, blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
address: this._getAddress(addressOrName),
|
||||
@ -16550,7 +16568,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getTransactionCount(addressOrName, blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
address: this._getAddress(addressOrName),
|
||||
@ -16560,7 +16578,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getCode(addressOrName, blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
address: this._getAddress(addressOrName),
|
||||
@ -16570,7 +16588,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getStorageAt(addressOrName, position, blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
address: this._getAddress(addressOrName),
|
||||
@ -16591,7 +16609,7 @@ class BaseProvider extends Provider {
|
||||
logger$r.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
||||
}
|
||||
// @TODO: (confirmations? number, timeout? number)
|
||||
result.wait = (confirmations) => __awaiter$4(this, void 0, void 0, function* () {
|
||||
result.wait = (confirmations) => __awaiter$5(this, void 0, void 0, function* () {
|
||||
// We know this transaction *must* exist (whether it gets mined is
|
||||
// another story), so setting an emitted value forces us to
|
||||
// wait even if the node returns null for the receipt
|
||||
@ -16616,7 +16634,7 @@ class BaseProvider extends Provider {
|
||||
return result;
|
||||
}
|
||||
sendTransaction(signedTransaction) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const hexTx = yield Promise.resolve(signedTransaction).then(t => hexlify(t));
|
||||
const tx = this.formatter.transaction(signedTransaction);
|
||||
@ -16632,7 +16650,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
_getTransactionRequest(transaction) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
const values = yield transaction;
|
||||
const tx = {};
|
||||
["from", "to"].forEach((key) => {
|
||||
@ -16657,7 +16675,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
_getFilter(filter) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
if (filter instanceof Promise) {
|
||||
filter = yield filter;
|
||||
}
|
||||
@ -16677,11 +16695,11 @@ class BaseProvider extends Provider {
|
||||
}
|
||||
result[key] = this._getBlockTag(filter[key]);
|
||||
});
|
||||
return this.formatter.filter(yield resolveProperties(filter));
|
||||
return this.formatter.filter(yield resolveProperties(result));
|
||||
});
|
||||
}
|
||||
call(transaction, blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
transaction: this._getTransactionRequest(transaction),
|
||||
@ -16691,7 +16709,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
estimateGas(transaction) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({
|
||||
transaction: this._getTransactionRequest(transaction)
|
||||
@ -16700,7 +16718,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
_getAddress(addressOrName) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
const address = yield this.resolveName(addressOrName);
|
||||
if (address == null) {
|
||||
logger$r.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
@ -16711,7 +16729,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
_getBlock(blockHashOrBlockTag, includeTransactions) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
if (blockHashOrBlockTag instanceof Promise) {
|
||||
blockHashOrBlockTag = yield blockHashOrBlockTag;
|
||||
@ -16735,7 +16753,7 @@ class BaseProvider extends Provider {
|
||||
logger$r.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
||||
}
|
||||
}
|
||||
return poll(() => __awaiter$4(this, void 0, void 0, function* () {
|
||||
return poll(() => __awaiter$5(this, void 0, void 0, function* () {
|
||||
const block = yield this.perform("getBlock", params);
|
||||
// Block was not found
|
||||
if (block == null) {
|
||||
@ -16789,13 +16807,13 @@ class BaseProvider extends Provider {
|
||||
return (this._getBlock(blockHashOrBlockTag, true));
|
||||
}
|
||||
getTransaction(transactionHash) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
if (transactionHash instanceof Promise) {
|
||||
transactionHash = yield transactionHash;
|
||||
}
|
||||
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
||||
return poll(() => __awaiter$4(this, void 0, void 0, function* () {
|
||||
return poll(() => __awaiter$5(this, void 0, void 0, function* () {
|
||||
const result = yield this.perform("getTransaction", params);
|
||||
if (result == null) {
|
||||
if (this._emitted["t:" + transactionHash] == null) {
|
||||
@ -16821,13 +16839,13 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getTransactionReceipt(transactionHash) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
if (transactionHash instanceof Promise) {
|
||||
transactionHash = yield transactionHash;
|
||||
}
|
||||
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
||||
return poll(() => __awaiter$4(this, void 0, void 0, function* () {
|
||||
return poll(() => __awaiter$5(this, void 0, void 0, function* () {
|
||||
const result = yield this.perform("getTransactionReceipt", params);
|
||||
if (result == null) {
|
||||
if (this._emitted["t:" + transactionHash] == null) {
|
||||
@ -16857,7 +16875,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getLogs(filter) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
const params = yield resolveProperties({ filter: this._getFilter(filter) });
|
||||
const logs = yield this.perform("getLogs", params);
|
||||
@ -16870,13 +16888,13 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
getEtherPrice() {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
yield this.ready;
|
||||
return this.perform("getEtherPrice", {});
|
||||
});
|
||||
}
|
||||
_getBlockTag(blockTag) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
if (blockTag instanceof Promise) {
|
||||
blockTag = yield blockTag;
|
||||
}
|
||||
@ -16895,7 +16913,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
_getResolver(name) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
// Get the resolver from the blockchain
|
||||
const network = yield this.getNetwork();
|
||||
// No ENS...
|
||||
@ -16911,7 +16929,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
resolveName(name) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
if (name instanceof Promise) {
|
||||
name = yield name;
|
||||
}
|
||||
@ -16942,7 +16960,7 @@ class BaseProvider extends Provider {
|
||||
});
|
||||
}
|
||||
lookupAddress(address) {
|
||||
return __awaiter$4(this, void 0, void 0, function* () {
|
||||
return __awaiter$5(this, void 0, void 0, function* () {
|
||||
if (address instanceof Promise) {
|
||||
address = yield address;
|
||||
}
|
||||
@ -17085,7 +17103,7 @@ class BaseProvider extends Provider {
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -17285,7 +17303,7 @@ class JsonRpcProvider extends BaseProvider {
|
||||
else {
|
||||
// The network is unknown, query the JSON-RPC for it
|
||||
const ready = new Promise((resolve, reject) => {
|
||||
setTimeout(() => __awaiter$5(this, void 0, void 0, function* () {
|
||||
setTimeout(() => __awaiter$6(this, void 0, void 0, function* () {
|
||||
let chainId = null;
|
||||
try {
|
||||
chainId = yield this.send("eth_chainId", []);
|
||||
@ -17614,6 +17632,15 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
const logger$v = new Logger(version$m);
|
||||
class CloudflareProvider extends UrlJsonRpcProvider {
|
||||
static getApiKey(apiKey) {
|
||||
@ -17633,10 +17660,24 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
||||
}
|
||||
return host;
|
||||
}
|
||||
perform(method, params) {
|
||||
const _super = Object.create(null, {
|
||||
perform: { get: () => super.perform }
|
||||
});
|
||||
return __awaiter$7(this, void 0, void 0, function* () {
|
||||
// The Cloudflare provider does not support eth_blockNumber,
|
||||
// so we get the latest block and pull it from that
|
||||
if (method === "getBlockNumber") {
|
||||
const block = yield _super.perform.call(this, "getBlock", { blockTag: "latest" });
|
||||
return block.number;
|
||||
}
|
||||
return _super.perform.call(this, method, params);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -17740,13 +17781,13 @@ class EtherscanProvider extends BaseProvider {
|
||||
const _super = Object.create(null, {
|
||||
perform: { get: () => super.perform }
|
||||
});
|
||||
return __awaiter$6(this, void 0, void 0, function* () {
|
||||
return __awaiter$8(this, void 0, void 0, function* () {
|
||||
let url = this.baseUrl;
|
||||
let apiKey = "";
|
||||
if (this.apiKey) {
|
||||
apiKey += "&apikey=" + this.apiKey;
|
||||
}
|
||||
const get = (url, procFunc) => __awaiter$6(this, void 0, void 0, function* () {
|
||||
const get = (url, procFunc) => __awaiter$8(this, void 0, void 0, function* () {
|
||||
this.emit("debug", {
|
||||
action: "request",
|
||||
request: url,
|
||||
@ -17818,7 +17859,7 @@ class EtherscanProvider extends BaseProvider {
|
||||
url += apiKey;
|
||||
return get(url);
|
||||
}
|
||||
throw new Error("getBlock by blockHash not implmeneted");
|
||||
throw new Error("getBlock by blockHash not implemented");
|
||||
case "getTransaction":
|
||||
url += "/api?module=proxy&action=eth_getTransactionByHash&txhash=" + params.transactionHash;
|
||||
url += apiKey;
|
||||
@ -17959,7 +18000,7 @@ class EtherscanProvider extends BaseProvider {
|
||||
}
|
||||
|
||||
"use strict";
|
||||
var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -17993,7 +18034,7 @@ function checkNetworks(networks) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function median(values) {
|
||||
function median(values, maxDelta) {
|
||||
values = values.slice().sort();
|
||||
const middle = Math.floor(values.length / 2);
|
||||
// Odd length; take the middle
|
||||
@ -18002,6 +18043,9 @@ function median(values) {
|
||||
}
|
||||
// Even length; take the average of the two middle
|
||||
const a = values[middle - 1], b = values[middle];
|
||||
if (maxDelta != null && Math.abs(a - b) > maxDelta) {
|
||||
return null;
|
||||
}
|
||||
return (a + b) / 2;
|
||||
}
|
||||
function serialize$1(value) {
|
||||
@ -18104,7 +18148,11 @@ function getProcessFunc(provider, method, params) {
|
||||
return function (configs) {
|
||||
const values = configs.map((c) => c.result);
|
||||
// Get the median block number
|
||||
let blockNumber = Math.ceil(median(configs.map((c) => c.result)));
|
||||
let blockNumber = median(configs.map((c) => c.result), 2);
|
||||
if (blockNumber == null) {
|
||||
return undefined;
|
||||
}
|
||||
blockNumber = Math.ceil(blockNumber);
|
||||
// If the next block height is present, its prolly safe to use
|
||||
if (values.indexOf(blockNumber + 1) >= 0) {
|
||||
blockNumber++;
|
||||
@ -18267,7 +18315,7 @@ class FallbackProvider extends BaseProvider {
|
||||
this._highestBlockNumber = -1;
|
||||
}
|
||||
perform(method, params) {
|
||||
return __awaiter$7(this, void 0, void 0, function* () {
|
||||
return __awaiter$9(this, void 0, void 0, function* () {
|
||||
// Sending transactions is special; always broadcast it to all backends
|
||||
if (method === "sendTransaction") {
|
||||
return Promise.all(this.providerConfigs.map((c) => {
|
||||
@ -18294,6 +18342,7 @@ class FallbackProvider extends BaseProvider {
|
||||
const configs = shuffled(this.providerConfigs.map((c) => shallowCopy(c)));
|
||||
configs.sort((a, b) => (a.priority - b.priority));
|
||||
let i = 0;
|
||||
let first = true;
|
||||
while (true) {
|
||||
const t0 = now();
|
||||
// Get a list of running
|
||||
@ -18366,6 +18415,10 @@ class FallbackProvider extends BaseProvider {
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
if (!first) {
|
||||
yield stall(100);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
// All configs have run to completion; we will never get more data
|
||||
if (configs.filter((c) => !c.done).length === 0) {
|
||||
@ -18583,7 +18636,7 @@ module.exports = WS;
|
||||
var WebSocket$1 = unwrapExports(browserWs);
|
||||
|
||||
"use strict";
|
||||
var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@ -18675,7 +18728,7 @@ class WebSocketProvider extends JsonRpcProvider {
|
||||
});
|
||||
}
|
||||
poll() {
|
||||
return __awaiter$8(this, void 0, void 0, function* () {
|
||||
return __awaiter$a(this, void 0, void 0, function* () {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
@ -18709,13 +18762,15 @@ class WebSocketProvider extends JsonRpcProvider {
|
||||
});
|
||||
}
|
||||
static defaultUrl() {
|
||||
return "ws:/" + "/localhost:8546";
|
||||
return "ws:/\/localhost:8546";
|
||||
}
|
||||
_subscribe(tag, param, processFunc) {
|
||||
return __awaiter$8(this, void 0, void 0, function* () {
|
||||
return __awaiter$a(this, void 0, void 0, function* () {
|
||||
let subIdPromise = this._subIds[tag];
|
||||
if (subIdPromise == null) {
|
||||
subIdPromise = this.send("eth_subscribe", param);
|
||||
subIdPromise = Promise.all(param).then((param) => {
|
||||
return this.send("eth_subscribe", param);
|
||||
});
|
||||
this._subIds[tag] = subIdPromise;
|
||||
}
|
||||
const subId = yield subIdPromise;
|
||||
@ -18735,8 +18790,11 @@ class WebSocketProvider extends JsonRpcProvider {
|
||||
});
|
||||
break;
|
||||
case "filter":
|
||||
this._subscribe(event.tag, ["logs", event.filter], (result) => {
|
||||
this.emit(event.filter, result);
|
||||
this._subscribe(event.tag, ["logs", this._getFilter(event.filter)], (result) => {
|
||||
if (result.removed == null) {
|
||||
result.removed = false;
|
||||
}
|
||||
this.emit(event.filter, this.formatter.filterLog(result));
|
||||
});
|
||||
break;
|
||||
case "tx": {
|
||||
@ -19064,9 +19122,13 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
||||
formatUnits: formatUnits,
|
||||
parseUnits: parseUnits,
|
||||
commify: commify,
|
||||
computeHmac: browser_5,
|
||||
keccak256: keccak256,
|
||||
ripemd160: browser_2,
|
||||
sha256: browser_3,
|
||||
sha512: browser_4,
|
||||
randomBytes: randomBytes,
|
||||
shuffled: shuffled,
|
||||
solidityPack: pack$1,
|
||||
solidityKeccak256: keccak256$1,
|
||||
soliditySha256: sha256$1,
|
||||
|
4
packages/ethers/dist/ethers.esm.min.js
vendored
4
packages/ethers/dist/ethers.esm.min.js
vendored
File diff suppressed because one or more lines are too long
289
packages/ethers/dist/ethers.umd.js
vendored
289
packages/ethers/dist/ethers.umd.js
vendored
@ -4195,7 +4195,7 @@
|
||||
var _version$4 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "bignumber/5.0.0-beta.137";
|
||||
exports.version = "bignumber/5.0.0-beta.138";
|
||||
});
|
||||
|
||||
var _version$5 = unwrapExports(_version$4);
|
||||
@ -4232,7 +4232,7 @@
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call consturtor directly; use BigNumber.from", lib.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
logger.throwError("cannot call constructor directly; use BigNumber.from", lib.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
@ -4678,7 +4678,7 @@
|
||||
decimals = 0;
|
||||
}
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal cound", "decimals", decimals);
|
||||
logger.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
var comps = this.toString().split(".");
|
||||
@ -4952,7 +4952,7 @@
|
||||
var _version$8 = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abi/5.0.0-beta.150";
|
||||
exports.version = "abi/5.0.0-beta.151";
|
||||
});
|
||||
|
||||
var _version$9 = unwrapExports(_version$8);
|
||||
@ -5444,7 +5444,7 @@
|
||||
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
|
||||
logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = lib$2.BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
@ -5755,7 +5755,7 @@
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger.throwArgumentError("unbalanced parenthsis", "value", value);
|
||||
logger.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8146,7 +8146,7 @@
|
||||
format = fragments.FormatTypes.full;
|
||||
}
|
||||
if (format === fragments.FormatTypes.sighash) {
|
||||
logger.throwArgumentError("interface does not support formating sighash", "format", format);
|
||||
logger.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
var abi = this.fragments.map(function (fragment) { return fragment.format(format); });
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
@ -8908,7 +8908,7 @@
|
||||
var _version$m = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "contracts/5.0.0-beta.148";
|
||||
exports.version = "contracts/5.0.0-beta.149";
|
||||
});
|
||||
|
||||
var _version$n = unwrapExports(_version$m);
|
||||
@ -8929,6 +8929,42 @@
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __spreadArrays = (commonjsGlobal && commonjsGlobal.__spreadArrays) || function () {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
@ -9002,7 +9038,7 @@
|
||||
// Check for unexpected keys (e.g. using "gas" instead of "gasLimit")
|
||||
for (var key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
logger.throwError(("unknown transaxction override - " + key), "overrides", tx);
|
||||
logger.throwError(("unknown transaction override - " + key), "overrides", tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9691,7 +9727,7 @@
|
||||
}
|
||||
var tx = {};
|
||||
// If we have 1 additional argument, we allow transaction overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
|
||||
tx = lib$3.shallowCopy(args.pop());
|
||||
for (var key in tx) {
|
||||
if (!allowedTransactionKeys[key]) {
|
||||
@ -9716,20 +9752,35 @@
|
||||
return tx;
|
||||
};
|
||||
ContractFactory.prototype.deploy = function () {
|
||||
var _this = this;
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then(function (args) {
|
||||
// Get the deployment transaction (with optional overrides)
|
||||
var tx = _this.getDeployTransaction.apply(_this, args);
|
||||
// Send the deployment transaction
|
||||
return _this.signer.sendTransaction(tx).then(function (tx) {
|
||||
var address = (_this.constructor).getContractAddress(tx);
|
||||
var contract = (_this.constructor).getContract(address, _this.interface, _this.signer);
|
||||
lib$3.defineReadOnly(contract, "deployTransaction", tx);
|
||||
return contract;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var overrides, params, unsignedTx, tx, address, contract;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
overrides = {};
|
||||
// If 1 extra parameter was passed in, it contains overrides
|
||||
if (args.length === this.interface.deploy.inputs.length + 1) {
|
||||
overrides = args.pop();
|
||||
}
|
||||
// Make sure the call matches the constructor signature
|
||||
logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
||||
return [4 /*yield*/, resolveAddresses(this.signer, args, this.interface.deploy.inputs)];
|
||||
case 1:
|
||||
params = _a.sent();
|
||||
params.push(overrides);
|
||||
unsignedTx = this.getDeployTransaction.apply(this, params);
|
||||
return [4 /*yield*/, this.signer.sendTransaction(unsignedTx)];
|
||||
case 2:
|
||||
tx = _a.sent();
|
||||
address = lib$3.getStatic(this.constructor, "getContractAddress")(tx);
|
||||
contract = lib$3.getStatic(this.constructor, "getContract")(address, this.interface, this.signer);
|
||||
lib$3.defineReadOnly(contract, "deployTransaction", tx);
|
||||
return [2 /*return*/, contract];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -13645,7 +13696,7 @@
|
||||
var _version$s = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "transactions/5.0.0-beta.134";
|
||||
exports.version = "transactions/5.0.0-beta.135";
|
||||
});
|
||||
|
||||
var _version$t = unwrapExports(_version$s);
|
||||
@ -13777,7 +13828,7 @@
|
||||
function parse(rawTransaction) {
|
||||
var transaction = RLP.decode(rawTransaction);
|
||||
if (transaction.length !== 9 && transaction.length !== 6) {
|
||||
logger.throwArgumentError("invalid raw transaction", "rawTransactin", rawTransaction);
|
||||
logger.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
|
||||
}
|
||||
var tx = {
|
||||
nonce: handleNumber(transaction[0]).toNumber(),
|
||||
@ -16575,7 +16626,7 @@
|
||||
var _version$C = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "wallet/5.0.0-beta.139";
|
||||
exports.version = "wallet/5.0.0-beta.140";
|
||||
});
|
||||
|
||||
var _version$D = unwrapExports(_version$C);
|
||||
@ -16631,7 +16682,7 @@
|
||||
lib$3.defineReadOnly(_this, "_signingKey", function () { return signingKey_1; });
|
||||
lib$3.defineReadOnly(_this, "address", lib$g.computeAddress(_this.publicKey));
|
||||
if (_this.address !== lib$6.getAddress(privateKey.address)) {
|
||||
logger.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDCACTED]");
|
||||
logger.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
||||
}
|
||||
if (hasMnemonic(privateKey)) {
|
||||
var srcMnemonic_1 = privateKey.mnemonic;
|
||||
@ -16643,7 +16694,7 @@
|
||||
var mnemonic = _this.mnemonic;
|
||||
var node = lib$h.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
||||
if (lib$g.computeAddress(node.privateKey) !== _this.address) {
|
||||
logger.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDCACTED]");
|
||||
logger.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -17510,7 +17561,7 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
throw new Error("invaid boolean - " + value);
|
||||
throw new Error("invalid boolean - " + value);
|
||||
};
|
||||
Formatter.prototype.hex = function (value, strict) {
|
||||
if (typeof (value) === "string") {
|
||||
@ -18538,7 +18589,7 @@
|
||||
result[key] = _this._getBlockTag(filter[key]);
|
||||
});
|
||||
_b = (_a = this.formatter).filter;
|
||||
return [4 /*yield*/, lib$3.resolveProperties(filter)];
|
||||
return [4 /*yield*/, lib$3.resolveProperties(result)];
|
||||
case 3: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
||||
}
|
||||
});
|
||||
@ -19816,6 +19867,42 @@
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
|
||||
@ -19843,6 +19930,22 @@
|
||||
}
|
||||
return host;
|
||||
};
|
||||
CloudflareProvider.prototype.perform = function (method, params) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var block;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
if (!(method === "getBlockNumber")) return [3 /*break*/, 2];
|
||||
return [4 /*yield*/, _super.prototype.perform.call(this, "getBlock", { blockTag: "latest" })];
|
||||
case 1:
|
||||
block = _a.sent();
|
||||
return [2 /*return*/, block.number];
|
||||
case 2: return [2 /*return*/, _super.prototype.perform.call(this, method, params)];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return CloudflareProvider;
|
||||
}(urlJsonRpcProvider.UrlJsonRpcProvider));
|
||||
exports.CloudflareProvider = CloudflareProvider;
|
||||
@ -20113,7 +20216,7 @@
|
||||
url += apiKey;
|
||||
return [2 /*return*/, get(url)];
|
||||
}
|
||||
throw new Error("getBlock by blockHash not implmeneted");
|
||||
throw new Error("getBlock by blockHash not implemented");
|
||||
case 9:
|
||||
url += "/api?module=proxy&action=eth_getTransactionByHash&txhash=" + params.transactionHash;
|
||||
url += apiKey;
|
||||
@ -20358,7 +20461,7 @@
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function median(values) {
|
||||
function median(values, maxDelta) {
|
||||
values = values.slice().sort();
|
||||
var middle = Math.floor(values.length / 2);
|
||||
// Odd length; take the middle
|
||||
@ -20367,6 +20470,9 @@
|
||||
}
|
||||
// Even length; take the average of the two middle
|
||||
var a = values[middle - 1], b = values[middle];
|
||||
if (maxDelta != null && Math.abs(a - b) > maxDelta) {
|
||||
return null;
|
||||
}
|
||||
return (a + b) / 2;
|
||||
}
|
||||
function serialize(value) {
|
||||
@ -20469,7 +20575,11 @@
|
||||
return function (configs) {
|
||||
var values = configs.map(function (c) { return c.result; });
|
||||
// Get the median block number
|
||||
var blockNumber = Math.ceil(median(configs.map(function (c) { return c.result; })));
|
||||
var blockNumber = median(configs.map(function (c) { return c.result; }), 2);
|
||||
if (blockNumber == null) {
|
||||
return undefined;
|
||||
}
|
||||
blockNumber = Math.ceil(blockNumber);
|
||||
// If the next block height is present, its prolly safe to use
|
||||
if (values.indexOf(blockNumber + 1) >= 0) {
|
||||
blockNumber++;
|
||||
@ -20637,7 +20747,7 @@
|
||||
}
|
||||
FallbackProvider.prototype.perform = function (method, params) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var processFunc, configs, i, _loop_1, this_1, state_1;
|
||||
var processFunc, configs, i, first, _loop_1, this_1, state_1;
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
@ -20666,6 +20776,7 @@
|
||||
configs = browser$6.shuffled(this.providerConfigs.map(function (c) { return lib$3.shallowCopy(c); }));
|
||||
configs.sort(function (a, b) { return (a.priority - b.priority); });
|
||||
i = 0;
|
||||
first = true;
|
||||
_loop_1 = function () {
|
||||
var t0, inflightWeight, _loop_2, waiting, results, result;
|
||||
return __generator(this, function (_a) {
|
||||
@ -20737,12 +20848,20 @@
|
||||
_a.label = 2;
|
||||
case 2:
|
||||
results = configs.filter(function (c) { return (c.done && c.error == null); });
|
||||
if (results.length >= this_1.quorum) {
|
||||
result = processFunc(results);
|
||||
if (result !== undefined) {
|
||||
return [2 /*return*/, { value: result }];
|
||||
}
|
||||
if (!(results.length >= this_1.quorum)) return [3 /*break*/, 5];
|
||||
result = processFunc(results);
|
||||
if (result !== undefined) {
|
||||
return [2 /*return*/, { value: result }];
|
||||
}
|
||||
if (!!first) return [3 /*break*/, 4];
|
||||
return [4 /*yield*/, stall(100)];
|
||||
case 3:
|
||||
_a.sent();
|
||||
_a.label = 4;
|
||||
case 4:
|
||||
first = false;
|
||||
_a.label = 5;
|
||||
case 5:
|
||||
// All configs have run to completion; we will never get more data
|
||||
if (configs.filter(function (c) { return !c.done; }).length === 0) {
|
||||
return [2 /*return*/, "break"];
|
||||
@ -21249,17 +21368,20 @@
|
||||
});
|
||||
};
|
||||
WebSocketProvider.defaultUrl = function () {
|
||||
return "ws:/" + "/localhost:8546";
|
||||
return "ws:/\/localhost:8546";
|
||||
};
|
||||
WebSocketProvider.prototype._subscribe = function (tag, param, processFunc) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var subIdPromise, subId;
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
subIdPromise = this._subIds[tag];
|
||||
if (subIdPromise == null) {
|
||||
subIdPromise = this.send("eth_subscribe", param);
|
||||
subIdPromise = Promise.all(param).then(function (param) {
|
||||
return _this.send("eth_subscribe", param);
|
||||
});
|
||||
this._subIds[tag] = subIdPromise;
|
||||
}
|
||||
return [4 /*yield*/, subIdPromise];
|
||||
@ -21285,8 +21407,11 @@
|
||||
});
|
||||
break;
|
||||
case "filter":
|
||||
this._subscribe(event.tag, ["logs", event.filter], function (result) {
|
||||
_this.emit(event.filter, result);
|
||||
this._subscribe(event.tag, ["logs", this._getFilter(event.filter)], function (result) {
|
||||
if (result.removed == null) {
|
||||
result.removed = false;
|
||||
}
|
||||
_this.emit(event.filter, _this.formatter.filterLog(result));
|
||||
});
|
||||
break;
|
||||
case "tx": {
|
||||
@ -21699,13 +21824,17 @@
|
||||
|
||||
exports.Logger = lib.Logger;
|
||||
|
||||
exports.computeHmac = browser.computeHmac;
|
||||
exports.ripemd160 = browser.ripemd160;
|
||||
exports.sha256 = browser.sha256;
|
||||
exports.sha512 = browser.sha512;
|
||||
|
||||
exports.solidityKeccak256 = lib$n.keccak256;
|
||||
exports.solidityPack = lib$n.pack;
|
||||
exports.soliditySha256 = lib$n.sha256;
|
||||
|
||||
exports.randomBytes = browser$6.randomBytes;
|
||||
exports.shuffled = browser$6.shuffled;
|
||||
|
||||
exports.checkProperties = lib$3.checkProperties;
|
||||
exports.deepCopy = lib$3.deepCopy;
|
||||
@ -21797,44 +21926,48 @@
|
||||
var utils_41 = utils$3.getJsonWalletAddress;
|
||||
var utils_42 = utils$3.keccak256;
|
||||
var utils_43 = utils$3.Logger;
|
||||
var utils_44 = utils$3.sha256;
|
||||
var utils_45 = utils$3.solidityKeccak256;
|
||||
var utils_46 = utils$3.solidityPack;
|
||||
var utils_47 = utils$3.soliditySha256;
|
||||
var utils_48 = utils$3.randomBytes;
|
||||
var utils_49 = utils$3.checkProperties;
|
||||
var utils_50 = utils$3.deepCopy;
|
||||
var utils_51 = utils$3.defineReadOnly;
|
||||
var utils_52 = utils$3.getStatic;
|
||||
var utils_53 = utils$3.resolveProperties;
|
||||
var utils_54 = utils$3.shallowCopy;
|
||||
var utils_55 = utils$3.RLP;
|
||||
var utils_56 = utils$3.computePublicKey;
|
||||
var utils_57 = utils$3.recoverPublicKey;
|
||||
var utils_58 = utils$3.SigningKey;
|
||||
var utils_59 = utils$3.formatBytes32String;
|
||||
var utils_60 = utils$3.nameprep;
|
||||
var utils_61 = utils$3.parseBytes32String;
|
||||
var utils_62 = utils$3._toEscapedUtf8String;
|
||||
var utils_63 = utils$3.toUtf8Bytes;
|
||||
var utils_64 = utils$3.toUtf8CodePoints;
|
||||
var utils_65 = utils$3.toUtf8String;
|
||||
var utils_66 = utils$3.Utf8ErrorFuncs;
|
||||
var utils_67 = utils$3.computeAddress;
|
||||
var utils_68 = utils$3.parseTransaction;
|
||||
var utils_69 = utils$3.recoverAddress;
|
||||
var utils_70 = utils$3.serializeTransaction;
|
||||
var utils_71 = utils$3.commify;
|
||||
var utils_72 = utils$3.formatEther;
|
||||
var utils_73 = utils$3.parseEther;
|
||||
var utils_74 = utils$3.formatUnits;
|
||||
var utils_75 = utils$3.parseUnits;
|
||||
var utils_76 = utils$3.verifyMessage;
|
||||
var utils_77 = utils$3.fetchJson;
|
||||
var utils_78 = utils$3.poll;
|
||||
var utils_79 = utils$3.SupportedAlgorithm;
|
||||
var utils_80 = utils$3.UnicodeNormalizationForm;
|
||||
var utils_81 = utils$3.Utf8ErrorReason;
|
||||
var utils_44 = utils$3.computeHmac;
|
||||
var utils_45 = utils$3.ripemd160;
|
||||
var utils_46 = utils$3.sha256;
|
||||
var utils_47 = utils$3.sha512;
|
||||
var utils_48 = utils$3.solidityKeccak256;
|
||||
var utils_49 = utils$3.solidityPack;
|
||||
var utils_50 = utils$3.soliditySha256;
|
||||
var utils_51 = utils$3.randomBytes;
|
||||
var utils_52 = utils$3.shuffled;
|
||||
var utils_53 = utils$3.checkProperties;
|
||||
var utils_54 = utils$3.deepCopy;
|
||||
var utils_55 = utils$3.defineReadOnly;
|
||||
var utils_56 = utils$3.getStatic;
|
||||
var utils_57 = utils$3.resolveProperties;
|
||||
var utils_58 = utils$3.shallowCopy;
|
||||
var utils_59 = utils$3.RLP;
|
||||
var utils_60 = utils$3.computePublicKey;
|
||||
var utils_61 = utils$3.recoverPublicKey;
|
||||
var utils_62 = utils$3.SigningKey;
|
||||
var utils_63 = utils$3.formatBytes32String;
|
||||
var utils_64 = utils$3.nameprep;
|
||||
var utils_65 = utils$3.parseBytes32String;
|
||||
var utils_66 = utils$3._toEscapedUtf8String;
|
||||
var utils_67 = utils$3.toUtf8Bytes;
|
||||
var utils_68 = utils$3.toUtf8CodePoints;
|
||||
var utils_69 = utils$3.toUtf8String;
|
||||
var utils_70 = utils$3.Utf8ErrorFuncs;
|
||||
var utils_71 = utils$3.computeAddress;
|
||||
var utils_72 = utils$3.parseTransaction;
|
||||
var utils_73 = utils$3.recoverAddress;
|
||||
var utils_74 = utils$3.serializeTransaction;
|
||||
var utils_75 = utils$3.commify;
|
||||
var utils_76 = utils$3.formatEther;
|
||||
var utils_77 = utils$3.parseEther;
|
||||
var utils_78 = utils$3.formatUnits;
|
||||
var utils_79 = utils$3.parseUnits;
|
||||
var utils_80 = utils$3.verifyMessage;
|
||||
var utils_81 = utils$3.fetchJson;
|
||||
var utils_82 = utils$3.poll;
|
||||
var utils_83 = utils$3.SupportedAlgorithm;
|
||||
var utils_84 = utils$3.UnicodeNormalizationForm;
|
||||
var utils_85 = utils$3.Utf8ErrorReason;
|
||||
|
||||
var _version$M = createCommonjsModule(function (module, exports) {
|
||||
"use strict";
|
||||
|
4
packages/ethers/dist/ethers.umd.min.js
vendored
4
packages/ethers/dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
6
packages/ethers/lib.esm/utils.d.ts
vendored
6
packages/ethers/lib.esm/utils.d.ts
vendored
@ -7,9 +7,9 @@ import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntr
|
||||
import { getJsonWalletAddress } from "@ethersproject/json-wallets";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { sha256 } from "@ethersproject/sha2";
|
||||
import { computeHmac, ripemd160, sha256, sha512 } from "@ethersproject/sha2";
|
||||
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from "@ethersproject/solidity";
|
||||
import { randomBytes } from "@ethersproject/random";
|
||||
import { randomBytes, shuffled } from "@ethersproject/random";
|
||||
import { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from "@ethersproject/properties";
|
||||
import * as RLP from "@ethersproject/rlp";
|
||||
import { computePublicKey, recoverPublicKey, SigningKey } from "@ethersproject/signing-key";
|
||||
@ -27,4 +27,4 @@ import { Mnemonic } from "@ethersproject/hdnode";
|
||||
import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets";
|
||||
import { Utf8ErrorFunc } from "@ethersproject/strings";
|
||||
import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web";
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, UnsignedTransaction, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, computeHmac, keccak256, ripemd160, sha256, sha512, randomBytes, shuffled, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, UnsignedTransaction, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };
|
||||
|
@ -8,9 +8,9 @@ import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntr
|
||||
import { getJsonWalletAddress } from "@ethersproject/json-wallets";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { sha256 } from "@ethersproject/sha2";
|
||||
import { computeHmac, ripemd160, sha256, sha512 } from "@ethersproject/sha2";
|
||||
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from "@ethersproject/solidity";
|
||||
import { randomBytes } from "@ethersproject/random";
|
||||
import { randomBytes, shuffled } from "@ethersproject/random";
|
||||
import { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from "@ethersproject/properties";
|
||||
import * as RLP from "@ethersproject/rlp";
|
||||
import { computePublicKey, recoverPublicKey, SigningKey } from "@ethersproject/signing-key";
|
||||
@ -25,7 +25,7 @@ import { SupportedAlgorithm } from "@ethersproject/sha2";
|
||||
import { UnicodeNormalizationForm, Utf8ErrorReason } from "@ethersproject/strings";
|
||||
////////////////////////
|
||||
// Exports
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed,
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, computeHmac, keccak256, ripemd160, sha256, sha512, randomBytes, shuffled, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed,
|
||||
////////////////////////
|
||||
// Enums
|
||||
SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Indexed };
|
||||
|
6
packages/ethers/lib/utils.d.ts
vendored
6
packages/ethers/lib/utils.d.ts
vendored
@ -7,9 +7,9 @@ import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntr
|
||||
import { getJsonWalletAddress } from "@ethersproject/json-wallets";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { sha256 } from "@ethersproject/sha2";
|
||||
import { computeHmac, ripemd160, sha256, sha512 } from "@ethersproject/sha2";
|
||||
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from "@ethersproject/solidity";
|
||||
import { randomBytes } from "@ethersproject/random";
|
||||
import { randomBytes, shuffled } from "@ethersproject/random";
|
||||
import { checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy } from "@ethersproject/properties";
|
||||
import * as RLP from "@ethersproject/rlp";
|
||||
import { computePublicKey, recoverPublicKey, SigningKey } from "@ethersproject/signing-key";
|
||||
@ -27,4 +27,4 @@ import { Mnemonic } from "@ethersproject/hdnode";
|
||||
import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets";
|
||||
import { Utf8ErrorFunc } from "@ethersproject/strings";
|
||||
import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web";
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, UnsignedTransaction, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };
|
||||
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, computeHmac, keccak256, ripemd160, sha256, sha512, randomBytes, shuffled, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, UnsignedTransaction, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };
|
||||
|
@ -60,13 +60,17 @@ exports.keccak256 = keccak256_1.keccak256;
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
exports.Logger = logger_1.Logger;
|
||||
var sha2_1 = require("@ethersproject/sha2");
|
||||
exports.computeHmac = sha2_1.computeHmac;
|
||||
exports.ripemd160 = sha2_1.ripemd160;
|
||||
exports.sha256 = sha2_1.sha256;
|
||||
exports.sha512 = sha2_1.sha512;
|
||||
var solidity_1 = require("@ethersproject/solidity");
|
||||
exports.solidityKeccak256 = solidity_1.keccak256;
|
||||
exports.solidityPack = solidity_1.pack;
|
||||
exports.soliditySha256 = solidity_1.sha256;
|
||||
var random_1 = require("@ethersproject/random");
|
||||
exports.randomBytes = random_1.randomBytes;
|
||||
exports.shuffled = random_1.shuffled;
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
exports.checkProperties = properties_1.checkProperties;
|
||||
exports.deepCopy = properties_1.deepCopy;
|
||||
|
@ -52,7 +52,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0xc36f9b83c0eca1542b66200f8178af5eb78cf9a2453c74b911ddcbbc1b9ad875",
|
||||
"tarballHash": "0x3933d6c571e157630b196b1b19aa7e6e8cd39449d6d49a34dd7a43620e82d6d6",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.183"
|
||||
}
|
||||
|
2
packages/experimental/lib.esm/_version.d.ts
vendored
2
packages/experimental/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "experimental/5.0.0-beta.138";
|
||||
export declare const version = "experimental/5.0.0-beta.139";
|
||||
|
@ -1 +1 @@
|
||||
export const version = "experimental/5.0.0-beta.138";
|
||||
export const version = "experimental/5.0.0-beta.139";
|
||||
|
@ -85,7 +85,7 @@ export class _Eip1193Bridge extends EventEmitter {
|
||||
}
|
||||
case "estimateGas": {
|
||||
if (params[1] && params[1] !== "latest") {
|
||||
throwUnsupported("estimateGas does not supprot blockTag");
|
||||
throwUnsupported("estimateGas does not support blockTag");
|
||||
}
|
||||
const req = ethers.providers.JsonRpcProvider.hexlifyTransaction(params[0]);
|
||||
const result = yield this.provider.estimateGas(req);
|
||||
|
2
packages/experimental/lib/_version.d.ts
vendored
2
packages/experimental/lib/_version.d.ts
vendored
@ -1 +1 @@
|
||||
export declare const version = "experimental/5.0.0-beta.138";
|
||||
export declare const version = "experimental/5.0.0-beta.139";
|
||||
|
@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "experimental/5.0.0-beta.138";
|
||||
exports.version = "experimental/5.0.0-beta.139";
|
||||
|
@ -170,7 +170,7 @@ var _Eip1193Bridge = /** @class */ (function (_super) {
|
||||
case 22: return [2 /*return*/, _b.sent()];
|
||||
case 23:
|
||||
if (params[1] && params[1] !== "latest") {
|
||||
throwUnsupported("estimateGas does not supprot blockTag");
|
||||
throwUnsupported("estimateGas does not support blockTag");
|
||||
}
|
||||
req = ethers_1.ethers.providers.JsonRpcProvider.hexlifyTransaction(params[0]);
|
||||
return [4 /*yield*/, this.provider.estimateGas(req)];
|
||||
|
@ -26,7 +26,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x009a87b910a7b0c8b49b46740ad8c189a3f298cc51120bae583bc7ce75ccb39b",
|
||||
"tarballHash": "0x67f0af42138915fffdb98c94335e8bcba809cff65a7ee2bd1c734fcd7dea57f6",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.138"
|
||||
"version": "5.0.0-beta.139"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "experimental/5.0.0-beta.138";
|
||||
export const version = "experimental/5.0.0-beta.139";
|
||||
|
@ -4241,7 +4241,7 @@ class LedgerSigner extends ethers.Signer {
|
||||
ethers.utils.defineReadOnly(this, "provider", provider || null);
|
||||
const transport = transports[type];
|
||||
if (!transport) {
|
||||
logger.throwArgumentError("unknown or unsupport type", "type", type);
|
||||
logger.throwArgumentError("unknown or unsupported type", "type", type);
|
||||
}
|
||||
ethers.utils.defineReadOnly(this, "_eth", transport.create().then((transport) => {
|
||||
const eth = new Eth(transport);
|
||||
|
File diff suppressed because one or more lines are too long
@ -36,7 +36,7 @@ export class LedgerSigner extends ethers.Signer {
|
||||
ethers.utils.defineReadOnly(this, "provider", provider || null);
|
||||
const transport = transports[type];
|
||||
if (!transport) {
|
||||
logger.throwArgumentError("unknown or unsupport type", "type", type);
|
||||
logger.throwArgumentError("unknown or unsupported type", "type", type);
|
||||
}
|
||||
ethers.utils.defineReadOnly(this, "_eth", transport.create().then((transport) => {
|
||||
const eth = new Eth(transport);
|
||||
|
@ -81,7 +81,7 @@ var LedgerSigner = /** @class */ (function (_super) {
|
||||
ethers_1.ethers.utils.defineReadOnly(_this, "provider", provider || null);
|
||||
var transport = ledger_transport_1.transports[type];
|
||||
if (!transport) {
|
||||
logger.throwArgumentError("unknown or unsupport type", "type", type);
|
||||
logger.throwArgumentError("unknown or unsupported type", "type", type);
|
||||
}
|
||||
ethers_1.ethers.utils.defineReadOnly(_this, "_eth", transport.create().then(function (transport) {
|
||||
var eth = new hw_app_eth_1.default(transport);
|
||||
|
@ -43,7 +43,7 @@
|
||||
"scripts": {
|
||||
"test": "exit 1"
|
||||
},
|
||||
"tarballHash": "0xebc0cb4f4552b0f6e80c88d7c2c1e9fe9e3de359808fd322afd8c54bc1347bc5",
|
||||
"tarballHash": "0x1b67e58e1190281f2ec7f3534b77c3070b9e82f3f125ef96763b8038acb23f92",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.5"
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ export class BaseProvider extends Provider {
|
||||
}
|
||||
result[key] = this._getBlockTag(filter[key]);
|
||||
});
|
||||
return this.formatter.filter(yield resolveProperties(filter));
|
||||
return this.formatter.filter(yield resolveProperties(result));
|
||||
});
|
||||
}
|
||||
call(transaction, blockTag) {
|
||||
|
@ -3,4 +3,5 @@ import { UrlJsonRpcProvider } from "./url-json-rpc-provider";
|
||||
export declare class CloudflareProvider extends UrlJsonRpcProvider {
|
||||
static getApiKey(apiKey: any): any;
|
||||
static getUrl(network: Network, apiKey?: any): string;
|
||||
perform(method: string, params: any): Promise<any>;
|
||||
}
|
||||
|
@ -1,4 +1,13 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { UrlJsonRpcProvider } from "./url-json-rpc-provider";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
@ -21,4 +30,18 @@ export class CloudflareProvider extends UrlJsonRpcProvider {
|
||||
}
|
||||
return host;
|
||||
}
|
||||
perform(method, params) {
|
||||
const _super = Object.create(null, {
|
||||
perform: { get: () => super.perform }
|
||||
});
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// The Cloudflare provider does not support eth_blockNumber,
|
||||
// so we get the latest block and pull it from that
|
||||
if (method === "getBlockNumber") {
|
||||
const block = yield _super.perform.call(this, "getBlock", { blockTag: "latest" });
|
||||
return block.number;
|
||||
}
|
||||
return _super.perform.call(this, method, params);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ export class EtherscanProvider extends BaseProvider {
|
||||
url += apiKey;
|
||||
return get(url);
|
||||
}
|
||||
throw new Error("getBlock by blockHash not implmeneted");
|
||||
throw new Error("getBlock by blockHash not implemented");
|
||||
case "getTransaction":
|
||||
url += "/api?module=proxy&action=eth_getTransactionByHash&txhash=" + params.transactionHash;
|
||||
url += apiKey;
|
||||
|
@ -40,7 +40,7 @@ function checkNetworks(networks) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function median(values) {
|
||||
function median(values, maxDelta) {
|
||||
values = values.slice().sort();
|
||||
const middle = Math.floor(values.length / 2);
|
||||
// Odd length; take the middle
|
||||
@ -49,6 +49,9 @@ function median(values) {
|
||||
}
|
||||
// Even length; take the average of the two middle
|
||||
const a = values[middle - 1], b = values[middle];
|
||||
if (maxDelta != null && Math.abs(a - b) > maxDelta) {
|
||||
return null;
|
||||
}
|
||||
return (a + b) / 2;
|
||||
}
|
||||
function serialize(value) {
|
||||
@ -151,7 +154,11 @@ function getProcessFunc(provider, method, params) {
|
||||
return function (configs) {
|
||||
const values = configs.map((c) => c.result);
|
||||
// Get the median block number
|
||||
let blockNumber = Math.ceil(median(configs.map((c) => c.result)));
|
||||
let blockNumber = median(configs.map((c) => c.result), 2);
|
||||
if (blockNumber == null) {
|
||||
return undefined;
|
||||
}
|
||||
blockNumber = Math.ceil(blockNumber);
|
||||
// If the next block height is present, its prolly safe to use
|
||||
if (values.indexOf(blockNumber + 1) >= 0) {
|
||||
blockNumber++;
|
||||
@ -341,6 +348,7 @@ export class FallbackProvider extends BaseProvider {
|
||||
const configs = shuffled(this.providerConfigs.map((c) => shallowCopy(c)));
|
||||
configs.sort((a, b) => (a.priority - b.priority));
|
||||
let i = 0;
|
||||
let first = true;
|
||||
while (true) {
|
||||
const t0 = now();
|
||||
// Get a list of running
|
||||
@ -413,6 +421,10 @@ export class FallbackProvider extends BaseProvider {
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
if (!first) {
|
||||
yield stall(100);
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
// All configs have run to completion; we will never get more data
|
||||
if (configs.filter((c) => !c.done).length === 0) {
|
||||
|
@ -135,7 +135,7 @@ export class Formatter {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
throw new Error("invaid boolean - " + value);
|
||||
throw new Error("invalid boolean - " + value);
|
||||
}
|
||||
hex(value, strict) {
|
||||
if (typeof (value) === "string") {
|
||||
|
@ -131,13 +131,15 @@ export class WebSocketProvider extends JsonRpcProvider {
|
||||
});
|
||||
}
|
||||
static defaultUrl() {
|
||||
return "ws:/" + "/localhost:8546";
|
||||
return "ws:/\/localhost:8546";
|
||||
}
|
||||
_subscribe(tag, param, processFunc) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let subIdPromise = this._subIds[tag];
|
||||
if (subIdPromise == null) {
|
||||
subIdPromise = this.send("eth_subscribe", param);
|
||||
subIdPromise = Promise.all(param).then((param) => {
|
||||
return this.send("eth_subscribe", param);
|
||||
});
|
||||
this._subIds[tag] = subIdPromise;
|
||||
}
|
||||
const subId = yield subIdPromise;
|
||||
@ -157,8 +159,11 @@ export class WebSocketProvider extends JsonRpcProvider {
|
||||
});
|
||||
break;
|
||||
case "filter":
|
||||
this._subscribe(event.tag, ["logs", event.filter], (result) => {
|
||||
this.emit(event.filter, result);
|
||||
this._subscribe(event.tag, ["logs", this._getFilter(event.filter)], (result) => {
|
||||
if (result.removed == null) {
|
||||
result.removed = false;
|
||||
}
|
||||
this.emit(event.filter, this.formatter.filterLog(result));
|
||||
});
|
||||
break;
|
||||
case "tx": {
|
||||
|
@ -772,7 +772,7 @@ var BaseProvider = /** @class */ (function (_super) {
|
||||
result[key] = _this._getBlockTag(filter[key]);
|
||||
});
|
||||
_b = (_a = this.formatter).filter;
|
||||
return [4 /*yield*/, properties_1.resolveProperties(filter)];
|
||||
return [4 /*yield*/, properties_1.resolveProperties(result)];
|
||||
case 3: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
||||
}
|
||||
});
|
||||
|
@ -3,4 +3,5 @@ import { UrlJsonRpcProvider } from "./url-json-rpc-provider";
|
||||
export declare class CloudflareProvider extends UrlJsonRpcProvider {
|
||||
static getApiKey(apiKey: any): any;
|
||||
static getUrl(network: Network, apiKey?: any): string;
|
||||
perform(method: string, params: any): Promise<any>;
|
||||
}
|
||||
|
@ -12,6 +12,42 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var url_json_rpc_provider_1 = require("./url-json-rpc-provider");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
@ -39,6 +75,22 @@ var CloudflareProvider = /** @class */ (function (_super) {
|
||||
}
|
||||
return host;
|
||||
};
|
||||
CloudflareProvider.prototype.perform = function (method, params) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var block;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
if (!(method === "getBlockNumber")) return [3 /*break*/, 2];
|
||||
return [4 /*yield*/, _super.prototype.perform.call(this, "getBlock", { blockTag: "latest" })];
|
||||
case 1:
|
||||
block = _a.sent();
|
||||
return [2 /*return*/, block.number];
|
||||
case 2: return [2 /*return*/, _super.prototype.perform.call(this, method, params)];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return CloudflareProvider;
|
||||
}(url_json_rpc_provider_1.UrlJsonRpcProvider));
|
||||
exports.CloudflareProvider = CloudflareProvider;
|
||||
|
@ -259,7 +259,7 @@ var EtherscanProvider = /** @class */ (function (_super) {
|
||||
url += apiKey;
|
||||
return [2 /*return*/, get(url)];
|
||||
}
|
||||
throw new Error("getBlock by blockHash not implmeneted");
|
||||
throw new Error("getBlock by blockHash not implemented");
|
||||
case 9:
|
||||
url += "/api?module=proxy&action=eth_getTransactionByHash&txhash=" + params.transactionHash;
|
||||
url += apiKey;
|
||||
|
@ -81,7 +81,7 @@ function checkNetworks(networks) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function median(values) {
|
||||
function median(values, maxDelta) {
|
||||
values = values.slice().sort();
|
||||
var middle = Math.floor(values.length / 2);
|
||||
// Odd length; take the middle
|
||||
@ -90,6 +90,9 @@ function median(values) {
|
||||
}
|
||||
// Even length; take the average of the two middle
|
||||
var a = values[middle - 1], b = values[middle];
|
||||
if (maxDelta != null && Math.abs(a - b) > maxDelta) {
|
||||
return null;
|
||||
}
|
||||
return (a + b) / 2;
|
||||
}
|
||||
function serialize(value) {
|
||||
@ -192,7 +195,11 @@ function getProcessFunc(provider, method, params) {
|
||||
return function (configs) {
|
||||
var values = configs.map(function (c) { return c.result; });
|
||||
// Get the median block number
|
||||
var blockNumber = Math.ceil(median(configs.map(function (c) { return c.result; })));
|
||||
var blockNumber = median(configs.map(function (c) { return c.result; }), 2);
|
||||
if (blockNumber == null) {
|
||||
return undefined;
|
||||
}
|
||||
blockNumber = Math.ceil(blockNumber);
|
||||
// If the next block height is present, its prolly safe to use
|
||||
if (values.indexOf(blockNumber + 1) >= 0) {
|
||||
blockNumber++;
|
||||
@ -360,7 +367,7 @@ var FallbackProvider = /** @class */ (function (_super) {
|
||||
}
|
||||
FallbackProvider.prototype.perform = function (method, params) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var processFunc, configs, i, _loop_1, this_1, state_1;
|
||||
var processFunc, configs, i, first, _loop_1, this_1, state_1;
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
@ -389,6 +396,7 @@ var FallbackProvider = /** @class */ (function (_super) {
|
||||
configs = random_1.shuffled(this.providerConfigs.map(function (c) { return properties_1.shallowCopy(c); }));
|
||||
configs.sort(function (a, b) { return (a.priority - b.priority); });
|
||||
i = 0;
|
||||
first = true;
|
||||
_loop_1 = function () {
|
||||
var t0, inflightWeight, _loop_2, waiting, results, result;
|
||||
return __generator(this, function (_a) {
|
||||
@ -460,12 +468,20 @@ var FallbackProvider = /** @class */ (function (_super) {
|
||||
_a.label = 2;
|
||||
case 2:
|
||||
results = configs.filter(function (c) { return (c.done && c.error == null); });
|
||||
if (results.length >= this_1.quorum) {
|
||||
result = processFunc(results);
|
||||
if (result !== undefined) {
|
||||
return [2 /*return*/, { value: result }];
|
||||
}
|
||||
if (!(results.length >= this_1.quorum)) return [3 /*break*/, 5];
|
||||
result = processFunc(results);
|
||||
if (result !== undefined) {
|
||||
return [2 /*return*/, { value: result }];
|
||||
}
|
||||
if (!!first) return [3 /*break*/, 4];
|
||||
return [4 /*yield*/, stall(100)];
|
||||
case 3:
|
||||
_a.sent();
|
||||
_a.label = 4;
|
||||
case 4:
|
||||
first = false;
|
||||
_a.label = 5;
|
||||
case 5:
|
||||
// All configs have run to completion; we will never get more data
|
||||
if (configs.filter(function (c) { return !c.done; }).length === 0) {
|
||||
return [2 /*return*/, "break"];
|
||||
|
@ -138,7 +138,7 @@ var Formatter = /** @class */ (function () {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
throw new Error("invaid boolean - " + value);
|
||||
throw new Error("invalid boolean - " + value);
|
||||
};
|
||||
Formatter.prototype.hex = function (value, strict) {
|
||||
if (typeof (value) === "string") {
|
||||
|
@ -188,17 +188,20 @@ var WebSocketProvider = /** @class */ (function (_super) {
|
||||
});
|
||||
};
|
||||
WebSocketProvider.defaultUrl = function () {
|
||||
return "ws:/" + "/localhost:8546";
|
||||
return "ws:/\/localhost:8546";
|
||||
};
|
||||
WebSocketProvider.prototype._subscribe = function (tag, param, processFunc) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var subIdPromise, subId;
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
subIdPromise = this._subIds[tag];
|
||||
if (subIdPromise == null) {
|
||||
subIdPromise = this.send("eth_subscribe", param);
|
||||
subIdPromise = Promise.all(param).then(function (param) {
|
||||
return _this.send("eth_subscribe", param);
|
||||
});
|
||||
this._subIds[tag] = subIdPromise;
|
||||
}
|
||||
return [4 /*yield*/, subIdPromise];
|
||||
@ -224,8 +227,11 @@ var WebSocketProvider = /** @class */ (function (_super) {
|
||||
});
|
||||
break;
|
||||
case "filter":
|
||||
this._subscribe(event.tag, ["logs", event.filter], function (result) {
|
||||
_this.emit(event.filter, result);
|
||||
this._subscribe(event.tag, ["logs", this._getFilter(event.filter)], function (result) {
|
||||
if (result.removed == null) {
|
||||
result.removed = false;
|
||||
}
|
||||
_this.emit(event.filter, _this.formatter.filterLog(result));
|
||||
});
|
||||
break;
|
||||
case "tx": {
|
||||
|
@ -56,7 +56,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0xdf3ecc5dba96a760a59197769b212c72a8c5f8b607d528d4654c975381ab3e25",
|
||||
"tarballHash": "0x8ed93dc5731b3952a7330ea77091897baabaa467c96b6fb030276c3a2356c66c",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.163"
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ describe('ABI Coder Encoding', function () {
|
||||
let types = JSON.parse(test.types);
|
||||
let result = test.result;
|
||||
let title = test.name + ' => (' + test.types + ') = (' + test.normalizedValues + ')';
|
||||
it(('encodes paramters - ' + test.name + ' - ' + test.types), function () {
|
||||
it(('encodes parameters - ' + test.name + ' - ' + test.types), function () {
|
||||
this.timeout(120000);
|
||||
let encoded = coder.encode(types, values);
|
||||
assert.equal(encoded, result, 'encoded data - ' + title);
|
||||
|
@ -557,9 +557,7 @@ function testProvider(providerName, networkName) {
|
||||
return;
|
||||
}
|
||||
// Cloudflare seems down and I want a fix out. RicMoo
|
||||
if (providerName === "CloudflareProvider") {
|
||||
return;
|
||||
}
|
||||
//if (providerName === "CloudflareProvider") { return; }
|
||||
if (networkName === "goerli" && providerName === "AlchemyProvider") {
|
||||
return;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ describe('Test Namehash', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('Test ID Hash Functione', function () {
|
||||
describe('Test ID Hash Functions', function () {
|
||||
const tests = [
|
||||
{
|
||||
name: 'setAddr signature hash',
|
||||
@ -245,7 +245,7 @@ describe('Test Base64 coder', function () {
|
||||
let decoded = ethers.utils.toUtf8Bytes(decodedText);
|
||||
let encoded = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=';
|
||||
assert.equal(ethers.utils.base64.encode(decoded), encoded, 'encodes to base64 string');
|
||||
assert.equal(ethers.utils.toUtf8String(ethers.utils.base64.decode(encoded)), decodedText, 'decodes from base64 sstring');
|
||||
assert.equal(ethers.utils.toUtf8String(ethers.utils.base64.decode(encoded)), decodedText, 'decodes from base64 string');
|
||||
});
|
||||
});
|
||||
describe('Test UTF-8 coder', function () {
|
||||
@ -341,7 +341,7 @@ describe('Test Bytes32String coder', function () {
|
||||
});
|
||||
});
|
||||
describe('Test BigNumber', function () {
|
||||
it("computes absoltue values", function () {
|
||||
it("computes absolute values", function () {
|
||||
function testAbs(test) {
|
||||
let value = ethers.BigNumber.from(test.value);
|
||||
let expected = ethers.BigNumber.from(test.expected);
|
||||
|
@ -29,7 +29,7 @@ describe('Test JSON Wallets', function () {
|
||||
return wallet.encrypt(password).then((json) => {
|
||||
return ethers.Wallet.fromEncryptedJson(json, password).then((decryptedWallet) => {
|
||||
assert.equal(decryptedWallet.address, wallet.address, 'decrypted wallet - ' + wallet.privateKey);
|
||||
assert.equal(decryptedWallet.mnemonic.phrase, wallet.mnemonic.phrase, "decrypted wallet menonic - " + wallet.privateKey);
|
||||
assert.equal(decryptedWallet.mnemonic.phrase, wallet.mnemonic.phrase, "decrypted wallet mnemonic - " + wallet.privateKey);
|
||||
assert.equal(decryptedWallet.mnemonic.path, wallet.mnemonic.path, "decrypted wallet path - " + wallet.privateKey);
|
||||
return decryptedWallet.encrypt(password).then((encryptedWallet) => {
|
||||
let parsedWallet = JSON.parse(encryptedWallet);
|
||||
@ -94,7 +94,7 @@ describe('Test Transaction Signing and Parsing', function () {
|
||||
// Legacy serializes unsigned transaction
|
||||
(function () {
|
||||
let unsignedTx = ethers.utils.serializeTransaction(transaction);
|
||||
assert.equal(unsignedTx, test.unsignedTransaction, 'serializes undsigned transaction (legacy)');
|
||||
assert.equal(unsignedTx, test.unsignedTransaction, 'serializes unsigned transaction (legacy)');
|
||||
// Legacy signed serialized transaction
|
||||
let signature = signDigest(ethers.utils.keccak256(unsignedTx));
|
||||
assert.equal(ethers.utils.serializeTransaction(transaction, signature), test.signedTransaction, 'signs transaction (legacy)');
|
||||
|
@ -107,7 +107,7 @@ describe('ABI Coder Encoding', function () {
|
||||
var types = JSON.parse(test.types);
|
||||
var result = test.result;
|
||||
var title = test.name + ' => (' + test.types + ') = (' + test.normalizedValues + ')';
|
||||
it(('encodes paramters - ' + test.name + ' - ' + test.types), function () {
|
||||
it(('encodes parameters - ' + test.name + ' - ' + test.types), function () {
|
||||
this.timeout(120000);
|
||||
var encoded = coder.encode(types, values);
|
||||
assert_1.default.equal(encoded, result, 'encoded data - ' + title);
|
||||
|
@ -561,9 +561,7 @@ function testProvider(providerName, networkName) {
|
||||
return;
|
||||
}
|
||||
// Cloudflare seems down and I want a fix out. RicMoo
|
||||
if (providerName === "CloudflareProvider") {
|
||||
return;
|
||||
}
|
||||
//if (providerName === "CloudflareProvider") { return; }
|
||||
if (networkName === "goerli" && providerName === "AlchemyProvider") {
|
||||
return;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ describe('Test Namehash', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('Test ID Hash Functione', function () {
|
||||
describe('Test ID Hash Functions', function () {
|
||||
var tests = [
|
||||
{
|
||||
name: 'setAddr signature hash',
|
||||
@ -256,7 +256,7 @@ describe('Test Base64 coder', function () {
|
||||
var decoded = ethers_1.ethers.utils.toUtf8Bytes(decodedText);
|
||||
var encoded = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=';
|
||||
assert_1.default.equal(ethers_1.ethers.utils.base64.encode(decoded), encoded, 'encodes to base64 string');
|
||||
assert_1.default.equal(ethers_1.ethers.utils.toUtf8String(ethers_1.ethers.utils.base64.decode(encoded)), decodedText, 'decodes from base64 sstring');
|
||||
assert_1.default.equal(ethers_1.ethers.utils.toUtf8String(ethers_1.ethers.utils.base64.decode(encoded)), decodedText, 'decodes from base64 string');
|
||||
});
|
||||
});
|
||||
describe('Test UTF-8 coder', function () {
|
||||
@ -352,7 +352,7 @@ describe('Test Bytes32String coder', function () {
|
||||
});
|
||||
});
|
||||
describe('Test BigNumber', function () {
|
||||
it("computes absoltue values", function () {
|
||||
it("computes absolute values", function () {
|
||||
function testAbs(test) {
|
||||
var value = ethers_1.ethers.BigNumber.from(test.value);
|
||||
var expected = ethers_1.ethers.BigNumber.from(test.expected);
|
||||
|
@ -40,7 +40,7 @@ describe('Test JSON Wallets', function () {
|
||||
return wallet.encrypt(password).then(function (json) {
|
||||
return ethers_1.ethers.Wallet.fromEncryptedJson(json, password).then(function (decryptedWallet) {
|
||||
assert_1.default.equal(decryptedWallet.address, wallet.address, 'decrypted wallet - ' + wallet.privateKey);
|
||||
assert_1.default.equal(decryptedWallet.mnemonic.phrase, wallet.mnemonic.phrase, "decrypted wallet menonic - " + wallet.privateKey);
|
||||
assert_1.default.equal(decryptedWallet.mnemonic.phrase, wallet.mnemonic.phrase, "decrypted wallet mnemonic - " + wallet.privateKey);
|
||||
assert_1.default.equal(decryptedWallet.mnemonic.path, wallet.mnemonic.path, "decrypted wallet path - " + wallet.privateKey);
|
||||
return decryptedWallet.encrypt(password).then(function (encryptedWallet) {
|
||||
var parsedWallet = JSON.parse(encryptedWallet);
|
||||
@ -105,7 +105,7 @@ describe('Test Transaction Signing and Parsing', function () {
|
||||
// Legacy serializes unsigned transaction
|
||||
(function () {
|
||||
var unsignedTx = ethers_1.ethers.utils.serializeTransaction(transaction);
|
||||
assert_1.default.equal(unsignedTx, test.unsignedTransaction, 'serializes undsigned transaction (legacy)');
|
||||
assert_1.default.equal(unsignedTx, test.unsignedTransaction, 'serializes unsigned transaction (legacy)');
|
||||
// Legacy signed serialized transaction
|
||||
var signature = signDigest(ethers_1.ethers.utils.keccak256(unsignedTx));
|
||||
assert_1.default.equal(ethers_1.ethers.utils.serializeTransaction(transaction, signature), test.signedTransaction, 'signs transaction (legacy)');
|
||||
|
@ -39,7 +39,7 @@
|
||||
"scripts": {
|
||||
"test": "exit 1"
|
||||
},
|
||||
"tarballHash": "0x6b5c3b2a65eadbb9c8080540429f43ebbaccb67135db81ebfafa605a8bdb35a6",
|
||||
"tarballHash": "0xce6551574d7db92e9a59a54ccdfa185955433f5cda3602a89fa9499804335ca9",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.157"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user