Updated dist files.
This commit is contained in:
parent
58488e78f9
commit
ce8f1e4015
@ -3,6 +3,14 @@ Changelog
|
||||
|
||||
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
|
||||
|
||||
ethers/v5.1.3 (2021-04-19 21:01)
|
||||
--------------------------------
|
||||
|
||||
- Fixed JsonRpcProvider event-loop caching when using any network. ([#1484](https://github.com/ethers-io/ethers.js/issues/1484); [58488e7](https://github.com/ethers-io/ethers.js/commit/58488e78f9ef79715693e19b42663335aad88c03))
|
||||
- Updated experimental Eip1193Bridge to support final EIP-1193 API. ([2911659](https://github.com/ethers-io/ethers.js/commit/29116593ba6c9c0fa491b13787cca8b233d4218c))
|
||||
- Fail early for ABI decoding that will obviously run out of data. ([#1486](https://github.com/ethers-io/ethers.js/issues/1486); [51f0e1a](https://github.com/ethers-io/ethers.js/commit/51f0e1a52fb885e6f146f7b3b70ed487fd1c8f5a))
|
||||
- Fixed BigNumber toBigInt return type. ([#1485](https://github.com/ethers-io/ethers.js/issues/1485); [c086962](https://github.com/ethers-io/ethers.js/commit/c0869623024bbf3671938dad03b131ff2ac54345))
|
||||
|
||||
ethers/v5.1.2 (2021-04-18 19:31)
|
||||
--------------------------------
|
||||
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -1275,9 +1275,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001210",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001210.tgz",
|
||||
"integrity": "sha512-avmGf0Jo00I8vB0I89J4Pba48kddasErV7slu7wrkyM5uY9gE5P+B+V3hjABv8Hp4YNG2nBqIUFUXlnqNteXEA==",
|
||||
"version": "1.0.30001211",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001211.tgz",
|
||||
"integrity": "sha512-v3GXWKofIkN3PkSidLI5d1oqeKNsam9nQkqieoMhP87nxOY0RPDC8X2+jcv8pjV4dRozPLSoMqNii9sDViOlIg==",
|
||||
"dev": true
|
||||
},
|
||||
"caseless": {
|
||||
|
2
packages/abi/lib.esm/_version.d.ts
vendored
2
packages/abi/lib.esm/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "abi/5.1.0";
|
||||
export declare const version = "abi/5.1.1";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,2 +1,2 @@
|
||||
export const version = "abi/5.1.0";
|
||||
export const version = "abi/5.1.1";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src.ts/coders/array.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGjE,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CAuEzH;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAiFnE;AAGD,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAS3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAoBjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAW9B"}
|
||||
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src.ts/coders/array.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGjE,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CAuEzH;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAiFnE;AAGD,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAS3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAoBjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAsB9B"}
|
@ -185,6 +185,17 @@ export class ArrayCoder extends Coder {
|
||||
let count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
// Check that there is *roughly* enough data to ensure
|
||||
// stray random data is not being read as a length. Each
|
||||
// slot requires at least 32 bytes for their value (or 32
|
||||
// bytes as a link to the data). This could use a much
|
||||
// tighter bound, but we are erroring on the side of safety.
|
||||
if (count * 32 > reader._data.length) {
|
||||
logger.throwError("insufficient data length", Logger.errors.BUFFER_OVERRUN, {
|
||||
length: reader._data.length,
|
||||
count: count
|
||||
});
|
||||
}
|
||||
}
|
||||
let coders = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
|
File diff suppressed because one or more lines are too long
2
packages/abi/lib/_version.d.ts
vendored
2
packages/abi/lib/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "abi/5.1.0";
|
||||
export declare const version = "abi/5.1.1";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "abi/5.1.0";
|
||||
exports.version = "abi/5.1.1";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src.ts/coders/array.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGjE,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CAuEzH;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAiFnE;AAGD,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAS3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAoBjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAW9B"}
|
||||
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src.ts/coders/array.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGjE,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CAuEzH;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAiFnE;AAGD,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAS3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAoBjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAsB9B"}
|
@ -210,6 +210,17 @@ var ArrayCoder = /** @class */ (function (_super) {
|
||||
var count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
// Check that there is *roughly* enough data to ensure
|
||||
// stray random data is not being read as a length. Each
|
||||
// slot requires at least 32 bytes for their value (or 32
|
||||
// bytes as a link to the data). This could use a much
|
||||
// tighter bound, but we are erroring on the side of safety.
|
||||
if (count * 32 > reader._data.length) {
|
||||
logger.throwError("insufficient data length", logger_1.Logger.errors.BUFFER_OVERRUN, {
|
||||
length: reader._data.length,
|
||||
count: count
|
||||
});
|
||||
}
|
||||
}
|
||||
var coders = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -43,7 +43,7 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"tarballHash": "0x1268f244b9c48541e6ac01c961ac81782d8dc8212aa3a00f570f8e4a5ebb541b",
|
||||
"tarballHash": "0x070ed6a837106528848f7ee9e3b1289bf4619f37d865653cbf2e6c839288b49b",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.1.0"
|
||||
"version": "5.1.1"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "abi/5.1.0";
|
||||
export const version = "abi/5.1.1";
|
||||
|
2
packages/bignumber/lib.esm/_version.d.ts
vendored
2
packages/bignumber/lib.esm/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "bignumber/5.1.0";
|
||||
export declare const version = "bignumber/5.1.1";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,2 +1,2 @@
|
||||
export const version = "bignumber/5.1.0";
|
||||
export const version = "bignumber/5.1.1";
|
||||
//# sourceMappingURL=_version.js.map
|
2
packages/bignumber/lib.esm/bignumber.d.ts
vendored
2
packages/bignumber/lib.esm/bignumber.d.ts
vendored
@ -28,7 +28,7 @@ export declare class BigNumber implements Hexable {
|
||||
isNegative(): boolean;
|
||||
isZero(): boolean;
|
||||
toNumber(): number;
|
||||
toBigInt(): BigInt;
|
||||
toBigInt(): bigint;
|
||||
toString(): string;
|
||||
toHexString(): string;
|
||||
toJSON(key?: string): any;
|
||||
|
2
packages/bignumber/lib/_version.d.ts
vendored
2
packages/bignumber/lib/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "bignumber/5.1.0";
|
||||
export declare const version = "bignumber/5.1.1";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "bignumber/5.1.0";
|
||||
exports.version = "bignumber/5.1.1";
|
||||
//# sourceMappingURL=_version.js.map
|
2
packages/bignumber/lib/bignumber.d.ts
vendored
2
packages/bignumber/lib/bignumber.d.ts
vendored
@ -28,7 +28,7 @@ export declare class BigNumber implements Hexable {
|
||||
isNegative(): boolean;
|
||||
isZero(): boolean;
|
||||
toNumber(): number;
|
||||
toBigInt(): BigInt;
|
||||
toBigInt(): bigint;
|
||||
toString(): string;
|
||||
toHexString(): string;
|
||||
toJSON(key?: string): any;
|
||||
|
@ -38,7 +38,7 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"tarballHash": "0xdf932169e5ac6c5295c4f89abee9c6fc836911f223c065539226bd7f3e4da2b1",
|
||||
"tarballHash": "0x3e0d0e0c51ff62d1611ec52119f7549d3e6f35973a4b489185a70b63ed3178e9",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.1.0"
|
||||
"version": "5.1.1"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "bignumber/5.1.0";
|
||||
export const version = "bignumber/5.1.1";
|
||||
|
42
packages/ethers/dist/ethers.esm.js
vendored
42
packages/ethers/dist/ethers.esm.js
vendored
@ -4171,7 +4171,7 @@ function joinSignature(signature) {
|
||||
]));
|
||||
}
|
||||
|
||||
const version$2 = "bignumber/5.1.0";
|
||||
const version$2 = "bignumber/5.1.1";
|
||||
|
||||
"use strict";
|
||||
var BN = bn.BN;
|
||||
@ -4920,7 +4920,7 @@ class Description {
|
||||
}
|
||||
}
|
||||
|
||||
const version$4 = "abi/5.1.0";
|
||||
const version$4 = "abi/5.1.1";
|
||||
|
||||
"use strict";
|
||||
const logger$4 = new Logger(version$4);
|
||||
@ -6805,6 +6805,17 @@ class ArrayCoder extends Coder {
|
||||
let count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
// Check that there is *roughly* enough data to ensure
|
||||
// stray random data is not being read as a length. Each
|
||||
// slot requires at least 32 bytes for their value (or 32
|
||||
// bytes as a link to the data). This could use a much
|
||||
// tighter bound, but we are erroring on the side of safety.
|
||||
if (count * 32 > reader._data.length) {
|
||||
logger$8.throwError("insufficient data length", Logger.errors.BUFFER_OVERRUN, {
|
||||
length: reader._data.length,
|
||||
count: count
|
||||
});
|
||||
}
|
||||
}
|
||||
let coders = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
@ -17849,7 +17860,7 @@ var bech32 = {
|
||||
fromWords: fromWords
|
||||
};
|
||||
|
||||
const version$m = "providers/5.1.1";
|
||||
const version$m = "providers/5.1.2";
|
||||
|
||||
"use strict";
|
||||
const logger$s = new Logger(version$m);
|
||||
@ -19923,7 +19934,6 @@ class JsonRpcProvider extends BaseProvider {
|
||||
});
|
||||
}
|
||||
super(networkOrReady);
|
||||
this._eventLoopCache = {};
|
||||
// Default URL
|
||||
if (!url) {
|
||||
url = getStatic(this.constructor, "defaultUrl")();
|
||||
@ -19938,18 +19948,24 @@ class JsonRpcProvider extends BaseProvider {
|
||||
}
|
||||
this._nextId = 42;
|
||||
}
|
||||
get _cache() {
|
||||
if (this._eventLoopCache == null) {
|
||||
this._eventLoopCache = {};
|
||||
}
|
||||
return this._eventLoopCache;
|
||||
}
|
||||
static defaultUrl() {
|
||||
return "http:/\/localhost:8545";
|
||||
}
|
||||
detectNetwork() {
|
||||
if (!this._eventLoopCache["detectNetwork"]) {
|
||||
this._eventLoopCache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
if (!this._cache["detectNetwork"]) {
|
||||
this._cache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
// Clear this cache at the beginning of the next event loop
|
||||
setTimeout(() => {
|
||||
this._eventLoopCache["detectNetwork"] = null;
|
||||
this._cache["detectNetwork"] = null;
|
||||
}, 0);
|
||||
}
|
||||
return this._eventLoopCache["detectNetwork"];
|
||||
return this._cache["detectNetwork"];
|
||||
}
|
||||
_uncachedDetectNetwork() {
|
||||
return __awaiter$9(this, void 0, void 0, function* () {
|
||||
@ -20008,8 +20024,8 @@ class JsonRpcProvider extends BaseProvider {
|
||||
// We can expand this in the future to any call, but for now these
|
||||
// are the biggest wins and do not require any serializing parameters.
|
||||
const cache = (["eth_chainId", "eth_blockNumber"].indexOf(method) >= 0);
|
||||
if (cache && this._eventLoopCache[method]) {
|
||||
return this._eventLoopCache[method];
|
||||
if (cache && this._cache[method]) {
|
||||
return this._cache[method];
|
||||
}
|
||||
const result = fetchJson(this.connection, JSON.stringify(request), getResult).then((result) => {
|
||||
this.emit("debug", {
|
||||
@ -20030,9 +20046,9 @@ class JsonRpcProvider extends BaseProvider {
|
||||
});
|
||||
// Cache the fetch, but clear it on the next event loop
|
||||
if (cache) {
|
||||
this._eventLoopCache[method] = result;
|
||||
this._cache[method] = result;
|
||||
setTimeout(() => {
|
||||
this._eventLoopCache[method] = null;
|
||||
this._cache[method] = null;
|
||||
}, 0);
|
||||
}
|
||||
return result;
|
||||
@ -22436,7 +22452,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
||||
Indexed: Indexed
|
||||
});
|
||||
|
||||
const version$o = "ethers/5.1.2";
|
||||
const version$o = "ethers/5.1.3";
|
||||
|
||||
"use strict";
|
||||
const logger$H = new Logger(version$o);
|
||||
|
2
packages/ethers/dist/ethers.esm.js.map
vendored
2
packages/ethers/dist/ethers.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/dist/ethers.esm.min.js
vendored
2
packages/ethers/dist/ethers.esm.min.js
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/dist/ethers.esm.min.js.map
vendored
2
packages/ethers/dist/ethers.esm.min.js.map
vendored
File diff suppressed because one or more lines are too long
46
packages/ethers/dist/ethers.umd.js
vendored
46
packages/ethers/dist/ethers.umd.js
vendored
@ -4244,7 +4244,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "bignumber/5.1.0";
|
||||
exports.version = "bignumber/5.1.1";
|
||||
|
||||
});
|
||||
|
||||
@ -5126,7 +5126,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "abi/5.1.0";
|
||||
exports.version = "abi/5.1.1";
|
||||
|
||||
});
|
||||
|
||||
@ -7238,6 +7238,17 @@
|
||||
var count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
// Check that there is *roughly* enough data to ensure
|
||||
// stray random data is not being read as a length. Each
|
||||
// slot requires at least 32 bytes for their value (or 32
|
||||
// bytes as a link to the data). This could use a much
|
||||
// tighter bound, but we are erroring on the side of safety.
|
||||
if (count * 32 > reader._data.length) {
|
||||
logger.throwError("insufficient data length", lib.Logger.errors.BUFFER_OVERRUN, {
|
||||
length: reader._data.length,
|
||||
count: count
|
||||
});
|
||||
}
|
||||
}
|
||||
var coders = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
@ -20096,7 +20107,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "providers/5.1.1";
|
||||
exports.version = "providers/5.1.2";
|
||||
|
||||
});
|
||||
|
||||
@ -22757,7 +22768,6 @@
|
||||
});
|
||||
}
|
||||
_this = _super.call(this, networkOrReady) || this;
|
||||
_this._eventLoopCache = {};
|
||||
// Default URL
|
||||
if (!url) {
|
||||
url = lib$3.getStatic(_this.constructor, "defaultUrl")();
|
||||
@ -22773,19 +22783,29 @@
|
||||
_this._nextId = 42;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(JsonRpcProvider.prototype, "_cache", {
|
||||
get: function () {
|
||||
if (this._eventLoopCache == null) {
|
||||
this._eventLoopCache = {};
|
||||
}
|
||||
return this._eventLoopCache;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
JsonRpcProvider.defaultUrl = function () {
|
||||
return "http:/\/localhost:8545";
|
||||
};
|
||||
JsonRpcProvider.prototype.detectNetwork = function () {
|
||||
var _this = this;
|
||||
if (!this._eventLoopCache["detectNetwork"]) {
|
||||
this._eventLoopCache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
if (!this._cache["detectNetwork"]) {
|
||||
this._cache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
// Clear this cache at the beginning of the next event loop
|
||||
setTimeout(function () {
|
||||
_this._eventLoopCache["detectNetwork"] = null;
|
||||
_this._cache["detectNetwork"] = null;
|
||||
}, 0);
|
||||
}
|
||||
return this._eventLoopCache["detectNetwork"];
|
||||
return this._cache["detectNetwork"];
|
||||
};
|
||||
JsonRpcProvider.prototype._uncachedDetectNetwork = function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
@ -22865,8 +22885,8 @@
|
||||
// We can expand this in the future to any call, but for now these
|
||||
// are the biggest wins and do not require any serializing parameters.
|
||||
var cache = (["eth_chainId", "eth_blockNumber"].indexOf(method) >= 0);
|
||||
if (cache && this._eventLoopCache[method]) {
|
||||
return this._eventLoopCache[method];
|
||||
if (cache && this._cache[method]) {
|
||||
return this._cache[method];
|
||||
}
|
||||
var result = lib$q.fetchJson(this.connection, JSON.stringify(request), getResult).then(function (result) {
|
||||
_this.emit("debug", {
|
||||
@ -22887,9 +22907,9 @@
|
||||
});
|
||||
// Cache the fetch, but clear it on the next event loop
|
||||
if (cache) {
|
||||
this._eventLoopCache[method] = result;
|
||||
this._cache[method] = result;
|
||||
setTimeout(function () {
|
||||
_this._eventLoopCache[method] = null;
|
||||
_this._cache[method] = null;
|
||||
}, 0);
|
||||
}
|
||||
return result;
|
||||
@ -26101,7 +26121,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "ethers/5.1.2";
|
||||
exports.version = "ethers/5.1.3";
|
||||
|
||||
});
|
||||
|
||||
|
2
packages/ethers/dist/ethers.umd.js.map
vendored
2
packages/ethers/dist/ethers.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/dist/ethers.umd.min.js
vendored
2
packages/ethers/dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/dist/ethers.umd.min.js.map
vendored
2
packages/ethers/dist/ethers.umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/lib.esm/_version.d.ts
vendored
2
packages/ethers/lib.esm/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "ethers/5.1.2";
|
||||
export declare const version = "ethers/5.1.3";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,2 +1,2 @@
|
||||
export const version = "ethers/5.1.2";
|
||||
export const version = "ethers/5.1.3";
|
||||
//# sourceMappingURL=_version.js.map
|
2
packages/ethers/lib/_version.d.ts
vendored
2
packages/ethers/lib/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "ethers/5.1.2";
|
||||
export declare const version = "ethers/5.1.3";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "ethers/5.1.2";
|
||||
exports.version = "ethers/5.1.3";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -2,13 +2,13 @@
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"browser-old": "./dist/ethers.umd.js",
|
||||
"dependencies": {
|
||||
"@ethersproject/abi": "5.1.0",
|
||||
"@ethersproject/abi": "5.1.1",
|
||||
"@ethersproject/abstract-provider": "5.1.0",
|
||||
"@ethersproject/abstract-signer": "5.1.0",
|
||||
"@ethersproject/address": "5.1.0",
|
||||
"@ethersproject/base64": "5.1.0",
|
||||
"@ethersproject/basex": "5.1.0",
|
||||
"@ethersproject/bignumber": "5.1.0",
|
||||
"@ethersproject/bignumber": "5.1.1",
|
||||
"@ethersproject/bytes": "5.1.0",
|
||||
"@ethersproject/constants": "5.1.0",
|
||||
"@ethersproject/contracts": "5.1.1",
|
||||
@ -20,7 +20,7 @@
|
||||
"@ethersproject/networks": "5.1.0",
|
||||
"@ethersproject/pbkdf2": "5.1.0",
|
||||
"@ethersproject/properties": "5.1.0",
|
||||
"@ethersproject/providers": "5.1.1",
|
||||
"@ethersproject/providers": "5.1.2",
|
||||
"@ethersproject/random": "5.1.0",
|
||||
"@ethersproject/rlp": "5.1.0",
|
||||
"@ethersproject/sha2": "5.1.0",
|
||||
@ -62,7 +62,7 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"tarballHash": "0xc8fa6f3d08d19014510f7f6cdab1fda529993f8d017c09220062823935738719",
|
||||
"tarballHash": "0x2ed0e8f40c615980e018a6e2ccb576fa4e7d8e07597b70b7c81ab3afb2ed24c7",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.1.2"
|
||||
"version": "5.1.3"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "ethers/5.1.2";
|
||||
export const version = "ethers/5.1.3";
|
||||
|
2
packages/experimental/lib.esm/_version.d.ts
vendored
2
packages/experimental/lib.esm/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "experimental/5.1.1";
|
||||
export declare const version = "experimental/5.1.2";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,2 +1,2 @@
|
||||
export const version = "experimental/5.1.1";
|
||||
export const version = "experimental/5.1.2";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -5,6 +5,10 @@ export declare class Eip1193Bridge extends EventEmitter {
|
||||
readonly signer: ethers.Signer;
|
||||
readonly provider: ethers.providers.Provider;
|
||||
constructor(signer: ethers.Signer, provider?: ethers.providers.Provider);
|
||||
request(request: {
|
||||
method: string;
|
||||
params?: Array<any>;
|
||||
}): Promise<any>;
|
||||
send(method: string, params?: Array<any>): Promise<any>;
|
||||
}
|
||||
//# sourceMappingURL=eip1193-bridge.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"eip1193-bridge.d.ts","sourceRoot":"","sources":["../src.ts/eip1193-bridge.ts"],"names":[],"mappings":";AAEA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAehC,qBAAa,aAAc,SAAQ,YAAY;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAEjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAMjE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAwIjE"}
|
||||
{"version":3,"file":"eip1193-bridge.d.ts","sourceRoot":"","sources":["../src.ts/eip1193-bridge.ts"],"names":[],"mappings":";AAEA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAehC,qBAAa,aAAc,SAAQ,YAAY;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAEjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAMvE,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAwIjE"}
|
@ -27,10 +27,13 @@ export class Eip1193Bridge extends EventEmitter {
|
||||
ethers.utils.defineReadOnly(this, "signer", signer);
|
||||
ethers.utils.defineReadOnly(this, "provider", provider || null);
|
||||
}
|
||||
request(request) {
|
||||
return this.send(request.method, request.params || []);
|
||||
}
|
||||
send(method, params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
function throwUnsupported(message) {
|
||||
return logger.throwError("eth_sign requires a signer", ethers.utils.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
return logger.throwError(message, ethers.utils.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
method: method,
|
||||
params: params
|
||||
});
|
||||
@ -119,7 +122,7 @@ export class Eip1193Bridge extends EventEmitter {
|
||||
}
|
||||
case "eth_sendTransaction": {
|
||||
if (!this.signer) {
|
||||
return throwUnsupported("eth_sign requires an account");
|
||||
return throwUnsupported("eth_sendTransaction requires an account");
|
||||
}
|
||||
const req = ethers.providers.JsonRpcProvider.hexlifyTransaction(params[0]);
|
||||
const tx = yield this.signer.sendTransaction(req);
|
||||
|
File diff suppressed because one or more lines are too long
2
packages/experimental/lib/_version.d.ts
vendored
2
packages/experimental/lib/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "experimental/5.1.1";
|
||||
export declare const version = "experimental/5.1.2";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "experimental/5.1.1";
|
||||
exports.version = "experimental/5.1.2";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -5,6 +5,10 @@ export declare class Eip1193Bridge extends EventEmitter {
|
||||
readonly signer: ethers.Signer;
|
||||
readonly provider: ethers.providers.Provider;
|
||||
constructor(signer: ethers.Signer, provider?: ethers.providers.Provider);
|
||||
request(request: {
|
||||
method: string;
|
||||
params?: Array<any>;
|
||||
}): Promise<any>;
|
||||
send(method: string, params?: Array<any>): Promise<any>;
|
||||
}
|
||||
//# sourceMappingURL=eip1193-bridge.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"eip1193-bridge.d.ts","sourceRoot":"","sources":["../src.ts/eip1193-bridge.ts"],"names":[],"mappings":";AAEA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAehC,qBAAa,aAAc,SAAQ,YAAY;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAEjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAMjE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAwIjE"}
|
||||
{"version":3,"file":"eip1193-bridge.d.ts","sourceRoot":"","sources":["../src.ts/eip1193-bridge.ts"],"names":[],"mappings":";AAEA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAehC,qBAAa,aAAc,SAAQ,YAAY;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAEjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAMvE,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAwIjE"}
|
@ -76,10 +76,13 @@ var Eip1193Bridge = /** @class */ (function (_super) {
|
||||
ethers_1.ethers.utils.defineReadOnly(_this, "provider", provider || null);
|
||||
return _this;
|
||||
}
|
||||
Eip1193Bridge.prototype.request = function (request) {
|
||||
return this.send(request.method, request.params || []);
|
||||
};
|
||||
Eip1193Bridge.prototype.send = function (method, params) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
function throwUnsupported(message) {
|
||||
return logger.throwError("eth_sign requires a signer", ethers_1.ethers.utils.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
return logger.throwError(message, ethers_1.ethers.utils.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
method: method,
|
||||
params: params
|
||||
});
|
||||
@ -203,7 +206,7 @@ var Eip1193Bridge = /** @class */ (function (_super) {
|
||||
return [2 /*return*/, this.signer.signMessage(ethers_1.ethers.utils.arrayify(params[1]))];
|
||||
case 35:
|
||||
if (!this.signer) {
|
||||
return [2 /*return*/, throwUnsupported("eth_sign requires an account")];
|
||||
return [2 /*return*/, throwUnsupported("eth_sendTransaction requires an account")];
|
||||
}
|
||||
req = ethers_1.ethers.providers.JsonRpcProvider.hexlifyTransaction(params[0]);
|
||||
return [4 /*yield*/, this.signer.sendTransaction(req)];
|
||||
|
File diff suppressed because one or more lines are too long
@ -37,7 +37,7 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"tarballHash": "0xf87c81e032ee4715c538b22f537dd55d724fcaa2ad7c409bae97d65338f41c38",
|
||||
"tarballHash": "0xf89a309b4070a759d8dc2a64179ecac3ce9b66e9e54a693d8fc4b343ca02fcc3",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.1.1"
|
||||
"version": "5.1.2"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "experimental/5.1.1";
|
||||
export const version = "experimental/5.1.2";
|
||||
|
2
packages/providers/lib.esm/_version.d.ts
vendored
2
packages/providers/lib.esm/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "providers/5.1.1";
|
||||
export declare const version = "providers/5.1.2";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,2 +1,2 @@
|
||||
export const version = "providers/5.1.1";
|
||||
export const version = "providers/5.1.2";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -29,6 +29,7 @@ export declare class JsonRpcProvider extends BaseProvider {
|
||||
_pendingFilter: Promise<number>;
|
||||
_nextId: number;
|
||||
_eventLoopCache: Record<string, Promise<any>>;
|
||||
get _cache(): Record<string, Promise<any>>;
|
||||
constructor(url?: ConnectionInfo | string, network?: Networkish);
|
||||
static defaultUrl(): string;
|
||||
detectNetwork(): Promise<Network>;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"json-rpc-provider.d.ts","sourceRoot":"","sources":["../src.ts/json-rpc-provider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE1G,OAAO,EAAE,KAAK,EAAkC,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAA6B,UAAU,EAA6D,MAAM,2BAA2B,CAAC;AAE7I,OAAO,EAAE,UAAU,EAAiB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAMrE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,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAqDtD,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAE;IA4D7D,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAaxD,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK/B,aAAa,IAAI,IAAI;IA2CrB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAiB9B,MAAM,CAAC,kBAAkB,CAAC,WAAW,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;KAAE;CAgC9I"}
|
@ -263,7 +263,6 @@ export class JsonRpcProvider extends BaseProvider {
|
||||
});
|
||||
}
|
||||
super(networkOrReady);
|
||||
this._eventLoopCache = {};
|
||||
// Default URL
|
||||
if (!url) {
|
||||
url = getStatic(this.constructor, "defaultUrl")();
|
||||
@ -278,18 +277,24 @@ export class JsonRpcProvider extends BaseProvider {
|
||||
}
|
||||
this._nextId = 42;
|
||||
}
|
||||
get _cache() {
|
||||
if (this._eventLoopCache == null) {
|
||||
this._eventLoopCache = {};
|
||||
}
|
||||
return this._eventLoopCache;
|
||||
}
|
||||
static defaultUrl() {
|
||||
return "http:/\/localhost:8545";
|
||||
}
|
||||
detectNetwork() {
|
||||
if (!this._eventLoopCache["detectNetwork"]) {
|
||||
this._eventLoopCache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
if (!this._cache["detectNetwork"]) {
|
||||
this._cache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
// Clear this cache at the beginning of the next event loop
|
||||
setTimeout(() => {
|
||||
this._eventLoopCache["detectNetwork"] = null;
|
||||
this._cache["detectNetwork"] = null;
|
||||
}, 0);
|
||||
}
|
||||
return this._eventLoopCache["detectNetwork"];
|
||||
return this._cache["detectNetwork"];
|
||||
}
|
||||
_uncachedDetectNetwork() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
@ -348,8 +353,8 @@ export class JsonRpcProvider extends BaseProvider {
|
||||
// We can expand this in the future to any call, but for now these
|
||||
// are the biggest wins and do not require any serializing parameters.
|
||||
const cache = (["eth_chainId", "eth_blockNumber"].indexOf(method) >= 0);
|
||||
if (cache && this._eventLoopCache[method]) {
|
||||
return this._eventLoopCache[method];
|
||||
if (cache && this._cache[method]) {
|
||||
return this._cache[method];
|
||||
}
|
||||
const result = fetchJson(this.connection, JSON.stringify(request), getResult).then((result) => {
|
||||
this.emit("debug", {
|
||||
@ -370,9 +375,9 @@ export class JsonRpcProvider extends BaseProvider {
|
||||
});
|
||||
// Cache the fetch, but clear it on the next event loop
|
||||
if (cache) {
|
||||
this._eventLoopCache[method] = result;
|
||||
this._cache[method] = result;
|
||||
setTimeout(() => {
|
||||
this._eventLoopCache[method] = null;
|
||||
this._cache[method] = null;
|
||||
}, 0);
|
||||
}
|
||||
return result;
|
||||
|
File diff suppressed because one or more lines are too long
2
packages/providers/lib/_version.d.ts
vendored
2
packages/providers/lib/_version.d.ts
vendored
@ -1,2 +1,2 @@
|
||||
export declare const version = "providers/5.1.1";
|
||||
export declare const version = "providers/5.1.2";
|
||||
//# sourceMappingURL=_version.d.ts.map
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "providers/5.1.1";
|
||||
exports.version = "providers/5.1.2";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -29,6 +29,7 @@ export declare class JsonRpcProvider extends BaseProvider {
|
||||
_pendingFilter: Promise<number>;
|
||||
_nextId: number;
|
||||
_eventLoopCache: Record<string, Promise<any>>;
|
||||
get _cache(): Record<string, Promise<any>>;
|
||||
constructor(url?: ConnectionInfo | string, network?: Networkish);
|
||||
static defaultUrl(): string;
|
||||
detectNetwork(): Promise<Network>;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"json-rpc-provider.d.ts","sourceRoot":"","sources":["../src.ts/json-rpc-provider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE1G,OAAO,EAAE,KAAK,EAAkC,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAA6B,UAAU,EAA6D,MAAM,2BAA2B,CAAC;AAE7I,OAAO,EAAE,UAAU,EAAiB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAMrE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAyFtD,qBAAa,aAAc,SAAQ,MAAO,YAAW,eAAe;IAChE,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;gBAEL,gBAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM;IA0B9F,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa;IAM1C,gBAAgB,IAAI,aAAa;IAIjC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAe7B,wBAAwB,CAAC,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;I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AC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;KAAE;CAgC9I"}
|
@ -354,7 +354,6 @@ var JsonRpcProvider = /** @class */ (function (_super) {
|
||||
});
|
||||
}
|
||||
_this = _super.call(this, networkOrReady) || this;
|
||||
_this._eventLoopCache = {};
|
||||
// Default URL
|
||||
if (!url) {
|
||||
url = properties_1.getStatic(_this.constructor, "defaultUrl")();
|
||||
@ -370,19 +369,29 @@ var JsonRpcProvider = /** @class */ (function (_super) {
|
||||
_this._nextId = 42;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(JsonRpcProvider.prototype, "_cache", {
|
||||
get: function () {
|
||||
if (this._eventLoopCache == null) {
|
||||
this._eventLoopCache = {};
|
||||
}
|
||||
return this._eventLoopCache;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
JsonRpcProvider.defaultUrl = function () {
|
||||
return "http:/\/localhost:8545";
|
||||
};
|
||||
JsonRpcProvider.prototype.detectNetwork = function () {
|
||||
var _this = this;
|
||||
if (!this._eventLoopCache["detectNetwork"]) {
|
||||
this._eventLoopCache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
if (!this._cache["detectNetwork"]) {
|
||||
this._cache["detectNetwork"] = this._uncachedDetectNetwork();
|
||||
// Clear this cache at the beginning of the next event loop
|
||||
setTimeout(function () {
|
||||
_this._eventLoopCache["detectNetwork"] = null;
|
||||
_this._cache["detectNetwork"] = null;
|
||||
}, 0);
|
||||
}
|
||||
return this._eventLoopCache["detectNetwork"];
|
||||
return this._cache["detectNetwork"];
|
||||
};
|
||||
JsonRpcProvider.prototype._uncachedDetectNetwork = function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
@ -462,8 +471,8 @@ var JsonRpcProvider = /** @class */ (function (_super) {
|
||||
// We can expand this in the future to any call, but for now these
|
||||
// are the biggest wins and do not require any serializing parameters.
|
||||
var cache = (["eth_chainId", "eth_blockNumber"].indexOf(method) >= 0);
|
||||
if (cache && this._eventLoopCache[method]) {
|
||||
return this._eventLoopCache[method];
|
||||
if (cache && this._cache[method]) {
|
||||
return this._cache[method];
|
||||
}
|
||||
var result = web_1.fetchJson(this.connection, JSON.stringify(request), getResult).then(function (result) {
|
||||
_this.emit("debug", {
|
||||
@ -484,9 +493,9 @@ var JsonRpcProvider = /** @class */ (function (_super) {
|
||||
});
|
||||
// Cache the fetch, but clear it on the next event loop
|
||||
if (cache) {
|
||||
this._eventLoopCache[method] = result;
|
||||
this._cache[method] = result;
|
||||
setTimeout(function () {
|
||||
_this._eventLoopCache[method] = null;
|
||||
_this._cache[method] = null;
|
||||
}, 0);
|
||||
}
|
||||
return result;
|
||||
|
File diff suppressed because one or more lines are too long
@ -66,7 +66,7 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"tarballHash": "0xa0262ee95a674718fcdede03961a5bba6742f793e0462e6dadf2a68c64719a62",
|
||||
"tarballHash": "0x0282d57c2e7162dd582ae2ed220be1f7d3d01237cfc3285d16ccff7cd00dede4",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.1.1"
|
||||
"version": "5.1.2"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = "providers/5.1.1";
|
||||
export const version = "providers/5.1.2";
|
||||
|
Loading…
Reference in New Issue
Block a user