2
0
mirror of synced 2025-02-23 19:48:28 +00:00

Updated dist files.

This commit is contained in:
Richard Moore 2020-04-15 18:28:04 -04:00
parent 797abb7267
commit 54dfaacba3
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
67 changed files with 501 additions and 262 deletions

View File

@ -3,6 +3,15 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.0-beta.181 (2020-04-15 18:23)
-----------------------------------------
- Temporarily remove CloudflareProvider tests; it is down and breaking the tests. ([797abb7](https://github.com/ethers-io/ethers.js/commit/797abb726711499d96bf1c12c61e3bb1a7b4925d))
- Better error reporting for Fragments. ([7dcefcb](https://github.com/ethers-io/ethers.js/commit/7dcefcbf71ef337103639bbe3f4ad2625565651a))
- Fixed Contract filter unsubscribing. ([2eb3823](https://github.com/ethers-io/ethers.js/commit/2eb3823de4ba111cc0c746a0715fe6dd3d1b16da), [39c78f3](https://github.com/ethers-io/ethers.js/commit/39c78f37ceff9b8ec08329903dcba7bd53bd8661))
- Fixed WebSocketProvider filter events. ([#784](https://github.com/ethers-io/ethers.js/issues/784); [69f7077](https://github.com/ethers-io/ethers.js/commit/69f707762ed5939c5f52bf6dce5c5513aaf6fa1d))
- Added bitwise operations to BigNumber. ([#781](https://github.com/ethers-io/ethers.js/issues/781); [7498c18](https://github.com/ethers-io/ethers.js/commit/7498c18235c7566b2f652cddba991f55e0943da8), [284771e](https://github.com/ethers-io/ethers.js/commit/284771ea39b6f4ee9cdf75ce5feea9e6aa9a65c5))
ethers/v5.0.0-beta.180 (2020-04-03 22:10)
-----------------------------------------

View File

@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.149";
export declare const version = "abi/5.0.0-beta.150";

View File

@ -1 +1 @@
export const version = "abi/5.0.0-beta.149";
export const version = "abi/5.0.0-beta.150";

View File

@ -12,24 +12,24 @@ export class NumberCoder extends Coder {
encode(writer, value) {
let v = BigNumber.from(value);
// Check bounds are safe for encoding
let maxUintValue = MaxUint256.maskn(writer.wordSize * 8);
let maxUintValue = MaxUint256.mask(writer.wordSize * 8);
if (this.signed) {
let bounds = maxUintValue.maskn(this.size * 8 - 1);
let bounds = maxUintValue.mask(this.size * 8 - 1);
if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {
this._throwError("value out-of-bounds", value);
}
}
else if (v.lt(Zero) || v.gt(maxUintValue.maskn(this.size * 8))) {
else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
this._throwError("value out-of-bounds", value);
}
v = v.toTwos(this.size * 8).maskn(this.size * 8);
v = v.toTwos(this.size * 8).mask(this.size * 8);
if (this.signed) {
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
}
return writer.writeValue(v);
}
decode(reader) {
let value = reader.readValue().maskn(this.size * 8);
let value = reader.readValue().mask(this.size * 8);
if (this.signed) {
value = value.fromTwos(this.size * 8);
}

View File

@ -27,7 +27,7 @@ function checkModifier(type, name) {
function parseParamType(param, allowIndexed) {
let originalParam = param;
function throwError(i) {
throw new Error("unexpected character '" + originalParam[i] + "' at position " + i + " in '" + originalParam + "'");
logger.throwArgumentError(`unexpected character at position ${i}`, "param", param);
}
param = param.replace(/\s/g, " ");
function newNode(parent) {
@ -166,7 +166,7 @@ function parseParamType(param, allowIndexed) {
}
}
if (node.parent) {
throw new Error("unexpected eof");
logger.throwArgumentError("unexpected eof", "param", param);
}
delete parent.state;
if (node.name === "indexed") {
@ -204,7 +204,9 @@ const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
export class ParamType {
constructor(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use fromString");
logger.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new ParamType()"
});
}
populate(this, params);
let match = this.type.match(paramTypeArray);
@ -318,7 +320,9 @@ function parseParams(value, allowIndex) {
export class Fragment {
constructor(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use a static from method");
logger.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new Fragment()"
});
}
populate(this, params);
this._isFragment = true;
@ -365,7 +369,7 @@ export class Fragment {
else if (value.split("(")[0].trim() === "constructor") {
return ConstructorFragment.fromString(value.trim());
}
throw new Error("unknown fragment");
return logger.throwArgumentError("unsupported fragment", "value", value);
}
static isFragment(value) {
return !!(value && value._isFragment);
@ -410,7 +414,7 @@ export class EventFragment extends Fragment {
return value;
}
if (value.type !== "event") {
throw new Error("invalid event object - " + value.type);
logger.throwArgumentError("invalid event object", "value", value);
}
return new EventFragment(_constructorGuard, {
name: verifyIdentifier(value.name),
@ -422,7 +426,7 @@ export class EventFragment extends Fragment {
static fromString(value) {
let match = value.match(regexParen);
if (!match) {
throw new Error("invalid event: " + value);
logger.throwArgumentError("invalid event string", "value", value);
}
let anonymous = false;
match[3].split(" ").forEach((modifier) => {
@ -452,10 +456,10 @@ function parseGas(value, params) {
let comps = value.split("@");
if (comps.length !== 1) {
if (comps.length > 2) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
}
if (!comps[1].match(/^[0-9]+$/)) {
throw new Error("invalid signature gas");
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
}
params.gas = BigNumber.from(comps[1]);
return comps[0];
@ -504,14 +508,14 @@ function verifyState(value) {
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
if (value.constant != null) {
if ((!!value.constant) !== result.constant) {
throw new Error("cannot have constant function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
}
}
// Set (and check things are consistent) the payable property
result.payable = (result.stateMutability === "payable");
if (value.payable != null) {
if ((!!value.payable) !== result.payable) {
throw new Error("cannot have payable function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
}
}
}
@ -519,7 +523,7 @@ function verifyState(value) {
result.payable = !!value.payable;
// If payable we can assume non-constant; otherwise we can't assume
if (value.constant == null && !result.payable && value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
result.constant = !!value.constant;
if (result.constant) {
@ -529,7 +533,7 @@ function verifyState(value) {
result.stateMutability = (result.payable ? "payable" : "nonpayable");
}
if (result.payable && result.constant) {
throw new Error("cannot have constant payable function");
logger.throwArgumentError("cannot have constant payable function", "value", value);
}
}
else if (value.constant != null) {
@ -538,7 +542,7 @@ function verifyState(value) {
result.stateMutability = (result.constant ? "view" : "payable");
}
else if (value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
return result;
}
@ -581,11 +585,11 @@ export class ConstructorFragment extends Fragment {
return value;
}
if (value.type !== "constructor") {
throw new Error("invalid constructor object - " + value.type);
logger.throwArgumentError("invalid constructor object", "value", value);
}
let state = verifyState(value);
if (state.constant) {
throw new Error("constructor cannot be constant");
logger.throwArgumentError("constructor cannot be constant", "value", value);
}
return new ConstructorFragment(_constructorGuard, {
name: null,
@ -599,11 +603,8 @@ export class ConstructorFragment extends Fragment {
let params = { type: "constructor" };
value = parseGas(value, params);
let parens = value.match(regexParen);
if (!parens) {
throw new Error("invalid constructor: " + value);
}
if (parens[1].trim() !== "constructor") {
throw new Error("invalid constructor");
if (!parens || parens[1].trim() !== "constructor") {
logger.throwArgumentError("invalid constructor string", "value", value);
}
params.inputs = parseParams(parens[2].trim(), false);
parseModifiers(parens[3].trim(), params);
@ -667,7 +668,7 @@ export class FunctionFragment extends ConstructorFragment {
return value;
}
if (value.type !== "function") {
throw new Error("invalid function object - " + value.type);
logger.throwArgumentError("invalid function object", "value", value);
}
let state = verifyState(value);
return new FunctionFragment(_constructorGuard, {
@ -686,15 +687,15 @@ export class FunctionFragment extends ConstructorFragment {
value = parseGas(value, params);
let comps = value.split(" returns ");
if (comps.length > 2) {
throw new Error("invalid function");
logger.throwArgumentError("invalid function string", "value", value);
}
let parens = comps[0].match(regexParen);
if (!parens) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid function signature", "value", value);
}
params.name = parens[1].trim();
if (!params.name.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + params.name + "'");
if (params.name) {
verifyIdentifier(params.name);
}
params.inputs = parseParams(parens[2], false);
parseModifiers(parens[3].trim(), params);
@ -702,7 +703,7 @@ export class FunctionFragment extends ConstructorFragment {
if (comps.length > 1) {
let returns = comps[1].match(regexParen);
if (returns[1].trim() != "" || returns[3].trim() != "") {
throw new Error("unexpected tokens");
logger.throwArgumentError("unexpected tokens", "value", value);
}
params.outputs = parseParams(returns[2], false);
}
@ -733,7 +734,7 @@ function verifyType(type) {
const regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + value + "'");
logger.throwArgumentError(`invalid identifier "${value}"`, "value", value);
}
return value;
}
@ -757,7 +758,7 @@ function splitNesting(value) {
else if (c === ")") {
depth--;
if (depth === -1) {
throw new Error("unbalanced parenthsis");
logger.throwArgumentError("unbalanced parenthsis", "value", value);
}
}
}

View File

@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.149";
export declare const version = "abi/5.0.0-beta.150";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abi/5.0.0-beta.149";
exports.version = "abi/5.0.0-beta.150";

View File

@ -29,24 +29,24 @@ var NumberCoder = /** @class */ (function (_super) {
NumberCoder.prototype.encode = function (writer, value) {
var v = bignumber_1.BigNumber.from(value);
// Check bounds are safe for encoding
var maxUintValue = constants_1.MaxUint256.maskn(writer.wordSize * 8);
var maxUintValue = constants_1.MaxUint256.mask(writer.wordSize * 8);
if (this.signed) {
var bounds = maxUintValue.maskn(this.size * 8 - 1);
var bounds = maxUintValue.mask(this.size * 8 - 1);
if (v.gt(bounds) || v.lt(bounds.add(constants_1.One).mul(constants_1.NegativeOne))) {
this._throwError("value out-of-bounds", value);
}
}
else if (v.lt(constants_1.Zero) || v.gt(maxUintValue.maskn(this.size * 8))) {
else if (v.lt(constants_1.Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
this._throwError("value out-of-bounds", value);
}
v = v.toTwos(this.size * 8).maskn(this.size * 8);
v = v.toTwos(this.size * 8).mask(this.size * 8);
if (this.signed) {
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
}
return writer.writeValue(v);
};
NumberCoder.prototype.decode = function (reader) {
var value = reader.readValue().maskn(this.size * 8);
var value = reader.readValue().mask(this.size * 8);
if (this.signed) {
value = value.fromTwos(this.size * 8);
}

View File

@ -41,7 +41,7 @@ function checkModifier(type, name) {
function parseParamType(param, allowIndexed) {
var originalParam = param;
function throwError(i) {
throw new Error("unexpected character '" + originalParam[i] + "' at position " + i + " in '" + originalParam + "'");
logger.throwArgumentError("unexpected character at position " + i, "param", param);
}
param = param.replace(/\s/g, " ");
function newNode(parent) {
@ -180,7 +180,7 @@ function parseParamType(param, allowIndexed) {
}
}
if (node.parent) {
throw new Error("unexpected eof");
logger.throwArgumentError("unexpected eof", "param", param);
}
delete parent.state;
if (node.name === "indexed") {
@ -218,7 +218,9 @@ var paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
var ParamType = /** @class */ (function () {
function ParamType(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use fromString");
logger.throwError("use fromString", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new ParamType()"
});
}
populate(this, params);
var match = this.type.match(paramTypeArray);
@ -334,7 +336,9 @@ function parseParams(value, allowIndex) {
var Fragment = /** @class */ (function () {
function Fragment(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use a static from method");
logger.throwError("use a static from method", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new Fragment()"
});
}
populate(this, params);
this._isFragment = true;
@ -381,7 +385,7 @@ var Fragment = /** @class */ (function () {
else if (value.split("(")[0].trim() === "constructor") {
return ConstructorFragment.fromString(value.trim());
}
throw new Error("unknown fragment");
return logger.throwArgumentError("unsupported fragment", "value", value);
};
Fragment.isFragment = function (value) {
return !!(value && value._isFragment);
@ -432,7 +436,7 @@ var EventFragment = /** @class */ (function (_super) {
return value;
}
if (value.type !== "event") {
throw new Error("invalid event object - " + value.type);
logger.throwArgumentError("invalid event object", "value", value);
}
return new EventFragment(_constructorGuard, {
name: verifyIdentifier(value.name),
@ -444,7 +448,7 @@ var EventFragment = /** @class */ (function (_super) {
EventFragment.fromString = function (value) {
var match = value.match(regexParen);
if (!match) {
throw new Error("invalid event: " + value);
logger.throwArgumentError("invalid event string", "value", value);
}
var anonymous = false;
match[3].split(" ").forEach(function (modifier) {
@ -476,10 +480,10 @@ function parseGas(value, params) {
var comps = value.split("@");
if (comps.length !== 1) {
if (comps.length > 2) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
}
if (!comps[1].match(/^[0-9]+$/)) {
throw new Error("invalid signature gas");
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
}
params.gas = bignumber_1.BigNumber.from(comps[1]);
return comps[0];
@ -528,14 +532,14 @@ function verifyState(value) {
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
if (value.constant != null) {
if ((!!value.constant) !== result.constant) {
throw new Error("cannot have constant function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
}
}
// Set (and check things are consistent) the payable property
result.payable = (result.stateMutability === "payable");
if (value.payable != null) {
if ((!!value.payable) !== result.payable) {
throw new Error("cannot have payable function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
}
}
}
@ -543,7 +547,7 @@ function verifyState(value) {
result.payable = !!value.payable;
// If payable we can assume non-constant; otherwise we can't assume
if (value.constant == null && !result.payable && value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
result.constant = !!value.constant;
if (result.constant) {
@ -553,7 +557,7 @@ function verifyState(value) {
result.stateMutability = (result.payable ? "payable" : "nonpayable");
}
if (result.payable && result.constant) {
throw new Error("cannot have constant payable function");
logger.throwArgumentError("cannot have constant payable function", "value", value);
}
}
else if (value.constant != null) {
@ -562,7 +566,7 @@ function verifyState(value) {
result.stateMutability = (result.constant ? "view" : "payable");
}
else if (value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
return result;
}
@ -609,11 +613,11 @@ var ConstructorFragment = /** @class */ (function (_super) {
return value;
}
if (value.type !== "constructor") {
throw new Error("invalid constructor object - " + value.type);
logger.throwArgumentError("invalid constructor object", "value", value);
}
var state = verifyState(value);
if (state.constant) {
throw new Error("constructor cannot be constant");
logger.throwArgumentError("constructor cannot be constant", "value", value);
}
return new ConstructorFragment(_constructorGuard, {
name: null,
@ -627,11 +631,8 @@ var ConstructorFragment = /** @class */ (function (_super) {
var params = { type: "constructor" };
value = parseGas(value, params);
var parens = value.match(regexParen);
if (!parens) {
throw new Error("invalid constructor: " + value);
}
if (parens[1].trim() !== "constructor") {
throw new Error("invalid constructor");
if (!parens || parens[1].trim() !== "constructor") {
logger.throwArgumentError("invalid constructor string", "value", value);
}
params.inputs = parseParams(parens[2].trim(), false);
parseModifiers(parens[3].trim(), params);
@ -701,7 +702,7 @@ var FunctionFragment = /** @class */ (function (_super) {
return value;
}
if (value.type !== "function") {
throw new Error("invalid function object - " + value.type);
logger.throwArgumentError("invalid function object", "value", value);
}
var state = verifyState(value);
return new FunctionFragment(_constructorGuard, {
@ -720,15 +721,15 @@ var FunctionFragment = /** @class */ (function (_super) {
value = parseGas(value, params);
var comps = value.split(" returns ");
if (comps.length > 2) {
throw new Error("invalid function");
logger.throwArgumentError("invalid function string", "value", value);
}
var parens = comps[0].match(regexParen);
if (!parens) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid function signature", "value", value);
}
params.name = parens[1].trim();
if (!params.name.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + params.name + "'");
if (params.name) {
verifyIdentifier(params.name);
}
params.inputs = parseParams(parens[2], false);
parseModifiers(parens[3].trim(), params);
@ -736,7 +737,7 @@ var FunctionFragment = /** @class */ (function (_super) {
if (comps.length > 1) {
var returns = comps[1].match(regexParen);
if (returns[1].trim() != "" || returns[3].trim() != "") {
throw new Error("unexpected tokens");
logger.throwArgumentError("unexpected tokens", "value", value);
}
params.outputs = parseParams(returns[2], false);
}
@ -769,7 +770,7 @@ function verifyType(type) {
var regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + value + "'");
logger.throwArgumentError("invalid identifier \"" + value + "\"", "value", value);
}
return value;
}
@ -793,7 +794,7 @@ function splitNesting(value) {
else if (c === ")") {
depth--;
if (depth === -1) {
throw new Error("unbalanced parenthsis");
logger.throwArgumentError("unbalanced parenthsis", "value", value);
}
}
}

View File

@ -31,7 +31,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x2f553c332ca62bdcdf54d5de432cafaa2fd06e1092663612c74b25b84b346120",
"tarballHash": "0x2e1c980d6089115e1936adc403a60c3131ad61225c3b11b8b9aacd41ca9c5db0",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.149"
"version": "5.0.0-beta.150"
}

View File

@ -1 +1 @@
export const version = "abi/5.0.0-beta.149";
export const version = "abi/5.0.0-beta.150";

View File

@ -1 +1 @@
export declare const version = "asm/5.0.0-beta.156";
export declare const version = "asm/5.0.0-beta.157";

View File

@ -1 +1 @@
export const version = "asm/5.0.0-beta.156";
export const version = "asm/5.0.0-beta.157";

View File

@ -1 +1 @@
export declare const version = "asm/5.0.0-beta.156";
export declare const version = "asm/5.0.0-beta.157";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "asm/5.0.0-beta.156";
exports.version = "asm/5.0.0-beta.157";

View File

@ -29,7 +29,7 @@
"generate": "node ./generate.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x83f3a40b745d707baed37b1405bfdbd1c216cc680840329846f936515d101d64",
"tarballHash": "0xc32734413bbb1f14895c26ed325257354c8bc27312b70ecf81426ed4086da18b",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.156"
"version": "5.0.0-beta.157"
}

View File

@ -1 +1 @@
export const version = "asm/5.0.0-beta.156";
export const version = "asm/5.0.0-beta.157";

View File

@ -1 +1 @@
export declare const version = "bignumber/5.0.0-beta.136";
export declare const version = "bignumber/5.0.0-beta.137";

View File

@ -1 +1 @@
export const version = "bignumber/5.0.0-beta.136";
export const version = "bignumber/5.0.0-beta.137";

View File

@ -14,12 +14,18 @@ export declare class BigNumber implements Hexable {
mul(other: BigNumberish): BigNumber;
mod(other: BigNumberish): BigNumber;
pow(other: BigNumberish): BigNumber;
maskn(value: number): BigNumber;
and(other: BigNumberish): BigNumber;
or(other: BigNumberish): BigNumber;
xor(other: BigNumberish): BigNumber;
mask(value: number): BigNumber;
shl(value: number): BigNumber;
shr(value: number): BigNumber;
eq(other: BigNumberish): boolean;
lt(other: BigNumberish): boolean;
lte(other: BigNumberish): boolean;
gt(other: BigNumberish): boolean;
gte(other: BigNumberish): boolean;
isNegative(): boolean;
isZero(): boolean;
toNumber(): number;
toString(): string;

View File

@ -62,14 +62,54 @@ export class BigNumber {
return toBigNumber(toBN(this).mul(toBN(other)));
}
mod(other) {
return toBigNumber(toBN(this).mod(toBN(other)));
const value = toBN(other);
if (value.isNeg()) {
throwFault("cannot modulo negative values", "mod");
}
return toBigNumber(toBN(this).umod(value));
}
pow(other) {
return toBigNumber(toBN(this).pow(toBN(other)));
}
maskn(value) {
and(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'and' negative values", "and");
}
return toBigNumber(toBN(this).and(value));
}
or(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'or' negative values", "or");
}
return toBigNumber(toBN(this).or(value));
}
xor(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'xor' negative values", "xor");
}
return toBigNumber(toBN(this).xor(value));
}
mask(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot mask negative values", "mask");
}
return toBigNumber(toBN(this).maskn(value));
}
shl(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shl");
}
return toBigNumber(toBN(this).shln(value));
}
shr(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shr");
}
return toBigNumber(toBN(this).shrn(value));
}
eq(other) {
return toBN(this).eq(toBN(other));
}
@ -85,6 +125,9 @@ export class BigNumber {
gte(other) {
return toBN(this).gte(toBN(other));
}
isNegative() {
return (this._hex[0] === "-");
}
isZero() {
return toBN(this).isZero();
}

View File

@ -1 +1 @@
export declare const version = "bignumber/5.0.0-beta.136";
export declare const version = "bignumber/5.0.0-beta.137";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "bignumber/5.0.0-beta.136";
exports.version = "bignumber/5.0.0-beta.137";

View File

@ -14,12 +14,18 @@ export declare class BigNumber implements Hexable {
mul(other: BigNumberish): BigNumber;
mod(other: BigNumberish): BigNumber;
pow(other: BigNumberish): BigNumber;
maskn(value: number): BigNumber;
and(other: BigNumberish): BigNumber;
or(other: BigNumberish): BigNumber;
xor(other: BigNumberish): BigNumber;
mask(value: number): BigNumber;
shl(value: number): BigNumber;
shr(value: number): BigNumber;
eq(other: BigNumberish): boolean;
lt(other: BigNumberish): boolean;
lte(other: BigNumberish): boolean;
gt(other: BigNumberish): boolean;
gte(other: BigNumberish): boolean;
isNegative(): boolean;
isZero(): boolean;
toNumber(): number;
toString(): string;

View File

@ -65,14 +65,54 @@ var BigNumber = /** @class */ (function () {
return toBigNumber(toBN(this).mul(toBN(other)));
};
BigNumber.prototype.mod = function (other) {
return toBigNumber(toBN(this).mod(toBN(other)));
var value = toBN(other);
if (value.isNeg()) {
throwFault("cannot modulo negative values", "mod");
}
return toBigNumber(toBN(this).umod(value));
};
BigNumber.prototype.pow = function (other) {
return toBigNumber(toBN(this).pow(toBN(other)));
};
BigNumber.prototype.maskn = function (value) {
BigNumber.prototype.and = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'and' negative values", "and");
}
return toBigNumber(toBN(this).and(value));
};
BigNumber.prototype.or = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'or' negative values", "or");
}
return toBigNumber(toBN(this).or(value));
};
BigNumber.prototype.xor = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'xor' negative values", "xor");
}
return toBigNumber(toBN(this).xor(value));
};
BigNumber.prototype.mask = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot mask negative values", "mask");
}
return toBigNumber(toBN(this).maskn(value));
};
BigNumber.prototype.shl = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shl");
}
return toBigNumber(toBN(this).shln(value));
};
BigNumber.prototype.shr = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shr");
}
return toBigNumber(toBN(this).shrn(value));
};
BigNumber.prototype.eq = function (other) {
return toBN(this).eq(toBN(other));
};
@ -88,6 +128,9 @@ var BigNumber = /** @class */ (function () {
BigNumber.prototype.gte = function (other) {
return toBN(this).gte(toBN(other));
};
BigNumber.prototype.isNegative = function () {
return (this._hex[0] === "-");
};
BigNumber.prototype.isZero = function () {
return toBN(this).isZero();
};

View File

@ -27,7 +27,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0xe97ddcd783677f38d7653e830ef63d485b09c77dfca102d5d1e264568e9f0238",
"tarballHash": "0x7e4030fc7f7653023c094089c662dace0b3215880d407e06c5af0fc20dd4af4b",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.136"
"version": "5.0.0-beta.137"
}

View File

@ -1 +1 @@
export const version = "bignumber/5.0.0-beta.136";
export const version = "bignumber/5.0.0-beta.137";

View File

@ -1 +1 @@
export declare const version = "contracts/5.0.0-beta.146";
export declare const version = "contracts/5.0.0-beta.147";

View File

@ -1 +1 @@
export const version = "contracts/5.0.0-beta.146";
export const version = "contracts/5.0.0-beta.147";

View File

@ -507,12 +507,12 @@ export class Contract {
_checkRunningEvents(runningEvent) {
if (runningEvent.listenerCount() === 0) {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
}
_wrapEvent(runningEvent, log, listener) {

View File

@ -1 +1 @@
export declare const version = "contracts/5.0.0-beta.146";
export declare const version = "contracts/5.0.0-beta.147";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "contracts/5.0.0-beta.146";
exports.version = "contracts/5.0.0-beta.147";

View File

@ -554,12 +554,12 @@ var Contract = /** @class */ (function () {
Contract.prototype._checkRunningEvents = function (runningEvent) {
if (runningEvent.listenerCount() === 0) {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
var emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
// If we have a poller for this, remove it
var emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
};
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {

View File

@ -32,7 +32,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x3623ceda84f4a2c5e122719048af58553d66c6d2c83b5e63f94dfd964fbd12ee",
"tarballHash": "0xf9eed94c2691cdfba2ad5388d60b3c10740a130b29ff74ac141e5b5043d79f87",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.146"
"version": "5.0.0-beta.147"
}

View File

@ -1 +1 @@
export const version = "contracts/5.0.0-beta.146";
export const version = "contracts/5.0.0-beta.147";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4135,7 +4135,7 @@ var lib_esm$1 = /*#__PURE__*/Object.freeze({
joinSignature: joinSignature
});
const version$2 = "bignumber/5.0.0-beta.136";
const version$2 = "bignumber/5.0.0-beta.137";
"use strict";
const logger$1 = new Logger(version$2);
@ -4190,14 +4190,54 @@ class BigNumber {
return toBigNumber(toBN(this).mul(toBN(other)));
}
mod(other) {
return toBigNumber(toBN(this).mod(toBN(other)));
const value = toBN(other);
if (value.isNeg()) {
throwFault("cannot modulo negative values", "mod");
}
return toBigNumber(toBN(this).umod(value));
}
pow(other) {
return toBigNumber(toBN(this).pow(toBN(other)));
}
maskn(value) {
and(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'and' negative values", "and");
}
return toBigNumber(toBN(this).and(value));
}
or(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'or' negative values", "or");
}
return toBigNumber(toBN(this).or(value));
}
xor(other) {
const value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'xor' negative values", "xor");
}
return toBigNumber(toBN(this).xor(value));
}
mask(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot mask negative values", "mask");
}
return toBigNumber(toBN(this).maskn(value));
}
shl(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shl");
}
return toBigNumber(toBN(this).shln(value));
}
shr(value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shr");
}
return toBigNumber(toBN(this).shrn(value));
}
eq(other) {
return toBN(this).eq(toBN(other));
}
@ -4213,6 +4253,9 @@ class BigNumber {
gte(other) {
return toBN(this).gte(toBN(other));
}
isNegative() {
return (this._hex[0] === "-");
}
isZero() {
return toBN(this).isZero();
}
@ -4762,7 +4805,7 @@ var lib_esm$2 = /*#__PURE__*/Object.freeze({
Description: Description
});
const version$4 = "abi/5.0.0-beta.149";
const version$4 = "abi/5.0.0-beta.150";
"use strict";
const logger$4 = new Logger(version$4);
@ -4789,7 +4832,7 @@ function checkModifier(type, name) {
function parseParamType(param, allowIndexed) {
let originalParam = param;
function throwError(i) {
throw new Error("unexpected character '" + originalParam[i] + "' at position " + i + " in '" + originalParam + "'");
logger$4.throwArgumentError(`unexpected character at position ${i}`, "param", param);
}
param = param.replace(/\s/g, " ");
function newNode(parent) {
@ -4928,7 +4971,7 @@ function parseParamType(param, allowIndexed) {
}
}
if (node.parent) {
throw new Error("unexpected eof");
logger$4.throwArgumentError("unexpected eof", "param", param);
}
delete parent.state;
if (node.name === "indexed") {
@ -4966,7 +5009,9 @@ const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
class ParamType {
constructor(constructorGuard, params) {
if (constructorGuard !== _constructorGuard$2) {
throw new Error("use fromString");
logger$4.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new ParamType()"
});
}
populate(this, params);
let match = this.type.match(paramTypeArray);
@ -5080,7 +5125,9 @@ function parseParams(value, allowIndex) {
class Fragment {
constructor(constructorGuard, params) {
if (constructorGuard !== _constructorGuard$2) {
throw new Error("use a static from method");
logger$4.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new Fragment()"
});
}
populate(this, params);
this._isFragment = true;
@ -5127,7 +5174,7 @@ class Fragment {
else if (value.split("(")[0].trim() === "constructor") {
return ConstructorFragment.fromString(value.trim());
}
throw new Error("unknown fragment");
return logger$4.throwArgumentError("unsupported fragment", "value", value);
}
static isFragment(value) {
return !!(value && value._isFragment);
@ -5172,7 +5219,7 @@ class EventFragment extends Fragment {
return value;
}
if (value.type !== "event") {
throw new Error("invalid event object - " + value.type);
logger$4.throwArgumentError("invalid event object", "value", value);
}
return new EventFragment(_constructorGuard$2, {
name: verifyIdentifier(value.name),
@ -5184,7 +5231,7 @@ class EventFragment extends Fragment {
static fromString(value) {
let match = value.match(regexParen);
if (!match) {
throw new Error("invalid event: " + value);
logger$4.throwArgumentError("invalid event string", "value", value);
}
let anonymous = false;
match[3].split(" ").forEach((modifier) => {
@ -5214,10 +5261,10 @@ function parseGas(value, params) {
let comps = value.split("@");
if (comps.length !== 1) {
if (comps.length > 2) {
throw new Error("invalid signature");
logger$4.throwArgumentError("invalid human-readable ABI signature", "value", value);
}
if (!comps[1].match(/^[0-9]+$/)) {
throw new Error("invalid signature gas");
logger$4.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
}
params.gas = BigNumber.from(comps[1]);
return comps[0];
@ -5266,14 +5313,14 @@ function verifyState(value) {
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
if (value.constant != null) {
if ((!!value.constant) !== result.constant) {
throw new Error("cannot have constant function with mutability " + result.stateMutability);
logger$4.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
}
}
// Set (and check things are consistent) the payable property
result.payable = (result.stateMutability === "payable");
if (value.payable != null) {
if ((!!value.payable) !== result.payable) {
throw new Error("cannot have payable function with mutability " + result.stateMutability);
logger$4.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
}
}
}
@ -5281,7 +5328,7 @@ function verifyState(value) {
result.payable = !!value.payable;
// If payable we can assume non-constant; otherwise we can't assume
if (value.constant == null && !result.payable && value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger$4.throwArgumentError("unable to determine stateMutability", "value", value);
}
result.constant = !!value.constant;
if (result.constant) {
@ -5291,7 +5338,7 @@ function verifyState(value) {
result.stateMutability = (result.payable ? "payable" : "nonpayable");
}
if (result.payable && result.constant) {
throw new Error("cannot have constant payable function");
logger$4.throwArgumentError("cannot have constant payable function", "value", value);
}
}
else if (value.constant != null) {
@ -5300,7 +5347,7 @@ function verifyState(value) {
result.stateMutability = (result.constant ? "view" : "payable");
}
else if (value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger$4.throwArgumentError("unable to determine stateMutability", "value", value);
}
return result;
}
@ -5343,11 +5390,11 @@ class ConstructorFragment extends Fragment {
return value;
}
if (value.type !== "constructor") {
throw new Error("invalid constructor object - " + value.type);
logger$4.throwArgumentError("invalid constructor object", "value", value);
}
let state = verifyState(value);
if (state.constant) {
throw new Error("constructor cannot be constant");
logger$4.throwArgumentError("constructor cannot be constant", "value", value);
}
return new ConstructorFragment(_constructorGuard$2, {
name: null,
@ -5361,11 +5408,8 @@ class ConstructorFragment extends Fragment {
let params = { type: "constructor" };
value = parseGas(value, params);
let parens = value.match(regexParen);
if (!parens) {
throw new Error("invalid constructor: " + value);
}
if (parens[1].trim() !== "constructor") {
throw new Error("invalid constructor");
if (!parens || parens[1].trim() !== "constructor") {
logger$4.throwArgumentError("invalid constructor string", "value", value);
}
params.inputs = parseParams(parens[2].trim(), false);
parseModifiers(parens[3].trim(), params);
@ -5429,7 +5473,7 @@ class FunctionFragment extends ConstructorFragment {
return value;
}
if (value.type !== "function") {
throw new Error("invalid function object - " + value.type);
logger$4.throwArgumentError("invalid function object", "value", value);
}
let state = verifyState(value);
return new FunctionFragment(_constructorGuard$2, {
@ -5448,15 +5492,15 @@ class FunctionFragment extends ConstructorFragment {
value = parseGas(value, params);
let comps = value.split(" returns ");
if (comps.length > 2) {
throw new Error("invalid function");
logger$4.throwArgumentError("invalid function string", "value", value);
}
let parens = comps[0].match(regexParen);
if (!parens) {
throw new Error("invalid signature");
logger$4.throwArgumentError("invalid function signature", "value", value);
}
params.name = parens[1].trim();
if (!params.name.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + params.name + "'");
if (params.name) {
verifyIdentifier(params.name);
}
params.inputs = parseParams(parens[2], false);
parseModifiers(parens[3].trim(), params);
@ -5464,7 +5508,7 @@ class FunctionFragment extends ConstructorFragment {
if (comps.length > 1) {
let returns = comps[1].match(regexParen);
if (returns[1].trim() != "" || returns[3].trim() != "") {
throw new Error("unexpected tokens");
logger$4.throwArgumentError("unexpected tokens", "value", value);
}
params.outputs = parseParams(returns[2], false);
}
@ -5495,7 +5539,7 @@ function verifyType(type) {
const regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + value + "'");
logger$4.throwArgumentError(`invalid identifier "${value}"`, "value", value);
}
return value;
}
@ -5519,7 +5563,7 @@ function splitNesting(value) {
else if (c === ")") {
depth--;
if (depth === -1) {
throw new Error("unbalanced parenthsis");
logger$4.throwArgumentError("unbalanced parenthsis", "value", value);
}
}
}
@ -6637,24 +6681,24 @@ class NumberCoder extends Coder {
encode(writer, value) {
let v = BigNumber.from(value);
// Check bounds are safe for encoding
let maxUintValue = MaxUint256.maskn(writer.wordSize * 8);
let maxUintValue = MaxUint256.mask(writer.wordSize * 8);
if (this.signed) {
let bounds = maxUintValue.maskn(this.size * 8 - 1);
let bounds = maxUintValue.mask(this.size * 8 - 1);
if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne$1))) {
this._throwError("value out-of-bounds", value);
}
}
else if (v.lt(Zero$1) || v.gt(maxUintValue.maskn(this.size * 8))) {
else if (v.lt(Zero$1) || v.gt(maxUintValue.mask(this.size * 8))) {
this._throwError("value out-of-bounds", value);
}
v = v.toTwos(this.size * 8).maskn(this.size * 8);
v = v.toTwos(this.size * 8).mask(this.size * 8);
if (this.signed) {
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
}
return writer.writeValue(v);
}
decode(reader) {
let value = reader.readValue().maskn(this.size * 8);
let value = reader.readValue().mask(this.size * 8);
if (this.signed) {
value = value.fromTwos(this.size * 8);
}
@ -7943,7 +7987,7 @@ class VoidSigner extends Signer {
}
}
const version$b = "contracts/5.0.0-beta.146";
const version$b = "contracts/5.0.0-beta.147";
"use strict";
const logger$f = new Logger(version$b);
@ -8444,12 +8488,12 @@ class Contract {
_checkRunningEvents(runningEvent) {
if (runningEvent.listenerCount() === 0) {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
}
_wrapEvent(runningEvent, log, listener) {
@ -16301,7 +16345,7 @@ function poll(func, options) {
});
}
const version$k = "providers/5.0.0-beta.160";
const version$k = "providers/5.0.0-beta.161";
"use strict";
const logger$o = new Logger(version$k);
@ -16774,6 +16818,15 @@ class Event {
defineReadOnly(this, "listener", listener);
defineReadOnly(this, "once", once);
}
get event() {
switch (this.type) {
case "tx":
return this.hash;
case "filter":
return this.filter;
}
return this.tag;
}
get type() {
return this.tag.split(":")[0];
}
@ -19142,7 +19195,7 @@ class Web3Provider extends JsonRpcProvider {
var _version$6 = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.160";
exports.version = "providers/5.0.0-beta.161";
});
var _version$7 = unwrapExports(_version$6);
@ -19193,11 +19246,8 @@ const logger$A = new Logger(version$k);
* with each other.
*/
let NextId = 1;
/*
function subscribable(tag: string): boolean {
return (tag === "block" || tag === "pending");
}
*/
// For more info about the Real-time Event API see:
// https://geth.ethereum.org/docs/rpc/pubsub
class WebSocketProvider extends JsonRpcProvider {
constructor(url, network) {
super(url, network);
@ -19366,7 +19416,7 @@ class WebSocketProvider extends JsonRpcProvider {
}
tag = "tx";
}
else if (this.listenerCount(event.tag)) {
else if (this.listenerCount(event.event)) {
// There are remaining event listeners
return;
}
@ -19678,7 +19728,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed
});
const version$m = "ethers/5.0.0-beta.180";
const version$m = "ethers/5.0.0-beta.181";
"use strict";
const errors = Logger.errors;

File diff suppressed because one or more lines are too long

View File

@ -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.136";
exports.version = "bignumber/5.0.0-beta.137";
});
var _version$5 = unwrapExports(_version$4);
@ -4269,14 +4269,54 @@
return toBigNumber(toBN(this).mul(toBN(other)));
};
BigNumber.prototype.mod = function (other) {
return toBigNumber(toBN(this).mod(toBN(other)));
var value = toBN(other);
if (value.isNeg()) {
throwFault("cannot modulo negative values", "mod");
}
return toBigNumber(toBN(this).umod(value));
};
BigNumber.prototype.pow = function (other) {
return toBigNumber(toBN(this).pow(toBN(other)));
};
BigNumber.prototype.maskn = function (value) {
BigNumber.prototype.and = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'and' negative values", "and");
}
return toBigNumber(toBN(this).and(value));
};
BigNumber.prototype.or = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'or' negative values", "or");
}
return toBigNumber(toBN(this).or(value));
};
BigNumber.prototype.xor = function (other) {
var value = toBN(other);
if (this.isNegative() || value.isNeg()) {
throwFault("cannot 'xor' negative values", "xor");
}
return toBigNumber(toBN(this).xor(value));
};
BigNumber.prototype.mask = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot mask negative values", "mask");
}
return toBigNumber(toBN(this).maskn(value));
};
BigNumber.prototype.shl = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shl");
}
return toBigNumber(toBN(this).shln(value));
};
BigNumber.prototype.shr = function (value) {
if (this.isNegative() || value < 0) {
throwFault("cannot shift negative values", "shr");
}
return toBigNumber(toBN(this).shrn(value));
};
BigNumber.prototype.eq = function (other) {
return toBN(this).eq(toBN(other));
};
@ -4292,6 +4332,9 @@
BigNumber.prototype.gte = function (other) {
return toBN(this).gte(toBN(other));
};
BigNumber.prototype.isNegative = function () {
return (this._hex[0] === "-");
};
BigNumber.prototype.isZero = function () {
return toBN(this).isZero();
};
@ -4909,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.149";
exports.version = "abi/5.0.0-beta.150";
});
var _version$9 = unwrapExports(_version$8);
@ -4959,7 +5002,7 @@
function parseParamType(param, allowIndexed) {
var originalParam = param;
function throwError(i) {
throw new Error("unexpected character '" + originalParam[i] + "' at position " + i + " in '" + originalParam + "'");
logger.throwArgumentError("unexpected character at position " + i, "param", param);
}
param = param.replace(/\s/g, " ");
function newNode(parent) {
@ -5098,7 +5141,7 @@
}
}
if (node.parent) {
throw new Error("unexpected eof");
logger.throwArgumentError("unexpected eof", "param", param);
}
delete parent.state;
if (node.name === "indexed") {
@ -5136,7 +5179,9 @@
var ParamType = /** @class */ (function () {
function ParamType(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use fromString");
logger.throwError("use fromString", lib.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new ParamType()"
});
}
populate(this, params);
var match = this.type.match(paramTypeArray);
@ -5252,7 +5297,9 @@
var Fragment = /** @class */ (function () {
function Fragment(constructorGuard, params) {
if (constructorGuard !== _constructorGuard) {
throw new Error("use a static from method");
logger.throwError("use a static from method", lib.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new Fragment()"
});
}
populate(this, params);
this._isFragment = true;
@ -5299,7 +5346,7 @@
else if (value.split("(")[0].trim() === "constructor") {
return ConstructorFragment.fromString(value.trim());
}
throw new Error("unknown fragment");
return logger.throwArgumentError("unsupported fragment", "value", value);
};
Fragment.isFragment = function (value) {
return !!(value && value._isFragment);
@ -5350,7 +5397,7 @@
return value;
}
if (value.type !== "event") {
throw new Error("invalid event object - " + value.type);
logger.throwArgumentError("invalid event object", "value", value);
}
return new EventFragment(_constructorGuard, {
name: verifyIdentifier(value.name),
@ -5362,7 +5409,7 @@
EventFragment.fromString = function (value) {
var match = value.match(regexParen);
if (!match) {
throw new Error("invalid event: " + value);
logger.throwArgumentError("invalid event string", "value", value);
}
var anonymous = false;
match[3].split(" ").forEach(function (modifier) {
@ -5394,10 +5441,10 @@
var comps = value.split("@");
if (comps.length !== 1) {
if (comps.length > 2) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
}
if (!comps[1].match(/^[0-9]+$/)) {
throw new Error("invalid signature gas");
logger.throwArgumentError("invalid human-readable aBI signature gas", "value", value);
}
params.gas = lib$2.BigNumber.from(comps[1]);
return comps[0];
@ -5446,14 +5493,14 @@
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
if (value.constant != null) {
if ((!!value.constant) !== result.constant) {
throw new Error("cannot have constant function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
}
}
// Set (and check things are consistent) the payable property
result.payable = (result.stateMutability === "payable");
if (value.payable != null) {
if ((!!value.payable) !== result.payable) {
throw new Error("cannot have payable function with mutability " + result.stateMutability);
logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
}
}
}
@ -5461,7 +5508,7 @@
result.payable = !!value.payable;
// If payable we can assume non-constant; otherwise we can't assume
if (value.constant == null && !result.payable && value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
result.constant = !!value.constant;
if (result.constant) {
@ -5471,7 +5518,7 @@
result.stateMutability = (result.payable ? "payable" : "nonpayable");
}
if (result.payable && result.constant) {
throw new Error("cannot have constant payable function");
logger.throwArgumentError("cannot have constant payable function", "value", value);
}
}
else if (value.constant != null) {
@ -5480,7 +5527,7 @@
result.stateMutability = (result.constant ? "view" : "payable");
}
else if (value.type !== "constructor") {
throw new Error("unable to determine stateMutability");
logger.throwArgumentError("unable to determine stateMutability", "value", value);
}
return result;
}
@ -5527,11 +5574,11 @@
return value;
}
if (value.type !== "constructor") {
throw new Error("invalid constructor object - " + value.type);
logger.throwArgumentError("invalid constructor object", "value", value);
}
var state = verifyState(value);
if (state.constant) {
throw new Error("constructor cannot be constant");
logger.throwArgumentError("constructor cannot be constant", "value", value);
}
return new ConstructorFragment(_constructorGuard, {
name: null,
@ -5545,11 +5592,8 @@
var params = { type: "constructor" };
value = parseGas(value, params);
var parens = value.match(regexParen);
if (!parens) {
throw new Error("invalid constructor: " + value);
}
if (parens[1].trim() !== "constructor") {
throw new Error("invalid constructor");
if (!parens || parens[1].trim() !== "constructor") {
logger.throwArgumentError("invalid constructor string", "value", value);
}
params.inputs = parseParams(parens[2].trim(), false);
parseModifiers(parens[3].trim(), params);
@ -5619,7 +5663,7 @@
return value;
}
if (value.type !== "function") {
throw new Error("invalid function object - " + value.type);
logger.throwArgumentError("invalid function object", "value", value);
}
var state = verifyState(value);
return new FunctionFragment(_constructorGuard, {
@ -5638,15 +5682,15 @@
value = parseGas(value, params);
var comps = value.split(" returns ");
if (comps.length > 2) {
throw new Error("invalid function");
logger.throwArgumentError("invalid function string", "value", value);
}
var parens = comps[0].match(regexParen);
if (!parens) {
throw new Error("invalid signature");
logger.throwArgumentError("invalid function signature", "value", value);
}
params.name = parens[1].trim();
if (!params.name.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + params.name + "'");
if (params.name) {
verifyIdentifier(params.name);
}
params.inputs = parseParams(parens[2], false);
parseModifiers(parens[3].trim(), params);
@ -5654,7 +5698,7 @@
if (comps.length > 1) {
var returns = comps[1].match(regexParen);
if (returns[1].trim() != "" || returns[3].trim() != "") {
throw new Error("unexpected tokens");
logger.throwArgumentError("unexpected tokens", "value", value);
}
params.outputs = parseParams(returns[2], false);
}
@ -5687,7 +5731,7 @@
var regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
function verifyIdentifier(value) {
if (!value || !value.match(regexIdentifier)) {
throw new Error("invalid identifier: '" + value + "'");
logger.throwArgumentError("invalid identifier \"" + value + "\"", "value", value);
}
return value;
}
@ -5711,7 +5755,7 @@
else if (c === ")") {
depth--;
if (depth === -1) {
throw new Error("unbalanced parenthsis");
logger.throwArgumentError("unbalanced parenthsis", "value", value);
}
}
}
@ -7145,24 +7189,24 @@
NumberCoder.prototype.encode = function (writer, value) {
var v = lib$2.BigNumber.from(value);
// Check bounds are safe for encoding
var maxUintValue = lib$7.MaxUint256.maskn(writer.wordSize * 8);
var maxUintValue = lib$7.MaxUint256.mask(writer.wordSize * 8);
if (this.signed) {
var bounds = maxUintValue.maskn(this.size * 8 - 1);
var bounds = maxUintValue.mask(this.size * 8 - 1);
if (v.gt(bounds) || v.lt(bounds.add(lib$7.One).mul(lib$7.NegativeOne))) {
this._throwError("value out-of-bounds", value);
}
}
else if (v.lt(lib$7.Zero) || v.gt(maxUintValue.maskn(this.size * 8))) {
else if (v.lt(lib$7.Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
this._throwError("value out-of-bounds", value);
}
v = v.toTwos(this.size * 8).maskn(this.size * 8);
v = v.toTwos(this.size * 8).mask(this.size * 8);
if (this.signed) {
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
}
return writer.writeValue(v);
};
NumberCoder.prototype.decode = function (reader) {
var value = reader.readValue().maskn(this.size * 8);
var value = reader.readValue().mask(this.size * 8);
if (this.signed) {
value = value.fromTwos(this.size * 8);
}
@ -8864,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.146";
exports.version = "contracts/5.0.0-beta.147";
});
var _version$n = unwrapExports(_version$m);
@ -9427,12 +9471,12 @@
Contract.prototype._checkRunningEvents = function (runningEvent) {
if (runningEvent.listenerCount() === 0) {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
var emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
// If we have a poller for this, remove it
var emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
};
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {
@ -17762,7 +17806,7 @@
var _version$I = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.160";
exports.version = "providers/5.0.0-beta.161";
});
var _version$J = unwrapExports(_version$I);
@ -18311,6 +18355,19 @@
lib$3.defineReadOnly(this, "listener", listener);
lib$3.defineReadOnly(this, "once", once);
}
Object.defineProperty(Event.prototype, "event", {
get: function () {
switch (this.type) {
case "tx":
return this.hash;
case "filter":
return this.filter;
}
return this.tag;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "type", {
get: function () {
return this.tag.split(":")[0];
@ -21590,11 +21647,8 @@
* with each other.
*/
var NextId = 1;
/*
function subscribable(tag: string): boolean {
return (tag === "block" || tag === "pending");
}
*/
// For more info about the Real-time Event API see:
// https://geth.ethereum.org/docs/rpc/pubsub
var WebSocketProvider = /** @class */ (function (_super) {
__extends(WebSocketProvider, _super);
function WebSocketProvider(url, network) {
@ -21787,7 +21841,7 @@
}
tag = "tx";
}
else if (this.listenerCount(event.tag)) {
else if (this.listenerCount(event.event)) {
// There are remaining event listeners
return;
}
@ -22297,7 +22351,7 @@
var _version$M = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.180";
exports.version = "ethers/5.0.0-beta.181";
});
var _version$N = unwrapExports(_version$M);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.180";
export declare const version = "ethers/5.0.0-beta.181";

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.180";
export const version = "ethers/5.0.0-beta.181";

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.180";
export declare const version = "ethers/5.0.0-beta.181";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.180";
exports.version = "ethers/5.0.0-beta.181";

View File

@ -52,7 +52,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x5dc9b6335250b1b917e5549e17cca07d4dbc11bde76c59103c33f82f8476726f",
"tarballHash": "0xa3e07c74fc1ea53f660f1543f14b836069db93879d1aad93fa033b03eb16f564",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.180"
"version": "5.0.0-beta.181"
}

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.180";
export const version = "ethers/5.0.0-beta.181";

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.160";
export declare const version = "providers/5.0.0-beta.161";

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.160";
export const version = "providers/5.0.0-beta.161";

View File

@ -18,6 +18,7 @@ export declare class Event {
readonly once: boolean;
readonly tag: string;
constructor(tag: string, listener: Listener, once: boolean);
get event(): EventType;
get type(): string;
get hash(): string;
get filter(): Filter;

View File

@ -105,6 +105,15 @@ export class Event {
defineReadOnly(this, "listener", listener);
defineReadOnly(this, "once", once);
}
get event() {
switch (this.type) {
case "tx":
return this.hash;
case "filter":
return this.filter;
}
return this.tag;
}
get type() {
return this.tag.split(":")[0];
}

View File

@ -30,11 +30,8 @@ const logger = new Logger(version);
* with each other.
*/
let NextId = 1;
/*
function subscribable(tag: string): boolean {
return (tag === "block" || tag === "pending");
}
*/
// For more info about the Real-time Event API see:
// https://geth.ethereum.org/docs/rpc/pubsub
export class WebSocketProvider extends JsonRpcProvider {
constructor(url, network) {
super(url, network);
@ -203,7 +200,7 @@ export class WebSocketProvider extends JsonRpcProvider {
}
tag = "tx";
}
else if (this.listenerCount(event.tag)) {
else if (this.listenerCount(event.event)) {
// There are remaining event listeners
return;
}

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.160";
export declare const version = "providers/5.0.0-beta.161";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.160";
exports.version = "providers/5.0.0-beta.161";

View File

@ -18,6 +18,7 @@ export declare class Event {
readonly once: boolean;
readonly tag: string;
constructor(tag: string, listener: Listener, once: boolean);
get event(): EventType;
get type(): string;
get hash(): string;
get filter(): Filter;

View File

@ -146,6 +146,19 @@ var Event = /** @class */ (function () {
properties_1.defineReadOnly(this, "listener", listener);
properties_1.defineReadOnly(this, "once", once);
}
Object.defineProperty(Event.prototype, "event", {
get: function () {
switch (this.type) {
case "tx":
return this.hash;
case "filter":
return this.filter;
}
return this.tag;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "type", {
get: function () {
return this.tag.split(":")[0];

View File

@ -74,11 +74,8 @@ var logger = new logger_1.Logger(_version_1.version);
* with each other.
*/
var NextId = 1;
/*
function subscribable(tag: string): boolean {
return (tag === "block" || tag === "pending");
}
*/
// For more info about the Real-time Event API see:
// https://geth.ethereum.org/docs/rpc/pubsub
var WebSocketProvider = /** @class */ (function (_super) {
__extends(WebSocketProvider, _super);
function WebSocketProvider(url, network) {
@ -271,7 +268,7 @@ var WebSocketProvider = /** @class */ (function (_super) {
}
tag = "tx";
}
else if (this.listenerCount(event.tag)) {
else if (this.listenerCount(event.event)) {
// There are remaining event listeners
return;
}

View File

@ -46,7 +46,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x90a3b6db9189b54c702903c083aa54a168ebab89a4ea41d23d8d17aea2d9fe9a",
"tarballHash": "0x72ffec5f93c2e2263163a4e8a21016ca74bc67313b2ca84314cededde6d6bebf",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.160"
"version": "5.0.0-beta.161"
}

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.160";
export const version = "providers/5.0.0-beta.161";

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.155";
export declare const version = "tests/5.0.0-beta.156";

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.155";
export const version = "tests/5.0.0-beta.156";

View File

@ -556,6 +556,10 @@ function testProvider(providerName, networkName) {
if (providerName === "NodesmithProvider") {
return;
}
// Cloudflare seems down and I want a fix out. RicMoo
if (providerName === "CloudflareProvider") {
return;
}
if (networkName === "goerli" && providerName === "AlchemyProvider") {
return;
}

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.155";
export declare const version = "tests/5.0.0-beta.156";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "tests/5.0.0-beta.155";
exports.version = "tests/5.0.0-beta.156";

View File

@ -560,6 +560,10 @@ function testProvider(providerName, networkName) {
if (providerName === "NodesmithProvider") {
return;
}
// Cloudflare seems down and I want a fix out. RicMoo
if (providerName === "CloudflareProvider") {
return;
}
if (networkName === "goerli" && providerName === "AlchemyProvider") {
return;
}

View File

@ -33,7 +33,7 @@
"scripts": {
"test": "exit 1"
},
"tarballHash": "0xad11e09485d7fd98314eba8f906667090fce4344c9f98b464d22956e4845aaca",
"tarballHash": "0x01732e6bde3152353f3ebcd09b5e272eb7337ebd892faf66f3ce4036c89a94cc",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.155"
"version": "5.0.0-beta.156"
}

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.155";
export const version = "tests/5.0.0-beta.156";