admin: updated dist files
This commit is contained in:
parent
ba36079a28
commit
ff9d124c60
@ -3,6 +3,12 @@ Change Log
|
||||
|
||||
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
|
||||
|
||||
ethers/v6.7.0 (2023-07-24 17:47)
|
||||
--------------------------------
|
||||
|
||||
- Use empty string for unnamed parameters in JSON output instead of undefined ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [8c2652c](https://github.com/ethers-io/ethers.js/commit/8c2652c8cb4d054207d89688d30930869d9d3f8b), [ba36079](https://github.com/ethers-io/ethers.js/commit/ba36079a285706694532ce726568c4c447acad47)).
|
||||
- Return undefined for Contract properties that do not exist instead of throwing an error ([#4266](https://github.com/ethers-io/ethers.js/issues/4266); [5bf7b34](https://github.com/ethers-io/ethers.js/commit/5bf7b3494ed62952fc387b4368a0bdc86dfe163e)).
|
||||
|
||||
ethers/v6.6.5 (2023-07-24 00:04)
|
||||
--------------------------------
|
||||
|
||||
|
47
dist/ethers.js
vendored
47
dist/ethers.js
vendored
@ -3,7 +3,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.6.5";
|
||||
const version = "6.7.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
@ -10446,7 +10446,7 @@ class ParamType {
|
||||
format = "sighash";
|
||||
}
|
||||
if (format === "json") {
|
||||
const name = this.name || undefined; // @TODO: Make this "" (minor bump)
|
||||
const name = this.name || "";
|
||||
if (this.isArray()) {
|
||||
const result = JSON.parse(this.arrayChildren.format("json"));
|
||||
result.name = name;
|
||||
@ -14568,17 +14568,20 @@ class BaseContract {
|
||||
setInternal(this, { addrPromise, addr, deployTx, subs });
|
||||
// Add the event filters
|
||||
const filters = new Proxy({}, {
|
||||
get: (target, _prop, receiver) => {
|
||||
get: (target, prop, receiver) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
if (passProperties.indexOf(_prop) >= 0) {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = this.getEvent(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
try {
|
||||
return this.getEvent(prop);
|
||||
}
|
||||
throw new Error(`unknown contract event: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
@ -14594,22 +14597,26 @@ class BaseContract {
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
get: (target, _prop, receiver) => {
|
||||
if (_prop in target || passProperties.indexOf(_prop) >= 0 || typeof (_prop) === "symbol") {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
get: (target, prop, receiver) => {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = target.getFunction(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
// Undefined properties should return undefined
|
||||
try {
|
||||
return target.getFunction(prop);
|
||||
}
|
||||
throw new Error(`unknown contract method: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
if (prop in target || passProperties.indexOf(prop) >= 0 || typeof (prop) === "symbol") {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.has(target, prop);
|
||||
}
|
||||
return target.interface.hasFunction(String(prop));
|
||||
return target.interface.hasFunction(prop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
2
dist/ethers.js.map
vendored
2
dist/ethers.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
47
dist/ethers.umd.js
vendored
47
dist/ethers.umd.js
vendored
@ -9,7 +9,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.6.5";
|
||||
const version = "6.7.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
@ -10452,7 +10452,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
format = "sighash";
|
||||
}
|
||||
if (format === "json") {
|
||||
const name = this.name || undefined; // @TODO: Make this "" (minor bump)
|
||||
const name = this.name || "";
|
||||
if (this.isArray()) {
|
||||
const result = JSON.parse(this.arrayChildren.format("json"));
|
||||
result.name = name;
|
||||
@ -14574,17 +14574,20 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
setInternal(this, { addrPromise, addr, deployTx, subs });
|
||||
// Add the event filters
|
||||
const filters = new Proxy({}, {
|
||||
get: (target, _prop, receiver) => {
|
||||
get: (target, prop, receiver) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
if (passProperties.indexOf(_prop) >= 0) {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = this.getEvent(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
try {
|
||||
return this.getEvent(prop);
|
||||
}
|
||||
throw new Error(`unknown contract event: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
@ -14600,22 +14603,26 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
get: (target, _prop, receiver) => {
|
||||
if (_prop in target || passProperties.indexOf(_prop) >= 0 || typeof (_prop) === "symbol") {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
get: (target, prop, receiver) => {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = target.getFunction(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
// Undefined properties should return undefined
|
||||
try {
|
||||
return target.getFunction(prop);
|
||||
}
|
||||
throw new Error(`unknown contract method: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
if (prop in target || passProperties.indexOf(prop) >= 0 || typeof (prop) === "symbol") {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.has(target, prop);
|
||||
}
|
||||
return target.interface.hasFunction(String(prop));
|
||||
return target.interface.hasFunction(prop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
2
dist/ethers.umd.js.map
vendored
2
dist/ethers.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.umd.min.js
vendored
2
dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.js
vendored
2
dist/wordlists-extra.js
vendored
@ -151,7 +151,7 @@ const u64 = {
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.6.5";
|
||||
const version = "6.7.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
|
2
dist/wordlists-extra.js.map
vendored
2
dist/wordlists-extra.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.min.js
vendored
2
dist/wordlists-extra.min.js
vendored
File diff suppressed because one or more lines are too long
@ -131,6 +131,21 @@ describe("Test Interface", function () {
|
||||
assert_1.default.equal(log.args[1], "0xAC1639CF97a3A46D431e6d1216f576622894cBB5");
|
||||
assert_1.default.equal(log.args[2], BigInt(234));
|
||||
});
|
||||
// See #4248
|
||||
it("formats JSON ABI parameters with default empty string for `name` key", function () {
|
||||
assert_1.default.deepEqual(JSON.parse(iface.getFunction("balanceOf").format('json')), {
|
||||
constant: false,
|
||||
inputs: [
|
||||
{ name: "owner", type: "address" }
|
||||
],
|
||||
name: "balanceOf",
|
||||
outputs: [
|
||||
{ name: "", type: "uint256" }
|
||||
],
|
||||
payable: false,
|
||||
type: "function",
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("Tests Legacy ABI formats", function () {
|
||||
// See: #3932
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,5 +5,5 @@ exports.version = void 0;
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
exports.version = "6.6.5";
|
||||
exports.version = "6.7.0";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -429,7 +429,7 @@ class ParamType {
|
||||
format = "sighash";
|
||||
}
|
||||
if (format === "json") {
|
||||
const name = this.name || undefined; // @TODO: Make this "" (minor bump)
|
||||
const name = this.name || "";
|
||||
if (this.isArray()) {
|
||||
const result = JSON.parse(this.arrayChildren.format("json"));
|
||||
result.name = name;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,E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AC;IAiBlE;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS3K;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"}
|
@ -577,17 +577,20 @@ class BaseContract {
|
||||
setInternal(this, { addrPromise, addr, deployTx, subs });
|
||||
// Add the event filters
|
||||
const filters = new Proxy({}, {
|
||||
get: (target, _prop, receiver) => {
|
||||
get: (target, prop, receiver) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
if (passProperties.indexOf(_prop) >= 0) {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = this.getEvent(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
try {
|
||||
return this.getEvent(prop);
|
||||
}
|
||||
throw new Error(`unknown contract event: ${prop}`);
|
||||
catch (error) {
|
||||
if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
@ -603,22 +606,26 @@ class BaseContract {
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
get: (target, _prop, receiver) => {
|
||||
if (_prop in target || passProperties.indexOf(_prop) >= 0 || typeof (_prop) === "symbol") {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
get: (target, prop, receiver) => {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = target.getFunction(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
// Undefined properties should return undefined
|
||||
try {
|
||||
return target.getFunction(prop);
|
||||
}
|
||||
throw new Error(`unknown contract method: ${prop}`);
|
||||
catch (error) {
|
||||
if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
if (prop in target || passProperties.indexOf(prop) >= 0 || typeof (prop) === "symbol") {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.has(target, prop);
|
||||
}
|
||||
return target.interface.hasFunction(String(prop));
|
||||
return target.interface.hasFunction(prop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -128,6 +128,21 @@ describe("Test Interface", function () {
|
||||
assert.equal(log.args[1], "0xAC1639CF97a3A46D431e6d1216f576622894cBB5");
|
||||
assert.equal(log.args[2], BigInt(234));
|
||||
});
|
||||
// See #4248
|
||||
it("formats JSON ABI parameters with default empty string for `name` key", function () {
|
||||
assert.deepEqual(JSON.parse(iface.getFunction("balanceOf").format('json')), {
|
||||
constant: false,
|
||||
inputs: [
|
||||
{ name: "owner", type: "address" }
|
||||
],
|
||||
name: "balanceOf",
|
||||
outputs: [
|
||||
{ name: "", type: "uint256" }
|
||||
],
|
||||
payable: false,
|
||||
type: "function",
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("Tests Legacy ABI formats", function () {
|
||||
// See: #3932
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,5 +2,5 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
export const version = "6.6.5";
|
||||
export const version = "6.7.0";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -426,7 +426,7 @@ export class ParamType {
|
||||
format = "sighash";
|
||||
}
|
||||
if (format === "json") {
|
||||
const name = this.name || undefined; // @TODO: Make this "" (minor bump)
|
||||
const name = this.name || "";
|
||||
if (this.isArray()) {
|
||||
const result = JSON.parse(this.arrayChildren.format("json"));
|
||||
result.name = name;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EAAE,cAAc,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAER,iBAAiB,EACjB,iBAAiB,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AI,GAAG,cAAc,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS3K;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"}
|
@ -3,7 +3,7 @@ import { isAddressable, resolveAddress } from "../address/index.js";
|
||||
// import from provider.ts instead of index.ts to prevent circular dep
|
||||
// from EtherscanProvider
|
||||
import { copyRequest, Log } from "../providers/provider.js";
|
||||
import { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument } from "../utils/index.js";
|
||||
import { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, isError, makeError, assert, assertArgument } from "../utils/index.js";
|
||||
import { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog } from "./wrappers.js";
|
||||
const BN_0 = BigInt(0);
|
||||
function canCall(value) {
|
||||
@ -572,17 +572,20 @@ export class BaseContract {
|
||||
setInternal(this, { addrPromise, addr, deployTx, subs });
|
||||
// Add the event filters
|
||||
const filters = new Proxy({}, {
|
||||
get: (target, _prop, receiver) => {
|
||||
get: (target, prop, receiver) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
if (passProperties.indexOf(_prop) >= 0) {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = this.getEvent(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
try {
|
||||
return this.getEvent(prop);
|
||||
}
|
||||
throw new Error(`unknown contract event: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
// Pass important checks (like `then` for Promise) through
|
||||
@ -598,22 +601,26 @@ export class BaseContract {
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
get: (target, _prop, receiver) => {
|
||||
if (_prop in target || passProperties.indexOf(_prop) >= 0 || typeof (_prop) === "symbol") {
|
||||
return Reflect.get(target, _prop, receiver);
|
||||
get: (target, prop, receiver) => {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.get(target, prop, receiver);
|
||||
}
|
||||
const prop = String(_prop);
|
||||
const result = target.getFunction(prop);
|
||||
if (result) {
|
||||
return result;
|
||||
// Undefined properties should return undefined
|
||||
try {
|
||||
return target.getFunction(prop);
|
||||
}
|
||||
throw new Error(`unknown contract method: ${prop}`);
|
||||
catch (error) {
|
||||
if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
has: (target, prop) => {
|
||||
if (prop in target || passProperties.indexOf(prop) >= 0 || typeof (prop) === "symbol") {
|
||||
if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) {
|
||||
return Reflect.has(target, prop);
|
||||
}
|
||||
return target.interface.hasFunction(String(prop));
|
||||
return target.interface.hasFunction(prop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -93,7 +93,7 @@
|
||||
"url": "https://www.buymeacoffee.com/ricmoo"
|
||||
}
|
||||
],
|
||||
"gitHead": "ac2f5e563b8ec0e91a931470eb6ea58b0c01fb3d",
|
||||
"gitHead": "ba36079a285706694532ce726568c4c447acad47",
|
||||
"homepage": "https://ethers.org",
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
@ -131,5 +131,5 @@
|
||||
"test-esm": "mocha --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"version": "6.6.5"
|
||||
"version": "6.7.0"
|
||||
}
|
||||
|
@ -3,4 +3,4 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
export const version: string = "6.6.5";
|
||||
export const version: string = "6.7.0";
|
||||
|
Loading…
Reference in New Issue
Block a user