damm-sdk 1.1.30-alpha.19 → 1.1.30-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +579 -422
- package/dist/index.cjs.map +5 -3
- package/dist/index.js +2414 -2895
- package/dist/index.js.map +14 -20
- package/package.json +1 -1
- package/src/lib/contractsRegistry.json +37 -1
package/dist/index.cjs
CHANGED
|
@@ -14489,7 +14489,7 @@ var require_utils2 = __commonJS((exports2) => {
|
|
|
14489
14489
|
var exports_process = {};
|
|
14490
14490
|
__export(exports_process, {
|
|
14491
14491
|
versions: () => versions,
|
|
14492
|
-
version: () =>
|
|
14492
|
+
version: () => version7,
|
|
14493
14493
|
umask: () => umask,
|
|
14494
14494
|
title: () => title,
|
|
14495
14495
|
removeListener: () => removeListener,
|
|
@@ -14546,7 +14546,7 @@ function nextTick(fun) {
|
|
|
14546
14546
|
setTimeout(drainQueue, 0);
|
|
14547
14547
|
}
|
|
14548
14548
|
function noop() {}
|
|
14549
|
-
var queue, draining = false, currentQueue, queueIndex = -1, title = "browser", browser = true, env, argv,
|
|
14549
|
+
var queue, draining = false, currentQueue, queueIndex = -1, title = "browser", browser = true, env, argv, version7 = "", versions, on, addListener, once, off, removeListener, removeAllListeners, emit, prependListener, prependOnceListener, listeners = function(name) {
|
|
14550
14550
|
return [];
|
|
14551
14551
|
}, binding = function(name) {
|
|
14552
14552
|
throw new Error("process.binding is not supported in browser polyfill");
|
|
@@ -35378,7 +35378,7 @@ var require_lib14 = __commonJS((exports2) => {
|
|
|
35378
35378
|
var properties_1 = require_lib4();
|
|
35379
35379
|
var logger_1 = require_lib();
|
|
35380
35380
|
var _version_1 = require__version10();
|
|
35381
|
-
var
|
|
35381
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
35382
35382
|
var _curve = null;
|
|
35383
35383
|
function getCurve() {
|
|
35384
35384
|
if (!_curve) {
|
|
@@ -35391,7 +35391,7 @@ var require_lib14 = __commonJS((exports2) => {
|
|
|
35391
35391
|
(0, properties_1.defineReadOnly)(this, "curve", "secp256k1");
|
|
35392
35392
|
(0, properties_1.defineReadOnly)(this, "privateKey", (0, bytes_1.hexlify)(privateKey));
|
|
35393
35393
|
if ((0, bytes_1.hexDataLength)(this.privateKey) !== 32) {
|
|
35394
|
-
|
|
35394
|
+
logger6.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]");
|
|
35395
35395
|
}
|
|
35396
35396
|
var keyPair = getCurve().keyFromPrivate((0, bytes_1.arrayify)(this.privateKey));
|
|
35397
35397
|
(0, properties_1.defineReadOnly)(this, "publicKey", "0x" + keyPair.getPublic(false, "hex"));
|
|
@@ -35407,7 +35407,7 @@ var require_lib14 = __commonJS((exports2) => {
|
|
|
35407
35407
|
var keyPair = getCurve().keyFromPrivate((0, bytes_1.arrayify)(this.privateKey));
|
|
35408
35408
|
var digestBytes = (0, bytes_1.arrayify)(digest);
|
|
35409
35409
|
if (digestBytes.length !== 32) {
|
|
35410
|
-
|
|
35410
|
+
logger6.throwArgumentError("bad digest length", "digest", digest);
|
|
35411
35411
|
}
|
|
35412
35412
|
var signature = keyPair.sign(digestBytes, { canonical: true });
|
|
35413
35413
|
return (0, bytes_1.splitSignature)({
|
|
@@ -35452,7 +35452,7 @@ var require_lib14 = __commonJS((exports2) => {
|
|
|
35452
35452
|
}
|
|
35453
35453
|
return "0x" + getCurve().keyFromPublic(bytes).getPublic(true, "hex");
|
|
35454
35454
|
}
|
|
35455
|
-
return
|
|
35455
|
+
return logger6.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
35456
35456
|
}
|
|
35457
35457
|
exports2.computePublicKey = computePublicKey;
|
|
35458
35458
|
});
|
|
@@ -35506,7 +35506,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35506
35506
|
var signing_key_1 = require_lib14();
|
|
35507
35507
|
var logger_1 = require_lib();
|
|
35508
35508
|
var _version_1 = require__version11();
|
|
35509
|
-
var
|
|
35509
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
35510
35510
|
var TransactionTypes;
|
|
35511
35511
|
(function(TransactionTypes2) {
|
|
35512
35512
|
TransactionTypes2[TransactionTypes2["legacy"] = 0] = "legacy";
|
|
@@ -35555,7 +35555,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35555
35555
|
function formatNumber(value, name) {
|
|
35556
35556
|
var result = (0, bytes_1.stripZeros)(bignumber_1.BigNumber.from(value).toHexString());
|
|
35557
35557
|
if (result.length > 32) {
|
|
35558
|
-
|
|
35558
|
+
logger6.throwArgumentError("invalid length for " + name, "transaction:" + name, value);
|
|
35559
35559
|
}
|
|
35560
35560
|
return result;
|
|
35561
35561
|
}
|
|
@@ -35564,7 +35564,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35564
35564
|
address: (0, address_1.getAddress)(addr),
|
|
35565
35565
|
storageKeys: (storageKeys || []).map(function(storageKey, index) {
|
|
35566
35566
|
if ((0, bytes_1.hexDataLength)(storageKey) !== 32) {
|
|
35567
|
-
|
|
35567
|
+
logger6.throwArgumentError("invalid access list storageKey", "accessList[" + addr + ":" + index + "]", storageKey);
|
|
35568
35568
|
}
|
|
35569
35569
|
return storageKey.toLowerCase();
|
|
35570
35570
|
})
|
|
@@ -35575,7 +35575,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35575
35575
|
return value.map(function(set, index) {
|
|
35576
35576
|
if (Array.isArray(set)) {
|
|
35577
35577
|
if (set.length > 2) {
|
|
35578
|
-
|
|
35578
|
+
logger6.throwArgumentError("access list expected to be [ address, storageKeys[] ]", "value[" + index + "]", set);
|
|
35579
35579
|
}
|
|
35580
35580
|
return accessSetify(set[0], set[1]);
|
|
35581
35581
|
}
|
|
@@ -35605,7 +35605,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35605
35605
|
var gasPrice = bignumber_1.BigNumber.from(transaction.gasPrice);
|
|
35606
35606
|
var maxFeePerGas = bignumber_1.BigNumber.from(transaction.maxFeePerGas || 0);
|
|
35607
35607
|
if (!gasPrice.eq(maxFeePerGas)) {
|
|
35608
|
-
|
|
35608
|
+
logger6.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas", "tx", {
|
|
35609
35609
|
gasPrice,
|
|
35610
35610
|
maxFeePerGas
|
|
35611
35611
|
});
|
|
@@ -35660,12 +35660,12 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35660
35660
|
}
|
|
35661
35661
|
value = (0, bytes_1.arrayify)((0, bytes_1.hexlify)(value, options));
|
|
35662
35662
|
if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {
|
|
35663
|
-
|
|
35663
|
+
logger6.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
35664
35664
|
}
|
|
35665
35665
|
if (fieldInfo.maxLength) {
|
|
35666
35666
|
value = (0, bytes_1.stripZeros)(value);
|
|
35667
35667
|
if (value.length > fieldInfo.maxLength) {
|
|
35668
|
-
|
|
35668
|
+
logger6.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
35669
35669
|
}
|
|
35670
35670
|
}
|
|
35671
35671
|
raw.push((0, bytes_1.hexlify)(value));
|
|
@@ -35674,7 +35674,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35674
35674
|
if (transaction.chainId != null) {
|
|
35675
35675
|
chainId = transaction.chainId;
|
|
35676
35676
|
if (typeof chainId !== "number") {
|
|
35677
|
-
|
|
35677
|
+
logger6.throwArgumentError("invalid transaction.chainId", "transaction", transaction);
|
|
35678
35678
|
}
|
|
35679
35679
|
} else if (signature && !(0, bytes_1.isBytesLike)(signature) && signature.v > 28) {
|
|
35680
35680
|
chainId = Math.floor((signature.v - 35) / 2);
|
|
@@ -35695,10 +35695,10 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35695
35695
|
raw.pop();
|
|
35696
35696
|
v += chainId * 2 + 8;
|
|
35697
35697
|
if (sig.v > 28 && sig.v !== v) {
|
|
35698
|
-
|
|
35698
|
+
logger6.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", signature);
|
|
35699
35699
|
}
|
|
35700
35700
|
} else if (sig.v !== v) {
|
|
35701
|
-
|
|
35701
|
+
logger6.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", signature);
|
|
35702
35702
|
}
|
|
35703
35703
|
raw.push((0, bytes_1.hexlify)(v));
|
|
35704
35704
|
raw.push((0, bytes_1.stripZeros)((0, bytes_1.arrayify)(sig.r)));
|
|
@@ -35708,7 +35708,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35708
35708
|
function serialize(transaction, signature) {
|
|
35709
35709
|
if (transaction.type == null || transaction.type === 0) {
|
|
35710
35710
|
if (transaction.accessList != null) {
|
|
35711
|
-
|
|
35711
|
+
logger6.throwArgumentError("untyped transactions do not support accessList; include type: 1", "transaction", transaction);
|
|
35712
35712
|
}
|
|
35713
35713
|
return _serialize(transaction, signature);
|
|
35714
35714
|
}
|
|
@@ -35720,7 +35720,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35720
35720
|
default:
|
|
35721
35721
|
break;
|
|
35722
35722
|
}
|
|
35723
|
-
return
|
|
35723
|
+
return logger6.throwError("unsupported transaction type: " + transaction.type, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
35724
35724
|
operation: "serializeTransaction",
|
|
35725
35725
|
transactionType: transaction.type
|
|
35726
35726
|
});
|
|
@@ -35734,7 +35734,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35734
35734
|
}
|
|
35735
35735
|
tx.v = recid;
|
|
35736
35736
|
} catch (error) {
|
|
35737
|
-
|
|
35737
|
+
logger6.throwArgumentError("invalid v for transaction type: 1", "v", fields[0]);
|
|
35738
35738
|
}
|
|
35739
35739
|
tx.r = (0, bytes_1.hexZeroPad)(fields[1], 32);
|
|
35740
35740
|
tx.s = (0, bytes_1.hexZeroPad)(fields[2], 32);
|
|
@@ -35746,7 +35746,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35746
35746
|
function _parseEip1559(payload) {
|
|
35747
35747
|
var transaction = RLP.decode(payload.slice(1));
|
|
35748
35748
|
if (transaction.length !== 9 && transaction.length !== 12) {
|
|
35749
|
-
|
|
35749
|
+
logger6.throwArgumentError("invalid component count for transaction type: 2", "payload", (0, bytes_1.hexlify)(payload));
|
|
35750
35750
|
}
|
|
35751
35751
|
var maxPriorityFeePerGas = handleNumber(transaction[2]);
|
|
35752
35752
|
var maxFeePerGas = handleNumber(transaction[3]);
|
|
@@ -35773,7 +35773,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35773
35773
|
function _parseEip2930(payload) {
|
|
35774
35774
|
var transaction = RLP.decode(payload.slice(1));
|
|
35775
35775
|
if (transaction.length !== 8 && transaction.length !== 11) {
|
|
35776
|
-
|
|
35776
|
+
logger6.throwArgumentError("invalid component count for transaction type: 1", "payload", (0, bytes_1.hexlify)(payload));
|
|
35777
35777
|
}
|
|
35778
35778
|
var tx = {
|
|
35779
35779
|
type: 1,
|
|
@@ -35796,7 +35796,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35796
35796
|
function _parse(rawTransaction) {
|
|
35797
35797
|
var transaction = RLP.decode(rawTransaction);
|
|
35798
35798
|
if (transaction.length !== 9 && transaction.length !== 6) {
|
|
35799
|
-
|
|
35799
|
+
logger6.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
|
|
35800
35800
|
}
|
|
35801
35801
|
var tx = {
|
|
35802
35802
|
nonce: handleNumber(transaction[0]).toNumber(),
|
|
@@ -35855,7 +35855,7 @@ var require_lib15 = __commonJS((exports2) => {
|
|
|
35855
35855
|
default:
|
|
35856
35856
|
break;
|
|
35857
35857
|
}
|
|
35858
|
-
return
|
|
35858
|
+
return logger6.throwError("unsupported transaction type: " + payload[0], logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
35859
35859
|
operation: "parseTransaction",
|
|
35860
35860
|
transactionType: payload[0]
|
|
35861
35861
|
});
|
|
@@ -35975,7 +35975,7 @@ var require_browser_sha2 = __commonJS((exports2) => {
|
|
|
35975
35975
|
var types_1 = require_types();
|
|
35976
35976
|
var logger_1 = require_lib();
|
|
35977
35977
|
var _version_1 = require__version12();
|
|
35978
|
-
var
|
|
35978
|
+
var logger7 = new logger_1.Logger(_version_1.version);
|
|
35979
35979
|
function ripemd160(data) {
|
|
35980
35980
|
return "0x" + hash_js_1.default.ripemd160().update((0, bytes_1.arrayify)(data)).digest("hex");
|
|
35981
35981
|
}
|
|
@@ -35990,7 +35990,7 @@ var require_browser_sha2 = __commonJS((exports2) => {
|
|
|
35990
35990
|
exports2.sha512 = sha512;
|
|
35991
35991
|
function computeHmac(algorithm, key, data) {
|
|
35992
35992
|
if (!types_1.SupportedAlgorithm[algorithm]) {
|
|
35993
|
-
|
|
35993
|
+
logger7.throwError("unsupported algorithm " + algorithm, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
35994
35994
|
operation: "hmac",
|
|
35995
35995
|
algorithm
|
|
35996
35996
|
});
|
|
@@ -36865,7 +36865,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
36865
36865
|
var wordlists_1 = require_lib19();
|
|
36866
36866
|
var logger_1 = require_lib();
|
|
36867
36867
|
var _version_1 = require__version14();
|
|
36868
|
-
var
|
|
36868
|
+
var logger7 = new logger_1.Logger(_version_1.version);
|
|
36869
36869
|
var N = bignumber_1.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
36870
36870
|
var MasterSecret = (0, strings_1.toUtf8Bytes)("Bitcoin seed");
|
|
36871
36871
|
var HardenedBit = 2147483648;
|
|
@@ -36888,7 +36888,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
36888
36888
|
if (typeof wordlist === "string") {
|
|
36889
36889
|
var words = wordlists_1.wordlists[wordlist];
|
|
36890
36890
|
if (words == null) {
|
|
36891
|
-
|
|
36891
|
+
logger7.throwArgumentError("unknown locale", "wordlist", wordlist);
|
|
36892
36892
|
}
|
|
36893
36893
|
return words;
|
|
36894
36894
|
}
|
|
@@ -37043,7 +37043,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
37043
37043
|
HDNode2.fromExtendedKey = function(extendedKey) {
|
|
37044
37044
|
var bytes = basex_1.Base58.decode(extendedKey);
|
|
37045
37045
|
if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {
|
|
37046
|
-
|
|
37046
|
+
logger7.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
37047
37047
|
}
|
|
37048
37048
|
var depth = bytes[4];
|
|
37049
37049
|
var parentFingerprint = (0, bytes_1.hexlify)(bytes.slice(5, 9));
|
|
@@ -37061,7 +37061,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
37061
37061
|
}
|
|
37062
37062
|
return new HDNode2(_constructorGuard3, (0, bytes_1.hexlify)(key.slice(1)), null, parentFingerprint, chainCode, index, depth, null);
|
|
37063
37063
|
}
|
|
37064
|
-
return
|
|
37064
|
+
return logger7.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
37065
37065
|
};
|
|
37066
37066
|
return HDNode2;
|
|
37067
37067
|
}();
|
|
@@ -37076,7 +37076,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
37076
37076
|
exports2.mnemonicToSeed = mnemonicToSeed;
|
|
37077
37077
|
function mnemonicToEntropy(mnemonic, wordlist) {
|
|
37078
37078
|
wordlist = getWordlist(wordlist);
|
|
37079
|
-
|
|
37079
|
+
logger7.checkNormalize();
|
|
37080
37080
|
var words = wordlist.split(mnemonic);
|
|
37081
37081
|
if (words.length % 3 !== 0) {
|
|
37082
37082
|
throw new Error("invalid mnemonic");
|
|
@@ -37144,7 +37144,7 @@ var require_lib20 = __commonJS((exports2) => {
|
|
|
37144
37144
|
exports2.isValidMnemonic = isValidMnemonic;
|
|
37145
37145
|
function getAccountPath(index) {
|
|
37146
37146
|
if (typeof index !== "number" || index < 0 || index >= HardenedBit || index % 1) {
|
|
37147
|
-
|
|
37147
|
+
logger7.throwArgumentError("invalid account index", "index", index);
|
|
37148
37148
|
}
|
|
37149
37149
|
return "m/44'/60'/" + index + "'/0/0";
|
|
37150
37150
|
}
|
|
@@ -37165,7 +37165,7 @@ var require_browser_random = __commonJS((exports2) => {
|
|
|
37165
37165
|
var bytes_1 = require_lib2();
|
|
37166
37166
|
var logger_1 = require_lib();
|
|
37167
37167
|
var _version_1 = require__version15();
|
|
37168
|
-
var
|
|
37168
|
+
var logger7 = new logger_1.Logger(_version_1.version);
|
|
37169
37169
|
function getGlobal() {
|
|
37170
37170
|
if (typeof self !== "undefined") {
|
|
37171
37171
|
return self;
|
|
@@ -37181,10 +37181,10 @@ var require_browser_random = __commonJS((exports2) => {
|
|
|
37181
37181
|
var anyGlobal = getGlobal();
|
|
37182
37182
|
var crypto2 = anyGlobal.crypto || anyGlobal.msCrypto;
|
|
37183
37183
|
if (!crypto2 || !crypto2.getRandomValues) {
|
|
37184
|
-
|
|
37184
|
+
logger7.warn("WARNING: Missing strong random number source");
|
|
37185
37185
|
crypto2 = {
|
|
37186
37186
|
getRandomValues: function(buffer) {
|
|
37187
|
-
return
|
|
37187
|
+
return logger7.throwError("no secure random source avaialble", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
37188
37188
|
operation: "crypto.getRandomValues"
|
|
37189
37189
|
});
|
|
37190
37190
|
}
|
|
@@ -37192,7 +37192,7 @@ var require_browser_random = __commonJS((exports2) => {
|
|
|
37192
37192
|
}
|
|
37193
37193
|
function randomBytes(length) {
|
|
37194
37194
|
if (length <= 0 || length > 1024 || length % 1 || length != length) {
|
|
37195
|
-
|
|
37195
|
+
logger7.throwArgumentError("invalid length", "length", length);
|
|
37196
37196
|
}
|
|
37197
37197
|
var result = new Uint8Array(length);
|
|
37198
37198
|
crypto2.getRandomValues(result);
|
|
@@ -37886,7 +37886,7 @@ var require_crowdsale = __commonJS((exports2) => {
|
|
|
37886
37886
|
var properties_1 = require_lib4();
|
|
37887
37887
|
var logger_1 = require_lib();
|
|
37888
37888
|
var _version_1 = require__version16();
|
|
37889
|
-
var
|
|
37889
|
+
var logger7 = new logger_1.Logger(_version_1.version);
|
|
37890
37890
|
var utils_1 = require_utils5();
|
|
37891
37891
|
var CrowdsaleAccount = function(_super) {
|
|
37892
37892
|
__extends(CrowdsaleAccount2, _super);
|
|
@@ -37905,7 +37905,7 @@ var require_crowdsale = __commonJS((exports2) => {
|
|
|
37905
37905
|
var ethaddr = (0, address_1.getAddress)((0, utils_1.searchPath)(data, "ethaddr"));
|
|
37906
37906
|
var encseed = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "encseed"));
|
|
37907
37907
|
if (!encseed || encseed.length % 16 !== 0) {
|
|
37908
|
-
|
|
37908
|
+
logger7.throwArgumentError("invalid encseed", "json", json);
|
|
37909
37909
|
}
|
|
37910
37910
|
var key = (0, bytes_1.arrayify)((0, pbkdf2_1.pbkdf2)(password, password, 2000, 32, "sha256")).slice(0, 16);
|
|
37911
37911
|
var iv = encseed.slice(0, 16);
|
|
@@ -38587,7 +38587,7 @@ var require_keystore = __commonJS((exports2) => {
|
|
|
38587
38587
|
var utils_1 = require_utils5();
|
|
38588
38588
|
var logger_1 = require_lib();
|
|
38589
38589
|
var _version_1 = require__version16();
|
|
38590
|
-
var
|
|
38590
|
+
var logger7 = new logger_1.Logger(_version_1.version);
|
|
38591
38591
|
function hasMnemonic(value) {
|
|
38592
38592
|
return value != null && value.mnemonic && value.mnemonic.phrase;
|
|
38593
38593
|
}
|
|
@@ -38620,7 +38620,7 @@ var require_keystore = __commonJS((exports2) => {
|
|
|
38620
38620
|
}
|
|
38621
38621
|
var privateKey = _decrypt(data, key.slice(0, 16), ciphertext);
|
|
38622
38622
|
if (!privateKey) {
|
|
38623
|
-
|
|
38623
|
+
logger7.throwError("unsupported cipher", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
38624
38624
|
operation: "decrypt"
|
|
38625
38625
|
});
|
|
38626
38626
|
}
|
|
@@ -38674,7 +38674,7 @@ var require_keystore = __commonJS((exports2) => {
|
|
|
38674
38674
|
var kdf = (0, utils_1.searchPath)(data, "crypto/kdf");
|
|
38675
38675
|
if (kdf && typeof kdf === "string") {
|
|
38676
38676
|
var throwError = function(name, value) {
|
|
38677
|
-
return
|
|
38677
|
+
return logger7.throwArgumentError("invalid key-derivation function parameters", name, value);
|
|
38678
38678
|
};
|
|
38679
38679
|
if (kdf.toLowerCase() === "scrypt") {
|
|
38680
38680
|
var salt = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/kdfparams/salt"));
|
|
@@ -38711,7 +38711,7 @@ var require_keystore = __commonJS((exports2) => {
|
|
|
38711
38711
|
return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);
|
|
38712
38712
|
}
|
|
38713
38713
|
}
|
|
38714
|
-
return
|
|
38714
|
+
return logger7.throwArgumentError("unsupported key-derivation function", "kdf", kdf);
|
|
38715
38715
|
}
|
|
38716
38716
|
function decryptSync(json, password) {
|
|
38717
38717
|
var data = JSON.parse(json);
|
|
@@ -39215,7 +39215,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39215
39215
|
var strings_1 = require_lib9();
|
|
39216
39216
|
var logger_1 = require_lib();
|
|
39217
39217
|
var _version_1 = require__version17();
|
|
39218
|
-
var
|
|
39218
|
+
var logger9 = new logger_1.Logger(_version_1.version);
|
|
39219
39219
|
var geturl_1 = require_browser_geturl();
|
|
39220
39220
|
function staller(duration) {
|
|
39221
39221
|
return new Promise(function(resolve) {
|
|
@@ -39246,10 +39246,10 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39246
39246
|
}
|
|
39247
39247
|
function _fetchData(connection, body, processFunc) {
|
|
39248
39248
|
var attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
39249
|
-
|
|
39249
|
+
logger9.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
39250
39250
|
var throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
|
|
39251
39251
|
var throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
|
|
39252
|
-
|
|
39252
|
+
logger9.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
39253
39253
|
var errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
|
|
39254
39254
|
var headers = {};
|
|
39255
39255
|
var url = null;
|
|
@@ -39262,7 +39262,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39262
39262
|
url = connection;
|
|
39263
39263
|
} else if (typeof connection === "object") {
|
|
39264
39264
|
if (connection == null || connection.url == null) {
|
|
39265
|
-
|
|
39265
|
+
logger9.throwArgumentError("missing URL", "connection.url", connection);
|
|
39266
39266
|
}
|
|
39267
39267
|
url = connection.url;
|
|
39268
39268
|
if (typeof connection.timeout === "number" && connection.timeout > 0) {
|
|
@@ -39279,7 +39279,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39279
39279
|
options.allowGzip = !!connection.allowGzip;
|
|
39280
39280
|
if (connection.user != null && connection.password != null) {
|
|
39281
39281
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
39282
|
-
|
|
39282
|
+
logger9.throwError("basic authentication requires a secure https url", logger_1.Logger.errors.INVALID_ARGUMENT, { argument: "url", url, user: connection.user, password: "[REDACTED]" });
|
|
39283
39283
|
}
|
|
39284
39284
|
var authorization = connection.user + ":" + connection.password;
|
|
39285
39285
|
headers["authorization"] = {
|
|
@@ -39310,7 +39310,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39310
39310
|
}
|
|
39311
39311
|
return Promise.resolve(result);
|
|
39312
39312
|
} catch (error) {
|
|
39313
|
-
|
|
39313
|
+
logger9.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39314
39314
|
body: bodyify(dataMatch[1], dataMatch[2]),
|
|
39315
39315
|
error,
|
|
39316
39316
|
requestBody: null,
|
|
@@ -39344,7 +39344,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39344
39344
|
return;
|
|
39345
39345
|
}
|
|
39346
39346
|
timer = null;
|
|
39347
|
-
reject(
|
|
39347
|
+
reject(logger9.makeError("timeout", logger_1.Logger.errors.TIMEOUT, {
|
|
39348
39348
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
39349
39349
|
requestMethod: options.method,
|
|
39350
39350
|
timeout,
|
|
@@ -39421,7 +39421,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39421
39421
|
response2 = error_1.response;
|
|
39422
39422
|
if (response2 == null) {
|
|
39423
39423
|
runningTimeout.cancel();
|
|
39424
|
-
|
|
39424
|
+
logger9.throwError("missing response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39425
39425
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
39426
39426
|
requestMethod: options.method,
|
|
39427
39427
|
serverError: error_1,
|
|
@@ -39435,7 +39435,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39435
39435
|
body_1 = null;
|
|
39436
39436
|
} else if (!errorPassThrough && (response2.statusCode < 200 || response2.statusCode >= 300)) {
|
|
39437
39437
|
runningTimeout.cancel();
|
|
39438
|
-
|
|
39438
|
+
logger9.throwError("bad response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39439
39439
|
status: response2.statusCode,
|
|
39440
39440
|
headers: response2.headers,
|
|
39441
39441
|
body: bodyify(body_1, response2.headers ? response2.headers["content-type"] : null),
|
|
@@ -39475,7 +39475,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39475
39475
|
return [3, 19];
|
|
39476
39476
|
case 17:
|
|
39477
39477
|
runningTimeout.cancel();
|
|
39478
|
-
|
|
39478
|
+
logger9.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39479
39479
|
body: bodyify(body_1, response2.headers ? response2.headers["content-type"] : null),
|
|
39480
39480
|
error: error_2,
|
|
39481
39481
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -39490,7 +39490,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39490
39490
|
attempt++;
|
|
39491
39491
|
return [3, 1];
|
|
39492
39492
|
case 20:
|
|
39493
|
-
return [2,
|
|
39493
|
+
return [2, logger9.throwError("failed response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39494
39494
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
39495
39495
|
requestMethod: options.method,
|
|
39496
39496
|
url
|
|
@@ -39509,7 +39509,7 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
39509
39509
|
try {
|
|
39510
39510
|
result = JSON.parse((0, strings_1.toUtf8String)(value));
|
|
39511
39511
|
} catch (error) {
|
|
39512
|
-
|
|
39512
|
+
logger9.throwError("invalid JSON", logger_1.Logger.errors.SERVER_ERROR, {
|
|
39513
39513
|
body: value,
|
|
39514
39514
|
error
|
|
39515
39515
|
});
|
|
@@ -39647,7 +39647,7 @@ var require_bech32 = __commonJS((exports2, module2) => {
|
|
|
39647
39647
|
}
|
|
39648
39648
|
return chk;
|
|
39649
39649
|
}
|
|
39650
|
-
function
|
|
39650
|
+
function encode2(prefix, words, LIMIT) {
|
|
39651
39651
|
LIMIT = LIMIT || 90;
|
|
39652
39652
|
if (prefix.length + 7 + words.length > LIMIT)
|
|
39653
39653
|
throw new TypeError("Exceeds length limit");
|
|
@@ -39772,7 +39772,7 @@ var require_bech32 = __commonJS((exports2, module2) => {
|
|
|
39772
39772
|
module2.exports = {
|
|
39773
39773
|
decodeUnsafe,
|
|
39774
39774
|
decode,
|
|
39775
|
-
encode,
|
|
39775
|
+
encode: encode2,
|
|
39776
39776
|
toWordsUnsafe,
|
|
39777
39777
|
toWords,
|
|
39778
39778
|
fromWordsUnsafe,
|
|
@@ -39802,7 +39802,7 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39802
39802
|
var Zeros = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
39803
39803
|
var logger_1 = require_lib();
|
|
39804
39804
|
var _version_1 = require__version18();
|
|
39805
|
-
var
|
|
39805
|
+
var logger25 = new logger_1.Logger(_version_1.version);
|
|
39806
39806
|
function _pack(type, value, isArray2) {
|
|
39807
39807
|
switch (type) {
|
|
39808
39808
|
case "address":
|
|
@@ -39825,7 +39825,7 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39825
39825
|
if (match) {
|
|
39826
39826
|
var size2 = parseInt(match[2] || "256");
|
|
39827
39827
|
if (match[2] && String(size2) !== match[2] || size2 % 8 !== 0 || size2 === 0 || size2 > 256) {
|
|
39828
|
-
|
|
39828
|
+
logger25.throwArgumentError("invalid number type", "type", type);
|
|
39829
39829
|
}
|
|
39830
39830
|
if (isArray2) {
|
|
39831
39831
|
size2 = 256;
|
|
@@ -39837,10 +39837,10 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39837
39837
|
if (match) {
|
|
39838
39838
|
var size2 = parseInt(match[1]);
|
|
39839
39839
|
if (String(size2) !== match[1] || size2 === 0 || size2 > 32) {
|
|
39840
|
-
|
|
39840
|
+
logger25.throwArgumentError("invalid bytes type", "type", type);
|
|
39841
39841
|
}
|
|
39842
39842
|
if ((0, bytes_1.arrayify)(value).byteLength !== size2) {
|
|
39843
|
-
|
|
39843
|
+
logger25.throwArgumentError("invalid value for " + type, "value", value);
|
|
39844
39844
|
}
|
|
39845
39845
|
if (isArray2) {
|
|
39846
39846
|
return (0, bytes_1.arrayify)((value + Zeros).substring(0, 66));
|
|
@@ -39852,7 +39852,7 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39852
39852
|
var baseType_1 = match[1];
|
|
39853
39853
|
var count = parseInt(match[2] || String(value.length));
|
|
39854
39854
|
if (count != value.length) {
|
|
39855
|
-
|
|
39855
|
+
logger25.throwArgumentError("invalid array length for " + type, "value", value);
|
|
39856
39856
|
}
|
|
39857
39857
|
var result_1 = [];
|
|
39858
39858
|
value.forEach(function(value2) {
|
|
@@ -39860,11 +39860,11 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39860
39860
|
});
|
|
39861
39861
|
return (0, bytes_1.concat)(result_1);
|
|
39862
39862
|
}
|
|
39863
|
-
return
|
|
39863
|
+
return logger25.throwArgumentError("invalid type", "type", type);
|
|
39864
39864
|
}
|
|
39865
39865
|
function pack(types2, values) {
|
|
39866
39866
|
if (types2.length != values.length) {
|
|
39867
|
-
|
|
39867
|
+
logger25.throwArgumentError("wrong number of values; expected ${ types.length }", "values", values);
|
|
39868
39868
|
}
|
|
39869
39869
|
var tight = [];
|
|
39870
39870
|
types2.forEach(function(type, index) {
|
|
@@ -39873,10 +39873,10 @@ var require_lib24 = __commonJS((exports2) => {
|
|
|
39873
39873
|
return (0, bytes_1.hexlify)((0, bytes_1.concat)(tight));
|
|
39874
39874
|
}
|
|
39875
39875
|
exports2.pack = pack;
|
|
39876
|
-
function
|
|
39876
|
+
function keccak2563(types2, values) {
|
|
39877
39877
|
return (0, keccak256_1.keccak256)(pack(types2, values));
|
|
39878
39878
|
}
|
|
39879
|
-
exports2.keccak256 =
|
|
39879
|
+
exports2.keccak256 = keccak2563;
|
|
39880
39880
|
function sha2562(types2, values) {
|
|
39881
39881
|
return (0, sha2_1.sha256)(pack(types2, values));
|
|
39882
39882
|
}
|
|
@@ -39897,7 +39897,7 @@ var require_lib25 = __commonJS((exports2) => {
|
|
|
39897
39897
|
var bignumber_1 = require_lib3();
|
|
39898
39898
|
var logger_1 = require_lib();
|
|
39899
39899
|
var _version_1 = require__version19();
|
|
39900
|
-
var
|
|
39900
|
+
var logger25 = new logger_1.Logger(_version_1.version);
|
|
39901
39901
|
var names = [
|
|
39902
39902
|
"wei",
|
|
39903
39903
|
"kwei",
|
|
@@ -39910,7 +39910,7 @@ var require_lib25 = __commonJS((exports2) => {
|
|
|
39910
39910
|
function commify(value) {
|
|
39911
39911
|
var comps = String(value).split(".");
|
|
39912
39912
|
if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || comps[1] && !comps[1].match(/^[0-9]*$/) || value === "." || value === "-.") {
|
|
39913
|
-
|
|
39913
|
+
logger25.throwArgumentError("invalid value", "value", value);
|
|
39914
39914
|
}
|
|
39915
39915
|
var whole = comps[0];
|
|
39916
39916
|
var negative = "";
|
|
@@ -39957,7 +39957,7 @@ var require_lib25 = __commonJS((exports2) => {
|
|
|
39957
39957
|
exports2.formatUnits = formatUnits;
|
|
39958
39958
|
function parseUnits(value, unitName) {
|
|
39959
39959
|
if (typeof value !== "string") {
|
|
39960
|
-
|
|
39960
|
+
logger25.throwArgumentError("value must be a string", "value", value);
|
|
39961
39961
|
}
|
|
39962
39962
|
if (typeof unitName === "string") {
|
|
39963
39963
|
var index = names.indexOf(unitName);
|
|
@@ -41216,7 +41216,7 @@ var require_decimal = __commonJS((exports2, module2) => {
|
|
|
41216
41216
|
toExpNeg: -7,
|
|
41217
41217
|
toExpPos: 21,
|
|
41218
41218
|
LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
|
|
41219
|
-
}, external = true, decimalError = "[DecimalError] ", invalidArgument = decimalError + "Invalid argument: ", exponentOutOfRange = decimalError + "Exponent out of range: ", mathfloor = Math.floor, mathpow = Math.pow, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ONE2, BASE = 1e7, LOG_BASE = 7,
|
|
41219
|
+
}, external = true, decimalError = "[DecimalError] ", invalidArgument = decimalError + "Invalid argument: ", exponentOutOfRange = decimalError + "Exponent out of range: ", mathfloor = Math.floor, mathpow = Math.pow, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ONE2, BASE = 1e7, LOG_BASE = 7, MAX_SAFE_INTEGER2 = 9007199254740991, MAX_E = mathfloor(MAX_SAFE_INTEGER2 / LOG_BASE), P = {};
|
|
41220
41220
|
P.absoluteValue = P.abs = function() {
|
|
41221
41221
|
var x = new this.constructor(this);
|
|
41222
41222
|
if (x.s)
|
|
@@ -41506,7 +41506,7 @@ var require_decimal = __commonJS((exports2, module2) => {
|
|
|
41506
41506
|
if (!yIsInt) {
|
|
41507
41507
|
if (sign < 0)
|
|
41508
41508
|
throw Error(decimalError + "NaN");
|
|
41509
|
-
} else if ((k = yn < 0 ? -yn : yn) <=
|
|
41509
|
+
} else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER2) {
|
|
41510
41510
|
r = new Ctor(ONE2);
|
|
41511
41511
|
e = Math.ceil(pr / LOG_BASE + 4);
|
|
41512
41512
|
external = false;
|
|
@@ -42988,7 +42988,7 @@ var require_lib26 = __commonJS((exports2) => {
|
|
|
42988
42988
|
var properties_1 = require_lib4();
|
|
42989
42989
|
var logger_1 = require_lib();
|
|
42990
42990
|
var _version_1 = require__version20();
|
|
42991
|
-
var
|
|
42991
|
+
var logger26 = new logger_1.Logger(_version_1.version);
|
|
42992
42992
|
var ForkEvent2 = function(_super) {
|
|
42993
42993
|
__extends(ForkEvent3, _super);
|
|
42994
42994
|
function ForkEvent3() {
|
|
@@ -43005,7 +43005,7 @@ var require_lib26 = __commonJS((exports2) => {
|
|
|
43005
43005
|
function BlockForkEvent2(blockHash, expiry) {
|
|
43006
43006
|
var _this = this;
|
|
43007
43007
|
if (!(0, bytes_1.isHexString)(blockHash, 32)) {
|
|
43008
|
-
|
|
43008
|
+
logger26.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
|
43009
43009
|
}
|
|
43010
43010
|
_this = _super.call(this, {
|
|
43011
43011
|
_isForkEvent: true,
|
|
@@ -43023,7 +43023,7 @@ var require_lib26 = __commonJS((exports2) => {
|
|
|
43023
43023
|
function TransactionForkEvent2(hash, expiry) {
|
|
43024
43024
|
var _this = this;
|
|
43025
43025
|
if (!(0, bytes_1.isHexString)(hash, 32)) {
|
|
43026
|
-
|
|
43026
|
+
logger26.throwArgumentError("invalid transaction hash", "hash", hash);
|
|
43027
43027
|
}
|
|
43028
43028
|
_this = _super.call(this, {
|
|
43029
43029
|
_isForkEvent: true,
|
|
@@ -43041,10 +43041,10 @@ var require_lib26 = __commonJS((exports2) => {
|
|
|
43041
43041
|
function TransactionOrderForkEvent2(beforeHash, afterHash, expiry) {
|
|
43042
43042
|
var _this = this;
|
|
43043
43043
|
if (!(0, bytes_1.isHexString)(beforeHash, 32)) {
|
|
43044
|
-
|
|
43044
|
+
logger26.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
|
43045
43045
|
}
|
|
43046
43046
|
if (!(0, bytes_1.isHexString)(afterHash, 32)) {
|
|
43047
|
-
|
|
43047
|
+
logger26.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
|
43048
43048
|
}
|
|
43049
43049
|
_this = _super.call(this, {
|
|
43050
43050
|
_isForkEvent: true,
|
|
@@ -43061,7 +43061,7 @@ var require_lib26 = __commonJS((exports2) => {
|
|
|
43061
43061
|
var Provider2 = function() {
|
|
43062
43062
|
function Provider3() {
|
|
43063
43063
|
var _newTarget = this.constructor;
|
|
43064
|
-
|
|
43064
|
+
logger26.checkAbstract(_newTarget, Provider3);
|
|
43065
43065
|
(0, properties_1.defineReadOnly)(this, "_isProvider", true);
|
|
43066
43066
|
}
|
|
43067
43067
|
Provider3.prototype.getFeeData = function() {
|
|
@@ -43241,7 +43241,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43241
43241
|
var properties_1 = require_lib4();
|
|
43242
43242
|
var logger_1 = require_lib();
|
|
43243
43243
|
var _version_1 = require__version21();
|
|
43244
|
-
var
|
|
43244
|
+
var logger26 = new logger_1.Logger(_version_1.version);
|
|
43245
43245
|
var allowedTransactionKeys4 = [
|
|
43246
43246
|
"accessList",
|
|
43247
43247
|
"ccipReadEnabled",
|
|
@@ -43266,7 +43266,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43266
43266
|
var Signer2 = function() {
|
|
43267
43267
|
function Signer3() {
|
|
43268
43268
|
var _newTarget = this.constructor;
|
|
43269
|
-
|
|
43269
|
+
logger26.checkAbstract(_newTarget, Signer3);
|
|
43270
43270
|
(0, properties_1.defineReadOnly)(this, "_isSigner", true);
|
|
43271
43271
|
}
|
|
43272
43272
|
Signer3.prototype.getBalance = function(blockTag) {
|
|
@@ -43406,7 +43406,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43406
43406
|
Signer3.prototype.checkTransaction = function(transaction) {
|
|
43407
43407
|
for (var key in transaction) {
|
|
43408
43408
|
if (allowedTransactionKeys4.indexOf(key) === -1) {
|
|
43409
|
-
|
|
43409
|
+
logger26.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
|
|
43410
43410
|
}
|
|
43411
43411
|
}
|
|
43412
43412
|
var tx = (0, properties_1.shallowCopy)(transaction);
|
|
@@ -43418,7 +43418,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43418
43418
|
this.getAddress()
|
|
43419
43419
|
]).then(function(result) {
|
|
43420
43420
|
if (result[0].toLowerCase() !== result[1].toLowerCase()) {
|
|
43421
|
-
|
|
43421
|
+
logger26.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
43422
43422
|
}
|
|
43423
43423
|
return result[0];
|
|
43424
43424
|
});
|
|
@@ -43449,7 +43449,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43449
43449
|
case 1:
|
|
43450
43450
|
address = _a2.sent();
|
|
43451
43451
|
if (address == null) {
|
|
43452
|
-
|
|
43452
|
+
logger26.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
43453
43453
|
}
|
|
43454
43454
|
return [2, address];
|
|
43455
43455
|
}
|
|
@@ -43460,9 +43460,9 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43460
43460
|
}
|
|
43461
43461
|
hasEip1559 = tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null;
|
|
43462
43462
|
if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
|
|
43463
|
-
|
|
43463
|
+
logger26.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
|
|
43464
43464
|
} else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
|
|
43465
|
-
|
|
43465
|
+
logger26.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
|
|
43466
43466
|
}
|
|
43467
43467
|
if (!((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)))
|
|
43468
43468
|
return [3, 2];
|
|
@@ -43497,7 +43497,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43497
43497
|
}
|
|
43498
43498
|
} else if (feeData.gasPrice != null) {
|
|
43499
43499
|
if (hasEip1559) {
|
|
43500
|
-
|
|
43500
|
+
logger26.throwError("network does not support EIP-1559", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
43501
43501
|
operation: "populateTransaction"
|
|
43502
43502
|
});
|
|
43503
43503
|
}
|
|
@@ -43506,7 +43506,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43506
43506
|
}
|
|
43507
43507
|
tx.type = 0;
|
|
43508
43508
|
} else {
|
|
43509
|
-
|
|
43509
|
+
logger26.throwError("failed to get consistent fee data", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
43510
43510
|
operation: "signer.getFeeData"
|
|
43511
43511
|
});
|
|
43512
43512
|
}
|
|
@@ -43528,7 +43528,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43528
43528
|
if (forwardErrors2.indexOf(error.code) >= 0) {
|
|
43529
43529
|
throw error;
|
|
43530
43530
|
}
|
|
43531
|
-
return
|
|
43531
|
+
return logger26.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
43532
43532
|
error,
|
|
43533
43533
|
tx
|
|
43534
43534
|
});
|
|
@@ -43542,7 +43542,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43542
43542
|
this.getChainId()
|
|
43543
43543
|
]).then(function(results) {
|
|
43544
43544
|
if (results[1] !== 0 && results[0] !== results[1]) {
|
|
43545
|
-
|
|
43545
|
+
logger26.throwArgumentError("chainId address mismatch", "transaction", transaction);
|
|
43546
43546
|
}
|
|
43547
43547
|
return results[0];
|
|
43548
43548
|
});
|
|
@@ -43556,7 +43556,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43556
43556
|
};
|
|
43557
43557
|
Signer3.prototype._checkProvider = function(operation) {
|
|
43558
43558
|
if (!this.provider) {
|
|
43559
|
-
|
|
43559
|
+
logger26.throwError("missing provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
43560
43560
|
operation: operation || "_checkProvider"
|
|
43561
43561
|
});
|
|
43562
43562
|
}
|
|
@@ -43580,7 +43580,7 @@ var require_lib27 = __commonJS((exports2) => {
|
|
|
43580
43580
|
};
|
|
43581
43581
|
VoidSigner3.prototype._fail = function(message, operation) {
|
|
43582
43582
|
return Promise.resolve().then(function() {
|
|
43583
|
-
|
|
43583
|
+
logger26.throwError(message, logger_1.Logger.errors.UNSUPPORTED_OPERATION, { operation });
|
|
43584
43584
|
});
|
|
43585
43585
|
};
|
|
43586
43586
|
VoidSigner3.prototype.signMessage = function(message) {
|
|
@@ -43749,7 +43749,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43749
43749
|
var transactions_1 = require_lib15();
|
|
43750
43750
|
var logger_1 = require_lib();
|
|
43751
43751
|
var _version_1 = require__version22();
|
|
43752
|
-
var
|
|
43752
|
+
var logger26 = new logger_1.Logger(_version_1.version);
|
|
43753
43753
|
function isAccount2(value) {
|
|
43754
43754
|
return value != null && (0, bytes_1.isHexString)(value.privateKey, 32) && value.address != null;
|
|
43755
43755
|
}
|
|
@@ -43768,7 +43768,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43768
43768
|
});
|
|
43769
43769
|
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
|
|
43770
43770
|
if (_this.address !== (0, address_1.getAddress)(privateKey.address)) {
|
|
43771
|
-
|
|
43771
|
+
logger26.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
43772
43772
|
}
|
|
43773
43773
|
if (hasMnemonic2(privateKey)) {
|
|
43774
43774
|
var srcMnemonic_1 = privateKey.mnemonic;
|
|
@@ -43782,7 +43782,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43782
43782
|
var mnemonic = _this.mnemonic;
|
|
43783
43783
|
var node = hdnode_1.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
43784
43784
|
if ((0, transactions_1.computeAddress)(node.privateKey) !== _this.address) {
|
|
43785
|
-
|
|
43785
|
+
logger26.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
43786
43786
|
}
|
|
43787
43787
|
} else {
|
|
43788
43788
|
(0, properties_1.defineReadOnly)(_this, "_mnemonic", function() {
|
|
@@ -43792,7 +43792,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43792
43792
|
} else {
|
|
43793
43793
|
if (signing_key_1.SigningKey.isSigningKey(privateKey)) {
|
|
43794
43794
|
if (privateKey.curve !== "secp256k1") {
|
|
43795
|
-
|
|
43795
|
+
logger26.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
43796
43796
|
}
|
|
43797
43797
|
(0, properties_1.defineReadOnly)(_this, "_signingKey", function() {
|
|
43798
43798
|
return privateKey;
|
|
@@ -43814,7 +43814,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43814
43814
|
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
|
|
43815
43815
|
}
|
|
43816
43816
|
if (provider && !abstract_provider_1.Provider.isProvider(provider)) {
|
|
43817
|
-
|
|
43817
|
+
logger26.throwArgumentError("invalid provider", "provider", provider);
|
|
43818
43818
|
}
|
|
43819
43819
|
(0, properties_1.defineReadOnly)(_this, "provider", provider || null);
|
|
43820
43820
|
return _this;
|
|
@@ -43851,7 +43851,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43851
43851
|
return (0, properties_1.resolveProperties)(transaction).then(function(tx) {
|
|
43852
43852
|
if (tx.from != null) {
|
|
43853
43853
|
if ((0, address_1.getAddress)(tx.from) !== _this.address) {
|
|
43854
|
-
|
|
43854
|
+
logger26.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
43855
43855
|
}
|
|
43856
43856
|
delete tx.from;
|
|
43857
43857
|
}
|
|
@@ -43875,7 +43875,7 @@ var require_lib28 = __commonJS((exports2) => {
|
|
|
43875
43875
|
case 0:
|
|
43876
43876
|
return [4, hash_1._TypedDataEncoder.resolveNames(domain, types3, value, function(name) {
|
|
43877
43877
|
if (_this.provider == null) {
|
|
43878
|
-
|
|
43878
|
+
logger26.throwError("cannot resolve ENS names without a provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
43879
43879
|
operation: "resolveName",
|
|
43880
43880
|
value: name
|
|
43881
43881
|
});
|
|
@@ -44888,10 +44888,10 @@ var createCall = (call) => {
|
|
|
44888
44888
|
var exports_ethers = {};
|
|
44889
44889
|
__export(exports_ethers, {
|
|
44890
44890
|
wordlists: () => wordlists,
|
|
44891
|
-
version: () =>
|
|
44891
|
+
version: () => version13,
|
|
44892
44892
|
utils: () => exports_utils,
|
|
44893
44893
|
providers: () => exports_lib2,
|
|
44894
|
-
logger: () =>
|
|
44894
|
+
logger: () => logger25,
|
|
44895
44895
|
getDefaultProvider: () => getDefaultProvider,
|
|
44896
44896
|
errors: () => ErrorCode,
|
|
44897
44897
|
constants: () => exports_lib,
|
|
@@ -45466,6 +45466,12 @@ function throwFault(fault, operation, value) {
|
|
|
45466
45466
|
}
|
|
45467
45467
|
return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
|
45468
45468
|
}
|
|
45469
|
+
function _base36To16(value) {
|
|
45470
|
+
return new BN(value, 36).toString(16);
|
|
45471
|
+
}
|
|
45472
|
+
function _base16To36(value) {
|
|
45473
|
+
return new BN(value, 16).toString(36);
|
|
45474
|
+
}
|
|
45469
45475
|
// node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js
|
|
45470
45476
|
var import_bytes2 = __toESM(require_lib2());
|
|
45471
45477
|
var logger2 = new Logger(version3);
|
|
@@ -46163,14 +46169,136 @@ class VoidSigner extends Signer {
|
|
|
46163
46169
|
}
|
|
46164
46170
|
}
|
|
46165
46171
|
|
|
46166
|
-
// node_modules/@ethersproject/
|
|
46167
|
-
var import_address2 = __toESM(require_lib7());
|
|
46172
|
+
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46168
46173
|
var import_bytes3 = __toESM(require_lib2());
|
|
46174
|
+
var import_keccak256 = __toESM(require_lib5());
|
|
46175
|
+
var import_rlp = __toESM(require_lib6());
|
|
46176
|
+
|
|
46177
|
+
// node_modules/@ethersproject/address/lib.esm/_version.js
|
|
46178
|
+
var version6 = "address/5.7.0";
|
|
46179
|
+
|
|
46180
|
+
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46181
|
+
var logger5 = new Logger(version6);
|
|
46182
|
+
function getChecksumAddress(address) {
|
|
46183
|
+
if (!import_bytes3.isHexString(address, 20)) {
|
|
46184
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46185
|
+
}
|
|
46186
|
+
address = address.toLowerCase();
|
|
46187
|
+
const chars = address.substring(2).split("");
|
|
46188
|
+
const expanded = new Uint8Array(40);
|
|
46189
|
+
for (let i2 = 0;i2 < 40; i2++) {
|
|
46190
|
+
expanded[i2] = chars[i2].charCodeAt(0);
|
|
46191
|
+
}
|
|
46192
|
+
const hashed = import_bytes3.arrayify(import_keccak256.keccak256(expanded));
|
|
46193
|
+
for (let i2 = 0;i2 < 40; i2 += 2) {
|
|
46194
|
+
if (hashed[i2 >> 1] >> 4 >= 8) {
|
|
46195
|
+
chars[i2] = chars[i2].toUpperCase();
|
|
46196
|
+
}
|
|
46197
|
+
if ((hashed[i2 >> 1] & 15) >= 8) {
|
|
46198
|
+
chars[i2 + 1] = chars[i2 + 1].toUpperCase();
|
|
46199
|
+
}
|
|
46200
|
+
}
|
|
46201
|
+
return "0x" + chars.join("");
|
|
46202
|
+
}
|
|
46203
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
46204
|
+
function log10(x) {
|
|
46205
|
+
if (Math.log10) {
|
|
46206
|
+
return Math.log10(x);
|
|
46207
|
+
}
|
|
46208
|
+
return Math.log(x) / Math.LN10;
|
|
46209
|
+
}
|
|
46210
|
+
var ibanLookup = {};
|
|
46211
|
+
for (let i2 = 0;i2 < 10; i2++) {
|
|
46212
|
+
ibanLookup[String(i2)] = String(i2);
|
|
46213
|
+
}
|
|
46214
|
+
for (let i2 = 0;i2 < 26; i2++) {
|
|
46215
|
+
ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2);
|
|
46216
|
+
}
|
|
46217
|
+
var safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
46218
|
+
function ibanChecksum(address) {
|
|
46219
|
+
address = address.toUpperCase();
|
|
46220
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
46221
|
+
let expanded = address.split("").map((c) => {
|
|
46222
|
+
return ibanLookup[c];
|
|
46223
|
+
}).join("");
|
|
46224
|
+
while (expanded.length >= safeDigits) {
|
|
46225
|
+
let block = expanded.substring(0, safeDigits);
|
|
46226
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
46227
|
+
}
|
|
46228
|
+
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
|
46229
|
+
while (checksum.length < 2) {
|
|
46230
|
+
checksum = "0" + checksum;
|
|
46231
|
+
}
|
|
46232
|
+
return checksum;
|
|
46233
|
+
}
|
|
46234
|
+
function getAddress(address) {
|
|
46235
|
+
let result = null;
|
|
46236
|
+
if (typeof address !== "string") {
|
|
46237
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46238
|
+
}
|
|
46239
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
46240
|
+
if (address.substring(0, 2) !== "0x") {
|
|
46241
|
+
address = "0x" + address;
|
|
46242
|
+
}
|
|
46243
|
+
result = getChecksumAddress(address);
|
|
46244
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
46245
|
+
logger5.throwArgumentError("bad address checksum", "address", address);
|
|
46246
|
+
}
|
|
46247
|
+
} else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
46248
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
46249
|
+
logger5.throwArgumentError("bad icap checksum", "address", address);
|
|
46250
|
+
}
|
|
46251
|
+
result = _base36To16(address.substring(4));
|
|
46252
|
+
while (result.length < 40) {
|
|
46253
|
+
result = "0" + result;
|
|
46254
|
+
}
|
|
46255
|
+
result = getChecksumAddress("0x" + result);
|
|
46256
|
+
} else {
|
|
46257
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46258
|
+
}
|
|
46259
|
+
return result;
|
|
46260
|
+
}
|
|
46261
|
+
function isAddress(address) {
|
|
46262
|
+
try {
|
|
46263
|
+
getAddress(address);
|
|
46264
|
+
return true;
|
|
46265
|
+
} catch (error) {}
|
|
46266
|
+
return false;
|
|
46267
|
+
}
|
|
46268
|
+
function getIcapAddress(address) {
|
|
46269
|
+
let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();
|
|
46270
|
+
while (base36.length < 30) {
|
|
46271
|
+
base36 = "0" + base36;
|
|
46272
|
+
}
|
|
46273
|
+
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
|
46274
|
+
}
|
|
46275
|
+
function getContractAddress(transaction) {
|
|
46276
|
+
let from2 = null;
|
|
46277
|
+
try {
|
|
46278
|
+
from2 = getAddress(transaction.from);
|
|
46279
|
+
} catch (error) {
|
|
46280
|
+
logger5.throwArgumentError("missing from address", "transaction", transaction);
|
|
46281
|
+
}
|
|
46282
|
+
const nonce = import_bytes3.stripZeros(import_bytes3.arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
46283
|
+
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_rlp.encode([from2, nonce])), 12));
|
|
46284
|
+
}
|
|
46285
|
+
function getCreate2Address(from2, salt, initCodeHash) {
|
|
46286
|
+
if (import_bytes3.hexDataLength(salt) !== 32) {
|
|
46287
|
+
logger5.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
|
46288
|
+
}
|
|
46289
|
+
if (import_bytes3.hexDataLength(initCodeHash) !== 32) {
|
|
46290
|
+
logger5.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
46291
|
+
}
|
|
46292
|
+
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_bytes3.concat(["0xff", getAddress(from2), salt, initCodeHash])), 12));
|
|
46293
|
+
}
|
|
46294
|
+
|
|
46295
|
+
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46296
|
+
var import_bytes4 = __toESM(require_lib2());
|
|
46169
46297
|
var import_properties3 = __toESM(require_lib4());
|
|
46170
46298
|
var import_transactions = __toESM(require_lib15());
|
|
46171
46299
|
|
|
46172
46300
|
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
46173
|
-
var
|
|
46301
|
+
var version8 = "contracts/5.7.0";
|
|
46174
46302
|
|
|
46175
46303
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46176
46304
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
@@ -46200,7 +46328,7 @@ var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
|
46200
46328
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46201
46329
|
});
|
|
46202
46330
|
};
|
|
46203
|
-
var
|
|
46331
|
+
var logger6 = new Logger(version8);
|
|
46204
46332
|
var allowedTransactionKeys2 = {
|
|
46205
46333
|
chainId: true,
|
|
46206
46334
|
data: true,
|
|
@@ -46221,19 +46349,19 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
46221
46349
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46222
46350
|
const name = yield nameOrPromise;
|
|
46223
46351
|
if (typeof name !== "string") {
|
|
46224
|
-
|
|
46352
|
+
logger6.throwArgumentError("invalid address or ENS name", "name", name);
|
|
46225
46353
|
}
|
|
46226
46354
|
try {
|
|
46227
|
-
return
|
|
46355
|
+
return getAddress(name);
|
|
46228
46356
|
} catch (error) {}
|
|
46229
46357
|
if (!resolver) {
|
|
46230
|
-
|
|
46358
|
+
logger6.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46231
46359
|
operation: "resolveName"
|
|
46232
46360
|
});
|
|
46233
46361
|
}
|
|
46234
46362
|
const address = yield resolver.resolveName(name);
|
|
46235
46363
|
if (address == null) {
|
|
46236
|
-
|
|
46364
|
+
logger6.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
|
|
46237
46365
|
}
|
|
46238
46366
|
return address;
|
|
46239
46367
|
});
|
|
@@ -46253,7 +46381,7 @@ function resolveAddresses(resolver, value, paramType) {
|
|
|
46253
46381
|
}
|
|
46254
46382
|
if (paramType.baseType === "array") {
|
|
46255
46383
|
if (!Array.isArray(value)) {
|
|
46256
|
-
return Promise.reject(
|
|
46384
|
+
return Promise.reject(logger6.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
|
|
46257
46385
|
argument: "value",
|
|
46258
46386
|
value
|
|
46259
46387
|
}));
|
|
@@ -46269,15 +46397,15 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46269
46397
|
if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
|
|
46270
46398
|
overrides = import_properties3.shallowCopy(args.pop());
|
|
46271
46399
|
}
|
|
46272
|
-
|
|
46400
|
+
logger6.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
|
|
46273
46401
|
if (contract.signer) {
|
|
46274
46402
|
if (overrides.from) {
|
|
46275
46403
|
overrides.from = import_properties3.resolveProperties({
|
|
46276
46404
|
override: resolveName(contract.signer, overrides.from),
|
|
46277
46405
|
signer: contract.signer.getAddress()
|
|
46278
46406
|
}).then((check) => __awaiter3(this, undefined, undefined, function* () {
|
|
46279
|
-
if (
|
|
46280
|
-
|
|
46407
|
+
if (getAddress(check.signer) !== check.override) {
|
|
46408
|
+
logger6.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46281
46409
|
operation: "overrides.from"
|
|
46282
46410
|
});
|
|
46283
46411
|
}
|
|
@@ -46326,7 +46454,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46326
46454
|
}
|
|
46327
46455
|
if (tx.gasLimit == null && fragment.gas != null) {
|
|
46328
46456
|
let intrinsic = 21000;
|
|
46329
|
-
const bytes =
|
|
46457
|
+
const bytes = import_bytes4.arrayify(data);
|
|
46330
46458
|
for (let i2 = 0;i2 < bytes.length; i2++) {
|
|
46331
46459
|
intrinsic += 4;
|
|
46332
46460
|
if (bytes[i2]) {
|
|
@@ -46338,7 +46466,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46338
46466
|
if (ro.value) {
|
|
46339
46467
|
const roValue = BigNumber.from(ro.value);
|
|
46340
46468
|
if (!roValue.isZero() && !fragment.payable) {
|
|
46341
|
-
|
|
46469
|
+
logger6.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46342
46470
|
operation: "overrides.value",
|
|
46343
46471
|
value: overrides.value
|
|
46344
46472
|
});
|
|
@@ -46364,7 +46492,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46364
46492
|
delete overrides.ccipReadEnabled;
|
|
46365
46493
|
const leftovers = Object.keys(overrides).filter((key) => overrides[key] != null);
|
|
46366
46494
|
if (leftovers.length) {
|
|
46367
|
-
|
|
46495
|
+
logger6.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46368
46496
|
operation: "overrides",
|
|
46369
46497
|
overrides: leftovers
|
|
46370
46498
|
});
|
|
@@ -46382,7 +46510,7 @@ function buildEstimate(contract, fragment) {
|
|
|
46382
46510
|
return function(...args) {
|
|
46383
46511
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46384
46512
|
if (!signerOrProvider) {
|
|
46385
|
-
|
|
46513
|
+
logger6.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46386
46514
|
operation: "estimateGas"
|
|
46387
46515
|
});
|
|
46388
46516
|
}
|
|
@@ -46466,7 +46594,7 @@ function buildSend(contract, fragment) {
|
|
|
46466
46594
|
return function(...args) {
|
|
46467
46595
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46468
46596
|
if (!contract.signer) {
|
|
46469
|
-
|
|
46597
|
+
logger6.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46470
46598
|
operation: "sendTransaction"
|
|
46471
46599
|
});
|
|
46472
46600
|
}
|
|
@@ -46557,7 +46685,7 @@ class FragmentRunningEvent extends RunningEvent {
|
|
|
46557
46685
|
let topic = contractInterface.getEventTopic(fragment);
|
|
46558
46686
|
if (topics) {
|
|
46559
46687
|
if (topic !== topics[0]) {
|
|
46560
|
-
|
|
46688
|
+
logger6.throwArgumentError("topic mismatch", "topics", topics);
|
|
46561
46689
|
}
|
|
46562
46690
|
filter.topics = topics.slice();
|
|
46563
46691
|
} else {
|
|
@@ -46626,7 +46754,7 @@ class BaseContract {
|
|
|
46626
46754
|
import_properties3.defineReadOnly(this, "provider", signerOrProvider);
|
|
46627
46755
|
import_properties3.defineReadOnly(this, "signer", null);
|
|
46628
46756
|
} else {
|
|
46629
|
-
|
|
46757
|
+
logger6.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
|
|
46630
46758
|
}
|
|
46631
46759
|
import_properties3.defineReadOnly(this, "callStatic", {});
|
|
46632
46760
|
import_properties3.defineReadOnly(this, "estimateGas", {});
|
|
@@ -46653,23 +46781,23 @@ class BaseContract {
|
|
|
46653
46781
|
if (filters.length === 1) {
|
|
46654
46782
|
import_properties3.defineReadOnly(this.filters, name, this.filters[filters[0]]);
|
|
46655
46783
|
} else {
|
|
46656
|
-
|
|
46784
|
+
logger6.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
|
|
46657
46785
|
}
|
|
46658
46786
|
});
|
|
46659
46787
|
}
|
|
46660
46788
|
import_properties3.defineReadOnly(this, "_runningEvents", {});
|
|
46661
46789
|
import_properties3.defineReadOnly(this, "_wrappedEmits", {});
|
|
46662
46790
|
if (addressOrName == null) {
|
|
46663
|
-
|
|
46791
|
+
logger6.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
|
|
46664
46792
|
}
|
|
46665
46793
|
import_properties3.defineReadOnly(this, "address", addressOrName);
|
|
46666
46794
|
if (this.provider) {
|
|
46667
46795
|
import_properties3.defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
|
|
46668
46796
|
} else {
|
|
46669
46797
|
try {
|
|
46670
|
-
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(
|
|
46798
|
+
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
46671
46799
|
} catch (error) {
|
|
46672
|
-
|
|
46800
|
+
logger6.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46673
46801
|
operation: "new Contract"
|
|
46674
46802
|
});
|
|
46675
46803
|
}
|
|
@@ -46680,7 +46808,7 @@ class BaseContract {
|
|
|
46680
46808
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
46681
46809
|
const fragment = this.interface.functions[signature];
|
|
46682
46810
|
if (uniqueSignatures[signature]) {
|
|
46683
|
-
|
|
46811
|
+
logger6.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
|
|
46684
46812
|
return;
|
|
46685
46813
|
}
|
|
46686
46814
|
uniqueSignatures[signature] = true;
|
|
@@ -46734,7 +46862,7 @@ class BaseContract {
|
|
|
46734
46862
|
});
|
|
46735
46863
|
}
|
|
46736
46864
|
static getContractAddress(transaction) {
|
|
46737
|
-
return
|
|
46865
|
+
return getContractAddress(transaction);
|
|
46738
46866
|
}
|
|
46739
46867
|
static getInterface(contractInterface) {
|
|
46740
46868
|
if (import_abi.Interface.isInterface(contractInterface)) {
|
|
@@ -46754,7 +46882,7 @@ class BaseContract {
|
|
|
46754
46882
|
} else {
|
|
46755
46883
|
this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code2) => {
|
|
46756
46884
|
if (code2 === "0x") {
|
|
46757
|
-
|
|
46885
|
+
logger6.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46758
46886
|
contractAddress: this.address,
|
|
46759
46887
|
operation: "getDeployed"
|
|
46760
46888
|
});
|
|
@@ -46767,14 +46895,14 @@ class BaseContract {
|
|
|
46767
46895
|
}
|
|
46768
46896
|
fallback(overrides) {
|
|
46769
46897
|
if (!this.signer) {
|
|
46770
|
-
|
|
46898
|
+
logger6.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
|
|
46771
46899
|
}
|
|
46772
46900
|
const tx = import_properties3.shallowCopy(overrides || {});
|
|
46773
46901
|
["from", "to"].forEach(function(key) {
|
|
46774
46902
|
if (tx[key] == null) {
|
|
46775
46903
|
return;
|
|
46776
46904
|
}
|
|
46777
|
-
|
|
46905
|
+
logger6.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
46778
46906
|
});
|
|
46779
46907
|
tx.to = this.resolvedAddress;
|
|
46780
46908
|
return this.deployed().then(() => {
|
|
@@ -46867,7 +46995,7 @@ class BaseContract {
|
|
|
46867
46995
|
}
|
|
46868
46996
|
_addEventListener(runningEvent, listener, once3) {
|
|
46869
46997
|
if (!this.provider) {
|
|
46870
|
-
|
|
46998
|
+
logger6.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
46871
46999
|
}
|
|
46872
47000
|
runningEvent.addListener(listener, once3);
|
|
46873
47001
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
|
@@ -46898,9 +47026,9 @@ class BaseContract {
|
|
|
46898
47026
|
queryFilter(event, fromBlockOrBlockhash, toBlock) {
|
|
46899
47027
|
const runningEvent = this._getRunningEvent(event);
|
|
46900
47028
|
const filter = import_properties3.shallowCopy(runningEvent.filter);
|
|
46901
|
-
if (typeof fromBlockOrBlockhash === "string" &&
|
|
47029
|
+
if (typeof fromBlockOrBlockhash === "string" && import_bytes4.isHexString(fromBlockOrBlockhash, 32)) {
|
|
46902
47030
|
if (toBlock != null) {
|
|
46903
|
-
|
|
47031
|
+
logger6.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
|
|
46904
47032
|
}
|
|
46905
47033
|
filter.blockHash = fromBlockOrBlockhash;
|
|
46906
47034
|
} else {
|
|
@@ -46993,8 +47121,8 @@ class ContractFactory {
|
|
|
46993
47121
|
let bytecodeHex = null;
|
|
46994
47122
|
if (typeof bytecode === "string") {
|
|
46995
47123
|
bytecodeHex = bytecode;
|
|
46996
|
-
} else if (
|
|
46997
|
-
bytecodeHex =
|
|
47124
|
+
} else if (import_bytes4.isBytes(bytecode)) {
|
|
47125
|
+
bytecodeHex = import_bytes4.hexlify(bytecode);
|
|
46998
47126
|
} else if (bytecode && typeof bytecode.object === "string") {
|
|
46999
47127
|
bytecodeHex = bytecode.object;
|
|
47000
47128
|
} else {
|
|
@@ -47003,11 +47131,11 @@ class ContractFactory {
|
|
|
47003
47131
|
if (bytecodeHex.substring(0, 2) !== "0x") {
|
|
47004
47132
|
bytecodeHex = "0x" + bytecodeHex;
|
|
47005
47133
|
}
|
|
47006
|
-
if (!
|
|
47007
|
-
|
|
47134
|
+
if (!import_bytes4.isHexString(bytecodeHex) || bytecodeHex.length % 2) {
|
|
47135
|
+
logger6.throwArgumentError("invalid bytecode", "bytecode", bytecode);
|
|
47008
47136
|
}
|
|
47009
47137
|
if (signer && !Signer.isSigner(signer)) {
|
|
47010
|
-
|
|
47138
|
+
logger6.throwArgumentError("invalid signer", "signer", signer);
|
|
47011
47139
|
}
|
|
47012
47140
|
import_properties3.defineReadOnly(this, "bytecode", bytecodeHex);
|
|
47013
47141
|
import_properties3.defineReadOnly(this, "interface", import_properties3.getStatic(new.target, "getInterface")(contractInterface));
|
|
@@ -47027,19 +47155,19 @@ class ContractFactory {
|
|
|
47027
47155
|
if (tx[key] == null) {
|
|
47028
47156
|
return;
|
|
47029
47157
|
}
|
|
47030
|
-
|
|
47158
|
+
logger6.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
47031
47159
|
});
|
|
47032
47160
|
if (tx.value) {
|
|
47033
47161
|
const value = BigNumber.from(tx.value);
|
|
47034
47162
|
if (!value.isZero() && !this.interface.deploy.payable) {
|
|
47035
|
-
|
|
47163
|
+
logger6.throwError("non-payable constructor cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47036
47164
|
operation: "overrides.value",
|
|
47037
47165
|
value: tx.value
|
|
47038
47166
|
});
|
|
47039
47167
|
}
|
|
47040
47168
|
}
|
|
47041
|
-
|
|
47042
|
-
tx.data =
|
|
47169
|
+
logger6.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47170
|
+
tx.data = import_bytes4.hexlify(import_bytes4.concat([
|
|
47043
47171
|
this.bytecode,
|
|
47044
47172
|
this.interface.encodeDeploy(args)
|
|
47045
47173
|
]));
|
|
@@ -47051,7 +47179,7 @@ class ContractFactory {
|
|
|
47051
47179
|
if (args.length === this.interface.deploy.inputs.length + 1) {
|
|
47052
47180
|
overrides = args.pop();
|
|
47053
47181
|
}
|
|
47054
|
-
|
|
47182
|
+
logger6.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47055
47183
|
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
|
47056
47184
|
params.push(overrides);
|
|
47057
47185
|
const unsignedTx = this.getDeployTransaction(...params);
|
|
@@ -47071,7 +47199,7 @@ class ContractFactory {
|
|
|
47071
47199
|
}
|
|
47072
47200
|
static fromSolidity(compilerOutput, signer) {
|
|
47073
47201
|
if (compilerOutput == null) {
|
|
47074
|
-
|
|
47202
|
+
logger6.throwError("missing compiler output", Logger.errors.MISSING_ARGUMENT, { argument: "compilerOutput" });
|
|
47075
47203
|
}
|
|
47076
47204
|
if (typeof compilerOutput === "string") {
|
|
47077
47205
|
compilerOutput = JSON.parse(compilerOutput);
|
|
@@ -47089,7 +47217,7 @@ class ContractFactory {
|
|
|
47089
47217
|
return Contract.getInterface(contractInterface);
|
|
47090
47218
|
}
|
|
47091
47219
|
static getContractAddress(tx) {
|
|
47092
|
-
return
|
|
47220
|
+
return getContractAddress(tx);
|
|
47093
47221
|
}
|
|
47094
47222
|
static getContract(address, contractInterface, signer) {
|
|
47095
47223
|
return new Contract(address, contractInterface, signer);
|
|
@@ -47097,11 +47225,10 @@ class ContractFactory {
|
|
|
47097
47225
|
}
|
|
47098
47226
|
|
|
47099
47227
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47100
|
-
var
|
|
47101
|
-
var import_bytes4 = __toESM(require_lib2());
|
|
47228
|
+
var import_bytes5 = __toESM(require_lib2());
|
|
47102
47229
|
var import_hash = __toESM(require_lib12());
|
|
47103
47230
|
var import_hdnode = __toESM(require_lib20());
|
|
47104
|
-
var
|
|
47231
|
+
var import_keccak2562 = __toESM(require_lib5());
|
|
47105
47232
|
var import_properties4 = __toESM(require_lib4());
|
|
47106
47233
|
var import_random = __toESM(require_lib21());
|
|
47107
47234
|
var import_signing_key = __toESM(require_lib14());
|
|
@@ -47109,7 +47236,7 @@ var import_json_wallets = __toESM(require_lib22());
|
|
|
47109
47236
|
var import_transactions2 = __toESM(require_lib15());
|
|
47110
47237
|
|
|
47111
47238
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
47112
|
-
var
|
|
47239
|
+
var version9 = "wallet/5.7.0";
|
|
47113
47240
|
|
|
47114
47241
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47115
47242
|
var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
@@ -47139,9 +47266,9 @@ var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
|
47139
47266
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47140
47267
|
});
|
|
47141
47268
|
};
|
|
47142
|
-
var
|
|
47269
|
+
var logger7 = new Logger(version9);
|
|
47143
47270
|
function isAccount(value) {
|
|
47144
|
-
return value != null &&
|
|
47271
|
+
return value != null && import_bytes5.isHexString(value.privateKey, 32) && value.address != null;
|
|
47145
47272
|
}
|
|
47146
47273
|
function hasMnemonic(value) {
|
|
47147
47274
|
const mnemonic = value.mnemonic;
|
|
@@ -47155,8 +47282,8 @@ class Wallet extends Signer {
|
|
|
47155
47282
|
const signingKey = new import_signing_key.SigningKey(privateKey.privateKey);
|
|
47156
47283
|
import_properties4.defineReadOnly(this, "_signingKey", () => signingKey);
|
|
47157
47284
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47158
|
-
if (this.address !==
|
|
47159
|
-
|
|
47285
|
+
if (this.address !== getAddress(privateKey.address)) {
|
|
47286
|
+
logger7.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
47160
47287
|
}
|
|
47161
47288
|
if (hasMnemonic(privateKey)) {
|
|
47162
47289
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -47168,7 +47295,7 @@ class Wallet extends Signer {
|
|
|
47168
47295
|
const mnemonic = this.mnemonic;
|
|
47169
47296
|
const node = import_hdnode.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
47170
47297
|
if (import_transactions2.computeAddress(node.privateKey) !== this.address) {
|
|
47171
|
-
|
|
47298
|
+
logger7.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
47172
47299
|
}
|
|
47173
47300
|
} else {
|
|
47174
47301
|
import_properties4.defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -47176,7 +47303,7 @@ class Wallet extends Signer {
|
|
|
47176
47303
|
} else {
|
|
47177
47304
|
if (import_signing_key.SigningKey.isSigningKey(privateKey)) {
|
|
47178
47305
|
if (privateKey.curve !== "secp256k1") {
|
|
47179
|
-
|
|
47306
|
+
logger7.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
47180
47307
|
}
|
|
47181
47308
|
import_properties4.defineReadOnly(this, "_signingKey", () => privateKey);
|
|
47182
47309
|
} else {
|
|
@@ -47192,7 +47319,7 @@ class Wallet extends Signer {
|
|
|
47192
47319
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47193
47320
|
}
|
|
47194
47321
|
if (provider && !Provider.isProvider(provider)) {
|
|
47195
|
-
|
|
47322
|
+
logger7.throwArgumentError("invalid provider", "provider", provider);
|
|
47196
47323
|
}
|
|
47197
47324
|
import_properties4.defineReadOnly(this, "provider", provider || null);
|
|
47198
47325
|
}
|
|
@@ -47214,32 +47341,32 @@ class Wallet extends Signer {
|
|
|
47214
47341
|
signTransaction(transaction) {
|
|
47215
47342
|
return import_properties4.resolveProperties(transaction).then((tx) => {
|
|
47216
47343
|
if (tx.from != null) {
|
|
47217
|
-
if (
|
|
47218
|
-
|
|
47344
|
+
if (getAddress(tx.from) !== this.address) {
|
|
47345
|
+
logger7.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
47219
47346
|
}
|
|
47220
47347
|
delete tx.from;
|
|
47221
47348
|
}
|
|
47222
|
-
const signature = this._signingKey().signDigest(
|
|
47349
|
+
const signature = this._signingKey().signDigest(import_keccak2562.keccak256(import_transactions2.serialize(tx)));
|
|
47223
47350
|
return import_transactions2.serialize(tx, signature);
|
|
47224
47351
|
});
|
|
47225
47352
|
}
|
|
47226
47353
|
signMessage(message) {
|
|
47227
47354
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47228
|
-
return
|
|
47355
|
+
return import_bytes5.joinSignature(this._signingKey().signDigest(import_hash.hashMessage(message)));
|
|
47229
47356
|
});
|
|
47230
47357
|
}
|
|
47231
47358
|
_signTypedData(domain, types2, value) {
|
|
47232
47359
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47233
47360
|
const populated = yield import_hash._TypedDataEncoder.resolveNames(domain, types2, value, (name) => {
|
|
47234
47361
|
if (this.provider == null) {
|
|
47235
|
-
|
|
47362
|
+
logger7.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47236
47363
|
operation: "resolveName",
|
|
47237
47364
|
value: name
|
|
47238
47365
|
});
|
|
47239
47366
|
}
|
|
47240
47367
|
return this.provider.resolveName(name);
|
|
47241
47368
|
});
|
|
47242
|
-
return
|
|
47369
|
+
return import_bytes5.joinSignature(this._signingKey().signDigest(import_hash._TypedDataEncoder.hash(populated.domain, types2, populated.value)));
|
|
47243
47370
|
});
|
|
47244
47371
|
}
|
|
47245
47372
|
encrypt(password, options, progressCallback) {
|
|
@@ -47261,7 +47388,7 @@ class Wallet extends Signer {
|
|
|
47261
47388
|
options = {};
|
|
47262
47389
|
}
|
|
47263
47390
|
if (options.extraEntropy) {
|
|
47264
|
-
entropy =
|
|
47391
|
+
entropy = import_bytes5.arrayify(import_bytes5.hexDataSlice(import_keccak2562.keccak256(import_bytes5.concat([entropy, options.extraEntropy])), 0, 16));
|
|
47265
47392
|
}
|
|
47266
47393
|
const mnemonic = import_hdnode.entropyToMnemonic(entropy, options.locale);
|
|
47267
47394
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -47352,10 +47479,10 @@ __export(exports_lib2, {
|
|
|
47352
47479
|
});
|
|
47353
47480
|
|
|
47354
47481
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
47355
|
-
var
|
|
47482
|
+
var version10 = "networks/5.7.1";
|
|
47356
47483
|
|
|
47357
47484
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
47358
|
-
var
|
|
47485
|
+
var logger8 = new Logger(version10);
|
|
47359
47486
|
function isRenetworkable(value) {
|
|
47360
47487
|
return value && typeof value.renetwork === "function";
|
|
47361
47488
|
}
|
|
@@ -47550,12 +47677,12 @@ function getNetwork(network) {
|
|
|
47550
47677
|
const standard = networks[network.name];
|
|
47551
47678
|
if (!standard) {
|
|
47552
47679
|
if (typeof network.chainId !== "number") {
|
|
47553
|
-
|
|
47680
|
+
logger8.throwArgumentError("invalid network chainId", "network", network);
|
|
47554
47681
|
}
|
|
47555
47682
|
return network;
|
|
47556
47683
|
}
|
|
47557
47684
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
47558
|
-
|
|
47685
|
+
logger8.throwArgumentError("network chainId mismatch", "network", network);
|
|
47559
47686
|
}
|
|
47560
47687
|
let defaultProvider = network._defaultProvider || null;
|
|
47561
47688
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -47576,7 +47703,7 @@ function getNetwork(network) {
|
|
|
47576
47703
|
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
47577
47704
|
var import_base64 = __toESM(require_lib10());
|
|
47578
47705
|
var import_basex = __toESM(require_lib16());
|
|
47579
|
-
var
|
|
47706
|
+
var import_bytes7 = __toESM(require_lib2());
|
|
47580
47707
|
var import_hash2 = __toESM(require_lib12());
|
|
47581
47708
|
var import_properties6 = __toESM(require_lib4());
|
|
47582
47709
|
var import_sha2 = __toESM(require_lib17());
|
|
@@ -47585,14 +47712,13 @@ var import_web = __toESM(require_lib23());
|
|
|
47585
47712
|
var import_bech32 = __toESM(require_bech32());
|
|
47586
47713
|
|
|
47587
47714
|
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
47588
|
-
var
|
|
47715
|
+
var version11 = "providers/5.7.2";
|
|
47589
47716
|
|
|
47590
47717
|
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
47591
|
-
var
|
|
47592
|
-
var import_bytes5 = __toESM(require_lib2());
|
|
47718
|
+
var import_bytes6 = __toESM(require_lib2());
|
|
47593
47719
|
var import_properties5 = __toESM(require_lib4());
|
|
47594
47720
|
var import_transactions3 = __toESM(require_lib15());
|
|
47595
|
-
var
|
|
47721
|
+
var logger9 = new Logger(version11);
|
|
47596
47722
|
|
|
47597
47723
|
class Formatter {
|
|
47598
47724
|
constructor() {
|
|
@@ -47749,11 +47875,11 @@ class Formatter {
|
|
|
47749
47875
|
if (!strict && value.substring(0, 2) !== "0x") {
|
|
47750
47876
|
value = "0x" + value;
|
|
47751
47877
|
}
|
|
47752
|
-
if (
|
|
47878
|
+
if (import_bytes6.isHexString(value)) {
|
|
47753
47879
|
return value.toLowerCase();
|
|
47754
47880
|
}
|
|
47755
47881
|
}
|
|
47756
|
-
return
|
|
47882
|
+
return logger9.throwArgumentError("invalid hash", "value", value);
|
|
47757
47883
|
}
|
|
47758
47884
|
data(value, strict) {
|
|
47759
47885
|
const result = this.hex(value, strict);
|
|
@@ -47763,17 +47889,17 @@ class Formatter {
|
|
|
47763
47889
|
return result;
|
|
47764
47890
|
}
|
|
47765
47891
|
address(value) {
|
|
47766
|
-
return
|
|
47892
|
+
return getAddress(value);
|
|
47767
47893
|
}
|
|
47768
47894
|
callAddress(value) {
|
|
47769
|
-
if (!
|
|
47895
|
+
if (!import_bytes6.isHexString(value, 32)) {
|
|
47770
47896
|
return null;
|
|
47771
47897
|
}
|
|
47772
|
-
const address =
|
|
47898
|
+
const address = getAddress(import_bytes6.hexDataSlice(value, 12));
|
|
47773
47899
|
return address === AddressZero ? null : address;
|
|
47774
47900
|
}
|
|
47775
47901
|
contractAddress(value) {
|
|
47776
|
-
return
|
|
47902
|
+
return getContractAddress(value);
|
|
47777
47903
|
}
|
|
47778
47904
|
blockTag(blockTag) {
|
|
47779
47905
|
if (blockTag == null) {
|
|
@@ -47791,15 +47917,15 @@ class Formatter {
|
|
|
47791
47917
|
case "finalized":
|
|
47792
47918
|
return blockTag;
|
|
47793
47919
|
}
|
|
47794
|
-
if (typeof blockTag === "number" ||
|
|
47795
|
-
return
|
|
47920
|
+
if (typeof blockTag === "number" || import_bytes6.isHexString(blockTag)) {
|
|
47921
|
+
return import_bytes6.hexValue(blockTag);
|
|
47796
47922
|
}
|
|
47797
47923
|
throw new Error("invalid blockTag");
|
|
47798
47924
|
}
|
|
47799
47925
|
hash(value, strict) {
|
|
47800
47926
|
const result = this.hex(value, strict);
|
|
47801
|
-
if (
|
|
47802
|
-
return
|
|
47927
|
+
if (import_bytes6.hexDataLength(result) !== 32) {
|
|
47928
|
+
return logger9.throwArgumentError("invalid hash", "value", value);
|
|
47803
47929
|
}
|
|
47804
47930
|
return result;
|
|
47805
47931
|
}
|
|
@@ -47814,10 +47940,10 @@ class Formatter {
|
|
|
47814
47940
|
return null;
|
|
47815
47941
|
}
|
|
47816
47942
|
uint256(value) {
|
|
47817
|
-
if (!
|
|
47943
|
+
if (!import_bytes6.isHexString(value)) {
|
|
47818
47944
|
throw new Error("invalid uint256");
|
|
47819
47945
|
}
|
|
47820
|
-
return
|
|
47946
|
+
return import_bytes6.hexZeroPad(value, 32);
|
|
47821
47947
|
}
|
|
47822
47948
|
_block(value, format2) {
|
|
47823
47949
|
if (value.author != null && value.miner == null) {
|
|
@@ -47856,7 +47982,7 @@ class Formatter {
|
|
|
47856
47982
|
const result = Formatter.check(this.formats.transaction, transaction);
|
|
47857
47983
|
if (transaction.chainId != null) {
|
|
47858
47984
|
let chainId = transaction.chainId;
|
|
47859
|
-
if (
|
|
47985
|
+
if (import_bytes6.isHexString(chainId)) {
|
|
47860
47986
|
chainId = BigNumber.from(chainId).toNumber();
|
|
47861
47987
|
}
|
|
47862
47988
|
result.chainId = chainId;
|
|
@@ -47865,7 +47991,7 @@ class Formatter {
|
|
|
47865
47991
|
if (chainId == null && result.v == null) {
|
|
47866
47992
|
chainId = transaction.chainId;
|
|
47867
47993
|
}
|
|
47868
|
-
if (
|
|
47994
|
+
if (import_bytes6.isHexString(chainId)) {
|
|
47869
47995
|
chainId = BigNumber.from(chainId).toNumber();
|
|
47870
47996
|
}
|
|
47871
47997
|
if (typeof chainId !== "number" && result.v != null) {
|
|
@@ -47898,15 +48024,15 @@ class Formatter {
|
|
|
47898
48024
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
47899
48025
|
if (value2 === 0 || value2 === 1) {
|
|
47900
48026
|
if (result.status != null && result.status !== value2) {
|
|
47901
|
-
|
|
48027
|
+
logger9.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
47902
48028
|
}
|
|
47903
48029
|
result.status = value2;
|
|
47904
48030
|
delete result.root;
|
|
47905
48031
|
} else {
|
|
47906
|
-
|
|
48032
|
+
logger9.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
47907
48033
|
}
|
|
47908
48034
|
} else if (result.root.length !== 66) {
|
|
47909
|
-
|
|
48035
|
+
logger9.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
47910
48036
|
}
|
|
47911
48037
|
}
|
|
47912
48038
|
if (result.status != null) {
|
|
@@ -48027,14 +48153,14 @@ var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
|
48027
48153
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48028
48154
|
});
|
|
48029
48155
|
};
|
|
48030
|
-
var
|
|
48156
|
+
var logger10 = new Logger(version11);
|
|
48031
48157
|
var MAX_CCIP_REDIRECTS = 10;
|
|
48032
48158
|
function checkTopic(topic) {
|
|
48033
48159
|
if (topic == null) {
|
|
48034
48160
|
return "null";
|
|
48035
48161
|
}
|
|
48036
|
-
if (
|
|
48037
|
-
|
|
48162
|
+
if (import_bytes7.hexDataLength(topic) !== 32) {
|
|
48163
|
+
logger10.throwArgumentError("invalid topic", "topic", topic);
|
|
48038
48164
|
}
|
|
48039
48165
|
return topic.toLowerCase();
|
|
48040
48166
|
}
|
|
@@ -48074,7 +48200,7 @@ function deserializeTopics(data) {
|
|
|
48074
48200
|
function getEventTag2(eventName) {
|
|
48075
48201
|
if (typeof eventName === "string") {
|
|
48076
48202
|
eventName = eventName.toLowerCase();
|
|
48077
|
-
if (
|
|
48203
|
+
if (import_bytes7.hexDataLength(eventName) === 32) {
|
|
48078
48204
|
return "tx:" + eventName;
|
|
48079
48205
|
}
|
|
48080
48206
|
if (eventName.indexOf(":") === -1) {
|
|
@@ -48083,7 +48209,7 @@ function getEventTag2(eventName) {
|
|
|
48083
48209
|
} else if (Array.isArray(eventName)) {
|
|
48084
48210
|
return "filter:*:" + serializeTopics(eventName);
|
|
48085
48211
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
48086
|
-
|
|
48212
|
+
logger10.warn("not implemented");
|
|
48087
48213
|
throw new Error("not implemented");
|
|
48088
48214
|
} else if (eventName && typeof eventName === "object") {
|
|
48089
48215
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -48156,10 +48282,10 @@ var coinInfos = {
|
|
|
48156
48282
|
"700": { symbol: "xdai", ilk: "eth" }
|
|
48157
48283
|
};
|
|
48158
48284
|
function bytes32ify(value) {
|
|
48159
|
-
return
|
|
48285
|
+
return import_bytes7.hexZeroPad(BigNumber.from(value).toHexString(), 32);
|
|
48160
48286
|
}
|
|
48161
48287
|
function base58Encode(data) {
|
|
48162
|
-
return import_basex.Base58.encode(
|
|
48288
|
+
return import_basex.Base58.encode(import_bytes7.concat([data, import_bytes7.hexDataSlice(import_sha2.sha256(import_sha2.sha256(data)), 0, 4)]));
|
|
48163
48289
|
}
|
|
48164
48290
|
var matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
|
|
48165
48291
|
var matchers = [
|
|
@@ -48178,9 +48304,9 @@ function _parseBytes(result, start) {
|
|
|
48178
48304
|
if (result === "0x") {
|
|
48179
48305
|
return null;
|
|
48180
48306
|
}
|
|
48181
|
-
const offset = BigNumber.from(
|
|
48182
|
-
const length = BigNumber.from(
|
|
48183
|
-
return
|
|
48307
|
+
const offset = BigNumber.from(import_bytes7.hexDataSlice(result, start, start + 32)).toNumber();
|
|
48308
|
+
const length = BigNumber.from(import_bytes7.hexDataSlice(result, offset, offset + 32)).toNumber();
|
|
48309
|
+
return import_bytes7.hexDataSlice(result, offset + 32, offset + 32 + length);
|
|
48184
48310
|
}
|
|
48185
48311
|
function getIpfsLink(link) {
|
|
48186
48312
|
if (link.match(/^ipfs:\/\/ipfs\//i)) {
|
|
@@ -48188,12 +48314,12 @@ function getIpfsLink(link) {
|
|
|
48188
48314
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
48189
48315
|
link = link.substring(7);
|
|
48190
48316
|
} else {
|
|
48191
|
-
|
|
48317
|
+
logger10.throwArgumentError("unsupported IPFS format", "link", link);
|
|
48192
48318
|
}
|
|
48193
48319
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
48194
48320
|
}
|
|
48195
48321
|
function numPad(value) {
|
|
48196
|
-
const result =
|
|
48322
|
+
const result = import_bytes7.arrayify(value);
|
|
48197
48323
|
if (result.length > 32) {
|
|
48198
48324
|
throw new Error("internal; should not happen");
|
|
48199
48325
|
}
|
|
@@ -48217,13 +48343,13 @@ function encodeBytes(datas) {
|
|
|
48217
48343
|
byteCount += 32;
|
|
48218
48344
|
}
|
|
48219
48345
|
for (let i2 = 0;i2 < datas.length; i2++) {
|
|
48220
|
-
const data =
|
|
48346
|
+
const data = import_bytes7.arrayify(datas[i2]);
|
|
48221
48347
|
result[i2] = numPad(byteCount);
|
|
48222
48348
|
result.push(numPad(data.length));
|
|
48223
48349
|
result.push(bytesPad(data));
|
|
48224
48350
|
byteCount += 32 + Math.ceil(data.length / 32) * 32;
|
|
48225
48351
|
}
|
|
48226
|
-
return
|
|
48352
|
+
return import_bytes7.hexConcat(result);
|
|
48227
48353
|
}
|
|
48228
48354
|
|
|
48229
48355
|
class Resolver {
|
|
@@ -48255,17 +48381,17 @@ class Resolver {
|
|
|
48255
48381
|
const tx = {
|
|
48256
48382
|
to: this.address,
|
|
48257
48383
|
ccipReadEnabled: true,
|
|
48258
|
-
data:
|
|
48384
|
+
data: import_bytes7.hexConcat([selector, import_hash2.namehash(this.name), parameters || "0x"])
|
|
48259
48385
|
};
|
|
48260
48386
|
let parseBytes = false;
|
|
48261
48387
|
if (yield this.supportsWildcard()) {
|
|
48262
48388
|
parseBytes = true;
|
|
48263
|
-
tx.data =
|
|
48389
|
+
tx.data = import_bytes7.hexConcat(["0x9061b923", encodeBytes([import_hash2.dnsEncode(this.name), tx.data])]);
|
|
48264
48390
|
}
|
|
48265
48391
|
try {
|
|
48266
48392
|
let result = yield this.provider.call(tx);
|
|
48267
|
-
if (
|
|
48268
|
-
|
|
48393
|
+
if (import_bytes7.arrayify(result).length % 32 === 4) {
|
|
48394
|
+
logger10.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
48269
48395
|
transaction: tx,
|
|
48270
48396
|
data: result
|
|
48271
48397
|
});
|
|
@@ -48294,20 +48420,20 @@ class Resolver {
|
|
|
48294
48420
|
_getAddress(coinType, hexBytes) {
|
|
48295
48421
|
const coinInfo = coinInfos[String(coinType)];
|
|
48296
48422
|
if (coinInfo == null) {
|
|
48297
|
-
|
|
48423
|
+
logger10.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48298
48424
|
operation: `getAddress(${coinType})`
|
|
48299
48425
|
});
|
|
48300
48426
|
}
|
|
48301
48427
|
if (coinInfo.ilk === "eth") {
|
|
48302
48428
|
return this.provider.formatter.address(hexBytes);
|
|
48303
48429
|
}
|
|
48304
|
-
const bytes =
|
|
48430
|
+
const bytes = import_bytes7.arrayify(hexBytes);
|
|
48305
48431
|
if (coinInfo.p2pkh != null) {
|
|
48306
48432
|
const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);
|
|
48307
48433
|
if (p2pkh) {
|
|
48308
48434
|
const length = parseInt(p2pkh[1], 16);
|
|
48309
48435
|
if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48310
|
-
return base58Encode(
|
|
48436
|
+
return base58Encode(import_bytes7.concat([[coinInfo.p2pkh], "0x" + p2pkh[2]]));
|
|
48311
48437
|
}
|
|
48312
48438
|
}
|
|
48313
48439
|
}
|
|
@@ -48316,23 +48442,23 @@ class Resolver {
|
|
|
48316
48442
|
if (p2sh) {
|
|
48317
48443
|
const length = parseInt(p2sh[1], 16);
|
|
48318
48444
|
if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48319
|
-
return base58Encode(
|
|
48445
|
+
return base58Encode(import_bytes7.concat([[coinInfo.p2sh], "0x" + p2sh[2]]));
|
|
48320
48446
|
}
|
|
48321
48447
|
}
|
|
48322
48448
|
}
|
|
48323
48449
|
if (coinInfo.prefix != null) {
|
|
48324
48450
|
const length = bytes[1];
|
|
48325
|
-
let
|
|
48326
|
-
if (
|
|
48451
|
+
let version12 = bytes[0];
|
|
48452
|
+
if (version12 === 0) {
|
|
48327
48453
|
if (length !== 20 && length !== 32) {
|
|
48328
|
-
|
|
48454
|
+
version12 = -1;
|
|
48329
48455
|
}
|
|
48330
48456
|
} else {
|
|
48331
|
-
|
|
48457
|
+
version12 = -1;
|
|
48332
48458
|
}
|
|
48333
|
-
if (
|
|
48459
|
+
if (version12 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
48334
48460
|
const words = import_bech32.default.toWords(bytes.slice(2));
|
|
48335
|
-
words.unshift(
|
|
48461
|
+
words.unshift(version12);
|
|
48336
48462
|
return import_bech32.default.encode(coinInfo.prefix, words);
|
|
48337
48463
|
}
|
|
48338
48464
|
}
|
|
@@ -48363,7 +48489,7 @@ class Resolver {
|
|
|
48363
48489
|
}
|
|
48364
48490
|
const address = this._getAddress(coinType, hexBytes);
|
|
48365
48491
|
if (address == null) {
|
|
48366
|
-
|
|
48492
|
+
logger10.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48367
48493
|
operation: `getAddress(${coinType})`,
|
|
48368
48494
|
coinType,
|
|
48369
48495
|
data: hexBytes
|
|
@@ -48406,11 +48532,11 @@ class Resolver {
|
|
|
48406
48532
|
return null;
|
|
48407
48533
|
}
|
|
48408
48534
|
const addr = yield this.provider.formatter.address(comps[0]);
|
|
48409
|
-
const tokenId =
|
|
48535
|
+
const tokenId = import_bytes7.hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);
|
|
48410
48536
|
if (scheme === "erc721") {
|
|
48411
48537
|
const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({
|
|
48412
48538
|
to: addr,
|
|
48413
|
-
data:
|
|
48539
|
+
data: import_bytes7.hexConcat(["0x6352211e", tokenId])
|
|
48414
48540
|
}));
|
|
48415
48541
|
if (owner !== tokenOwner) {
|
|
48416
48542
|
return null;
|
|
@@ -48419,7 +48545,7 @@ class Resolver {
|
|
|
48419
48545
|
} else if (scheme === "erc1155") {
|
|
48420
48546
|
const balance = BigNumber.from(yield this.provider.call({
|
|
48421
48547
|
to: addr,
|
|
48422
|
-
data:
|
|
48548
|
+
data: import_bytes7.hexConcat(["0x00fdd58e", import_bytes7.hexZeroPad(owner, 32), tokenId])
|
|
48423
48549
|
}));
|
|
48424
48550
|
if (balance.isZero()) {
|
|
48425
48551
|
return null;
|
|
@@ -48428,7 +48554,7 @@ class Resolver {
|
|
|
48428
48554
|
}
|
|
48429
48555
|
const tx = {
|
|
48430
48556
|
to: this.provider.formatter.address(comps[0]),
|
|
48431
|
-
data:
|
|
48557
|
+
data: import_bytes7.hexConcat([selector, tokenId])
|
|
48432
48558
|
};
|
|
48433
48559
|
let metadataUrl = _parseString(yield this.provider.call(tx), 0);
|
|
48434
48560
|
if (metadataUrl == null) {
|
|
@@ -48503,7 +48629,7 @@ class Resolver {
|
|
|
48503
48629
|
return "sia://" + hash;
|
|
48504
48630
|
}
|
|
48505
48631
|
}
|
|
48506
|
-
return
|
|
48632
|
+
return logger10.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48507
48633
|
operation: "getContentHash()",
|
|
48508
48634
|
data: hexBytes
|
|
48509
48635
|
});
|
|
@@ -48512,11 +48638,11 @@ class Resolver {
|
|
|
48512
48638
|
getText(key) {
|
|
48513
48639
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48514
48640
|
let keyBytes = import_strings2.toUtf8Bytes(key);
|
|
48515
|
-
keyBytes =
|
|
48641
|
+
keyBytes = import_bytes7.concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
48516
48642
|
if (keyBytes.length % 32 !== 0) {
|
|
48517
|
-
keyBytes =
|
|
48643
|
+
keyBytes = import_bytes7.concat([keyBytes, import_bytes7.hexZeroPad("0x", 32 - key.length % 32)]);
|
|
48518
48644
|
}
|
|
48519
|
-
const hexBytes = yield this._fetchBytes("0x59d1d43c",
|
|
48645
|
+
const hexBytes = yield this._fetchBytes("0x59d1d43c", import_bytes7.hexlify(keyBytes));
|
|
48520
48646
|
if (hexBytes == null || hexBytes === "0x") {
|
|
48521
48647
|
return null;
|
|
48522
48648
|
}
|
|
@@ -48548,7 +48674,7 @@ class BaseProvider extends Provider {
|
|
|
48548
48674
|
import_properties6.defineReadOnly(this, "_network", knownNetwork);
|
|
48549
48675
|
this.emit("network", knownNetwork, null);
|
|
48550
48676
|
} else {
|
|
48551
|
-
|
|
48677
|
+
logger10.throwArgumentError("invalid network", "network", network);
|
|
48552
48678
|
}
|
|
48553
48679
|
}
|
|
48554
48680
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -48570,7 +48696,7 @@ class BaseProvider extends Provider {
|
|
|
48570
48696
|
network = yield this.detectNetwork();
|
|
48571
48697
|
}
|
|
48572
48698
|
if (!network) {
|
|
48573
|
-
|
|
48699
|
+
logger10.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
48574
48700
|
}
|
|
48575
48701
|
if (this._network == null) {
|
|
48576
48702
|
if (this.anyNetwork) {
|
|
@@ -48626,11 +48752,11 @@ class BaseProvider extends Provider {
|
|
|
48626
48752
|
}
|
|
48627
48753
|
const errorMessage = result.message || "unknown error";
|
|
48628
48754
|
if (result.status >= 400 && result.status < 500) {
|
|
48629
|
-
return
|
|
48755
|
+
return logger10.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
48630
48756
|
}
|
|
48631
48757
|
errorMessages.push(errorMessage);
|
|
48632
48758
|
}
|
|
48633
|
-
return
|
|
48759
|
+
return logger10.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
48634
48760
|
urls,
|
|
48635
48761
|
errorMessages
|
|
48636
48762
|
});
|
|
@@ -48705,8 +48831,8 @@ class BaseProvider extends Provider {
|
|
|
48705
48831
|
this._emitted.block = blockNumber - 1;
|
|
48706
48832
|
}
|
|
48707
48833
|
if (Math.abs(this._emitted.block - blockNumber) > 1000) {
|
|
48708
|
-
|
|
48709
|
-
this.emit("error",
|
|
48834
|
+
logger10.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
48835
|
+
this.emit("error", logger10.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
48710
48836
|
blockNumber,
|
|
48711
48837
|
event: "blockSkew",
|
|
48712
48838
|
previousBlockNumber: this._emitted.block
|
|
@@ -48811,7 +48937,7 @@ class BaseProvider extends Provider {
|
|
|
48811
48937
|
}
|
|
48812
48938
|
detectNetwork() {
|
|
48813
48939
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48814
|
-
return
|
|
48940
|
+
return logger10.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48815
48941
|
operation: "provider.detectNetwork"
|
|
48816
48942
|
});
|
|
48817
48943
|
});
|
|
@@ -48834,7 +48960,7 @@ class BaseProvider extends Provider {
|
|
|
48834
48960
|
yield stall(0);
|
|
48835
48961
|
return this._network;
|
|
48836
48962
|
}
|
|
48837
|
-
const error =
|
|
48963
|
+
const error = logger10.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
48838
48964
|
event: "changed",
|
|
48839
48965
|
network,
|
|
48840
48966
|
detectedNetwork: currentNetwork
|
|
@@ -49001,7 +49127,7 @@ class BaseProvider extends Provider {
|
|
|
49001
49127
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
49002
49128
|
reason = "cancelled";
|
|
49003
49129
|
}
|
|
49004
|
-
reject(
|
|
49130
|
+
reject(logger10.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
49005
49131
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
49006
49132
|
reason,
|
|
49007
49133
|
replacement: this._wrapTransaction(tx),
|
|
@@ -49038,7 +49164,7 @@ class BaseProvider extends Provider {
|
|
|
49038
49164
|
if (alreadyDone()) {
|
|
49039
49165
|
return;
|
|
49040
49166
|
}
|
|
49041
|
-
reject(
|
|
49167
|
+
reject(logger10.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
49042
49168
|
}, timeout);
|
|
49043
49169
|
if (timer.unref) {
|
|
49044
49170
|
timer.unref();
|
|
@@ -49062,7 +49188,7 @@ class BaseProvider extends Provider {
|
|
|
49062
49188
|
try {
|
|
49063
49189
|
return BigNumber.from(result);
|
|
49064
49190
|
} catch (error) {
|
|
49065
|
-
return
|
|
49191
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49066
49192
|
method: "getGasPrice",
|
|
49067
49193
|
result,
|
|
49068
49194
|
error
|
|
@@ -49081,7 +49207,7 @@ class BaseProvider extends Provider {
|
|
|
49081
49207
|
try {
|
|
49082
49208
|
return BigNumber.from(result);
|
|
49083
49209
|
} catch (error) {
|
|
49084
|
-
return
|
|
49210
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49085
49211
|
method: "getBalance",
|
|
49086
49212
|
params,
|
|
49087
49213
|
result,
|
|
@@ -49101,7 +49227,7 @@ class BaseProvider extends Provider {
|
|
|
49101
49227
|
try {
|
|
49102
49228
|
return BigNumber.from(result).toNumber();
|
|
49103
49229
|
} catch (error) {
|
|
49104
|
-
return
|
|
49230
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49105
49231
|
method: "getTransactionCount",
|
|
49106
49232
|
params,
|
|
49107
49233
|
result,
|
|
@@ -49119,9 +49245,9 @@ class BaseProvider extends Provider {
|
|
|
49119
49245
|
});
|
|
49120
49246
|
const result = yield this.perform("getCode", params);
|
|
49121
49247
|
try {
|
|
49122
|
-
return
|
|
49248
|
+
return import_bytes7.hexlify(result);
|
|
49123
49249
|
} catch (error) {
|
|
49124
|
-
return
|
|
49250
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49125
49251
|
method: "getCode",
|
|
49126
49252
|
params,
|
|
49127
49253
|
result,
|
|
@@ -49136,13 +49262,13 @@ class BaseProvider extends Provider {
|
|
|
49136
49262
|
const params = yield import_properties6.resolveProperties({
|
|
49137
49263
|
address: this._getAddress(addressOrName),
|
|
49138
49264
|
blockTag: this._getBlockTag(blockTag),
|
|
49139
|
-
position: Promise.resolve(position).then((p) =>
|
|
49265
|
+
position: Promise.resolve(position).then((p) => import_bytes7.hexValue(p))
|
|
49140
49266
|
});
|
|
49141
49267
|
const result = yield this.perform("getStorageAt", params);
|
|
49142
49268
|
try {
|
|
49143
|
-
return
|
|
49269
|
+
return import_bytes7.hexlify(result);
|
|
49144
49270
|
} catch (error) {
|
|
49145
|
-
return
|
|
49271
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49146
49272
|
method: "getStorageAt",
|
|
49147
49273
|
params,
|
|
49148
49274
|
result,
|
|
@@ -49152,12 +49278,12 @@ class BaseProvider extends Provider {
|
|
|
49152
49278
|
});
|
|
49153
49279
|
}
|
|
49154
49280
|
_wrapTransaction(tx, hash, startBlock) {
|
|
49155
|
-
if (hash != null &&
|
|
49281
|
+
if (hash != null && import_bytes7.hexDataLength(hash) !== 32) {
|
|
49156
49282
|
throw new Error("invalid response - sendTransaction");
|
|
49157
49283
|
}
|
|
49158
49284
|
const result = tx;
|
|
49159
49285
|
if (hash != null && tx.hash !== hash) {
|
|
49160
|
-
|
|
49286
|
+
logger10.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
|
49161
49287
|
}
|
|
49162
49288
|
result.wait = (confirms, timeout) => __awaiter5(this, undefined, undefined, function* () {
|
|
49163
49289
|
if (confirms == null) {
|
|
@@ -49183,7 +49309,7 @@ class BaseProvider extends Provider {
|
|
|
49183
49309
|
}
|
|
49184
49310
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
49185
49311
|
if (receipt.status === 0) {
|
|
49186
|
-
|
|
49312
|
+
logger10.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
49187
49313
|
transactionHash: tx.hash,
|
|
49188
49314
|
transaction: tx,
|
|
49189
49315
|
receipt
|
|
@@ -49196,7 +49322,7 @@ class BaseProvider extends Provider {
|
|
|
49196
49322
|
sendTransaction(signedTransaction) {
|
|
49197
49323
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49198
49324
|
yield this.getNetwork();
|
|
49199
|
-
const hexTx = yield Promise.resolve(signedTransaction).then((t) =>
|
|
49325
|
+
const hexTx = yield Promise.resolve(signedTransaction).then((t) => import_bytes7.hexlify(t));
|
|
49200
49326
|
const tx = this.formatter.transaction(signedTransaction);
|
|
49201
49327
|
if (tx.confirmations == null) {
|
|
49202
49328
|
tx.confirmations = 0;
|
|
@@ -49241,7 +49367,7 @@ class BaseProvider extends Provider {
|
|
|
49241
49367
|
if (values[key] == null) {
|
|
49242
49368
|
return;
|
|
49243
49369
|
}
|
|
49244
|
-
tx[key] = Promise.resolve(values[key]).then((v) => v ?
|
|
49370
|
+
tx[key] = Promise.resolve(values[key]).then((v) => v ? import_bytes7.hexlify(v) : null);
|
|
49245
49371
|
});
|
|
49246
49372
|
return this.formatter.transactionRequest(yield import_properties6.resolveProperties(tx));
|
|
49247
49373
|
});
|
|
@@ -49271,19 +49397,19 @@ class BaseProvider extends Provider {
|
|
|
49271
49397
|
_call(transaction, blockTag, attempt) {
|
|
49272
49398
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49273
49399
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
49274
|
-
|
|
49400
|
+
logger10.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
49275
49401
|
redirects: attempt,
|
|
49276
49402
|
transaction
|
|
49277
49403
|
});
|
|
49278
49404
|
}
|
|
49279
49405
|
const txSender = transaction.to;
|
|
49280
49406
|
const result = yield this.perform("call", { transaction, blockTag });
|
|
49281
|
-
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" &&
|
|
49407
|
+
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" && import_bytes7.hexDataLength(result) % 32 === 4) {
|
|
49282
49408
|
try {
|
|
49283
|
-
const data =
|
|
49284
|
-
const sender =
|
|
49409
|
+
const data = import_bytes7.hexDataSlice(result, 4);
|
|
49410
|
+
const sender = import_bytes7.hexDataSlice(data, 0, 32);
|
|
49285
49411
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
49286
|
-
|
|
49412
|
+
logger10.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
49287
49413
|
name: "OffchainLookup",
|
|
49288
49414
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49289
49415
|
transaction,
|
|
@@ -49291,13 +49417,13 @@ class BaseProvider extends Provider {
|
|
|
49291
49417
|
});
|
|
49292
49418
|
}
|
|
49293
49419
|
const urls = [];
|
|
49294
|
-
const urlsOffset = BigNumber.from(
|
|
49295
|
-
const urlsLength = BigNumber.from(
|
|
49296
|
-
const urlsData =
|
|
49420
|
+
const urlsOffset = BigNumber.from(import_bytes7.hexDataSlice(data, 32, 64)).toNumber();
|
|
49421
|
+
const urlsLength = BigNumber.from(import_bytes7.hexDataSlice(data, urlsOffset, urlsOffset + 32)).toNumber();
|
|
49422
|
+
const urlsData = import_bytes7.hexDataSlice(data, urlsOffset + 32);
|
|
49297
49423
|
for (let u = 0;u < urlsLength; u++) {
|
|
49298
49424
|
const url = _parseString(urlsData, u * 32);
|
|
49299
49425
|
if (url == null) {
|
|
49300
|
-
|
|
49426
|
+
logger10.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
49301
49427
|
name: "OffchainLookup",
|
|
49302
49428
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49303
49429
|
transaction,
|
|
@@ -49307,19 +49433,19 @@ class BaseProvider extends Provider {
|
|
|
49307
49433
|
urls.push(url);
|
|
49308
49434
|
}
|
|
49309
49435
|
const calldata = _parseBytes(data, 64);
|
|
49310
|
-
if (!BigNumber.from(
|
|
49311
|
-
|
|
49436
|
+
if (!BigNumber.from(import_bytes7.hexDataSlice(data, 100, 128)).isZero()) {
|
|
49437
|
+
logger10.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
49312
49438
|
name: "OffchainLookup",
|
|
49313
49439
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49314
49440
|
transaction,
|
|
49315
49441
|
data: result
|
|
49316
49442
|
});
|
|
49317
49443
|
}
|
|
49318
|
-
const callbackSelector =
|
|
49444
|
+
const callbackSelector = import_bytes7.hexDataSlice(data, 96, 100);
|
|
49319
49445
|
const extraData = _parseBytes(data, 128);
|
|
49320
49446
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
49321
49447
|
if (ccipResult == null) {
|
|
49322
|
-
|
|
49448
|
+
logger10.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
49323
49449
|
name: "OffchainLookup",
|
|
49324
49450
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49325
49451
|
transaction,
|
|
@@ -49328,7 +49454,7 @@ class BaseProvider extends Provider {
|
|
|
49328
49454
|
}
|
|
49329
49455
|
const tx = {
|
|
49330
49456
|
to: txSender,
|
|
49331
|
-
data:
|
|
49457
|
+
data: import_bytes7.hexConcat([callbackSelector, encodeBytes([ccipResult, extraData])])
|
|
49332
49458
|
};
|
|
49333
49459
|
return this._call(tx, blockTag, attempt + 1);
|
|
49334
49460
|
} catch (error) {
|
|
@@ -49338,9 +49464,9 @@ class BaseProvider extends Provider {
|
|
|
49338
49464
|
}
|
|
49339
49465
|
}
|
|
49340
49466
|
try {
|
|
49341
|
-
return
|
|
49467
|
+
return import_bytes7.hexlify(result);
|
|
49342
49468
|
} catch (error) {
|
|
49343
|
-
return
|
|
49469
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49344
49470
|
method: "call",
|
|
49345
49471
|
params: { transaction, blockTag },
|
|
49346
49472
|
result,
|
|
@@ -49370,7 +49496,7 @@ class BaseProvider extends Provider {
|
|
|
49370
49496
|
try {
|
|
49371
49497
|
return BigNumber.from(result);
|
|
49372
49498
|
} catch (error) {
|
|
49373
|
-
return
|
|
49499
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49374
49500
|
method: "estimateGas",
|
|
49375
49501
|
params,
|
|
49376
49502
|
result,
|
|
@@ -49383,11 +49509,11 @@ class BaseProvider extends Provider {
|
|
|
49383
49509
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49384
49510
|
addressOrName = yield addressOrName;
|
|
49385
49511
|
if (typeof addressOrName !== "string") {
|
|
49386
|
-
|
|
49512
|
+
logger10.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
49387
49513
|
}
|
|
49388
49514
|
const address = yield this.resolveName(addressOrName);
|
|
49389
49515
|
if (address == null) {
|
|
49390
|
-
|
|
49516
|
+
logger10.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49391
49517
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
49392
49518
|
});
|
|
49393
49519
|
}
|
|
@@ -49402,16 +49528,16 @@ class BaseProvider extends Provider {
|
|
|
49402
49528
|
const params = {
|
|
49403
49529
|
includeTransactions: !!includeTransactions
|
|
49404
49530
|
};
|
|
49405
|
-
if (
|
|
49531
|
+
if (import_bytes7.isHexString(blockHashOrBlockTag, 32)) {
|
|
49406
49532
|
params.blockHash = blockHashOrBlockTag;
|
|
49407
49533
|
} else {
|
|
49408
49534
|
try {
|
|
49409
49535
|
params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);
|
|
49410
|
-
if (
|
|
49536
|
+
if (import_bytes7.isHexString(params.blockTag)) {
|
|
49411
49537
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
49412
49538
|
}
|
|
49413
49539
|
} catch (error) {
|
|
49414
|
-
|
|
49540
|
+
logger10.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
49415
49541
|
}
|
|
49416
49542
|
}
|
|
49417
49543
|
return import_web.poll(() => __awaiter5(this, undefined, undefined, function* () {
|
|
@@ -49543,7 +49669,7 @@ class BaseProvider extends Provider {
|
|
|
49543
49669
|
blockTag = yield blockTag;
|
|
49544
49670
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
49545
49671
|
if (blockTag % 1) {
|
|
49546
|
-
|
|
49672
|
+
logger10.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
49547
49673
|
}
|
|
49548
49674
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
49549
49675
|
blockNumber += blockTag;
|
|
@@ -49584,7 +49710,7 @@ class BaseProvider extends Provider {
|
|
|
49584
49710
|
}
|
|
49585
49711
|
const network = yield this.getNetwork();
|
|
49586
49712
|
if (!network.ensAddress) {
|
|
49587
|
-
|
|
49713
|
+
logger10.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
49588
49714
|
}
|
|
49589
49715
|
try {
|
|
49590
49716
|
const addrData = yield this.call({
|
|
@@ -49602,12 +49728,12 @@ class BaseProvider extends Provider {
|
|
|
49602
49728
|
try {
|
|
49603
49729
|
return Promise.resolve(this.formatter.address(name));
|
|
49604
49730
|
} catch (error) {
|
|
49605
|
-
if (
|
|
49731
|
+
if (import_bytes7.isHexString(name)) {
|
|
49606
49732
|
throw error;
|
|
49607
49733
|
}
|
|
49608
49734
|
}
|
|
49609
49735
|
if (typeof name !== "string") {
|
|
49610
|
-
|
|
49736
|
+
logger10.throwArgumentError("invalid ENS name", "name", name);
|
|
49611
49737
|
}
|
|
49612
49738
|
const resolver = yield this.getResolver(name);
|
|
49613
49739
|
if (!resolver) {
|
|
@@ -49639,7 +49765,7 @@ class BaseProvider extends Provider {
|
|
|
49639
49765
|
getAvatar(nameOrAddress) {
|
|
49640
49766
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49641
49767
|
let resolver = null;
|
|
49642
|
-
if (
|
|
49768
|
+
if (import_bytes7.isHexString(nameOrAddress)) {
|
|
49643
49769
|
const address = this.formatter.address(nameOrAddress);
|
|
49644
49770
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
49645
49771
|
const resolverAddress = yield this._getResolver(node, "getAvatar");
|
|
@@ -49683,7 +49809,7 @@ class BaseProvider extends Provider {
|
|
|
49683
49809
|
});
|
|
49684
49810
|
}
|
|
49685
49811
|
perform(method, params) {
|
|
49686
|
-
return
|
|
49812
|
+
return logger10.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
49687
49813
|
}
|
|
49688
49814
|
_startEvent(event) {
|
|
49689
49815
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -49794,7 +49920,7 @@ var import_properties10 = __toESM(require_lib4());
|
|
|
49794
49920
|
var import_properties8 = __toESM(require_lib4());
|
|
49795
49921
|
|
|
49796
49922
|
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
49797
|
-
var
|
|
49923
|
+
var import_bytes8 = __toESM(require_lib2());
|
|
49798
49924
|
var import_hash3 = __toESM(require_lib12());
|
|
49799
49925
|
var import_properties7 = __toESM(require_lib4());
|
|
49800
49926
|
var import_strings3 = __toESM(require_lib9());
|
|
@@ -49827,14 +49953,14 @@ var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
|
49827
49953
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49828
49954
|
});
|
|
49829
49955
|
};
|
|
49830
|
-
var
|
|
49956
|
+
var logger11 = new Logger(version11);
|
|
49831
49957
|
var errorGas = ["call", "estimateGas"];
|
|
49832
49958
|
function spelunk(value, requireData) {
|
|
49833
49959
|
if (value == null) {
|
|
49834
49960
|
return null;
|
|
49835
49961
|
}
|
|
49836
49962
|
if (typeof value.message === "string" && value.message.match("reverted")) {
|
|
49837
|
-
const data =
|
|
49963
|
+
const data = import_bytes8.isHexString(value.data) ? value.data : null;
|
|
49838
49964
|
if (!requireData || data) {
|
|
49839
49965
|
return { message: value.message, data };
|
|
49840
49966
|
}
|
|
@@ -49862,7 +49988,7 @@ function checkError(method, error, params) {
|
|
|
49862
49988
|
if (result) {
|
|
49863
49989
|
return result.data;
|
|
49864
49990
|
}
|
|
49865
|
-
|
|
49991
|
+
logger11.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
49866
49992
|
data: "0x",
|
|
49867
49993
|
transaction,
|
|
49868
49994
|
error
|
|
@@ -49874,7 +50000,7 @@ function checkError(method, error, params) {
|
|
|
49874
50000
|
result = spelunk(error, false);
|
|
49875
50001
|
}
|
|
49876
50002
|
if (result) {
|
|
49877
|
-
|
|
50003
|
+
logger11.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
49878
50004
|
reason: result.message,
|
|
49879
50005
|
method,
|
|
49880
50006
|
transaction,
|
|
@@ -49892,35 +50018,35 @@ function checkError(method, error, params) {
|
|
|
49892
50018
|
}
|
|
49893
50019
|
message = (message || "").toLowerCase();
|
|
49894
50020
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
49895
|
-
|
|
50021
|
+
logger11.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
49896
50022
|
error,
|
|
49897
50023
|
method,
|
|
49898
50024
|
transaction
|
|
49899
50025
|
});
|
|
49900
50026
|
}
|
|
49901
50027
|
if (message.match(/nonce (is )?too low/i)) {
|
|
49902
|
-
|
|
50028
|
+
logger11.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
49903
50029
|
error,
|
|
49904
50030
|
method,
|
|
49905
50031
|
transaction
|
|
49906
50032
|
});
|
|
49907
50033
|
}
|
|
49908
50034
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
49909
|
-
|
|
50035
|
+
logger11.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
49910
50036
|
error,
|
|
49911
50037
|
method,
|
|
49912
50038
|
transaction
|
|
49913
50039
|
});
|
|
49914
50040
|
}
|
|
49915
50041
|
if (message.match(/only replay-protected/i)) {
|
|
49916
|
-
|
|
50042
|
+
logger11.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49917
50043
|
error,
|
|
49918
50044
|
method,
|
|
49919
50045
|
transaction
|
|
49920
50046
|
});
|
|
49921
50047
|
}
|
|
49922
50048
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
49923
|
-
|
|
50049
|
+
logger11.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
49924
50050
|
error,
|
|
49925
50051
|
method,
|
|
49926
50052
|
transaction
|
|
@@ -49967,11 +50093,11 @@ class JsonRpcSigner extends Signer {
|
|
|
49967
50093
|
import_properties7.defineReadOnly(this, "_index", addressOrIndex);
|
|
49968
50094
|
import_properties7.defineReadOnly(this, "_address", null);
|
|
49969
50095
|
} else {
|
|
49970
|
-
|
|
50096
|
+
logger11.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
49971
50097
|
}
|
|
49972
50098
|
}
|
|
49973
50099
|
connect(provider) {
|
|
49974
|
-
return
|
|
50100
|
+
return logger11.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49975
50101
|
operation: "connect"
|
|
49976
50102
|
});
|
|
49977
50103
|
}
|
|
@@ -49984,7 +50110,7 @@ class JsonRpcSigner extends Signer {
|
|
|
49984
50110
|
}
|
|
49985
50111
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
49986
50112
|
if (accounts.length <= this._index) {
|
|
49987
|
-
|
|
50113
|
+
logger11.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49988
50114
|
operation: "getAddress"
|
|
49989
50115
|
});
|
|
49990
50116
|
}
|
|
@@ -50011,7 +50137,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50011
50137
|
}
|
|
50012
50138
|
const address = yield this.provider.resolveName(to);
|
|
50013
50139
|
if (address == null) {
|
|
50014
|
-
|
|
50140
|
+
logger11.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
50015
50141
|
}
|
|
50016
50142
|
return address;
|
|
50017
50143
|
}));
|
|
@@ -50022,7 +50148,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50022
50148
|
}).then(({ tx, sender }) => {
|
|
50023
50149
|
if (tx.from != null) {
|
|
50024
50150
|
if (tx.from.toLowerCase() !== sender) {
|
|
50025
|
-
|
|
50151
|
+
logger11.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
50026
50152
|
}
|
|
50027
50153
|
} else {
|
|
50028
50154
|
tx.from = sender;
|
|
@@ -50032,7 +50158,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50032
50158
|
return hash;
|
|
50033
50159
|
}, (error) => {
|
|
50034
50160
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50035
|
-
|
|
50161
|
+
logger11.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
50036
50162
|
action: "sendTransaction",
|
|
50037
50163
|
transaction: tx
|
|
50038
50164
|
});
|
|
@@ -50042,7 +50168,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50042
50168
|
});
|
|
50043
50169
|
}
|
|
50044
50170
|
signTransaction(transaction) {
|
|
50045
|
-
return
|
|
50171
|
+
return logger11.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50046
50172
|
operation: "signTransaction"
|
|
50047
50173
|
});
|
|
50048
50174
|
}
|
|
@@ -50069,10 +50195,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50069
50195
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50070
50196
|
const address = yield this.getAddress();
|
|
50071
50197
|
try {
|
|
50072
|
-
return yield this.provider.send("personal_sign", [
|
|
50198
|
+
return yield this.provider.send("personal_sign", [import_bytes8.hexlify(data), address.toLowerCase()]);
|
|
50073
50199
|
} catch (error) {
|
|
50074
50200
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50075
|
-
|
|
50201
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50076
50202
|
action: "signMessage",
|
|
50077
50203
|
from: address,
|
|
50078
50204
|
messageData: message
|
|
@@ -50087,10 +50213,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50087
50213
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50088
50214
|
const address = yield this.getAddress();
|
|
50089
50215
|
try {
|
|
50090
|
-
return yield this.provider.send("eth_sign", [address.toLowerCase(),
|
|
50216
|
+
return yield this.provider.send("eth_sign", [address.toLowerCase(), import_bytes8.hexlify(data)]);
|
|
50091
50217
|
} catch (error) {
|
|
50092
50218
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50093
|
-
|
|
50219
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50094
50220
|
action: "_legacySignMessage",
|
|
50095
50221
|
from: address,
|
|
50096
50222
|
messageData: message
|
|
@@ -50113,7 +50239,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50113
50239
|
]);
|
|
50114
50240
|
} catch (error) {
|
|
50115
50241
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50116
|
-
|
|
50242
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50117
50243
|
action: "_signTypedData",
|
|
50118
50244
|
from: address,
|
|
50119
50245
|
messageData: { domain: populated.domain, types: types2, value: populated.value }
|
|
@@ -50227,14 +50353,14 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50227
50353
|
try {
|
|
50228
50354
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
50229
50355
|
} catch (error) {
|
|
50230
|
-
return
|
|
50356
|
+
return logger11.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50231
50357
|
chainId,
|
|
50232
50358
|
event: "invalidNetwork",
|
|
50233
50359
|
serverError: error
|
|
50234
50360
|
});
|
|
50235
50361
|
}
|
|
50236
50362
|
}
|
|
50237
|
-
return
|
|
50363
|
+
return logger11.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50238
50364
|
event: "noNetwork"
|
|
50239
50365
|
});
|
|
50240
50366
|
});
|
|
@@ -50304,7 +50430,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50304
50430
|
case "getCode":
|
|
50305
50431
|
return ["eth_getCode", [getLowerCase(params.address), params.blockTag]];
|
|
50306
50432
|
case "getStorageAt":
|
|
50307
|
-
return ["eth_getStorageAt", [getLowerCase(params.address),
|
|
50433
|
+
return ["eth_getStorageAt", [getLowerCase(params.address), import_bytes8.hexZeroPad(params.position, 32), params.blockTag]];
|
|
50308
50434
|
case "sendTransaction":
|
|
50309
50435
|
return ["eth_sendRawTransaction", [params.signedTransaction]];
|
|
50310
50436
|
case "getBlock":
|
|
@@ -50353,7 +50479,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50353
50479
|
}
|
|
50354
50480
|
const args = this.prepareRequest(method, params);
|
|
50355
50481
|
if (args == null) {
|
|
50356
|
-
|
|
50482
|
+
logger11.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
50357
50483
|
}
|
|
50358
50484
|
try {
|
|
50359
50485
|
return yield this.send(args[0], args[1]);
|
|
@@ -50430,7 +50556,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50430
50556
|
if (transaction[key] == null) {
|
|
50431
50557
|
return;
|
|
50432
50558
|
}
|
|
50433
|
-
const value =
|
|
50559
|
+
const value = import_bytes8.hexValue(BigNumber.from(transaction[key]));
|
|
50434
50560
|
if (key === "gasLimit") {
|
|
50435
50561
|
key = "gas";
|
|
50436
50562
|
}
|
|
@@ -50440,7 +50566,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50440
50566
|
if (transaction[key] == null) {
|
|
50441
50567
|
return;
|
|
50442
50568
|
}
|
|
50443
|
-
result[key] =
|
|
50569
|
+
result[key] = import_bytes8.hexlify(transaction[key]);
|
|
50444
50570
|
});
|
|
50445
50571
|
if (transaction.accessList) {
|
|
50446
50572
|
result["accessList"] = import_transactions4.accessListify(transaction.accessList);
|
|
@@ -50457,9 +50583,9 @@ try {
|
|
|
50457
50583
|
throw new Error("inject please");
|
|
50458
50584
|
}
|
|
50459
50585
|
} catch (error) {
|
|
50460
|
-
const
|
|
50586
|
+
const logger12 = new Logger(version11);
|
|
50461
50587
|
WS = function() {
|
|
50462
|
-
|
|
50588
|
+
logger12.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50463
50589
|
operation: "new WebSocket()"
|
|
50464
50590
|
});
|
|
50465
50591
|
};
|
|
@@ -50493,13 +50619,13 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
50493
50619
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50494
50620
|
});
|
|
50495
50621
|
};
|
|
50496
|
-
var
|
|
50622
|
+
var logger12 = new Logger(version11);
|
|
50497
50623
|
var NextId = 1;
|
|
50498
50624
|
|
|
50499
50625
|
class WebSocketProvider extends JsonRpcProvider {
|
|
50500
50626
|
constructor(url, network) {
|
|
50501
50627
|
if (network === "any") {
|
|
50502
|
-
|
|
50628
|
+
logger12.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50503
50629
|
operation: "network:any"
|
|
50504
50630
|
});
|
|
50505
50631
|
}
|
|
@@ -50583,12 +50709,12 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50583
50709
|
return 0;
|
|
50584
50710
|
}
|
|
50585
50711
|
resetEventsBlock(blockNumber) {
|
|
50586
|
-
|
|
50712
|
+
logger12.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50587
50713
|
operation: "resetEventBlock"
|
|
50588
50714
|
});
|
|
50589
50715
|
}
|
|
50590
50716
|
set pollingInterval(value) {
|
|
50591
|
-
|
|
50717
|
+
logger12.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50592
50718
|
operation: "setPollingInterval"
|
|
50593
50719
|
});
|
|
50594
50720
|
}
|
|
@@ -50601,7 +50727,7 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50601
50727
|
if (!value) {
|
|
50602
50728
|
return;
|
|
50603
50729
|
}
|
|
50604
|
-
|
|
50730
|
+
logger12.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50605
50731
|
operation: "setPolling"
|
|
50606
50732
|
});
|
|
50607
50733
|
}
|
|
@@ -50765,7 +50891,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
50765
50891
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50766
50892
|
});
|
|
50767
50893
|
};
|
|
50768
|
-
var
|
|
50894
|
+
var logger13 = new Logger(version11);
|
|
50769
50895
|
|
|
50770
50896
|
class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
50771
50897
|
detectNetwork() {
|
|
@@ -50777,7 +50903,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50777
50903
|
if (network == null) {
|
|
50778
50904
|
network = yield _super.detectNetwork.call(this);
|
|
50779
50905
|
if (!network) {
|
|
50780
|
-
|
|
50906
|
+
logger13.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
50781
50907
|
}
|
|
50782
50908
|
if (this._network == null) {
|
|
50783
50909
|
import_properties9.defineReadOnly(this, "_network", network);
|
|
@@ -50791,7 +50917,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50791
50917
|
|
|
50792
50918
|
class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
50793
50919
|
constructor(network, apiKey) {
|
|
50794
|
-
|
|
50920
|
+
logger13.checkAbstract(new.target, UrlJsonRpcProvider);
|
|
50795
50921
|
network = import_properties9.getStatic(new.target, "getNetwork")(network);
|
|
50796
50922
|
apiKey = import_properties9.getStatic(new.target, "getApiKey")(apiKey);
|
|
50797
50923
|
const connection = import_properties9.getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -50805,13 +50931,13 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50805
50931
|
}
|
|
50806
50932
|
}
|
|
50807
50933
|
_startPending() {
|
|
50808
|
-
|
|
50934
|
+
logger13.warn("WARNING: API provider does not support pending filters");
|
|
50809
50935
|
}
|
|
50810
50936
|
isCommunityResource() {
|
|
50811
50937
|
return false;
|
|
50812
50938
|
}
|
|
50813
50939
|
getSigner(address) {
|
|
50814
|
-
return
|
|
50940
|
+
return logger13.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
50815
50941
|
}
|
|
50816
50942
|
listAccounts() {
|
|
50817
50943
|
return Promise.resolve([]);
|
|
@@ -50820,14 +50946,14 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50820
50946
|
return apiKey;
|
|
50821
50947
|
}
|
|
50822
50948
|
static getUrl(network, apiKey) {
|
|
50823
|
-
return
|
|
50949
|
+
return logger13.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
50824
50950
|
operation: "getUrl"
|
|
50825
50951
|
});
|
|
50826
50952
|
}
|
|
50827
50953
|
}
|
|
50828
50954
|
|
|
50829
50955
|
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
50830
|
-
var
|
|
50956
|
+
var logger14 = new Logger(version11);
|
|
50831
50957
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
50832
50958
|
|
|
50833
50959
|
class AlchemyWebSocketProvider extends WebSocketProvider {
|
|
@@ -50851,7 +50977,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50851
50977
|
return defaultApiKey;
|
|
50852
50978
|
}
|
|
50853
50979
|
if (apiKey && typeof apiKey !== "string") {
|
|
50854
|
-
|
|
50980
|
+
logger14.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
50855
50981
|
}
|
|
50856
50982
|
return apiKey;
|
|
50857
50983
|
}
|
|
@@ -50883,7 +51009,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50883
51009
|
host = "opt-goerli.g.alchemy.com/v2/";
|
|
50884
51010
|
break;
|
|
50885
51011
|
default:
|
|
50886
|
-
|
|
51012
|
+
logger14.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
50887
51013
|
}
|
|
50888
51014
|
return {
|
|
50889
51015
|
allowGzip: true,
|
|
@@ -50902,7 +51028,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50902
51028
|
}
|
|
50903
51029
|
|
|
50904
51030
|
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
50905
|
-
var
|
|
51031
|
+
var logger15 = new Logger(version11);
|
|
50906
51032
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
50907
51033
|
function getHost(name) {
|
|
50908
51034
|
switch (name) {
|
|
@@ -50919,7 +51045,7 @@ function getHost(name) {
|
|
|
50919
51045
|
case "arbitrum":
|
|
50920
51046
|
return "rpc.ankr.com/arbitrum/";
|
|
50921
51047
|
}
|
|
50922
|
-
return
|
|
51048
|
+
return logger15.throwArgumentError("unsupported network", "name", name);
|
|
50923
51049
|
}
|
|
50924
51050
|
|
|
50925
51051
|
class AnkrProvider extends UrlJsonRpcProvider {
|
|
@@ -50982,12 +51108,12 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
50982
51108
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50983
51109
|
});
|
|
50984
51110
|
};
|
|
50985
|
-
var
|
|
51111
|
+
var logger16 = new Logger(version11);
|
|
50986
51112
|
|
|
50987
51113
|
class CloudflareProvider extends UrlJsonRpcProvider {
|
|
50988
51114
|
static getApiKey(apiKey) {
|
|
50989
51115
|
if (apiKey != null) {
|
|
50990
|
-
|
|
51116
|
+
logger16.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
50991
51117
|
}
|
|
50992
51118
|
return null;
|
|
50993
51119
|
}
|
|
@@ -50998,7 +51124,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
50998
51124
|
host = "https://cloudflare-eth.com/";
|
|
50999
51125
|
break;
|
|
51000
51126
|
default:
|
|
51001
|
-
|
|
51127
|
+
logger16.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
51002
51128
|
}
|
|
51003
51129
|
return host;
|
|
51004
51130
|
}
|
|
@@ -51017,7 +51143,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
51017
51143
|
}
|
|
51018
51144
|
|
|
51019
51145
|
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
51020
|
-
var
|
|
51146
|
+
var import_bytes9 = __toESM(require_lib2());
|
|
51021
51147
|
var import_properties11 = __toESM(require_lib4());
|
|
51022
51148
|
var import_transactions5 = __toESM(require_lib15());
|
|
51023
51149
|
var import_web3 = __toESM(require_lib23());
|
|
@@ -51048,7 +51174,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
51048
51174
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51049
51175
|
});
|
|
51050
51176
|
};
|
|
51051
|
-
var
|
|
51177
|
+
var logger17 = new Logger(version11);
|
|
51052
51178
|
function getTransactionPostData(transaction) {
|
|
51053
51179
|
const result = {};
|
|
51054
51180
|
for (let key in transaction) {
|
|
@@ -51060,13 +51186,13 @@ function getTransactionPostData(transaction) {
|
|
|
51060
51186
|
continue;
|
|
51061
51187
|
}
|
|
51062
51188
|
if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {
|
|
51063
|
-
value =
|
|
51189
|
+
value = import_bytes9.hexValue(import_bytes9.hexlify(value));
|
|
51064
51190
|
} else if (key === "accessList") {
|
|
51065
51191
|
value = "[" + import_transactions5.accessListify(value).map((set) => {
|
|
51066
51192
|
return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`;
|
|
51067
51193
|
}).join(",") + "]";
|
|
51068
51194
|
} else {
|
|
51069
|
-
value =
|
|
51195
|
+
value = import_bytes9.hexlify(value);
|
|
51070
51196
|
}
|
|
51071
51197
|
result[key] = value;
|
|
51072
51198
|
}
|
|
@@ -51127,10 +51253,10 @@ function checkError2(method, error, transaction) {
|
|
|
51127
51253
|
if (data) {
|
|
51128
51254
|
data = "0x" + data.replace(/^.*0x/i, "");
|
|
51129
51255
|
}
|
|
51130
|
-
if (
|
|
51256
|
+
if (import_bytes9.isHexString(data)) {
|
|
51131
51257
|
return data;
|
|
51132
51258
|
}
|
|
51133
|
-
|
|
51259
|
+
logger17.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
51134
51260
|
error,
|
|
51135
51261
|
data: "0x"
|
|
51136
51262
|
});
|
|
@@ -51148,28 +51274,28 @@ function checkError2(method, error, transaction) {
|
|
|
51148
51274
|
}
|
|
51149
51275
|
message = (message || "").toLowerCase();
|
|
51150
51276
|
if (message.match(/insufficient funds/)) {
|
|
51151
|
-
|
|
51277
|
+
logger17.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
51152
51278
|
error,
|
|
51153
51279
|
method,
|
|
51154
51280
|
transaction
|
|
51155
51281
|
});
|
|
51156
51282
|
}
|
|
51157
51283
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
51158
|
-
|
|
51284
|
+
logger17.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
51159
51285
|
error,
|
|
51160
51286
|
method,
|
|
51161
51287
|
transaction
|
|
51162
51288
|
});
|
|
51163
51289
|
}
|
|
51164
51290
|
if (message.match(/another transaction with same nonce/)) {
|
|
51165
|
-
|
|
51291
|
+
logger17.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
51166
51292
|
error,
|
|
51167
51293
|
method,
|
|
51168
51294
|
transaction
|
|
51169
51295
|
});
|
|
51170
51296
|
}
|
|
51171
51297
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
51172
|
-
|
|
51298
|
+
logger17.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
51173
51299
|
error,
|
|
51174
51300
|
method,
|
|
51175
51301
|
transaction
|
|
@@ -51206,7 +51332,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51206
51332
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
51207
51333
|
default:
|
|
51208
51334
|
}
|
|
51209
|
-
return
|
|
51335
|
+
return logger17.throwArgumentError("unsupported network", "network", this.network.name);
|
|
51210
51336
|
}
|
|
51211
51337
|
getUrl(module2, params) {
|
|
51212
51338
|
const query = Object.keys(params).reduce((accum, key) => {
|
|
@@ -51366,12 +51492,12 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51366
51492
|
}
|
|
51367
51493
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
51368
51494
|
if (params.filter.topics.length > 1) {
|
|
51369
|
-
|
|
51495
|
+
logger17.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
51370
51496
|
}
|
|
51371
51497
|
if (params.filter.topics.length === 1) {
|
|
51372
51498
|
const topic0 = params.filter.topics[0];
|
|
51373
51499
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
51374
|
-
|
|
51500
|
+
logger17.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
51375
51501
|
}
|
|
51376
51502
|
args.topic0 = topic0;
|
|
51377
51503
|
}
|
|
@@ -51437,7 +51563,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51437
51563
|
}
|
|
51438
51564
|
|
|
51439
51565
|
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
51440
|
-
var
|
|
51566
|
+
var import_bytes10 = __toESM(require_lib2());
|
|
51441
51567
|
var import_properties12 = __toESM(require_lib4());
|
|
51442
51568
|
var import_random2 = __toESM(require_lib21());
|
|
51443
51569
|
var import_web4 = __toESM(require_lib23());
|
|
@@ -51468,7 +51594,7 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
51468
51594
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51469
51595
|
});
|
|
51470
51596
|
};
|
|
51471
|
-
var
|
|
51597
|
+
var logger18 = new Logger(version11);
|
|
51472
51598
|
function now() {
|
|
51473
51599
|
return new Date().getTime();
|
|
51474
51600
|
}
|
|
@@ -51481,7 +51607,7 @@ function checkNetworks(networks2) {
|
|
|
51481
51607
|
}
|
|
51482
51608
|
if (result) {
|
|
51483
51609
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
51484
|
-
|
|
51610
|
+
logger18.throwArgumentError("provider mismatch", "networks", networks2);
|
|
51485
51611
|
}
|
|
51486
51612
|
} else {
|
|
51487
51613
|
result = network;
|
|
@@ -51717,23 +51843,23 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51717
51843
|
case "getBalance":
|
|
51718
51844
|
case "getTransactionCount":
|
|
51719
51845
|
case "getCode":
|
|
51720
|
-
if (params.blockTag &&
|
|
51846
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51721
51847
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51722
51848
|
}
|
|
51723
51849
|
return provider[method](params.address, params.blockTag || "latest");
|
|
51724
51850
|
case "getStorageAt":
|
|
51725
|
-
if (params.blockTag &&
|
|
51851
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51726
51852
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51727
51853
|
}
|
|
51728
51854
|
return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");
|
|
51729
51855
|
case "getBlock":
|
|
51730
|
-
if (params.blockTag &&
|
|
51856
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51731
51857
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51732
51858
|
}
|
|
51733
51859
|
return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);
|
|
51734
51860
|
case "call":
|
|
51735
51861
|
case "estimateGas":
|
|
51736
|
-
if (params.blockTag &&
|
|
51862
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51737
51863
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51738
51864
|
}
|
|
51739
51865
|
if (method === "call" && params.blockTag) {
|
|
@@ -51745,13 +51871,13 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51745
51871
|
return provider[method](params.transactionHash);
|
|
51746
51872
|
case "getLogs": {
|
|
51747
51873
|
let filter = params.filter;
|
|
51748
|
-
if (filter.fromBlock &&
|
|
51874
|
+
if (filter.fromBlock && import_bytes10.isHexString(filter.fromBlock) || filter.toBlock && import_bytes10.isHexString(filter.toBlock)) {
|
|
51749
51875
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51750
51876
|
}
|
|
51751
51877
|
return provider.getLogs(filter);
|
|
51752
51878
|
}
|
|
51753
51879
|
}
|
|
51754
|
-
return
|
|
51880
|
+
return logger18.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
51755
51881
|
method,
|
|
51756
51882
|
params
|
|
51757
51883
|
});
|
|
@@ -51761,7 +51887,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51761
51887
|
class FallbackProvider extends BaseProvider {
|
|
51762
51888
|
constructor(providers, quorum) {
|
|
51763
51889
|
if (providers.length === 0) {
|
|
51764
|
-
|
|
51890
|
+
logger18.throwArgumentError("missing providers", "providers", providers);
|
|
51765
51891
|
}
|
|
51766
51892
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
51767
51893
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -51781,7 +51907,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51781
51907
|
}
|
|
51782
51908
|
const weight = config.weight;
|
|
51783
51909
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
51784
|
-
|
|
51910
|
+
logger18.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
51785
51911
|
}
|
|
51786
51912
|
return Object.freeze(config);
|
|
51787
51913
|
});
|
|
@@ -51789,7 +51915,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51789
51915
|
if (quorum == null) {
|
|
51790
51916
|
quorum = total / 2;
|
|
51791
51917
|
} else if (quorum > total) {
|
|
51792
|
-
|
|
51918
|
+
logger18.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
51793
51919
|
}
|
|
51794
51920
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
51795
51921
|
if (networkOrReady == null) {
|
|
@@ -51946,7 +52072,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51946
52072
|
}
|
|
51947
52073
|
props[name] = e[name];
|
|
51948
52074
|
});
|
|
51949
|
-
|
|
52075
|
+
logger18.throwError(e.reason || e.message, errorCode, props);
|
|
51950
52076
|
});
|
|
51951
52077
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
51952
52078
|
break;
|
|
@@ -51958,7 +52084,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51958
52084
|
}
|
|
51959
52085
|
c.cancelled = true;
|
|
51960
52086
|
});
|
|
51961
|
-
return
|
|
52087
|
+
return logger18.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
51962
52088
|
method,
|
|
51963
52089
|
params,
|
|
51964
52090
|
results: configs.map((c) => exposeDebugConfig(c)),
|
|
@@ -51973,7 +52099,7 @@ var IpcProvider = null;
|
|
|
51973
52099
|
|
|
51974
52100
|
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
51975
52101
|
var import_properties13 = __toESM(require_lib4());
|
|
51976
|
-
var
|
|
52102
|
+
var logger19 = new Logger(version11);
|
|
51977
52103
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
51978
52104
|
|
|
51979
52105
|
class InfuraWebSocketProvider extends WebSocketProvider {
|
|
@@ -51981,7 +52107,7 @@ class InfuraWebSocketProvider extends WebSocketProvider {
|
|
|
51981
52107
|
const provider = new InfuraProvider(network, apiKey);
|
|
51982
52108
|
const connection = provider.connection;
|
|
51983
52109
|
if (connection.password) {
|
|
51984
|
-
|
|
52110
|
+
logger19.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51985
52111
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
51986
52112
|
});
|
|
51987
52113
|
}
|
|
@@ -52012,8 +52138,8 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52012
52138
|
if (typeof apiKey === "string") {
|
|
52013
52139
|
apiKeyObj.projectId = apiKey;
|
|
52014
52140
|
} else if (apiKey.projectSecret != null) {
|
|
52015
|
-
|
|
52016
|
-
|
|
52141
|
+
logger19.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
52142
|
+
logger19.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
52017
52143
|
apiKeyObj.projectId = apiKey.projectId;
|
|
52018
52144
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
52019
52145
|
} else if (apiKey.projectId) {
|
|
@@ -52053,7 +52179,7 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52053
52179
|
host = "arbitrum-goerli.infura.io";
|
|
52054
52180
|
break;
|
|
52055
52181
|
default:
|
|
52056
|
-
|
|
52182
|
+
logger19.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52057
52183
|
argument: "network",
|
|
52058
52184
|
value: network
|
|
52059
52185
|
});
|
|
@@ -52146,18 +52272,18 @@ class JsonRpcBatchProvider extends JsonRpcProvider {
|
|
|
52146
52272
|
}
|
|
52147
52273
|
|
|
52148
52274
|
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
52149
|
-
var
|
|
52275
|
+
var logger20 = new Logger(version11);
|
|
52150
52276
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
52151
52277
|
|
|
52152
52278
|
class NodesmithProvider extends UrlJsonRpcProvider {
|
|
52153
52279
|
static getApiKey(apiKey) {
|
|
52154
52280
|
if (apiKey && typeof apiKey !== "string") {
|
|
52155
|
-
|
|
52281
|
+
logger20.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
52156
52282
|
}
|
|
52157
52283
|
return apiKey || defaultApiKey3;
|
|
52158
52284
|
}
|
|
52159
52285
|
static getUrl(network, apiKey) {
|
|
52160
|
-
|
|
52286
|
+
logger20.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
52161
52287
|
let host = null;
|
|
52162
52288
|
switch (network.name) {
|
|
52163
52289
|
case "homestead":
|
|
@@ -52176,14 +52302,14 @@ class NodesmithProvider extends UrlJsonRpcProvider {
|
|
|
52176
52302
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
52177
52303
|
break;
|
|
52178
52304
|
default:
|
|
52179
|
-
|
|
52305
|
+
logger20.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
52180
52306
|
}
|
|
52181
52307
|
return host + "?apiKey=" + apiKey;
|
|
52182
52308
|
}
|
|
52183
52309
|
}
|
|
52184
52310
|
|
|
52185
52311
|
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
52186
|
-
var
|
|
52312
|
+
var logger21 = new Logger(version11);
|
|
52187
52313
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
52188
52314
|
|
|
52189
52315
|
class PocketProvider extends UrlJsonRpcProvider {
|
|
@@ -52203,7 +52329,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52203
52329
|
} else if (apiKey.applicationId) {
|
|
52204
52330
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
52205
52331
|
} else {
|
|
52206
|
-
|
|
52332
|
+
logger21.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
52207
52333
|
}
|
|
52208
52334
|
return apiKeyObj;
|
|
52209
52335
|
}
|
|
@@ -52232,7 +52358,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52232
52358
|
host = "eth-ropsten.gateway.pokt.network";
|
|
52233
52359
|
break;
|
|
52234
52360
|
default:
|
|
52235
|
-
|
|
52361
|
+
logger21.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52236
52362
|
argument: "network",
|
|
52237
52363
|
value: network
|
|
52238
52364
|
});
|
|
@@ -52252,7 +52378,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52252
52378
|
|
|
52253
52379
|
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
52254
52380
|
var import_properties15 = __toESM(require_lib4());
|
|
52255
|
-
var
|
|
52381
|
+
var logger22 = new Logger(version11);
|
|
52256
52382
|
var _nextId = 1;
|
|
52257
52383
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
52258
52384
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -52336,7 +52462,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
52336
52462
|
class Web3Provider extends JsonRpcProvider {
|
|
52337
52463
|
constructor(provider, network) {
|
|
52338
52464
|
if (provider == null) {
|
|
52339
|
-
|
|
52465
|
+
logger22.throwArgumentError("missing provider", "provider", provider);
|
|
52340
52466
|
}
|
|
52341
52467
|
let path = null;
|
|
52342
52468
|
let jsonRpcFetchFunc = null;
|
|
@@ -52360,7 +52486,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52360
52486
|
} else if (provider.send) {
|
|
52361
52487
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
52362
52488
|
} else {
|
|
52363
|
-
|
|
52489
|
+
logger22.throwArgumentError("unsupported provider", "provider", provider);
|
|
52364
52490
|
}
|
|
52365
52491
|
if (!path) {
|
|
52366
52492
|
path = "unknown:";
|
|
@@ -52376,7 +52502,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52376
52502
|
}
|
|
52377
52503
|
|
|
52378
52504
|
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
52379
|
-
var
|
|
52505
|
+
var logger23 = new Logger(version11);
|
|
52380
52506
|
function getDefaultProvider(network, options) {
|
|
52381
52507
|
if (network == null) {
|
|
52382
52508
|
network = "homestead";
|
|
@@ -52392,13 +52518,13 @@ function getDefaultProvider(network, options) {
|
|
|
52392
52518
|
case "wss":
|
|
52393
52519
|
return new WebSocketProvider(network);
|
|
52394
52520
|
default:
|
|
52395
|
-
|
|
52521
|
+
logger23.throwArgumentError("unsupported URL scheme", "network", network);
|
|
52396
52522
|
}
|
|
52397
52523
|
}
|
|
52398
52524
|
}
|
|
52399
52525
|
const n = getNetwork(network);
|
|
52400
52526
|
if (!n || !n._defaultProvider) {
|
|
52401
|
-
|
|
52527
|
+
logger23.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
52402
52528
|
operation: "getDefaultProvider",
|
|
52403
52529
|
network
|
|
52404
52530
|
});
|
|
@@ -52423,15 +52549,15 @@ var import_hash4 = __toESM(require_lib12());
|
|
|
52423
52549
|
var import_properties16 = __toESM(require_lib4());
|
|
52424
52550
|
|
|
52425
52551
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
52426
|
-
var
|
|
52552
|
+
var version12 = "wordlists/5.7.0";
|
|
52427
52553
|
|
|
52428
52554
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
52429
52555
|
var exportWordlist = false;
|
|
52430
|
-
var
|
|
52556
|
+
var logger24 = new Logger(version12);
|
|
52431
52557
|
|
|
52432
52558
|
class Wordlist {
|
|
52433
52559
|
constructor(locale) {
|
|
52434
|
-
|
|
52560
|
+
logger24.checkAbstract(new.target, Wordlist);
|
|
52435
52561
|
import_properties16.defineReadOnly(this, "locale", locale);
|
|
52436
52562
|
}
|
|
52437
52563
|
split(mnemonic) {
|
|
@@ -52508,14 +52634,14 @@ var wordlists = {
|
|
|
52508
52634
|
// node_modules/ethers/lib.esm/utils.js
|
|
52509
52635
|
var exports_utils = {};
|
|
52510
52636
|
__export(exports_utils, {
|
|
52511
|
-
zeroPad: () =>
|
|
52637
|
+
zeroPad: () => import_bytes11.zeroPad,
|
|
52512
52638
|
verifyTypedData: () => verifyTypedData,
|
|
52513
52639
|
verifyMessage: () => verifyMessage,
|
|
52514
52640
|
toUtf8String: () => import_strings4.toUtf8String,
|
|
52515
52641
|
toUtf8CodePoints: () => import_strings4.toUtf8CodePoints,
|
|
52516
52642
|
toUtf8Bytes: () => import_strings4.toUtf8Bytes,
|
|
52517
|
-
stripZeros: () =>
|
|
52518
|
-
splitSignature: () =>
|
|
52643
|
+
stripZeros: () => import_bytes11.stripZeros,
|
|
52644
|
+
splitSignature: () => import_bytes11.splitSignature,
|
|
52519
52645
|
soliditySha256: () => import_solidity.sha256,
|
|
52520
52646
|
solidityPack: () => import_solidity.pack,
|
|
52521
52647
|
solidityKeccak256: () => import_solidity.keccak256,
|
|
@@ -52538,29 +52664,29 @@ __export(exports_utils, {
|
|
|
52538
52664
|
namehash: () => import_hash5.namehash,
|
|
52539
52665
|
mnemonicToSeed: () => import_hdnode2.mnemonicToSeed,
|
|
52540
52666
|
mnemonicToEntropy: () => import_hdnode2.mnemonicToEntropy,
|
|
52541
|
-
keccak256: () =>
|
|
52542
|
-
joinSignature: () =>
|
|
52667
|
+
keccak256: () => import_keccak2563.keccak256,
|
|
52668
|
+
joinSignature: () => import_bytes11.joinSignature,
|
|
52543
52669
|
isValidName: () => import_hash5.isValidName,
|
|
52544
52670
|
isValidMnemonic: () => import_hdnode2.isValidMnemonic,
|
|
52545
|
-
isHexString: () =>
|
|
52546
|
-
isBytesLike: () =>
|
|
52547
|
-
isBytes: () =>
|
|
52548
|
-
isAddress: () =>
|
|
52671
|
+
isHexString: () => import_bytes11.isHexString,
|
|
52672
|
+
isBytesLike: () => import_bytes11.isBytesLike,
|
|
52673
|
+
isBytes: () => import_bytes11.isBytes,
|
|
52674
|
+
isAddress: () => isAddress,
|
|
52549
52675
|
id: () => import_hash5.id,
|
|
52550
|
-
hexlify: () =>
|
|
52551
|
-
hexZeroPad: () =>
|
|
52552
|
-
hexValue: () =>
|
|
52553
|
-
hexStripZeros: () =>
|
|
52554
|
-
hexDataSlice: () =>
|
|
52555
|
-
hexDataLength: () =>
|
|
52556
|
-
hexConcat: () =>
|
|
52676
|
+
hexlify: () => import_bytes11.hexlify,
|
|
52677
|
+
hexZeroPad: () => import_bytes11.hexZeroPad,
|
|
52678
|
+
hexValue: () => import_bytes11.hexValue,
|
|
52679
|
+
hexStripZeros: () => import_bytes11.hexStripZeros,
|
|
52680
|
+
hexDataSlice: () => import_bytes11.hexDataSlice,
|
|
52681
|
+
hexDataLength: () => import_bytes11.hexDataLength,
|
|
52682
|
+
hexConcat: () => import_bytes11.hexConcat,
|
|
52557
52683
|
hashMessage: () => import_hash5.hashMessage,
|
|
52558
52684
|
getStatic: () => import_properties17.getStatic,
|
|
52559
52685
|
getJsonWalletAddress: () => import_json_wallets2.getJsonWalletAddress,
|
|
52560
|
-
getIcapAddress: () =>
|
|
52561
|
-
getCreate2Address: () =>
|
|
52562
|
-
getContractAddress: () =>
|
|
52563
|
-
getAddress: () =>
|
|
52686
|
+
getIcapAddress: () => getIcapAddress,
|
|
52687
|
+
getCreate2Address: () => getCreate2Address,
|
|
52688
|
+
getContractAddress: () => getContractAddress,
|
|
52689
|
+
getAddress: () => getAddress,
|
|
52564
52690
|
getAccountPath: () => import_hdnode2.getAccountPath,
|
|
52565
52691
|
formatUnits: () => import_units.formatUnits,
|
|
52566
52692
|
formatEther: () => import_units.formatEther,
|
|
@@ -52572,7 +52698,7 @@ __export(exports_utils, {
|
|
|
52572
52698
|
defaultPath: () => import_hdnode2.defaultPath,
|
|
52573
52699
|
defaultAbiCoder: () => import_abi2.defaultAbiCoder,
|
|
52574
52700
|
deepCopy: () => import_properties17.deepCopy,
|
|
52575
|
-
concat: () =>
|
|
52701
|
+
concat: () => import_bytes11.concat,
|
|
52576
52702
|
computePublicKey: () => import_signing_key2.computePublicKey,
|
|
52577
52703
|
computeHmac: () => import_sha22.computeHmac,
|
|
52578
52704
|
computeAddress: () => import_transactions6.computeAddress,
|
|
@@ -52581,7 +52707,7 @@ __export(exports_utils, {
|
|
|
52581
52707
|
checkProperties: () => import_properties17.checkProperties,
|
|
52582
52708
|
base64: () => base64,
|
|
52583
52709
|
base58: () => import_basex2.Base58,
|
|
52584
|
-
arrayify: () =>
|
|
52710
|
+
arrayify: () => import_bytes11.arrayify,
|
|
52585
52711
|
accessListify: () => import_transactions6.accessListify,
|
|
52586
52712
|
_toEscapedUtf8String: () => import_strings4._toEscapedUtf8String,
|
|
52587
52713
|
_fetchData: () => import_web6._fetchData,
|
|
@@ -52609,14 +52735,13 @@ __export(exports_utils, {
|
|
|
52609
52735
|
AbiCoder: () => import_abi2.AbiCoder
|
|
52610
52736
|
});
|
|
52611
52737
|
var import_abi2 = __toESM(require_lib13());
|
|
52612
|
-
var import_address5 = __toESM(require_lib7());
|
|
52613
52738
|
var base64 = __toESM(require_lib10());
|
|
52614
52739
|
var import_basex2 = __toESM(require_lib16());
|
|
52615
|
-
var
|
|
52740
|
+
var import_bytes11 = __toESM(require_lib2());
|
|
52616
52741
|
var import_hash5 = __toESM(require_lib12());
|
|
52617
52742
|
var import_hdnode2 = __toESM(require_lib20());
|
|
52618
52743
|
var import_json_wallets2 = __toESM(require_lib22());
|
|
52619
|
-
var
|
|
52744
|
+
var import_keccak2563 = __toESM(require_lib5());
|
|
52620
52745
|
var import_sha22 = __toESM(require_lib17());
|
|
52621
52746
|
var import_solidity = __toESM(require_lib24());
|
|
52622
52747
|
var import_random3 = __toESM(require_lib21());
|
|
@@ -52631,10 +52756,10 @@ var import_sha23 = __toESM(require_lib17());
|
|
|
52631
52756
|
var import_strings5 = __toESM(require_lib9());
|
|
52632
52757
|
|
|
52633
52758
|
// node_modules/ethers/lib.esm/_version.js
|
|
52634
|
-
var
|
|
52759
|
+
var version13 = "ethers/5.7.2";
|
|
52635
52760
|
|
|
52636
52761
|
// node_modules/ethers/lib.esm/ethers.js
|
|
52637
|
-
var
|
|
52762
|
+
var logger25 = new Logger(version13);
|
|
52638
52763
|
|
|
52639
52764
|
// node_modules/ethers/lib.esm/index.js
|
|
52640
52765
|
try {
|
|
@@ -53298,7 +53423,11 @@ var contractsRegistry_default = {
|
|
|
53298
53423
|
morphoBlue: "0x6c247b1F6182318877311737BaC0844bAa518F5e",
|
|
53299
53424
|
vaultV1_0: "0x7c574174DA4b2be3f705c6244B4BfA0815a8B3Ed"
|
|
53300
53425
|
},
|
|
53301
|
-
poster: "0x000000000000cd17345801aa8147b8D3950260FF"
|
|
53426
|
+
poster: "0x000000000000cd17345801aa8147b8D3950260FF",
|
|
53427
|
+
cctp: {
|
|
53428
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53429
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53430
|
+
}
|
|
53302
53431
|
},
|
|
53303
53432
|
base: {
|
|
53304
53433
|
aaveV3: {
|
|
@@ -53355,6 +53484,10 @@ var contractsRegistry_default = {
|
|
|
53355
53484
|
morpho: {
|
|
53356
53485
|
morphoBlue: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"
|
|
53357
53486
|
},
|
|
53487
|
+
cctp: {
|
|
53488
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53489
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53490
|
+
},
|
|
53358
53491
|
stargate: {
|
|
53359
53492
|
feeLibV1ETH: "0x17E450Be3Ba9557F2378E20d64AD417E59Ef9A34",
|
|
53360
53493
|
stargateMultiRewarder: "0x9Aa02D4Fae7F58b8E8f34c66E756cC734DAc7fe4",
|
|
@@ -53433,6 +53566,10 @@ var contractsRegistry_default = {
|
|
|
53433
53566
|
morphoBlue: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67",
|
|
53434
53567
|
vaultV1_0: "0x781FB7F6d845E3bE129289833b04d43Aa8558c42"
|
|
53435
53568
|
},
|
|
53569
|
+
cctp: {
|
|
53570
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53571
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53572
|
+
},
|
|
53436
53573
|
OFTAdapters: {
|
|
53437
53574
|
"0xc2132D05D31c914a87C6611C10748AEb04B58e8F": "0x6BA10300f0DC58B7a1e4c0e41f5daBb7D7829e13"
|
|
53438
53575
|
},
|
|
@@ -53531,6 +53668,10 @@ var contractsRegistry_default = {
|
|
|
53531
53668
|
morpho: {
|
|
53532
53669
|
morphoBlue: "0xce95AfbB8EA029495c66020883F87aaE8864AF92"
|
|
53533
53670
|
},
|
|
53671
|
+
cctp: {
|
|
53672
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53673
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53674
|
+
},
|
|
53534
53675
|
poster: "0x000000000000cd17345801aa8147b8D3950260FF",
|
|
53535
53676
|
wrappedNativeToken: "0x4200000000000000000000000000000000000006",
|
|
53536
53677
|
slipstream: {
|
|
@@ -53592,6 +53733,10 @@ var contractsRegistry_default = {
|
|
|
53592
53733
|
morpho: {
|
|
53593
53734
|
morphoBlue: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"
|
|
53594
53735
|
},
|
|
53736
|
+
cctp: {
|
|
53737
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53738
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53739
|
+
},
|
|
53595
53740
|
"1inch": {
|
|
53596
53741
|
aggregatorV6: "0x111111125421cA6dc452d289314280a0f8842A65"
|
|
53597
53742
|
},
|
|
@@ -53664,6 +53809,10 @@ var contractsRegistry_default = {
|
|
|
53664
53809
|
morpho: {
|
|
53665
53810
|
morphoBlue: "0x8f5ae9CddB9f68de460C77730b018Ae7E04a140A"
|
|
53666
53811
|
},
|
|
53812
|
+
cctp: {
|
|
53813
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53814
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53815
|
+
},
|
|
53667
53816
|
OFTAdapters: {
|
|
53668
53817
|
"0x9151434b16b9763660705744891fA906F660EcC5": "0xc07be8994d035631c36fb4a89c918cefb2f03ec3"
|
|
53669
53818
|
},
|
|
@@ -53762,6 +53911,10 @@ var contractsRegistry_default = {
|
|
|
53762
53911
|
morpho: {
|
|
53763
53912
|
morphoBlue: "0xE741BC7c34758b4caE05062794E8Ae24978AF432"
|
|
53764
53913
|
},
|
|
53914
|
+
cctp: {
|
|
53915
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53916
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53917
|
+
},
|
|
53765
53918
|
gnosisSafe: {
|
|
53766
53919
|
v1_4_1: {
|
|
53767
53920
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
@@ -53813,6 +53966,10 @@ var contractsRegistry_default = {
|
|
|
53813
53966
|
morpho: {
|
|
53814
53967
|
morphoBlue: "0xd011EE229E7459ba1ddd22631eF7bF528d424A14"
|
|
53815
53968
|
},
|
|
53969
|
+
cctp: {
|
|
53970
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
53971
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
53972
|
+
},
|
|
53816
53973
|
stargate: {
|
|
53817
53974
|
feeLibV1USDC: "0xCd4302D950e7e6606b6910Cd232758b5ad423311",
|
|
53818
53975
|
stargateOFTUSDT: "0x1C10CC06DC6D35970d1D53B2A23c76ef370d4135",
|
|
@@ -53859,6 +54016,10 @@ var contractsRegistry_default = {
|
|
|
53859
54016
|
},
|
|
53860
54017
|
multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
53861
54018
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
54019
|
+
cctp: {
|
|
54020
|
+
tokenMessengerV2: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
|
|
54021
|
+
messageTransmitterV2: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64"
|
|
54022
|
+
},
|
|
53862
54023
|
poster: "0x000000000000cd17345801aa8147b8D3950260FF"
|
|
53863
54024
|
}
|
|
53864
54025
|
};
|
|
@@ -53946,8 +54107,8 @@ class MultisendBuilder {
|
|
|
53946
54107
|
data
|
|
53947
54108
|
});
|
|
53948
54109
|
}
|
|
53949
|
-
static new(chainId,
|
|
53950
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${
|
|
54110
|
+
static new(chainId, version14 = "v1_4_1") {
|
|
54111
|
+
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version14}.multisend`));
|
|
53951
54112
|
}
|
|
53952
54113
|
}
|
|
53953
54114
|
// src/integrations/gnosis/safe.L2.abi.ts
|
|
@@ -58187,7 +58348,6 @@ function invariant(condition, message) {
|
|
|
58187
58348
|
var import_decimal = __toESM(require_decimal());
|
|
58188
58349
|
var import_big = __toESM(require_big());
|
|
58189
58350
|
var import_toformat = __toESM(require_toFormat());
|
|
58190
|
-
var import_address6 = __toESM(require_lib7());
|
|
58191
58351
|
function _defineProperties(target, props) {
|
|
58192
58352
|
for (var i2 = 0;i2 < props.length; i2++) {
|
|
58193
58353
|
var descriptor = props[i2];
|
|
@@ -58747,7 +58907,7 @@ var NativeCurrency = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
58747
58907
|
}(BaseCurrency);
|
|
58748
58908
|
function validateAndParseAddress(address) {
|
|
58749
58909
|
try {
|
|
58750
|
-
return
|
|
58910
|
+
return getAddress(address);
|
|
58751
58911
|
} catch (error) {
|
|
58752
58912
|
throw new Error(address + " is not a valid address.");
|
|
58753
58913
|
}
|
|
@@ -58824,13 +58984,13 @@ var Ether = /* @__PURE__ */ function(_NativeCurrency) {
|
|
|
58824
58984
|
return Ether2;
|
|
58825
58985
|
}(NativeCurrency);
|
|
58826
58986
|
Ether._etherCache = {};
|
|
58827
|
-
var
|
|
58987
|
+
var MAX_SAFE_INTEGER2 = /* @__PURE__ */ import_jsbi.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
58828
58988
|
var ZERO = /* @__PURE__ */ import_jsbi.default.BigInt(0);
|
|
58829
58989
|
var ONE2 = /* @__PURE__ */ import_jsbi.default.BigInt(1);
|
|
58830
58990
|
var TWO = /* @__PURE__ */ import_jsbi.default.BigInt(2);
|
|
58831
58991
|
function sqrt(value) {
|
|
58832
58992
|
!import_jsbi.default.greaterThanOrEqual(value, ZERO) && invariant(false, "NEGATIVE");
|
|
58833
|
-
if (import_jsbi.default.lessThan(value,
|
|
58993
|
+
if (import_jsbi.default.lessThan(value, MAX_SAFE_INTEGER2)) {
|
|
58834
58994
|
return import_jsbi.default.BigInt(Math.floor(Math.sqrt(import_jsbi.default.toNumber(value))));
|
|
58835
58995
|
}
|
|
58836
58996
|
var z;
|
|
@@ -58847,7 +59007,6 @@ function sqrt(value) {
|
|
|
58847
59007
|
// node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
58848
59008
|
var import_jsbi2 = __toESM(require_jsbi_umd());
|
|
58849
59009
|
var import_abi3 = __toESM(require_lib13());
|
|
58850
|
-
var import_address7 = __toESM(require_lib7());
|
|
58851
59010
|
var import_solidity2 = __toESM(require_lib24());
|
|
58852
59011
|
// node_modules/@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json
|
|
58853
59012
|
var IMulticall_default = {
|
|
@@ -62783,7 +62942,7 @@ var Q192 = /* @__PURE__ */ import_jsbi2.default.exponentiate(Q96, /* @__PURE__ *
|
|
|
62783
62942
|
function computePoolAddress(_ref) {
|
|
62784
62943
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride } = _ref;
|
|
62785
62944
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
62786
|
-
return
|
|
62945
|
+
return getCreate2Address(factoryAddress, import_solidity2.keccak256(["bytes"], [import_abi3.defaultAbiCoder.encode(["address", "address", "uint24"], [token0.address, token1.address, fee])]), initCodeHashManualOverride != null ? initCodeHashManualOverride : POOL_INIT_CODE_HASH);
|
|
62787
62946
|
}
|
|
62788
62947
|
var LiquidityMath = /* @__PURE__ */ function() {
|
|
62789
62948
|
function LiquidityMath2() {}
|
|
@@ -64156,9 +64315,8 @@ var import_jsbi3 = __toESM(require_jsbi_umd());
|
|
|
64156
64315
|
var import_decimal2 = __toESM(require_decimal());
|
|
64157
64316
|
var import_big2 = __toESM(require_big());
|
|
64158
64317
|
var import_toformat2 = __toESM(require_toFormat());
|
|
64159
|
-
var
|
|
64160
|
-
var
|
|
64161
|
-
var import_keccak2563 = __toESM(require_lib5());
|
|
64318
|
+
var import_bytes12 = __toESM(require_lib2());
|
|
64319
|
+
var import_keccak2564 = __toESM(require_lib5());
|
|
64162
64320
|
var import_strings6 = __toESM(require_lib9());
|
|
64163
64321
|
function _defineProperties3(e, r) {
|
|
64164
64322
|
for (var t = 0;t < r.length; t++) {
|
|
@@ -64863,7 +65021,7 @@ var NativeCurrency2 = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
64863
65021
|
}(BaseCurrency3);
|
|
64864
65022
|
function validateAndParseAddress2(address) {
|
|
64865
65023
|
try {
|
|
64866
|
-
return
|
|
65024
|
+
return getAddress(address);
|
|
64867
65025
|
} catch (error) {
|
|
64868
65026
|
throw new Error(address + " is not a valid address.");
|
|
64869
65027
|
}
|
|
@@ -64967,18 +65125,18 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
64967
65125
|
if (input === undefined) {
|
|
64968
65126
|
input = "0x";
|
|
64969
65127
|
}
|
|
64970
|
-
var prefix2 =
|
|
64971
|
-
var inputHash =
|
|
64972
|
-
var addressBytes =
|
|
64973
|
-
return
|
|
65128
|
+
var prefix2 = import_keccak2564.keccak256(import_strings6.toUtf8Bytes("zksyncCreate2"));
|
|
65129
|
+
var inputHash = import_keccak2564.keccak256(input);
|
|
65130
|
+
var addressBytes = import_keccak2564.keccak256(import_bytes12.concat([prefix2, import_bytes12.hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
65131
|
+
return getAddress(addressBytes);
|
|
64974
65132
|
}
|
|
64975
|
-
var
|
|
65133
|
+
var MAX_SAFE_INTEGER3 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
64976
65134
|
var ZERO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(0);
|
|
64977
65135
|
var ONE4 = /* @__PURE__ */ import_jsbi3.default.BigInt(1);
|
|
64978
65136
|
var TWO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(2);
|
|
64979
65137
|
function sqrt2(value) {
|
|
64980
65138
|
!import_jsbi3.default.greaterThanOrEqual(value, ZERO3) && invariant(false, "NEGATIVE");
|
|
64981
|
-
if (import_jsbi3.default.lessThan(value,
|
|
65139
|
+
if (import_jsbi3.default.lessThan(value, MAX_SAFE_INTEGER3)) {
|
|
64982
65140
|
return import_jsbi3.default.BigInt(Math.floor(Math.sqrt(import_jsbi3.default.toNumber(value))));
|
|
64983
65141
|
}
|
|
64984
65142
|
var z;
|
|
@@ -64995,7 +65153,6 @@ function sqrt2(value) {
|
|
|
64995
65153
|
// node_modules/@uniswap/v4-sdk/node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
64996
65154
|
var import_jsbi4 = __toESM(require_jsbi_umd());
|
|
64997
65155
|
var import_abi4 = __toESM(require_lib13());
|
|
64998
|
-
var import_address9 = __toESM(require_lib7());
|
|
64999
65156
|
var import_solidity3 = __toESM(require_lib24());
|
|
65000
65157
|
function _arrayLikeToArray2(r, a) {
|
|
65001
65158
|
(a == null || a > r.length) && (a = r.length);
|
|
@@ -65447,7 +65604,7 @@ function computePoolAddress2(_ref) {
|
|
|
65447
65604
|
case ChainId2.ZKSYNC:
|
|
65448
65605
|
return computeZksyncCreate2Address(factoryAddress, initCodeHash, salt);
|
|
65449
65606
|
default:
|
|
65450
|
-
return
|
|
65607
|
+
return getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
65451
65608
|
}
|
|
65452
65609
|
}
|
|
65453
65610
|
var FullMath2 = /* @__PURE__ */ function() {
|
|
@@ -69302,7 +69459,7 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69302
69459
|
hookData = "0x",
|
|
69303
69460
|
recipient
|
|
69304
69461
|
}) => {
|
|
69305
|
-
const
|
|
69462
|
+
const getAddress2 = (currency) => {
|
|
69306
69463
|
return currency.address;
|
|
69307
69464
|
};
|
|
69308
69465
|
const commands = exports_ethers.utils.solidityPack(["uint8"], [16 /* V4_SWAP */]);
|
|
@@ -69310,15 +69467,15 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69310
69467
|
const params = [
|
|
69311
69468
|
exports_ethers.utils.defaultAbiCoder.encode(["tuple(tuple(address,address,uint24,int24,address),bool,uint128,uint128,bytes)"], [
|
|
69312
69469
|
[
|
|
69313
|
-
[
|
|
69470
|
+
[getAddress2(pool.currency0), getAddress2(pool.currency1), pool.fee, pool.tickSpacing, pool.hooks],
|
|
69314
69471
|
zeroForOne,
|
|
69315
69472
|
amountIn,
|
|
69316
69473
|
amountOutMinimum,
|
|
69317
69474
|
hookData
|
|
69318
69475
|
]
|
|
69319
69476
|
]),
|
|
69320
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69321
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69477
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress2(pool.currency0) : getAddress2(pool.currency1), amountIn]),
|
|
69478
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress2(pool.currency1) : getAddress2(pool.currency0), amountOutMinimum])
|
|
69322
69479
|
];
|
|
69323
69480
|
const actionsList = [];
|
|
69324
69481
|
actionsList.push(Actions2.SWAP_EXACT_IN_SINGLE);
|
|
@@ -84820,4 +84977,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
84820
84977
|
};
|
|
84821
84978
|
};
|
|
84822
84979
|
|
|
84823
|
-
//# debugId=
|
|
84980
|
+
//# debugId=CB509665AD717ACD64756E2164756E21
|