damm-sdk 1.1.31-alpha.41 → 1.1.31-alpha.43
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 +546 -422
- package/dist/index.cjs.map +5 -3
- package/dist/index.js +2858 -2338
- package/dist/index.js.map +20 -14
- package/package.json +1 -1
- package/src/lib/contractsRegistry.json +4 -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
|
});
|
|
@@ -44915,10 +44915,10 @@ var createCall = (call) => {
|
|
|
44915
44915
|
var exports_ethers = {};
|
|
44916
44916
|
__export(exports_ethers, {
|
|
44917
44917
|
wordlists: () => wordlists,
|
|
44918
|
-
version: () =>
|
|
44918
|
+
version: () => version13,
|
|
44919
44919
|
utils: () => exports_utils,
|
|
44920
44920
|
providers: () => exports_lib2,
|
|
44921
|
-
logger: () =>
|
|
44921
|
+
logger: () => logger25,
|
|
44922
44922
|
getDefaultProvider: () => getDefaultProvider,
|
|
44923
44923
|
errors: () => ErrorCode,
|
|
44924
44924
|
constants: () => exports_lib,
|
|
@@ -45493,6 +45493,12 @@ function throwFault(fault, operation, value) {
|
|
|
45493
45493
|
}
|
|
45494
45494
|
return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
|
45495
45495
|
}
|
|
45496
|
+
function _base36To16(value) {
|
|
45497
|
+
return new BN(value, 36).toString(16);
|
|
45498
|
+
}
|
|
45499
|
+
function _base16To36(value) {
|
|
45500
|
+
return new BN(value, 16).toString(36);
|
|
45501
|
+
}
|
|
45496
45502
|
// node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js
|
|
45497
45503
|
var import_bytes2 = __toESM(require_lib2());
|
|
45498
45504
|
var logger2 = new Logger(version3);
|
|
@@ -46190,14 +46196,136 @@ class VoidSigner extends Signer {
|
|
|
46190
46196
|
}
|
|
46191
46197
|
}
|
|
46192
46198
|
|
|
46193
|
-
// node_modules/@ethersproject/
|
|
46194
|
-
var import_address2 = __toESM(require_lib7());
|
|
46199
|
+
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46195
46200
|
var import_bytes3 = __toESM(require_lib2());
|
|
46201
|
+
var import_keccak256 = __toESM(require_lib5());
|
|
46202
|
+
var import_rlp = __toESM(require_lib6());
|
|
46203
|
+
|
|
46204
|
+
// node_modules/@ethersproject/address/lib.esm/_version.js
|
|
46205
|
+
var version6 = "address/5.7.0";
|
|
46206
|
+
|
|
46207
|
+
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46208
|
+
var logger5 = new Logger(version6);
|
|
46209
|
+
function getChecksumAddress(address) {
|
|
46210
|
+
if (!import_bytes3.isHexString(address, 20)) {
|
|
46211
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46212
|
+
}
|
|
46213
|
+
address = address.toLowerCase();
|
|
46214
|
+
const chars = address.substring(2).split("");
|
|
46215
|
+
const expanded = new Uint8Array(40);
|
|
46216
|
+
for (let i2 = 0;i2 < 40; i2++) {
|
|
46217
|
+
expanded[i2] = chars[i2].charCodeAt(0);
|
|
46218
|
+
}
|
|
46219
|
+
const hashed = import_bytes3.arrayify(import_keccak256.keccak256(expanded));
|
|
46220
|
+
for (let i2 = 0;i2 < 40; i2 += 2) {
|
|
46221
|
+
if (hashed[i2 >> 1] >> 4 >= 8) {
|
|
46222
|
+
chars[i2] = chars[i2].toUpperCase();
|
|
46223
|
+
}
|
|
46224
|
+
if ((hashed[i2 >> 1] & 15) >= 8) {
|
|
46225
|
+
chars[i2 + 1] = chars[i2 + 1].toUpperCase();
|
|
46226
|
+
}
|
|
46227
|
+
}
|
|
46228
|
+
return "0x" + chars.join("");
|
|
46229
|
+
}
|
|
46230
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
46231
|
+
function log10(x) {
|
|
46232
|
+
if (Math.log10) {
|
|
46233
|
+
return Math.log10(x);
|
|
46234
|
+
}
|
|
46235
|
+
return Math.log(x) / Math.LN10;
|
|
46236
|
+
}
|
|
46237
|
+
var ibanLookup = {};
|
|
46238
|
+
for (let i2 = 0;i2 < 10; i2++) {
|
|
46239
|
+
ibanLookup[String(i2)] = String(i2);
|
|
46240
|
+
}
|
|
46241
|
+
for (let i2 = 0;i2 < 26; i2++) {
|
|
46242
|
+
ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2);
|
|
46243
|
+
}
|
|
46244
|
+
var safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
46245
|
+
function ibanChecksum(address) {
|
|
46246
|
+
address = address.toUpperCase();
|
|
46247
|
+
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
46248
|
+
let expanded = address.split("").map((c) => {
|
|
46249
|
+
return ibanLookup[c];
|
|
46250
|
+
}).join("");
|
|
46251
|
+
while (expanded.length >= safeDigits) {
|
|
46252
|
+
let block = expanded.substring(0, safeDigits);
|
|
46253
|
+
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
46254
|
+
}
|
|
46255
|
+
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
|
46256
|
+
while (checksum.length < 2) {
|
|
46257
|
+
checksum = "0" + checksum;
|
|
46258
|
+
}
|
|
46259
|
+
return checksum;
|
|
46260
|
+
}
|
|
46261
|
+
function getAddress(address) {
|
|
46262
|
+
let result = null;
|
|
46263
|
+
if (typeof address !== "string") {
|
|
46264
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46265
|
+
}
|
|
46266
|
+
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
46267
|
+
if (address.substring(0, 2) !== "0x") {
|
|
46268
|
+
address = "0x" + address;
|
|
46269
|
+
}
|
|
46270
|
+
result = getChecksumAddress(address);
|
|
46271
|
+
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
46272
|
+
logger5.throwArgumentError("bad address checksum", "address", address);
|
|
46273
|
+
}
|
|
46274
|
+
} else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
46275
|
+
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
46276
|
+
logger5.throwArgumentError("bad icap checksum", "address", address);
|
|
46277
|
+
}
|
|
46278
|
+
result = _base36To16(address.substring(4));
|
|
46279
|
+
while (result.length < 40) {
|
|
46280
|
+
result = "0" + result;
|
|
46281
|
+
}
|
|
46282
|
+
result = getChecksumAddress("0x" + result);
|
|
46283
|
+
} else {
|
|
46284
|
+
logger5.throwArgumentError("invalid address", "address", address);
|
|
46285
|
+
}
|
|
46286
|
+
return result;
|
|
46287
|
+
}
|
|
46288
|
+
function isAddress(address) {
|
|
46289
|
+
try {
|
|
46290
|
+
getAddress(address);
|
|
46291
|
+
return true;
|
|
46292
|
+
} catch (error) {}
|
|
46293
|
+
return false;
|
|
46294
|
+
}
|
|
46295
|
+
function getIcapAddress(address) {
|
|
46296
|
+
let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();
|
|
46297
|
+
while (base36.length < 30) {
|
|
46298
|
+
base36 = "0" + base36;
|
|
46299
|
+
}
|
|
46300
|
+
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
|
46301
|
+
}
|
|
46302
|
+
function getContractAddress(transaction) {
|
|
46303
|
+
let from2 = null;
|
|
46304
|
+
try {
|
|
46305
|
+
from2 = getAddress(transaction.from);
|
|
46306
|
+
} catch (error) {
|
|
46307
|
+
logger5.throwArgumentError("missing from address", "transaction", transaction);
|
|
46308
|
+
}
|
|
46309
|
+
const nonce = import_bytes3.stripZeros(import_bytes3.arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
46310
|
+
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_rlp.encode([from2, nonce])), 12));
|
|
46311
|
+
}
|
|
46312
|
+
function getCreate2Address(from2, salt, initCodeHash) {
|
|
46313
|
+
if (import_bytes3.hexDataLength(salt) !== 32) {
|
|
46314
|
+
logger5.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
|
46315
|
+
}
|
|
46316
|
+
if (import_bytes3.hexDataLength(initCodeHash) !== 32) {
|
|
46317
|
+
logger5.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
46318
|
+
}
|
|
46319
|
+
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_bytes3.concat(["0xff", getAddress(from2), salt, initCodeHash])), 12));
|
|
46320
|
+
}
|
|
46321
|
+
|
|
46322
|
+
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46323
|
+
var import_bytes4 = __toESM(require_lib2());
|
|
46196
46324
|
var import_properties3 = __toESM(require_lib4());
|
|
46197
46325
|
var import_transactions = __toESM(require_lib15());
|
|
46198
46326
|
|
|
46199
46327
|
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
46200
|
-
var
|
|
46328
|
+
var version8 = "contracts/5.7.0";
|
|
46201
46329
|
|
|
46202
46330
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46203
46331
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
@@ -46227,7 +46355,7 @@ var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
|
46227
46355
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46228
46356
|
});
|
|
46229
46357
|
};
|
|
46230
|
-
var
|
|
46358
|
+
var logger6 = new Logger(version8);
|
|
46231
46359
|
var allowedTransactionKeys2 = {
|
|
46232
46360
|
chainId: true,
|
|
46233
46361
|
data: true,
|
|
@@ -46248,19 +46376,19 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
46248
46376
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46249
46377
|
const name = yield nameOrPromise;
|
|
46250
46378
|
if (typeof name !== "string") {
|
|
46251
|
-
|
|
46379
|
+
logger6.throwArgumentError("invalid address or ENS name", "name", name);
|
|
46252
46380
|
}
|
|
46253
46381
|
try {
|
|
46254
|
-
return
|
|
46382
|
+
return getAddress(name);
|
|
46255
46383
|
} catch (error) {}
|
|
46256
46384
|
if (!resolver) {
|
|
46257
|
-
|
|
46385
|
+
logger6.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46258
46386
|
operation: "resolveName"
|
|
46259
46387
|
});
|
|
46260
46388
|
}
|
|
46261
46389
|
const address = yield resolver.resolveName(name);
|
|
46262
46390
|
if (address == null) {
|
|
46263
|
-
|
|
46391
|
+
logger6.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
|
|
46264
46392
|
}
|
|
46265
46393
|
return address;
|
|
46266
46394
|
});
|
|
@@ -46280,7 +46408,7 @@ function resolveAddresses(resolver, value, paramType) {
|
|
|
46280
46408
|
}
|
|
46281
46409
|
if (paramType.baseType === "array") {
|
|
46282
46410
|
if (!Array.isArray(value)) {
|
|
46283
|
-
return Promise.reject(
|
|
46411
|
+
return Promise.reject(logger6.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
|
|
46284
46412
|
argument: "value",
|
|
46285
46413
|
value
|
|
46286
46414
|
}));
|
|
@@ -46296,15 +46424,15 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46296
46424
|
if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
|
|
46297
46425
|
overrides = import_properties3.shallowCopy(args.pop());
|
|
46298
46426
|
}
|
|
46299
|
-
|
|
46427
|
+
logger6.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
|
|
46300
46428
|
if (contract.signer) {
|
|
46301
46429
|
if (overrides.from) {
|
|
46302
46430
|
overrides.from = import_properties3.resolveProperties({
|
|
46303
46431
|
override: resolveName(contract.signer, overrides.from),
|
|
46304
46432
|
signer: contract.signer.getAddress()
|
|
46305
46433
|
}).then((check) => __awaiter3(this, undefined, undefined, function* () {
|
|
46306
|
-
if (
|
|
46307
|
-
|
|
46434
|
+
if (getAddress(check.signer) !== check.override) {
|
|
46435
|
+
logger6.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46308
46436
|
operation: "overrides.from"
|
|
46309
46437
|
});
|
|
46310
46438
|
}
|
|
@@ -46353,7 +46481,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46353
46481
|
}
|
|
46354
46482
|
if (tx.gasLimit == null && fragment.gas != null) {
|
|
46355
46483
|
let intrinsic = 21000;
|
|
46356
|
-
const bytes =
|
|
46484
|
+
const bytes = import_bytes4.arrayify(data);
|
|
46357
46485
|
for (let i2 = 0;i2 < bytes.length; i2++) {
|
|
46358
46486
|
intrinsic += 4;
|
|
46359
46487
|
if (bytes[i2]) {
|
|
@@ -46365,7 +46493,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46365
46493
|
if (ro.value) {
|
|
46366
46494
|
const roValue = BigNumber.from(ro.value);
|
|
46367
46495
|
if (!roValue.isZero() && !fragment.payable) {
|
|
46368
|
-
|
|
46496
|
+
logger6.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46369
46497
|
operation: "overrides.value",
|
|
46370
46498
|
value: overrides.value
|
|
46371
46499
|
});
|
|
@@ -46391,7 +46519,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46391
46519
|
delete overrides.ccipReadEnabled;
|
|
46392
46520
|
const leftovers = Object.keys(overrides).filter((key) => overrides[key] != null);
|
|
46393
46521
|
if (leftovers.length) {
|
|
46394
|
-
|
|
46522
|
+
logger6.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46395
46523
|
operation: "overrides",
|
|
46396
46524
|
overrides: leftovers
|
|
46397
46525
|
});
|
|
@@ -46409,7 +46537,7 @@ function buildEstimate(contract, fragment) {
|
|
|
46409
46537
|
return function(...args) {
|
|
46410
46538
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46411
46539
|
if (!signerOrProvider) {
|
|
46412
|
-
|
|
46540
|
+
logger6.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46413
46541
|
operation: "estimateGas"
|
|
46414
46542
|
});
|
|
46415
46543
|
}
|
|
@@ -46493,7 +46621,7 @@ function buildSend(contract, fragment) {
|
|
|
46493
46621
|
return function(...args) {
|
|
46494
46622
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46495
46623
|
if (!contract.signer) {
|
|
46496
|
-
|
|
46624
|
+
logger6.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46497
46625
|
operation: "sendTransaction"
|
|
46498
46626
|
});
|
|
46499
46627
|
}
|
|
@@ -46584,7 +46712,7 @@ class FragmentRunningEvent extends RunningEvent {
|
|
|
46584
46712
|
let topic = contractInterface.getEventTopic(fragment);
|
|
46585
46713
|
if (topics) {
|
|
46586
46714
|
if (topic !== topics[0]) {
|
|
46587
|
-
|
|
46715
|
+
logger6.throwArgumentError("topic mismatch", "topics", topics);
|
|
46588
46716
|
}
|
|
46589
46717
|
filter.topics = topics.slice();
|
|
46590
46718
|
} else {
|
|
@@ -46653,7 +46781,7 @@ class BaseContract {
|
|
|
46653
46781
|
import_properties3.defineReadOnly(this, "provider", signerOrProvider);
|
|
46654
46782
|
import_properties3.defineReadOnly(this, "signer", null);
|
|
46655
46783
|
} else {
|
|
46656
|
-
|
|
46784
|
+
logger6.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
|
|
46657
46785
|
}
|
|
46658
46786
|
import_properties3.defineReadOnly(this, "callStatic", {});
|
|
46659
46787
|
import_properties3.defineReadOnly(this, "estimateGas", {});
|
|
@@ -46680,23 +46808,23 @@ class BaseContract {
|
|
|
46680
46808
|
if (filters.length === 1) {
|
|
46681
46809
|
import_properties3.defineReadOnly(this.filters, name, this.filters[filters[0]]);
|
|
46682
46810
|
} else {
|
|
46683
|
-
|
|
46811
|
+
logger6.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
|
|
46684
46812
|
}
|
|
46685
46813
|
});
|
|
46686
46814
|
}
|
|
46687
46815
|
import_properties3.defineReadOnly(this, "_runningEvents", {});
|
|
46688
46816
|
import_properties3.defineReadOnly(this, "_wrappedEmits", {});
|
|
46689
46817
|
if (addressOrName == null) {
|
|
46690
|
-
|
|
46818
|
+
logger6.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
|
|
46691
46819
|
}
|
|
46692
46820
|
import_properties3.defineReadOnly(this, "address", addressOrName);
|
|
46693
46821
|
if (this.provider) {
|
|
46694
46822
|
import_properties3.defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
|
|
46695
46823
|
} else {
|
|
46696
46824
|
try {
|
|
46697
|
-
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(
|
|
46825
|
+
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
46698
46826
|
} catch (error) {
|
|
46699
|
-
|
|
46827
|
+
logger6.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46700
46828
|
operation: "new Contract"
|
|
46701
46829
|
});
|
|
46702
46830
|
}
|
|
@@ -46707,7 +46835,7 @@ class BaseContract {
|
|
|
46707
46835
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
46708
46836
|
const fragment = this.interface.functions[signature];
|
|
46709
46837
|
if (uniqueSignatures[signature]) {
|
|
46710
|
-
|
|
46838
|
+
logger6.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
|
|
46711
46839
|
return;
|
|
46712
46840
|
}
|
|
46713
46841
|
uniqueSignatures[signature] = true;
|
|
@@ -46761,7 +46889,7 @@ class BaseContract {
|
|
|
46761
46889
|
});
|
|
46762
46890
|
}
|
|
46763
46891
|
static getContractAddress(transaction) {
|
|
46764
|
-
return
|
|
46892
|
+
return getContractAddress(transaction);
|
|
46765
46893
|
}
|
|
46766
46894
|
static getInterface(contractInterface) {
|
|
46767
46895
|
if (import_abi.Interface.isInterface(contractInterface)) {
|
|
@@ -46781,7 +46909,7 @@ class BaseContract {
|
|
|
46781
46909
|
} else {
|
|
46782
46910
|
this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code2) => {
|
|
46783
46911
|
if (code2 === "0x") {
|
|
46784
|
-
|
|
46912
|
+
logger6.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46785
46913
|
contractAddress: this.address,
|
|
46786
46914
|
operation: "getDeployed"
|
|
46787
46915
|
});
|
|
@@ -46794,14 +46922,14 @@ class BaseContract {
|
|
|
46794
46922
|
}
|
|
46795
46923
|
fallback(overrides) {
|
|
46796
46924
|
if (!this.signer) {
|
|
46797
|
-
|
|
46925
|
+
logger6.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
|
|
46798
46926
|
}
|
|
46799
46927
|
const tx = import_properties3.shallowCopy(overrides || {});
|
|
46800
46928
|
["from", "to"].forEach(function(key) {
|
|
46801
46929
|
if (tx[key] == null) {
|
|
46802
46930
|
return;
|
|
46803
46931
|
}
|
|
46804
|
-
|
|
46932
|
+
logger6.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
46805
46933
|
});
|
|
46806
46934
|
tx.to = this.resolvedAddress;
|
|
46807
46935
|
return this.deployed().then(() => {
|
|
@@ -46894,7 +47022,7 @@ class BaseContract {
|
|
|
46894
47022
|
}
|
|
46895
47023
|
_addEventListener(runningEvent, listener, once3) {
|
|
46896
47024
|
if (!this.provider) {
|
|
46897
|
-
|
|
47025
|
+
logger6.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
46898
47026
|
}
|
|
46899
47027
|
runningEvent.addListener(listener, once3);
|
|
46900
47028
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
|
@@ -46925,9 +47053,9 @@ class BaseContract {
|
|
|
46925
47053
|
queryFilter(event, fromBlockOrBlockhash, toBlock) {
|
|
46926
47054
|
const runningEvent = this._getRunningEvent(event);
|
|
46927
47055
|
const filter = import_properties3.shallowCopy(runningEvent.filter);
|
|
46928
|
-
if (typeof fromBlockOrBlockhash === "string" &&
|
|
47056
|
+
if (typeof fromBlockOrBlockhash === "string" && import_bytes4.isHexString(fromBlockOrBlockhash, 32)) {
|
|
46929
47057
|
if (toBlock != null) {
|
|
46930
|
-
|
|
47058
|
+
logger6.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
|
|
46931
47059
|
}
|
|
46932
47060
|
filter.blockHash = fromBlockOrBlockhash;
|
|
46933
47061
|
} else {
|
|
@@ -47020,8 +47148,8 @@ class ContractFactory {
|
|
|
47020
47148
|
let bytecodeHex = null;
|
|
47021
47149
|
if (typeof bytecode === "string") {
|
|
47022
47150
|
bytecodeHex = bytecode;
|
|
47023
|
-
} else if (
|
|
47024
|
-
bytecodeHex =
|
|
47151
|
+
} else if (import_bytes4.isBytes(bytecode)) {
|
|
47152
|
+
bytecodeHex = import_bytes4.hexlify(bytecode);
|
|
47025
47153
|
} else if (bytecode && typeof bytecode.object === "string") {
|
|
47026
47154
|
bytecodeHex = bytecode.object;
|
|
47027
47155
|
} else {
|
|
@@ -47030,11 +47158,11 @@ class ContractFactory {
|
|
|
47030
47158
|
if (bytecodeHex.substring(0, 2) !== "0x") {
|
|
47031
47159
|
bytecodeHex = "0x" + bytecodeHex;
|
|
47032
47160
|
}
|
|
47033
|
-
if (!
|
|
47034
|
-
|
|
47161
|
+
if (!import_bytes4.isHexString(bytecodeHex) || bytecodeHex.length % 2) {
|
|
47162
|
+
logger6.throwArgumentError("invalid bytecode", "bytecode", bytecode);
|
|
47035
47163
|
}
|
|
47036
47164
|
if (signer && !Signer.isSigner(signer)) {
|
|
47037
|
-
|
|
47165
|
+
logger6.throwArgumentError("invalid signer", "signer", signer);
|
|
47038
47166
|
}
|
|
47039
47167
|
import_properties3.defineReadOnly(this, "bytecode", bytecodeHex);
|
|
47040
47168
|
import_properties3.defineReadOnly(this, "interface", import_properties3.getStatic(new.target, "getInterface")(contractInterface));
|
|
@@ -47054,19 +47182,19 @@ class ContractFactory {
|
|
|
47054
47182
|
if (tx[key] == null) {
|
|
47055
47183
|
return;
|
|
47056
47184
|
}
|
|
47057
|
-
|
|
47185
|
+
logger6.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
47058
47186
|
});
|
|
47059
47187
|
if (tx.value) {
|
|
47060
47188
|
const value = BigNumber.from(tx.value);
|
|
47061
47189
|
if (!value.isZero() && !this.interface.deploy.payable) {
|
|
47062
|
-
|
|
47190
|
+
logger6.throwError("non-payable constructor cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47063
47191
|
operation: "overrides.value",
|
|
47064
47192
|
value: tx.value
|
|
47065
47193
|
});
|
|
47066
47194
|
}
|
|
47067
47195
|
}
|
|
47068
|
-
|
|
47069
|
-
tx.data =
|
|
47196
|
+
logger6.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47197
|
+
tx.data = import_bytes4.hexlify(import_bytes4.concat([
|
|
47070
47198
|
this.bytecode,
|
|
47071
47199
|
this.interface.encodeDeploy(args)
|
|
47072
47200
|
]));
|
|
@@ -47078,7 +47206,7 @@ class ContractFactory {
|
|
|
47078
47206
|
if (args.length === this.interface.deploy.inputs.length + 1) {
|
|
47079
47207
|
overrides = args.pop();
|
|
47080
47208
|
}
|
|
47081
|
-
|
|
47209
|
+
logger6.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47082
47210
|
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
|
47083
47211
|
params.push(overrides);
|
|
47084
47212
|
const unsignedTx = this.getDeployTransaction(...params);
|
|
@@ -47098,7 +47226,7 @@ class ContractFactory {
|
|
|
47098
47226
|
}
|
|
47099
47227
|
static fromSolidity(compilerOutput, signer) {
|
|
47100
47228
|
if (compilerOutput == null) {
|
|
47101
|
-
|
|
47229
|
+
logger6.throwError("missing compiler output", Logger.errors.MISSING_ARGUMENT, { argument: "compilerOutput" });
|
|
47102
47230
|
}
|
|
47103
47231
|
if (typeof compilerOutput === "string") {
|
|
47104
47232
|
compilerOutput = JSON.parse(compilerOutput);
|
|
@@ -47116,7 +47244,7 @@ class ContractFactory {
|
|
|
47116
47244
|
return Contract.getInterface(contractInterface);
|
|
47117
47245
|
}
|
|
47118
47246
|
static getContractAddress(tx) {
|
|
47119
|
-
return
|
|
47247
|
+
return getContractAddress(tx);
|
|
47120
47248
|
}
|
|
47121
47249
|
static getContract(address, contractInterface, signer) {
|
|
47122
47250
|
return new Contract(address, contractInterface, signer);
|
|
@@ -47124,11 +47252,10 @@ class ContractFactory {
|
|
|
47124
47252
|
}
|
|
47125
47253
|
|
|
47126
47254
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47127
|
-
var
|
|
47128
|
-
var import_bytes4 = __toESM(require_lib2());
|
|
47255
|
+
var import_bytes5 = __toESM(require_lib2());
|
|
47129
47256
|
var import_hash = __toESM(require_lib12());
|
|
47130
47257
|
var import_hdnode = __toESM(require_lib20());
|
|
47131
|
-
var
|
|
47258
|
+
var import_keccak2562 = __toESM(require_lib5());
|
|
47132
47259
|
var import_properties4 = __toESM(require_lib4());
|
|
47133
47260
|
var import_random = __toESM(require_lib21());
|
|
47134
47261
|
var import_signing_key = __toESM(require_lib14());
|
|
@@ -47136,7 +47263,7 @@ var import_json_wallets = __toESM(require_lib22());
|
|
|
47136
47263
|
var import_transactions2 = __toESM(require_lib15());
|
|
47137
47264
|
|
|
47138
47265
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
47139
|
-
var
|
|
47266
|
+
var version9 = "wallet/5.7.0";
|
|
47140
47267
|
|
|
47141
47268
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47142
47269
|
var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
@@ -47166,9 +47293,9 @@ var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
|
47166
47293
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47167
47294
|
});
|
|
47168
47295
|
};
|
|
47169
|
-
var
|
|
47296
|
+
var logger7 = new Logger(version9);
|
|
47170
47297
|
function isAccount(value) {
|
|
47171
|
-
return value != null &&
|
|
47298
|
+
return value != null && import_bytes5.isHexString(value.privateKey, 32) && value.address != null;
|
|
47172
47299
|
}
|
|
47173
47300
|
function hasMnemonic(value) {
|
|
47174
47301
|
const mnemonic = value.mnemonic;
|
|
@@ -47182,8 +47309,8 @@ class Wallet extends Signer {
|
|
|
47182
47309
|
const signingKey = new import_signing_key.SigningKey(privateKey.privateKey);
|
|
47183
47310
|
import_properties4.defineReadOnly(this, "_signingKey", () => signingKey);
|
|
47184
47311
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47185
|
-
if (this.address !==
|
|
47186
|
-
|
|
47312
|
+
if (this.address !== getAddress(privateKey.address)) {
|
|
47313
|
+
logger7.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
47187
47314
|
}
|
|
47188
47315
|
if (hasMnemonic(privateKey)) {
|
|
47189
47316
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -47195,7 +47322,7 @@ class Wallet extends Signer {
|
|
|
47195
47322
|
const mnemonic = this.mnemonic;
|
|
47196
47323
|
const node = import_hdnode.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
47197
47324
|
if (import_transactions2.computeAddress(node.privateKey) !== this.address) {
|
|
47198
|
-
|
|
47325
|
+
logger7.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
47199
47326
|
}
|
|
47200
47327
|
} else {
|
|
47201
47328
|
import_properties4.defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -47203,7 +47330,7 @@ class Wallet extends Signer {
|
|
|
47203
47330
|
} else {
|
|
47204
47331
|
if (import_signing_key.SigningKey.isSigningKey(privateKey)) {
|
|
47205
47332
|
if (privateKey.curve !== "secp256k1") {
|
|
47206
|
-
|
|
47333
|
+
logger7.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
47207
47334
|
}
|
|
47208
47335
|
import_properties4.defineReadOnly(this, "_signingKey", () => privateKey);
|
|
47209
47336
|
} else {
|
|
@@ -47219,7 +47346,7 @@ class Wallet extends Signer {
|
|
|
47219
47346
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47220
47347
|
}
|
|
47221
47348
|
if (provider && !Provider.isProvider(provider)) {
|
|
47222
|
-
|
|
47349
|
+
logger7.throwArgumentError("invalid provider", "provider", provider);
|
|
47223
47350
|
}
|
|
47224
47351
|
import_properties4.defineReadOnly(this, "provider", provider || null);
|
|
47225
47352
|
}
|
|
@@ -47241,32 +47368,32 @@ class Wallet extends Signer {
|
|
|
47241
47368
|
signTransaction(transaction) {
|
|
47242
47369
|
return import_properties4.resolveProperties(transaction).then((tx) => {
|
|
47243
47370
|
if (tx.from != null) {
|
|
47244
|
-
if (
|
|
47245
|
-
|
|
47371
|
+
if (getAddress(tx.from) !== this.address) {
|
|
47372
|
+
logger7.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
47246
47373
|
}
|
|
47247
47374
|
delete tx.from;
|
|
47248
47375
|
}
|
|
47249
|
-
const signature = this._signingKey().signDigest(
|
|
47376
|
+
const signature = this._signingKey().signDigest(import_keccak2562.keccak256(import_transactions2.serialize(tx)));
|
|
47250
47377
|
return import_transactions2.serialize(tx, signature);
|
|
47251
47378
|
});
|
|
47252
47379
|
}
|
|
47253
47380
|
signMessage(message) {
|
|
47254
47381
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47255
|
-
return
|
|
47382
|
+
return import_bytes5.joinSignature(this._signingKey().signDigest(import_hash.hashMessage(message)));
|
|
47256
47383
|
});
|
|
47257
47384
|
}
|
|
47258
47385
|
_signTypedData(domain, types2, value) {
|
|
47259
47386
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47260
47387
|
const populated = yield import_hash._TypedDataEncoder.resolveNames(domain, types2, value, (name) => {
|
|
47261
47388
|
if (this.provider == null) {
|
|
47262
|
-
|
|
47389
|
+
logger7.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47263
47390
|
operation: "resolveName",
|
|
47264
47391
|
value: name
|
|
47265
47392
|
});
|
|
47266
47393
|
}
|
|
47267
47394
|
return this.provider.resolveName(name);
|
|
47268
47395
|
});
|
|
47269
|
-
return
|
|
47396
|
+
return import_bytes5.joinSignature(this._signingKey().signDigest(import_hash._TypedDataEncoder.hash(populated.domain, types2, populated.value)));
|
|
47270
47397
|
});
|
|
47271
47398
|
}
|
|
47272
47399
|
encrypt(password, options, progressCallback) {
|
|
@@ -47288,7 +47415,7 @@ class Wallet extends Signer {
|
|
|
47288
47415
|
options = {};
|
|
47289
47416
|
}
|
|
47290
47417
|
if (options.extraEntropy) {
|
|
47291
|
-
entropy =
|
|
47418
|
+
entropy = import_bytes5.arrayify(import_bytes5.hexDataSlice(import_keccak2562.keccak256(import_bytes5.concat([entropy, options.extraEntropy])), 0, 16));
|
|
47292
47419
|
}
|
|
47293
47420
|
const mnemonic = import_hdnode.entropyToMnemonic(entropy, options.locale);
|
|
47294
47421
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -47379,10 +47506,10 @@ __export(exports_lib2, {
|
|
|
47379
47506
|
});
|
|
47380
47507
|
|
|
47381
47508
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
47382
|
-
var
|
|
47509
|
+
var version10 = "networks/5.7.1";
|
|
47383
47510
|
|
|
47384
47511
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
47385
|
-
var
|
|
47512
|
+
var logger8 = new Logger(version10);
|
|
47386
47513
|
function isRenetworkable(value) {
|
|
47387
47514
|
return value && typeof value.renetwork === "function";
|
|
47388
47515
|
}
|
|
@@ -47577,12 +47704,12 @@ function getNetwork(network) {
|
|
|
47577
47704
|
const standard = networks[network.name];
|
|
47578
47705
|
if (!standard) {
|
|
47579
47706
|
if (typeof network.chainId !== "number") {
|
|
47580
|
-
|
|
47707
|
+
logger8.throwArgumentError("invalid network chainId", "network", network);
|
|
47581
47708
|
}
|
|
47582
47709
|
return network;
|
|
47583
47710
|
}
|
|
47584
47711
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
47585
|
-
|
|
47712
|
+
logger8.throwArgumentError("network chainId mismatch", "network", network);
|
|
47586
47713
|
}
|
|
47587
47714
|
let defaultProvider = network._defaultProvider || null;
|
|
47588
47715
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -47603,7 +47730,7 @@ function getNetwork(network) {
|
|
|
47603
47730
|
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
47604
47731
|
var import_base64 = __toESM(require_lib10());
|
|
47605
47732
|
var import_basex = __toESM(require_lib16());
|
|
47606
|
-
var
|
|
47733
|
+
var import_bytes7 = __toESM(require_lib2());
|
|
47607
47734
|
var import_hash2 = __toESM(require_lib12());
|
|
47608
47735
|
var import_properties6 = __toESM(require_lib4());
|
|
47609
47736
|
var import_sha2 = __toESM(require_lib17());
|
|
@@ -47612,14 +47739,13 @@ var import_web = __toESM(require_lib23());
|
|
|
47612
47739
|
var import_bech32 = __toESM(require_bech32());
|
|
47613
47740
|
|
|
47614
47741
|
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
47615
|
-
var
|
|
47742
|
+
var version11 = "providers/5.7.2";
|
|
47616
47743
|
|
|
47617
47744
|
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
47618
|
-
var
|
|
47619
|
-
var import_bytes5 = __toESM(require_lib2());
|
|
47745
|
+
var import_bytes6 = __toESM(require_lib2());
|
|
47620
47746
|
var import_properties5 = __toESM(require_lib4());
|
|
47621
47747
|
var import_transactions3 = __toESM(require_lib15());
|
|
47622
|
-
var
|
|
47748
|
+
var logger9 = new Logger(version11);
|
|
47623
47749
|
|
|
47624
47750
|
class Formatter {
|
|
47625
47751
|
constructor() {
|
|
@@ -47776,11 +47902,11 @@ class Formatter {
|
|
|
47776
47902
|
if (!strict && value.substring(0, 2) !== "0x") {
|
|
47777
47903
|
value = "0x" + value;
|
|
47778
47904
|
}
|
|
47779
|
-
if (
|
|
47905
|
+
if (import_bytes6.isHexString(value)) {
|
|
47780
47906
|
return value.toLowerCase();
|
|
47781
47907
|
}
|
|
47782
47908
|
}
|
|
47783
|
-
return
|
|
47909
|
+
return logger9.throwArgumentError("invalid hash", "value", value);
|
|
47784
47910
|
}
|
|
47785
47911
|
data(value, strict) {
|
|
47786
47912
|
const result = this.hex(value, strict);
|
|
@@ -47790,17 +47916,17 @@ class Formatter {
|
|
|
47790
47916
|
return result;
|
|
47791
47917
|
}
|
|
47792
47918
|
address(value) {
|
|
47793
|
-
return
|
|
47919
|
+
return getAddress(value);
|
|
47794
47920
|
}
|
|
47795
47921
|
callAddress(value) {
|
|
47796
|
-
if (!
|
|
47922
|
+
if (!import_bytes6.isHexString(value, 32)) {
|
|
47797
47923
|
return null;
|
|
47798
47924
|
}
|
|
47799
|
-
const address =
|
|
47925
|
+
const address = getAddress(import_bytes6.hexDataSlice(value, 12));
|
|
47800
47926
|
return address === AddressZero ? null : address;
|
|
47801
47927
|
}
|
|
47802
47928
|
contractAddress(value) {
|
|
47803
|
-
return
|
|
47929
|
+
return getContractAddress(value);
|
|
47804
47930
|
}
|
|
47805
47931
|
blockTag(blockTag) {
|
|
47806
47932
|
if (blockTag == null) {
|
|
@@ -47818,15 +47944,15 @@ class Formatter {
|
|
|
47818
47944
|
case "finalized":
|
|
47819
47945
|
return blockTag;
|
|
47820
47946
|
}
|
|
47821
|
-
if (typeof blockTag === "number" ||
|
|
47822
|
-
return
|
|
47947
|
+
if (typeof blockTag === "number" || import_bytes6.isHexString(blockTag)) {
|
|
47948
|
+
return import_bytes6.hexValue(blockTag);
|
|
47823
47949
|
}
|
|
47824
47950
|
throw new Error("invalid blockTag");
|
|
47825
47951
|
}
|
|
47826
47952
|
hash(value, strict) {
|
|
47827
47953
|
const result = this.hex(value, strict);
|
|
47828
|
-
if (
|
|
47829
|
-
return
|
|
47954
|
+
if (import_bytes6.hexDataLength(result) !== 32) {
|
|
47955
|
+
return logger9.throwArgumentError("invalid hash", "value", value);
|
|
47830
47956
|
}
|
|
47831
47957
|
return result;
|
|
47832
47958
|
}
|
|
@@ -47841,10 +47967,10 @@ class Formatter {
|
|
|
47841
47967
|
return null;
|
|
47842
47968
|
}
|
|
47843
47969
|
uint256(value) {
|
|
47844
|
-
if (!
|
|
47970
|
+
if (!import_bytes6.isHexString(value)) {
|
|
47845
47971
|
throw new Error("invalid uint256");
|
|
47846
47972
|
}
|
|
47847
|
-
return
|
|
47973
|
+
return import_bytes6.hexZeroPad(value, 32);
|
|
47848
47974
|
}
|
|
47849
47975
|
_block(value, format2) {
|
|
47850
47976
|
if (value.author != null && value.miner == null) {
|
|
@@ -47883,7 +48009,7 @@ class Formatter {
|
|
|
47883
48009
|
const result = Formatter.check(this.formats.transaction, transaction);
|
|
47884
48010
|
if (transaction.chainId != null) {
|
|
47885
48011
|
let chainId = transaction.chainId;
|
|
47886
|
-
if (
|
|
48012
|
+
if (import_bytes6.isHexString(chainId)) {
|
|
47887
48013
|
chainId = BigNumber.from(chainId).toNumber();
|
|
47888
48014
|
}
|
|
47889
48015
|
result.chainId = chainId;
|
|
@@ -47892,7 +48018,7 @@ class Formatter {
|
|
|
47892
48018
|
if (chainId == null && result.v == null) {
|
|
47893
48019
|
chainId = transaction.chainId;
|
|
47894
48020
|
}
|
|
47895
|
-
if (
|
|
48021
|
+
if (import_bytes6.isHexString(chainId)) {
|
|
47896
48022
|
chainId = BigNumber.from(chainId).toNumber();
|
|
47897
48023
|
}
|
|
47898
48024
|
if (typeof chainId !== "number" && result.v != null) {
|
|
@@ -47925,15 +48051,15 @@ class Formatter {
|
|
|
47925
48051
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
47926
48052
|
if (value2 === 0 || value2 === 1) {
|
|
47927
48053
|
if (result.status != null && result.status !== value2) {
|
|
47928
|
-
|
|
48054
|
+
logger9.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
47929
48055
|
}
|
|
47930
48056
|
result.status = value2;
|
|
47931
48057
|
delete result.root;
|
|
47932
48058
|
} else {
|
|
47933
|
-
|
|
48059
|
+
logger9.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
47934
48060
|
}
|
|
47935
48061
|
} else if (result.root.length !== 66) {
|
|
47936
|
-
|
|
48062
|
+
logger9.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
47937
48063
|
}
|
|
47938
48064
|
}
|
|
47939
48065
|
if (result.status != null) {
|
|
@@ -48054,14 +48180,14 @@ var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
|
48054
48180
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48055
48181
|
});
|
|
48056
48182
|
};
|
|
48057
|
-
var
|
|
48183
|
+
var logger10 = new Logger(version11);
|
|
48058
48184
|
var MAX_CCIP_REDIRECTS = 10;
|
|
48059
48185
|
function checkTopic(topic) {
|
|
48060
48186
|
if (topic == null) {
|
|
48061
48187
|
return "null";
|
|
48062
48188
|
}
|
|
48063
|
-
if (
|
|
48064
|
-
|
|
48189
|
+
if (import_bytes7.hexDataLength(topic) !== 32) {
|
|
48190
|
+
logger10.throwArgumentError("invalid topic", "topic", topic);
|
|
48065
48191
|
}
|
|
48066
48192
|
return topic.toLowerCase();
|
|
48067
48193
|
}
|
|
@@ -48101,7 +48227,7 @@ function deserializeTopics(data) {
|
|
|
48101
48227
|
function getEventTag2(eventName) {
|
|
48102
48228
|
if (typeof eventName === "string") {
|
|
48103
48229
|
eventName = eventName.toLowerCase();
|
|
48104
|
-
if (
|
|
48230
|
+
if (import_bytes7.hexDataLength(eventName) === 32) {
|
|
48105
48231
|
return "tx:" + eventName;
|
|
48106
48232
|
}
|
|
48107
48233
|
if (eventName.indexOf(":") === -1) {
|
|
@@ -48110,7 +48236,7 @@ function getEventTag2(eventName) {
|
|
|
48110
48236
|
} else if (Array.isArray(eventName)) {
|
|
48111
48237
|
return "filter:*:" + serializeTopics(eventName);
|
|
48112
48238
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
48113
|
-
|
|
48239
|
+
logger10.warn("not implemented");
|
|
48114
48240
|
throw new Error("not implemented");
|
|
48115
48241
|
} else if (eventName && typeof eventName === "object") {
|
|
48116
48242
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -48183,10 +48309,10 @@ var coinInfos = {
|
|
|
48183
48309
|
"700": { symbol: "xdai", ilk: "eth" }
|
|
48184
48310
|
};
|
|
48185
48311
|
function bytes32ify(value) {
|
|
48186
|
-
return
|
|
48312
|
+
return import_bytes7.hexZeroPad(BigNumber.from(value).toHexString(), 32);
|
|
48187
48313
|
}
|
|
48188
48314
|
function base58Encode(data) {
|
|
48189
|
-
return import_basex.Base58.encode(
|
|
48315
|
+
return import_basex.Base58.encode(import_bytes7.concat([data, import_bytes7.hexDataSlice(import_sha2.sha256(import_sha2.sha256(data)), 0, 4)]));
|
|
48190
48316
|
}
|
|
48191
48317
|
var matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
|
|
48192
48318
|
var matchers = [
|
|
@@ -48205,9 +48331,9 @@ function _parseBytes(result, start) {
|
|
|
48205
48331
|
if (result === "0x") {
|
|
48206
48332
|
return null;
|
|
48207
48333
|
}
|
|
48208
|
-
const offset = BigNumber.from(
|
|
48209
|
-
const length = BigNumber.from(
|
|
48210
|
-
return
|
|
48334
|
+
const offset = BigNumber.from(import_bytes7.hexDataSlice(result, start, start + 32)).toNumber();
|
|
48335
|
+
const length = BigNumber.from(import_bytes7.hexDataSlice(result, offset, offset + 32)).toNumber();
|
|
48336
|
+
return import_bytes7.hexDataSlice(result, offset + 32, offset + 32 + length);
|
|
48211
48337
|
}
|
|
48212
48338
|
function getIpfsLink(link) {
|
|
48213
48339
|
if (link.match(/^ipfs:\/\/ipfs\//i)) {
|
|
@@ -48215,12 +48341,12 @@ function getIpfsLink(link) {
|
|
|
48215
48341
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
48216
48342
|
link = link.substring(7);
|
|
48217
48343
|
} else {
|
|
48218
|
-
|
|
48344
|
+
logger10.throwArgumentError("unsupported IPFS format", "link", link);
|
|
48219
48345
|
}
|
|
48220
48346
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
48221
48347
|
}
|
|
48222
48348
|
function numPad(value) {
|
|
48223
|
-
const result =
|
|
48349
|
+
const result = import_bytes7.arrayify(value);
|
|
48224
48350
|
if (result.length > 32) {
|
|
48225
48351
|
throw new Error("internal; should not happen");
|
|
48226
48352
|
}
|
|
@@ -48244,13 +48370,13 @@ function encodeBytes(datas) {
|
|
|
48244
48370
|
byteCount += 32;
|
|
48245
48371
|
}
|
|
48246
48372
|
for (let i2 = 0;i2 < datas.length; i2++) {
|
|
48247
|
-
const data =
|
|
48373
|
+
const data = import_bytes7.arrayify(datas[i2]);
|
|
48248
48374
|
result[i2] = numPad(byteCount);
|
|
48249
48375
|
result.push(numPad(data.length));
|
|
48250
48376
|
result.push(bytesPad(data));
|
|
48251
48377
|
byteCount += 32 + Math.ceil(data.length / 32) * 32;
|
|
48252
48378
|
}
|
|
48253
|
-
return
|
|
48379
|
+
return import_bytes7.hexConcat(result);
|
|
48254
48380
|
}
|
|
48255
48381
|
|
|
48256
48382
|
class Resolver {
|
|
@@ -48282,17 +48408,17 @@ class Resolver {
|
|
|
48282
48408
|
const tx = {
|
|
48283
48409
|
to: this.address,
|
|
48284
48410
|
ccipReadEnabled: true,
|
|
48285
|
-
data:
|
|
48411
|
+
data: import_bytes7.hexConcat([selector, import_hash2.namehash(this.name), parameters || "0x"])
|
|
48286
48412
|
};
|
|
48287
48413
|
let parseBytes = false;
|
|
48288
48414
|
if (yield this.supportsWildcard()) {
|
|
48289
48415
|
parseBytes = true;
|
|
48290
|
-
tx.data =
|
|
48416
|
+
tx.data = import_bytes7.hexConcat(["0x9061b923", encodeBytes([import_hash2.dnsEncode(this.name), tx.data])]);
|
|
48291
48417
|
}
|
|
48292
48418
|
try {
|
|
48293
48419
|
let result = yield this.provider.call(tx);
|
|
48294
|
-
if (
|
|
48295
|
-
|
|
48420
|
+
if (import_bytes7.arrayify(result).length % 32 === 4) {
|
|
48421
|
+
logger10.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
48296
48422
|
transaction: tx,
|
|
48297
48423
|
data: result
|
|
48298
48424
|
});
|
|
@@ -48321,20 +48447,20 @@ class Resolver {
|
|
|
48321
48447
|
_getAddress(coinType, hexBytes) {
|
|
48322
48448
|
const coinInfo = coinInfos[String(coinType)];
|
|
48323
48449
|
if (coinInfo == null) {
|
|
48324
|
-
|
|
48450
|
+
logger10.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48325
48451
|
operation: `getAddress(${coinType})`
|
|
48326
48452
|
});
|
|
48327
48453
|
}
|
|
48328
48454
|
if (coinInfo.ilk === "eth") {
|
|
48329
48455
|
return this.provider.formatter.address(hexBytes);
|
|
48330
48456
|
}
|
|
48331
|
-
const bytes =
|
|
48457
|
+
const bytes = import_bytes7.arrayify(hexBytes);
|
|
48332
48458
|
if (coinInfo.p2pkh != null) {
|
|
48333
48459
|
const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);
|
|
48334
48460
|
if (p2pkh) {
|
|
48335
48461
|
const length = parseInt(p2pkh[1], 16);
|
|
48336
48462
|
if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48337
|
-
return base58Encode(
|
|
48463
|
+
return base58Encode(import_bytes7.concat([[coinInfo.p2pkh], "0x" + p2pkh[2]]));
|
|
48338
48464
|
}
|
|
48339
48465
|
}
|
|
48340
48466
|
}
|
|
@@ -48343,23 +48469,23 @@ class Resolver {
|
|
|
48343
48469
|
if (p2sh) {
|
|
48344
48470
|
const length = parseInt(p2sh[1], 16);
|
|
48345
48471
|
if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48346
|
-
return base58Encode(
|
|
48472
|
+
return base58Encode(import_bytes7.concat([[coinInfo.p2sh], "0x" + p2sh[2]]));
|
|
48347
48473
|
}
|
|
48348
48474
|
}
|
|
48349
48475
|
}
|
|
48350
48476
|
if (coinInfo.prefix != null) {
|
|
48351
48477
|
const length = bytes[1];
|
|
48352
|
-
let
|
|
48353
|
-
if (
|
|
48478
|
+
let version12 = bytes[0];
|
|
48479
|
+
if (version12 === 0) {
|
|
48354
48480
|
if (length !== 20 && length !== 32) {
|
|
48355
|
-
|
|
48481
|
+
version12 = -1;
|
|
48356
48482
|
}
|
|
48357
48483
|
} else {
|
|
48358
|
-
|
|
48484
|
+
version12 = -1;
|
|
48359
48485
|
}
|
|
48360
|
-
if (
|
|
48486
|
+
if (version12 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
48361
48487
|
const words = import_bech32.default.toWords(bytes.slice(2));
|
|
48362
|
-
words.unshift(
|
|
48488
|
+
words.unshift(version12);
|
|
48363
48489
|
return import_bech32.default.encode(coinInfo.prefix, words);
|
|
48364
48490
|
}
|
|
48365
48491
|
}
|
|
@@ -48390,7 +48516,7 @@ class Resolver {
|
|
|
48390
48516
|
}
|
|
48391
48517
|
const address = this._getAddress(coinType, hexBytes);
|
|
48392
48518
|
if (address == null) {
|
|
48393
|
-
|
|
48519
|
+
logger10.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48394
48520
|
operation: `getAddress(${coinType})`,
|
|
48395
48521
|
coinType,
|
|
48396
48522
|
data: hexBytes
|
|
@@ -48433,11 +48559,11 @@ class Resolver {
|
|
|
48433
48559
|
return null;
|
|
48434
48560
|
}
|
|
48435
48561
|
const addr = yield this.provider.formatter.address(comps[0]);
|
|
48436
|
-
const tokenId =
|
|
48562
|
+
const tokenId = import_bytes7.hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);
|
|
48437
48563
|
if (scheme === "erc721") {
|
|
48438
48564
|
const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({
|
|
48439
48565
|
to: addr,
|
|
48440
|
-
data:
|
|
48566
|
+
data: import_bytes7.hexConcat(["0x6352211e", tokenId])
|
|
48441
48567
|
}));
|
|
48442
48568
|
if (owner !== tokenOwner) {
|
|
48443
48569
|
return null;
|
|
@@ -48446,7 +48572,7 @@ class Resolver {
|
|
|
48446
48572
|
} else if (scheme === "erc1155") {
|
|
48447
48573
|
const balance = BigNumber.from(yield this.provider.call({
|
|
48448
48574
|
to: addr,
|
|
48449
|
-
data:
|
|
48575
|
+
data: import_bytes7.hexConcat(["0x00fdd58e", import_bytes7.hexZeroPad(owner, 32), tokenId])
|
|
48450
48576
|
}));
|
|
48451
48577
|
if (balance.isZero()) {
|
|
48452
48578
|
return null;
|
|
@@ -48455,7 +48581,7 @@ class Resolver {
|
|
|
48455
48581
|
}
|
|
48456
48582
|
const tx = {
|
|
48457
48583
|
to: this.provider.formatter.address(comps[0]),
|
|
48458
|
-
data:
|
|
48584
|
+
data: import_bytes7.hexConcat([selector, tokenId])
|
|
48459
48585
|
};
|
|
48460
48586
|
let metadataUrl = _parseString(yield this.provider.call(tx), 0);
|
|
48461
48587
|
if (metadataUrl == null) {
|
|
@@ -48530,7 +48656,7 @@ class Resolver {
|
|
|
48530
48656
|
return "sia://" + hash;
|
|
48531
48657
|
}
|
|
48532
48658
|
}
|
|
48533
|
-
return
|
|
48659
|
+
return logger10.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48534
48660
|
operation: "getContentHash()",
|
|
48535
48661
|
data: hexBytes
|
|
48536
48662
|
});
|
|
@@ -48539,11 +48665,11 @@ class Resolver {
|
|
|
48539
48665
|
getText(key) {
|
|
48540
48666
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48541
48667
|
let keyBytes = import_strings2.toUtf8Bytes(key);
|
|
48542
|
-
keyBytes =
|
|
48668
|
+
keyBytes = import_bytes7.concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
48543
48669
|
if (keyBytes.length % 32 !== 0) {
|
|
48544
|
-
keyBytes =
|
|
48670
|
+
keyBytes = import_bytes7.concat([keyBytes, import_bytes7.hexZeroPad("0x", 32 - key.length % 32)]);
|
|
48545
48671
|
}
|
|
48546
|
-
const hexBytes = yield this._fetchBytes("0x59d1d43c",
|
|
48672
|
+
const hexBytes = yield this._fetchBytes("0x59d1d43c", import_bytes7.hexlify(keyBytes));
|
|
48547
48673
|
if (hexBytes == null || hexBytes === "0x") {
|
|
48548
48674
|
return null;
|
|
48549
48675
|
}
|
|
@@ -48575,7 +48701,7 @@ class BaseProvider extends Provider {
|
|
|
48575
48701
|
import_properties6.defineReadOnly(this, "_network", knownNetwork);
|
|
48576
48702
|
this.emit("network", knownNetwork, null);
|
|
48577
48703
|
} else {
|
|
48578
|
-
|
|
48704
|
+
logger10.throwArgumentError("invalid network", "network", network);
|
|
48579
48705
|
}
|
|
48580
48706
|
}
|
|
48581
48707
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -48597,7 +48723,7 @@ class BaseProvider extends Provider {
|
|
|
48597
48723
|
network = yield this.detectNetwork();
|
|
48598
48724
|
}
|
|
48599
48725
|
if (!network) {
|
|
48600
|
-
|
|
48726
|
+
logger10.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
48601
48727
|
}
|
|
48602
48728
|
if (this._network == null) {
|
|
48603
48729
|
if (this.anyNetwork) {
|
|
@@ -48653,11 +48779,11 @@ class BaseProvider extends Provider {
|
|
|
48653
48779
|
}
|
|
48654
48780
|
const errorMessage = result.message || "unknown error";
|
|
48655
48781
|
if (result.status >= 400 && result.status < 500) {
|
|
48656
|
-
return
|
|
48782
|
+
return logger10.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
48657
48783
|
}
|
|
48658
48784
|
errorMessages.push(errorMessage);
|
|
48659
48785
|
}
|
|
48660
|
-
return
|
|
48786
|
+
return logger10.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
48661
48787
|
urls,
|
|
48662
48788
|
errorMessages
|
|
48663
48789
|
});
|
|
@@ -48732,8 +48858,8 @@ class BaseProvider extends Provider {
|
|
|
48732
48858
|
this._emitted.block = blockNumber - 1;
|
|
48733
48859
|
}
|
|
48734
48860
|
if (Math.abs(this._emitted.block - blockNumber) > 1000) {
|
|
48735
|
-
|
|
48736
|
-
this.emit("error",
|
|
48861
|
+
logger10.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
48862
|
+
this.emit("error", logger10.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
48737
48863
|
blockNumber,
|
|
48738
48864
|
event: "blockSkew",
|
|
48739
48865
|
previousBlockNumber: this._emitted.block
|
|
@@ -48838,7 +48964,7 @@ class BaseProvider extends Provider {
|
|
|
48838
48964
|
}
|
|
48839
48965
|
detectNetwork() {
|
|
48840
48966
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48841
|
-
return
|
|
48967
|
+
return logger10.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48842
48968
|
operation: "provider.detectNetwork"
|
|
48843
48969
|
});
|
|
48844
48970
|
});
|
|
@@ -48861,7 +48987,7 @@ class BaseProvider extends Provider {
|
|
|
48861
48987
|
yield stall(0);
|
|
48862
48988
|
return this._network;
|
|
48863
48989
|
}
|
|
48864
|
-
const error =
|
|
48990
|
+
const error = logger10.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
48865
48991
|
event: "changed",
|
|
48866
48992
|
network,
|
|
48867
48993
|
detectedNetwork: currentNetwork
|
|
@@ -49028,7 +49154,7 @@ class BaseProvider extends Provider {
|
|
|
49028
49154
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
49029
49155
|
reason = "cancelled";
|
|
49030
49156
|
}
|
|
49031
|
-
reject(
|
|
49157
|
+
reject(logger10.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
49032
49158
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
49033
49159
|
reason,
|
|
49034
49160
|
replacement: this._wrapTransaction(tx),
|
|
@@ -49065,7 +49191,7 @@ class BaseProvider extends Provider {
|
|
|
49065
49191
|
if (alreadyDone()) {
|
|
49066
49192
|
return;
|
|
49067
49193
|
}
|
|
49068
|
-
reject(
|
|
49194
|
+
reject(logger10.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
49069
49195
|
}, timeout);
|
|
49070
49196
|
if (timer.unref) {
|
|
49071
49197
|
timer.unref();
|
|
@@ -49089,7 +49215,7 @@ class BaseProvider extends Provider {
|
|
|
49089
49215
|
try {
|
|
49090
49216
|
return BigNumber.from(result);
|
|
49091
49217
|
} catch (error) {
|
|
49092
|
-
return
|
|
49218
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49093
49219
|
method: "getGasPrice",
|
|
49094
49220
|
result,
|
|
49095
49221
|
error
|
|
@@ -49108,7 +49234,7 @@ class BaseProvider extends Provider {
|
|
|
49108
49234
|
try {
|
|
49109
49235
|
return BigNumber.from(result);
|
|
49110
49236
|
} catch (error) {
|
|
49111
|
-
return
|
|
49237
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49112
49238
|
method: "getBalance",
|
|
49113
49239
|
params,
|
|
49114
49240
|
result,
|
|
@@ -49128,7 +49254,7 @@ class BaseProvider extends Provider {
|
|
|
49128
49254
|
try {
|
|
49129
49255
|
return BigNumber.from(result).toNumber();
|
|
49130
49256
|
} catch (error) {
|
|
49131
|
-
return
|
|
49257
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49132
49258
|
method: "getTransactionCount",
|
|
49133
49259
|
params,
|
|
49134
49260
|
result,
|
|
@@ -49146,9 +49272,9 @@ class BaseProvider extends Provider {
|
|
|
49146
49272
|
});
|
|
49147
49273
|
const result = yield this.perform("getCode", params);
|
|
49148
49274
|
try {
|
|
49149
|
-
return
|
|
49275
|
+
return import_bytes7.hexlify(result);
|
|
49150
49276
|
} catch (error) {
|
|
49151
|
-
return
|
|
49277
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49152
49278
|
method: "getCode",
|
|
49153
49279
|
params,
|
|
49154
49280
|
result,
|
|
@@ -49163,13 +49289,13 @@ class BaseProvider extends Provider {
|
|
|
49163
49289
|
const params = yield import_properties6.resolveProperties({
|
|
49164
49290
|
address: this._getAddress(addressOrName),
|
|
49165
49291
|
blockTag: this._getBlockTag(blockTag),
|
|
49166
|
-
position: Promise.resolve(position).then((p) =>
|
|
49292
|
+
position: Promise.resolve(position).then((p) => import_bytes7.hexValue(p))
|
|
49167
49293
|
});
|
|
49168
49294
|
const result = yield this.perform("getStorageAt", params);
|
|
49169
49295
|
try {
|
|
49170
|
-
return
|
|
49296
|
+
return import_bytes7.hexlify(result);
|
|
49171
49297
|
} catch (error) {
|
|
49172
|
-
return
|
|
49298
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49173
49299
|
method: "getStorageAt",
|
|
49174
49300
|
params,
|
|
49175
49301
|
result,
|
|
@@ -49179,12 +49305,12 @@ class BaseProvider extends Provider {
|
|
|
49179
49305
|
});
|
|
49180
49306
|
}
|
|
49181
49307
|
_wrapTransaction(tx, hash, startBlock) {
|
|
49182
|
-
if (hash != null &&
|
|
49308
|
+
if (hash != null && import_bytes7.hexDataLength(hash) !== 32) {
|
|
49183
49309
|
throw new Error("invalid response - sendTransaction");
|
|
49184
49310
|
}
|
|
49185
49311
|
const result = tx;
|
|
49186
49312
|
if (hash != null && tx.hash !== hash) {
|
|
49187
|
-
|
|
49313
|
+
logger10.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
|
49188
49314
|
}
|
|
49189
49315
|
result.wait = (confirms, timeout) => __awaiter5(this, undefined, undefined, function* () {
|
|
49190
49316
|
if (confirms == null) {
|
|
@@ -49210,7 +49336,7 @@ class BaseProvider extends Provider {
|
|
|
49210
49336
|
}
|
|
49211
49337
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
49212
49338
|
if (receipt.status === 0) {
|
|
49213
|
-
|
|
49339
|
+
logger10.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
49214
49340
|
transactionHash: tx.hash,
|
|
49215
49341
|
transaction: tx,
|
|
49216
49342
|
receipt
|
|
@@ -49223,7 +49349,7 @@ class BaseProvider extends Provider {
|
|
|
49223
49349
|
sendTransaction(signedTransaction) {
|
|
49224
49350
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49225
49351
|
yield this.getNetwork();
|
|
49226
|
-
const hexTx = yield Promise.resolve(signedTransaction).then((t) =>
|
|
49352
|
+
const hexTx = yield Promise.resolve(signedTransaction).then((t) => import_bytes7.hexlify(t));
|
|
49227
49353
|
const tx = this.formatter.transaction(signedTransaction);
|
|
49228
49354
|
if (tx.confirmations == null) {
|
|
49229
49355
|
tx.confirmations = 0;
|
|
@@ -49268,7 +49394,7 @@ class BaseProvider extends Provider {
|
|
|
49268
49394
|
if (values[key] == null) {
|
|
49269
49395
|
return;
|
|
49270
49396
|
}
|
|
49271
|
-
tx[key] = Promise.resolve(values[key]).then((v) => v ?
|
|
49397
|
+
tx[key] = Promise.resolve(values[key]).then((v) => v ? import_bytes7.hexlify(v) : null);
|
|
49272
49398
|
});
|
|
49273
49399
|
return this.formatter.transactionRequest(yield import_properties6.resolveProperties(tx));
|
|
49274
49400
|
});
|
|
@@ -49298,19 +49424,19 @@ class BaseProvider extends Provider {
|
|
|
49298
49424
|
_call(transaction, blockTag, attempt) {
|
|
49299
49425
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49300
49426
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
49301
|
-
|
|
49427
|
+
logger10.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
49302
49428
|
redirects: attempt,
|
|
49303
49429
|
transaction
|
|
49304
49430
|
});
|
|
49305
49431
|
}
|
|
49306
49432
|
const txSender = transaction.to;
|
|
49307
49433
|
const result = yield this.perform("call", { transaction, blockTag });
|
|
49308
|
-
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" &&
|
|
49434
|
+
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" && import_bytes7.hexDataLength(result) % 32 === 4) {
|
|
49309
49435
|
try {
|
|
49310
|
-
const data =
|
|
49311
|
-
const sender =
|
|
49436
|
+
const data = import_bytes7.hexDataSlice(result, 4);
|
|
49437
|
+
const sender = import_bytes7.hexDataSlice(data, 0, 32);
|
|
49312
49438
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
49313
|
-
|
|
49439
|
+
logger10.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
49314
49440
|
name: "OffchainLookup",
|
|
49315
49441
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49316
49442
|
transaction,
|
|
@@ -49318,13 +49444,13 @@ class BaseProvider extends Provider {
|
|
|
49318
49444
|
});
|
|
49319
49445
|
}
|
|
49320
49446
|
const urls = [];
|
|
49321
|
-
const urlsOffset = BigNumber.from(
|
|
49322
|
-
const urlsLength = BigNumber.from(
|
|
49323
|
-
const urlsData =
|
|
49447
|
+
const urlsOffset = BigNumber.from(import_bytes7.hexDataSlice(data, 32, 64)).toNumber();
|
|
49448
|
+
const urlsLength = BigNumber.from(import_bytes7.hexDataSlice(data, urlsOffset, urlsOffset + 32)).toNumber();
|
|
49449
|
+
const urlsData = import_bytes7.hexDataSlice(data, urlsOffset + 32);
|
|
49324
49450
|
for (let u = 0;u < urlsLength; u++) {
|
|
49325
49451
|
const url = _parseString(urlsData, u * 32);
|
|
49326
49452
|
if (url == null) {
|
|
49327
|
-
|
|
49453
|
+
logger10.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
49328
49454
|
name: "OffchainLookup",
|
|
49329
49455
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49330
49456
|
transaction,
|
|
@@ -49334,19 +49460,19 @@ class BaseProvider extends Provider {
|
|
|
49334
49460
|
urls.push(url);
|
|
49335
49461
|
}
|
|
49336
49462
|
const calldata = _parseBytes(data, 64);
|
|
49337
|
-
if (!BigNumber.from(
|
|
49338
|
-
|
|
49463
|
+
if (!BigNumber.from(import_bytes7.hexDataSlice(data, 100, 128)).isZero()) {
|
|
49464
|
+
logger10.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
49339
49465
|
name: "OffchainLookup",
|
|
49340
49466
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49341
49467
|
transaction,
|
|
49342
49468
|
data: result
|
|
49343
49469
|
});
|
|
49344
49470
|
}
|
|
49345
|
-
const callbackSelector =
|
|
49471
|
+
const callbackSelector = import_bytes7.hexDataSlice(data, 96, 100);
|
|
49346
49472
|
const extraData = _parseBytes(data, 128);
|
|
49347
49473
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
49348
49474
|
if (ccipResult == null) {
|
|
49349
|
-
|
|
49475
|
+
logger10.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
49350
49476
|
name: "OffchainLookup",
|
|
49351
49477
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49352
49478
|
transaction,
|
|
@@ -49355,7 +49481,7 @@ class BaseProvider extends Provider {
|
|
|
49355
49481
|
}
|
|
49356
49482
|
const tx = {
|
|
49357
49483
|
to: txSender,
|
|
49358
|
-
data:
|
|
49484
|
+
data: import_bytes7.hexConcat([callbackSelector, encodeBytes([ccipResult, extraData])])
|
|
49359
49485
|
};
|
|
49360
49486
|
return this._call(tx, blockTag, attempt + 1);
|
|
49361
49487
|
} catch (error) {
|
|
@@ -49365,9 +49491,9 @@ class BaseProvider extends Provider {
|
|
|
49365
49491
|
}
|
|
49366
49492
|
}
|
|
49367
49493
|
try {
|
|
49368
|
-
return
|
|
49494
|
+
return import_bytes7.hexlify(result);
|
|
49369
49495
|
} catch (error) {
|
|
49370
|
-
return
|
|
49496
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49371
49497
|
method: "call",
|
|
49372
49498
|
params: { transaction, blockTag },
|
|
49373
49499
|
result,
|
|
@@ -49397,7 +49523,7 @@ class BaseProvider extends Provider {
|
|
|
49397
49523
|
try {
|
|
49398
49524
|
return BigNumber.from(result);
|
|
49399
49525
|
} catch (error) {
|
|
49400
|
-
return
|
|
49526
|
+
return logger10.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49401
49527
|
method: "estimateGas",
|
|
49402
49528
|
params,
|
|
49403
49529
|
result,
|
|
@@ -49410,11 +49536,11 @@ class BaseProvider extends Provider {
|
|
|
49410
49536
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49411
49537
|
addressOrName = yield addressOrName;
|
|
49412
49538
|
if (typeof addressOrName !== "string") {
|
|
49413
|
-
|
|
49539
|
+
logger10.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
49414
49540
|
}
|
|
49415
49541
|
const address = yield this.resolveName(addressOrName);
|
|
49416
49542
|
if (address == null) {
|
|
49417
|
-
|
|
49543
|
+
logger10.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49418
49544
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
49419
49545
|
});
|
|
49420
49546
|
}
|
|
@@ -49429,16 +49555,16 @@ class BaseProvider extends Provider {
|
|
|
49429
49555
|
const params = {
|
|
49430
49556
|
includeTransactions: !!includeTransactions
|
|
49431
49557
|
};
|
|
49432
|
-
if (
|
|
49558
|
+
if (import_bytes7.isHexString(blockHashOrBlockTag, 32)) {
|
|
49433
49559
|
params.blockHash = blockHashOrBlockTag;
|
|
49434
49560
|
} else {
|
|
49435
49561
|
try {
|
|
49436
49562
|
params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);
|
|
49437
|
-
if (
|
|
49563
|
+
if (import_bytes7.isHexString(params.blockTag)) {
|
|
49438
49564
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
49439
49565
|
}
|
|
49440
49566
|
} catch (error) {
|
|
49441
|
-
|
|
49567
|
+
logger10.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
49442
49568
|
}
|
|
49443
49569
|
}
|
|
49444
49570
|
return import_web.poll(() => __awaiter5(this, undefined, undefined, function* () {
|
|
@@ -49570,7 +49696,7 @@ class BaseProvider extends Provider {
|
|
|
49570
49696
|
blockTag = yield blockTag;
|
|
49571
49697
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
49572
49698
|
if (blockTag % 1) {
|
|
49573
|
-
|
|
49699
|
+
logger10.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
49574
49700
|
}
|
|
49575
49701
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
49576
49702
|
blockNumber += blockTag;
|
|
@@ -49611,7 +49737,7 @@ class BaseProvider extends Provider {
|
|
|
49611
49737
|
}
|
|
49612
49738
|
const network = yield this.getNetwork();
|
|
49613
49739
|
if (!network.ensAddress) {
|
|
49614
|
-
|
|
49740
|
+
logger10.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
49615
49741
|
}
|
|
49616
49742
|
try {
|
|
49617
49743
|
const addrData = yield this.call({
|
|
@@ -49629,12 +49755,12 @@ class BaseProvider extends Provider {
|
|
|
49629
49755
|
try {
|
|
49630
49756
|
return Promise.resolve(this.formatter.address(name));
|
|
49631
49757
|
} catch (error) {
|
|
49632
|
-
if (
|
|
49758
|
+
if (import_bytes7.isHexString(name)) {
|
|
49633
49759
|
throw error;
|
|
49634
49760
|
}
|
|
49635
49761
|
}
|
|
49636
49762
|
if (typeof name !== "string") {
|
|
49637
|
-
|
|
49763
|
+
logger10.throwArgumentError("invalid ENS name", "name", name);
|
|
49638
49764
|
}
|
|
49639
49765
|
const resolver = yield this.getResolver(name);
|
|
49640
49766
|
if (!resolver) {
|
|
@@ -49666,7 +49792,7 @@ class BaseProvider extends Provider {
|
|
|
49666
49792
|
getAvatar(nameOrAddress) {
|
|
49667
49793
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49668
49794
|
let resolver = null;
|
|
49669
|
-
if (
|
|
49795
|
+
if (import_bytes7.isHexString(nameOrAddress)) {
|
|
49670
49796
|
const address = this.formatter.address(nameOrAddress);
|
|
49671
49797
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
49672
49798
|
const resolverAddress = yield this._getResolver(node, "getAvatar");
|
|
@@ -49710,7 +49836,7 @@ class BaseProvider extends Provider {
|
|
|
49710
49836
|
});
|
|
49711
49837
|
}
|
|
49712
49838
|
perform(method, params) {
|
|
49713
|
-
return
|
|
49839
|
+
return logger10.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
49714
49840
|
}
|
|
49715
49841
|
_startEvent(event) {
|
|
49716
49842
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -49821,7 +49947,7 @@ var import_properties10 = __toESM(require_lib4());
|
|
|
49821
49947
|
var import_properties8 = __toESM(require_lib4());
|
|
49822
49948
|
|
|
49823
49949
|
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
49824
|
-
var
|
|
49950
|
+
var import_bytes8 = __toESM(require_lib2());
|
|
49825
49951
|
var import_hash3 = __toESM(require_lib12());
|
|
49826
49952
|
var import_properties7 = __toESM(require_lib4());
|
|
49827
49953
|
var import_strings3 = __toESM(require_lib9());
|
|
@@ -49854,14 +49980,14 @@ var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
|
49854
49980
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49855
49981
|
});
|
|
49856
49982
|
};
|
|
49857
|
-
var
|
|
49983
|
+
var logger11 = new Logger(version11);
|
|
49858
49984
|
var errorGas = ["call", "estimateGas"];
|
|
49859
49985
|
function spelunk(value, requireData) {
|
|
49860
49986
|
if (value == null) {
|
|
49861
49987
|
return null;
|
|
49862
49988
|
}
|
|
49863
49989
|
if (typeof value.message === "string" && value.message.match("reverted")) {
|
|
49864
|
-
const data =
|
|
49990
|
+
const data = import_bytes8.isHexString(value.data) ? value.data : null;
|
|
49865
49991
|
if (!requireData || data) {
|
|
49866
49992
|
return { message: value.message, data };
|
|
49867
49993
|
}
|
|
@@ -49889,7 +50015,7 @@ function checkError(method, error, params) {
|
|
|
49889
50015
|
if (result) {
|
|
49890
50016
|
return result.data;
|
|
49891
50017
|
}
|
|
49892
|
-
|
|
50018
|
+
logger11.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
49893
50019
|
data: "0x",
|
|
49894
50020
|
transaction,
|
|
49895
50021
|
error
|
|
@@ -49901,7 +50027,7 @@ function checkError(method, error, params) {
|
|
|
49901
50027
|
result = spelunk(error, false);
|
|
49902
50028
|
}
|
|
49903
50029
|
if (result) {
|
|
49904
|
-
|
|
50030
|
+
logger11.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
49905
50031
|
reason: result.message,
|
|
49906
50032
|
method,
|
|
49907
50033
|
transaction,
|
|
@@ -49919,35 +50045,35 @@ function checkError(method, error, params) {
|
|
|
49919
50045
|
}
|
|
49920
50046
|
message = (message || "").toLowerCase();
|
|
49921
50047
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
49922
|
-
|
|
50048
|
+
logger11.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
49923
50049
|
error,
|
|
49924
50050
|
method,
|
|
49925
50051
|
transaction
|
|
49926
50052
|
});
|
|
49927
50053
|
}
|
|
49928
50054
|
if (message.match(/nonce (is )?too low/i)) {
|
|
49929
|
-
|
|
50055
|
+
logger11.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
49930
50056
|
error,
|
|
49931
50057
|
method,
|
|
49932
50058
|
transaction
|
|
49933
50059
|
});
|
|
49934
50060
|
}
|
|
49935
50061
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
49936
|
-
|
|
50062
|
+
logger11.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
49937
50063
|
error,
|
|
49938
50064
|
method,
|
|
49939
50065
|
transaction
|
|
49940
50066
|
});
|
|
49941
50067
|
}
|
|
49942
50068
|
if (message.match(/only replay-protected/i)) {
|
|
49943
|
-
|
|
50069
|
+
logger11.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49944
50070
|
error,
|
|
49945
50071
|
method,
|
|
49946
50072
|
transaction
|
|
49947
50073
|
});
|
|
49948
50074
|
}
|
|
49949
50075
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
49950
|
-
|
|
50076
|
+
logger11.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
49951
50077
|
error,
|
|
49952
50078
|
method,
|
|
49953
50079
|
transaction
|
|
@@ -49994,11 +50120,11 @@ class JsonRpcSigner extends Signer {
|
|
|
49994
50120
|
import_properties7.defineReadOnly(this, "_index", addressOrIndex);
|
|
49995
50121
|
import_properties7.defineReadOnly(this, "_address", null);
|
|
49996
50122
|
} else {
|
|
49997
|
-
|
|
50123
|
+
logger11.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
49998
50124
|
}
|
|
49999
50125
|
}
|
|
50000
50126
|
connect(provider) {
|
|
50001
|
-
return
|
|
50127
|
+
return logger11.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50002
50128
|
operation: "connect"
|
|
50003
50129
|
});
|
|
50004
50130
|
}
|
|
@@ -50011,7 +50137,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50011
50137
|
}
|
|
50012
50138
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
50013
50139
|
if (accounts.length <= this._index) {
|
|
50014
|
-
|
|
50140
|
+
logger11.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50015
50141
|
operation: "getAddress"
|
|
50016
50142
|
});
|
|
50017
50143
|
}
|
|
@@ -50038,7 +50164,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50038
50164
|
}
|
|
50039
50165
|
const address = yield this.provider.resolveName(to);
|
|
50040
50166
|
if (address == null) {
|
|
50041
|
-
|
|
50167
|
+
logger11.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
50042
50168
|
}
|
|
50043
50169
|
return address;
|
|
50044
50170
|
}));
|
|
@@ -50049,7 +50175,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50049
50175
|
}).then(({ tx, sender }) => {
|
|
50050
50176
|
if (tx.from != null) {
|
|
50051
50177
|
if (tx.from.toLowerCase() !== sender) {
|
|
50052
|
-
|
|
50178
|
+
logger11.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
50053
50179
|
}
|
|
50054
50180
|
} else {
|
|
50055
50181
|
tx.from = sender;
|
|
@@ -50059,7 +50185,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50059
50185
|
return hash;
|
|
50060
50186
|
}, (error) => {
|
|
50061
50187
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50062
|
-
|
|
50188
|
+
logger11.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
50063
50189
|
action: "sendTransaction",
|
|
50064
50190
|
transaction: tx
|
|
50065
50191
|
});
|
|
@@ -50069,7 +50195,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50069
50195
|
});
|
|
50070
50196
|
}
|
|
50071
50197
|
signTransaction(transaction) {
|
|
50072
|
-
return
|
|
50198
|
+
return logger11.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50073
50199
|
operation: "signTransaction"
|
|
50074
50200
|
});
|
|
50075
50201
|
}
|
|
@@ -50096,10 +50222,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50096
50222
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50097
50223
|
const address = yield this.getAddress();
|
|
50098
50224
|
try {
|
|
50099
|
-
return yield this.provider.send("personal_sign", [
|
|
50225
|
+
return yield this.provider.send("personal_sign", [import_bytes8.hexlify(data), address.toLowerCase()]);
|
|
50100
50226
|
} catch (error) {
|
|
50101
50227
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50102
|
-
|
|
50228
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50103
50229
|
action: "signMessage",
|
|
50104
50230
|
from: address,
|
|
50105
50231
|
messageData: message
|
|
@@ -50114,10 +50240,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50114
50240
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50115
50241
|
const address = yield this.getAddress();
|
|
50116
50242
|
try {
|
|
50117
|
-
return yield this.provider.send("eth_sign", [address.toLowerCase(),
|
|
50243
|
+
return yield this.provider.send("eth_sign", [address.toLowerCase(), import_bytes8.hexlify(data)]);
|
|
50118
50244
|
} catch (error) {
|
|
50119
50245
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50120
|
-
|
|
50246
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50121
50247
|
action: "_legacySignMessage",
|
|
50122
50248
|
from: address,
|
|
50123
50249
|
messageData: message
|
|
@@ -50140,7 +50266,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50140
50266
|
]);
|
|
50141
50267
|
} catch (error) {
|
|
50142
50268
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50143
|
-
|
|
50269
|
+
logger11.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50144
50270
|
action: "_signTypedData",
|
|
50145
50271
|
from: address,
|
|
50146
50272
|
messageData: { domain: populated.domain, types: types2, value: populated.value }
|
|
@@ -50254,14 +50380,14 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50254
50380
|
try {
|
|
50255
50381
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
50256
50382
|
} catch (error) {
|
|
50257
|
-
return
|
|
50383
|
+
return logger11.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50258
50384
|
chainId,
|
|
50259
50385
|
event: "invalidNetwork",
|
|
50260
50386
|
serverError: error
|
|
50261
50387
|
});
|
|
50262
50388
|
}
|
|
50263
50389
|
}
|
|
50264
|
-
return
|
|
50390
|
+
return logger11.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50265
50391
|
event: "noNetwork"
|
|
50266
50392
|
});
|
|
50267
50393
|
});
|
|
@@ -50331,7 +50457,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50331
50457
|
case "getCode":
|
|
50332
50458
|
return ["eth_getCode", [getLowerCase(params.address), params.blockTag]];
|
|
50333
50459
|
case "getStorageAt":
|
|
50334
|
-
return ["eth_getStorageAt", [getLowerCase(params.address),
|
|
50460
|
+
return ["eth_getStorageAt", [getLowerCase(params.address), import_bytes8.hexZeroPad(params.position, 32), params.blockTag]];
|
|
50335
50461
|
case "sendTransaction":
|
|
50336
50462
|
return ["eth_sendRawTransaction", [params.signedTransaction]];
|
|
50337
50463
|
case "getBlock":
|
|
@@ -50380,7 +50506,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50380
50506
|
}
|
|
50381
50507
|
const args = this.prepareRequest(method, params);
|
|
50382
50508
|
if (args == null) {
|
|
50383
|
-
|
|
50509
|
+
logger11.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
50384
50510
|
}
|
|
50385
50511
|
try {
|
|
50386
50512
|
return yield this.send(args[0], args[1]);
|
|
@@ -50457,7 +50583,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50457
50583
|
if (transaction[key] == null) {
|
|
50458
50584
|
return;
|
|
50459
50585
|
}
|
|
50460
|
-
const value =
|
|
50586
|
+
const value = import_bytes8.hexValue(BigNumber.from(transaction[key]));
|
|
50461
50587
|
if (key === "gasLimit") {
|
|
50462
50588
|
key = "gas";
|
|
50463
50589
|
}
|
|
@@ -50467,7 +50593,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50467
50593
|
if (transaction[key] == null) {
|
|
50468
50594
|
return;
|
|
50469
50595
|
}
|
|
50470
|
-
result[key] =
|
|
50596
|
+
result[key] = import_bytes8.hexlify(transaction[key]);
|
|
50471
50597
|
});
|
|
50472
50598
|
if (transaction.accessList) {
|
|
50473
50599
|
result["accessList"] = import_transactions4.accessListify(transaction.accessList);
|
|
@@ -50484,9 +50610,9 @@ try {
|
|
|
50484
50610
|
throw new Error("inject please");
|
|
50485
50611
|
}
|
|
50486
50612
|
} catch (error) {
|
|
50487
|
-
const
|
|
50613
|
+
const logger12 = new Logger(version11);
|
|
50488
50614
|
WS = function() {
|
|
50489
|
-
|
|
50615
|
+
logger12.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50490
50616
|
operation: "new WebSocket()"
|
|
50491
50617
|
});
|
|
50492
50618
|
};
|
|
@@ -50520,13 +50646,13 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
50520
50646
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50521
50647
|
});
|
|
50522
50648
|
};
|
|
50523
|
-
var
|
|
50649
|
+
var logger12 = new Logger(version11);
|
|
50524
50650
|
var NextId = 1;
|
|
50525
50651
|
|
|
50526
50652
|
class WebSocketProvider extends JsonRpcProvider {
|
|
50527
50653
|
constructor(url, network) {
|
|
50528
50654
|
if (network === "any") {
|
|
50529
|
-
|
|
50655
|
+
logger12.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50530
50656
|
operation: "network:any"
|
|
50531
50657
|
});
|
|
50532
50658
|
}
|
|
@@ -50610,12 +50736,12 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50610
50736
|
return 0;
|
|
50611
50737
|
}
|
|
50612
50738
|
resetEventsBlock(blockNumber) {
|
|
50613
|
-
|
|
50739
|
+
logger12.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50614
50740
|
operation: "resetEventBlock"
|
|
50615
50741
|
});
|
|
50616
50742
|
}
|
|
50617
50743
|
set pollingInterval(value) {
|
|
50618
|
-
|
|
50744
|
+
logger12.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50619
50745
|
operation: "setPollingInterval"
|
|
50620
50746
|
});
|
|
50621
50747
|
}
|
|
@@ -50628,7 +50754,7 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50628
50754
|
if (!value) {
|
|
50629
50755
|
return;
|
|
50630
50756
|
}
|
|
50631
|
-
|
|
50757
|
+
logger12.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50632
50758
|
operation: "setPolling"
|
|
50633
50759
|
});
|
|
50634
50760
|
}
|
|
@@ -50792,7 +50918,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
50792
50918
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50793
50919
|
});
|
|
50794
50920
|
};
|
|
50795
|
-
var
|
|
50921
|
+
var logger13 = new Logger(version11);
|
|
50796
50922
|
|
|
50797
50923
|
class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
50798
50924
|
detectNetwork() {
|
|
@@ -50804,7 +50930,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50804
50930
|
if (network == null) {
|
|
50805
50931
|
network = yield _super.detectNetwork.call(this);
|
|
50806
50932
|
if (!network) {
|
|
50807
|
-
|
|
50933
|
+
logger13.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
50808
50934
|
}
|
|
50809
50935
|
if (this._network == null) {
|
|
50810
50936
|
import_properties9.defineReadOnly(this, "_network", network);
|
|
@@ -50818,7 +50944,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50818
50944
|
|
|
50819
50945
|
class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
50820
50946
|
constructor(network, apiKey) {
|
|
50821
|
-
|
|
50947
|
+
logger13.checkAbstract(new.target, UrlJsonRpcProvider);
|
|
50822
50948
|
network = import_properties9.getStatic(new.target, "getNetwork")(network);
|
|
50823
50949
|
apiKey = import_properties9.getStatic(new.target, "getApiKey")(apiKey);
|
|
50824
50950
|
const connection = import_properties9.getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -50832,13 +50958,13 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50832
50958
|
}
|
|
50833
50959
|
}
|
|
50834
50960
|
_startPending() {
|
|
50835
|
-
|
|
50961
|
+
logger13.warn("WARNING: API provider does not support pending filters");
|
|
50836
50962
|
}
|
|
50837
50963
|
isCommunityResource() {
|
|
50838
50964
|
return false;
|
|
50839
50965
|
}
|
|
50840
50966
|
getSigner(address) {
|
|
50841
|
-
return
|
|
50967
|
+
return logger13.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
50842
50968
|
}
|
|
50843
50969
|
listAccounts() {
|
|
50844
50970
|
return Promise.resolve([]);
|
|
@@ -50847,14 +50973,14 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50847
50973
|
return apiKey;
|
|
50848
50974
|
}
|
|
50849
50975
|
static getUrl(network, apiKey) {
|
|
50850
|
-
return
|
|
50976
|
+
return logger13.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
50851
50977
|
operation: "getUrl"
|
|
50852
50978
|
});
|
|
50853
50979
|
}
|
|
50854
50980
|
}
|
|
50855
50981
|
|
|
50856
50982
|
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
50857
|
-
var
|
|
50983
|
+
var logger14 = new Logger(version11);
|
|
50858
50984
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
50859
50985
|
|
|
50860
50986
|
class AlchemyWebSocketProvider extends WebSocketProvider {
|
|
@@ -50878,7 +51004,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50878
51004
|
return defaultApiKey;
|
|
50879
51005
|
}
|
|
50880
51006
|
if (apiKey && typeof apiKey !== "string") {
|
|
50881
|
-
|
|
51007
|
+
logger14.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
50882
51008
|
}
|
|
50883
51009
|
return apiKey;
|
|
50884
51010
|
}
|
|
@@ -50910,7 +51036,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50910
51036
|
host = "opt-goerli.g.alchemy.com/v2/";
|
|
50911
51037
|
break;
|
|
50912
51038
|
default:
|
|
50913
|
-
|
|
51039
|
+
logger14.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
50914
51040
|
}
|
|
50915
51041
|
return {
|
|
50916
51042
|
allowGzip: true,
|
|
@@ -50929,7 +51055,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
50929
51055
|
}
|
|
50930
51056
|
|
|
50931
51057
|
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
50932
|
-
var
|
|
51058
|
+
var logger15 = new Logger(version11);
|
|
50933
51059
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
50934
51060
|
function getHost(name) {
|
|
50935
51061
|
switch (name) {
|
|
@@ -50946,7 +51072,7 @@ function getHost(name) {
|
|
|
50946
51072
|
case "arbitrum":
|
|
50947
51073
|
return "rpc.ankr.com/arbitrum/";
|
|
50948
51074
|
}
|
|
50949
|
-
return
|
|
51075
|
+
return logger15.throwArgumentError("unsupported network", "name", name);
|
|
50950
51076
|
}
|
|
50951
51077
|
|
|
50952
51078
|
class AnkrProvider extends UrlJsonRpcProvider {
|
|
@@ -51009,12 +51135,12 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
51009
51135
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51010
51136
|
});
|
|
51011
51137
|
};
|
|
51012
|
-
var
|
|
51138
|
+
var logger16 = new Logger(version11);
|
|
51013
51139
|
|
|
51014
51140
|
class CloudflareProvider extends UrlJsonRpcProvider {
|
|
51015
51141
|
static getApiKey(apiKey) {
|
|
51016
51142
|
if (apiKey != null) {
|
|
51017
|
-
|
|
51143
|
+
logger16.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
51018
51144
|
}
|
|
51019
51145
|
return null;
|
|
51020
51146
|
}
|
|
@@ -51025,7 +51151,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
51025
51151
|
host = "https://cloudflare-eth.com/";
|
|
51026
51152
|
break;
|
|
51027
51153
|
default:
|
|
51028
|
-
|
|
51154
|
+
logger16.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
51029
51155
|
}
|
|
51030
51156
|
return host;
|
|
51031
51157
|
}
|
|
@@ -51044,7 +51170,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
51044
51170
|
}
|
|
51045
51171
|
|
|
51046
51172
|
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
51047
|
-
var
|
|
51173
|
+
var import_bytes9 = __toESM(require_lib2());
|
|
51048
51174
|
var import_properties11 = __toESM(require_lib4());
|
|
51049
51175
|
var import_transactions5 = __toESM(require_lib15());
|
|
51050
51176
|
var import_web3 = __toESM(require_lib23());
|
|
@@ -51075,7 +51201,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
51075
51201
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51076
51202
|
});
|
|
51077
51203
|
};
|
|
51078
|
-
var
|
|
51204
|
+
var logger17 = new Logger(version11);
|
|
51079
51205
|
function getTransactionPostData(transaction) {
|
|
51080
51206
|
const result = {};
|
|
51081
51207
|
for (let key in transaction) {
|
|
@@ -51087,13 +51213,13 @@ function getTransactionPostData(transaction) {
|
|
|
51087
51213
|
continue;
|
|
51088
51214
|
}
|
|
51089
51215
|
if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {
|
|
51090
|
-
value =
|
|
51216
|
+
value = import_bytes9.hexValue(import_bytes9.hexlify(value));
|
|
51091
51217
|
} else if (key === "accessList") {
|
|
51092
51218
|
value = "[" + import_transactions5.accessListify(value).map((set) => {
|
|
51093
51219
|
return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`;
|
|
51094
51220
|
}).join(",") + "]";
|
|
51095
51221
|
} else {
|
|
51096
|
-
value =
|
|
51222
|
+
value = import_bytes9.hexlify(value);
|
|
51097
51223
|
}
|
|
51098
51224
|
result[key] = value;
|
|
51099
51225
|
}
|
|
@@ -51154,10 +51280,10 @@ function checkError2(method, error, transaction) {
|
|
|
51154
51280
|
if (data) {
|
|
51155
51281
|
data = "0x" + data.replace(/^.*0x/i, "");
|
|
51156
51282
|
}
|
|
51157
|
-
if (
|
|
51283
|
+
if (import_bytes9.isHexString(data)) {
|
|
51158
51284
|
return data;
|
|
51159
51285
|
}
|
|
51160
|
-
|
|
51286
|
+
logger17.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
51161
51287
|
error,
|
|
51162
51288
|
data: "0x"
|
|
51163
51289
|
});
|
|
@@ -51175,28 +51301,28 @@ function checkError2(method, error, transaction) {
|
|
|
51175
51301
|
}
|
|
51176
51302
|
message = (message || "").toLowerCase();
|
|
51177
51303
|
if (message.match(/insufficient funds/)) {
|
|
51178
|
-
|
|
51304
|
+
logger17.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
51179
51305
|
error,
|
|
51180
51306
|
method,
|
|
51181
51307
|
transaction
|
|
51182
51308
|
});
|
|
51183
51309
|
}
|
|
51184
51310
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
51185
|
-
|
|
51311
|
+
logger17.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
51186
51312
|
error,
|
|
51187
51313
|
method,
|
|
51188
51314
|
transaction
|
|
51189
51315
|
});
|
|
51190
51316
|
}
|
|
51191
51317
|
if (message.match(/another transaction with same nonce/)) {
|
|
51192
|
-
|
|
51318
|
+
logger17.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
51193
51319
|
error,
|
|
51194
51320
|
method,
|
|
51195
51321
|
transaction
|
|
51196
51322
|
});
|
|
51197
51323
|
}
|
|
51198
51324
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
51199
|
-
|
|
51325
|
+
logger17.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
51200
51326
|
error,
|
|
51201
51327
|
method,
|
|
51202
51328
|
transaction
|
|
@@ -51233,7 +51359,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51233
51359
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
51234
51360
|
default:
|
|
51235
51361
|
}
|
|
51236
|
-
return
|
|
51362
|
+
return logger17.throwArgumentError("unsupported network", "network", this.network.name);
|
|
51237
51363
|
}
|
|
51238
51364
|
getUrl(module2, params) {
|
|
51239
51365
|
const query = Object.keys(params).reduce((accum, key) => {
|
|
@@ -51393,12 +51519,12 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51393
51519
|
}
|
|
51394
51520
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
51395
51521
|
if (params.filter.topics.length > 1) {
|
|
51396
|
-
|
|
51522
|
+
logger17.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
51397
51523
|
}
|
|
51398
51524
|
if (params.filter.topics.length === 1) {
|
|
51399
51525
|
const topic0 = params.filter.topics[0];
|
|
51400
51526
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
51401
|
-
|
|
51527
|
+
logger17.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
51402
51528
|
}
|
|
51403
51529
|
args.topic0 = topic0;
|
|
51404
51530
|
}
|
|
@@ -51464,7 +51590,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51464
51590
|
}
|
|
51465
51591
|
|
|
51466
51592
|
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
51467
|
-
var
|
|
51593
|
+
var import_bytes10 = __toESM(require_lib2());
|
|
51468
51594
|
var import_properties12 = __toESM(require_lib4());
|
|
51469
51595
|
var import_random2 = __toESM(require_lib21());
|
|
51470
51596
|
var import_web4 = __toESM(require_lib23());
|
|
@@ -51495,7 +51621,7 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
51495
51621
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51496
51622
|
});
|
|
51497
51623
|
};
|
|
51498
|
-
var
|
|
51624
|
+
var logger18 = new Logger(version11);
|
|
51499
51625
|
function now() {
|
|
51500
51626
|
return new Date().getTime();
|
|
51501
51627
|
}
|
|
@@ -51508,7 +51634,7 @@ function checkNetworks(networks2) {
|
|
|
51508
51634
|
}
|
|
51509
51635
|
if (result) {
|
|
51510
51636
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
51511
|
-
|
|
51637
|
+
logger18.throwArgumentError("provider mismatch", "networks", networks2);
|
|
51512
51638
|
}
|
|
51513
51639
|
} else {
|
|
51514
51640
|
result = network;
|
|
@@ -51744,23 +51870,23 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51744
51870
|
case "getBalance":
|
|
51745
51871
|
case "getTransactionCount":
|
|
51746
51872
|
case "getCode":
|
|
51747
|
-
if (params.blockTag &&
|
|
51873
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51748
51874
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51749
51875
|
}
|
|
51750
51876
|
return provider[method](params.address, params.blockTag || "latest");
|
|
51751
51877
|
case "getStorageAt":
|
|
51752
|
-
if (params.blockTag &&
|
|
51878
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51753
51879
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51754
51880
|
}
|
|
51755
51881
|
return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");
|
|
51756
51882
|
case "getBlock":
|
|
51757
|
-
if (params.blockTag &&
|
|
51883
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51758
51884
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51759
51885
|
}
|
|
51760
51886
|
return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);
|
|
51761
51887
|
case "call":
|
|
51762
51888
|
case "estimateGas":
|
|
51763
|
-
if (params.blockTag &&
|
|
51889
|
+
if (params.blockTag && import_bytes10.isHexString(params.blockTag)) {
|
|
51764
51890
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51765
51891
|
}
|
|
51766
51892
|
if (method === "call" && params.blockTag) {
|
|
@@ -51772,13 +51898,13 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51772
51898
|
return provider[method](params.transactionHash);
|
|
51773
51899
|
case "getLogs": {
|
|
51774
51900
|
let filter = params.filter;
|
|
51775
|
-
if (filter.fromBlock &&
|
|
51901
|
+
if (filter.fromBlock && import_bytes10.isHexString(filter.fromBlock) || filter.toBlock && import_bytes10.isHexString(filter.toBlock)) {
|
|
51776
51902
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51777
51903
|
}
|
|
51778
51904
|
return provider.getLogs(filter);
|
|
51779
51905
|
}
|
|
51780
51906
|
}
|
|
51781
|
-
return
|
|
51907
|
+
return logger18.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
51782
51908
|
method,
|
|
51783
51909
|
params
|
|
51784
51910
|
});
|
|
@@ -51788,7 +51914,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51788
51914
|
class FallbackProvider extends BaseProvider {
|
|
51789
51915
|
constructor(providers, quorum) {
|
|
51790
51916
|
if (providers.length === 0) {
|
|
51791
|
-
|
|
51917
|
+
logger18.throwArgumentError("missing providers", "providers", providers);
|
|
51792
51918
|
}
|
|
51793
51919
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
51794
51920
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -51808,7 +51934,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51808
51934
|
}
|
|
51809
51935
|
const weight = config.weight;
|
|
51810
51936
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
51811
|
-
|
|
51937
|
+
logger18.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
51812
51938
|
}
|
|
51813
51939
|
return Object.freeze(config);
|
|
51814
51940
|
});
|
|
@@ -51816,7 +51942,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51816
51942
|
if (quorum == null) {
|
|
51817
51943
|
quorum = total / 2;
|
|
51818
51944
|
} else if (quorum > total) {
|
|
51819
|
-
|
|
51945
|
+
logger18.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
51820
51946
|
}
|
|
51821
51947
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
51822
51948
|
if (networkOrReady == null) {
|
|
@@ -51973,7 +52099,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51973
52099
|
}
|
|
51974
52100
|
props[name] = e[name];
|
|
51975
52101
|
});
|
|
51976
|
-
|
|
52102
|
+
logger18.throwError(e.reason || e.message, errorCode, props);
|
|
51977
52103
|
});
|
|
51978
52104
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
51979
52105
|
break;
|
|
@@ -51985,7 +52111,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51985
52111
|
}
|
|
51986
52112
|
c.cancelled = true;
|
|
51987
52113
|
});
|
|
51988
|
-
return
|
|
52114
|
+
return logger18.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
51989
52115
|
method,
|
|
51990
52116
|
params,
|
|
51991
52117
|
results: configs.map((c) => exposeDebugConfig(c)),
|
|
@@ -52000,7 +52126,7 @@ var IpcProvider = null;
|
|
|
52000
52126
|
|
|
52001
52127
|
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
52002
52128
|
var import_properties13 = __toESM(require_lib4());
|
|
52003
|
-
var
|
|
52129
|
+
var logger19 = new Logger(version11);
|
|
52004
52130
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
52005
52131
|
|
|
52006
52132
|
class InfuraWebSocketProvider extends WebSocketProvider {
|
|
@@ -52008,7 +52134,7 @@ class InfuraWebSocketProvider extends WebSocketProvider {
|
|
|
52008
52134
|
const provider = new InfuraProvider(network, apiKey);
|
|
52009
52135
|
const connection = provider.connection;
|
|
52010
52136
|
if (connection.password) {
|
|
52011
|
-
|
|
52137
|
+
logger19.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52012
52138
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
52013
52139
|
});
|
|
52014
52140
|
}
|
|
@@ -52039,8 +52165,8 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52039
52165
|
if (typeof apiKey === "string") {
|
|
52040
52166
|
apiKeyObj.projectId = apiKey;
|
|
52041
52167
|
} else if (apiKey.projectSecret != null) {
|
|
52042
|
-
|
|
52043
|
-
|
|
52168
|
+
logger19.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
52169
|
+
logger19.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
52044
52170
|
apiKeyObj.projectId = apiKey.projectId;
|
|
52045
52171
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
52046
52172
|
} else if (apiKey.projectId) {
|
|
@@ -52080,7 +52206,7 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52080
52206
|
host = "arbitrum-goerli.infura.io";
|
|
52081
52207
|
break;
|
|
52082
52208
|
default:
|
|
52083
|
-
|
|
52209
|
+
logger19.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52084
52210
|
argument: "network",
|
|
52085
52211
|
value: network
|
|
52086
52212
|
});
|
|
@@ -52173,18 +52299,18 @@ class JsonRpcBatchProvider extends JsonRpcProvider {
|
|
|
52173
52299
|
}
|
|
52174
52300
|
|
|
52175
52301
|
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
52176
|
-
var
|
|
52302
|
+
var logger20 = new Logger(version11);
|
|
52177
52303
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
52178
52304
|
|
|
52179
52305
|
class NodesmithProvider extends UrlJsonRpcProvider {
|
|
52180
52306
|
static getApiKey(apiKey) {
|
|
52181
52307
|
if (apiKey && typeof apiKey !== "string") {
|
|
52182
|
-
|
|
52308
|
+
logger20.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
52183
52309
|
}
|
|
52184
52310
|
return apiKey || defaultApiKey3;
|
|
52185
52311
|
}
|
|
52186
52312
|
static getUrl(network, apiKey) {
|
|
52187
|
-
|
|
52313
|
+
logger20.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
52188
52314
|
let host = null;
|
|
52189
52315
|
switch (network.name) {
|
|
52190
52316
|
case "homestead":
|
|
@@ -52203,14 +52329,14 @@ class NodesmithProvider extends UrlJsonRpcProvider {
|
|
|
52203
52329
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
52204
52330
|
break;
|
|
52205
52331
|
default:
|
|
52206
|
-
|
|
52332
|
+
logger20.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
52207
52333
|
}
|
|
52208
52334
|
return host + "?apiKey=" + apiKey;
|
|
52209
52335
|
}
|
|
52210
52336
|
}
|
|
52211
52337
|
|
|
52212
52338
|
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
52213
|
-
var
|
|
52339
|
+
var logger21 = new Logger(version11);
|
|
52214
52340
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
52215
52341
|
|
|
52216
52342
|
class PocketProvider extends UrlJsonRpcProvider {
|
|
@@ -52230,7 +52356,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52230
52356
|
} else if (apiKey.applicationId) {
|
|
52231
52357
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
52232
52358
|
} else {
|
|
52233
|
-
|
|
52359
|
+
logger21.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
52234
52360
|
}
|
|
52235
52361
|
return apiKeyObj;
|
|
52236
52362
|
}
|
|
@@ -52259,7 +52385,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52259
52385
|
host = "eth-ropsten.gateway.pokt.network";
|
|
52260
52386
|
break;
|
|
52261
52387
|
default:
|
|
52262
|
-
|
|
52388
|
+
logger21.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52263
52389
|
argument: "network",
|
|
52264
52390
|
value: network
|
|
52265
52391
|
});
|
|
@@ -52279,7 +52405,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52279
52405
|
|
|
52280
52406
|
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
52281
52407
|
var import_properties15 = __toESM(require_lib4());
|
|
52282
|
-
var
|
|
52408
|
+
var logger22 = new Logger(version11);
|
|
52283
52409
|
var _nextId = 1;
|
|
52284
52410
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
52285
52411
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -52363,7 +52489,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
52363
52489
|
class Web3Provider extends JsonRpcProvider {
|
|
52364
52490
|
constructor(provider, network) {
|
|
52365
52491
|
if (provider == null) {
|
|
52366
|
-
|
|
52492
|
+
logger22.throwArgumentError("missing provider", "provider", provider);
|
|
52367
52493
|
}
|
|
52368
52494
|
let path = null;
|
|
52369
52495
|
let jsonRpcFetchFunc = null;
|
|
@@ -52387,7 +52513,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52387
52513
|
} else if (provider.send) {
|
|
52388
52514
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
52389
52515
|
} else {
|
|
52390
|
-
|
|
52516
|
+
logger22.throwArgumentError("unsupported provider", "provider", provider);
|
|
52391
52517
|
}
|
|
52392
52518
|
if (!path) {
|
|
52393
52519
|
path = "unknown:";
|
|
@@ -52403,7 +52529,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52403
52529
|
}
|
|
52404
52530
|
|
|
52405
52531
|
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
52406
|
-
var
|
|
52532
|
+
var logger23 = new Logger(version11);
|
|
52407
52533
|
function getDefaultProvider(network, options) {
|
|
52408
52534
|
if (network == null) {
|
|
52409
52535
|
network = "homestead";
|
|
@@ -52419,13 +52545,13 @@ function getDefaultProvider(network, options) {
|
|
|
52419
52545
|
case "wss":
|
|
52420
52546
|
return new WebSocketProvider(network);
|
|
52421
52547
|
default:
|
|
52422
|
-
|
|
52548
|
+
logger23.throwArgumentError("unsupported URL scheme", "network", network);
|
|
52423
52549
|
}
|
|
52424
52550
|
}
|
|
52425
52551
|
}
|
|
52426
52552
|
const n = getNetwork(network);
|
|
52427
52553
|
if (!n || !n._defaultProvider) {
|
|
52428
|
-
|
|
52554
|
+
logger23.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
52429
52555
|
operation: "getDefaultProvider",
|
|
52430
52556
|
network
|
|
52431
52557
|
});
|
|
@@ -52450,15 +52576,15 @@ var import_hash4 = __toESM(require_lib12());
|
|
|
52450
52576
|
var import_properties16 = __toESM(require_lib4());
|
|
52451
52577
|
|
|
52452
52578
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
52453
|
-
var
|
|
52579
|
+
var version12 = "wordlists/5.7.0";
|
|
52454
52580
|
|
|
52455
52581
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
52456
52582
|
var exportWordlist = false;
|
|
52457
|
-
var
|
|
52583
|
+
var logger24 = new Logger(version12);
|
|
52458
52584
|
|
|
52459
52585
|
class Wordlist {
|
|
52460
52586
|
constructor(locale) {
|
|
52461
|
-
|
|
52587
|
+
logger24.checkAbstract(new.target, Wordlist);
|
|
52462
52588
|
import_properties16.defineReadOnly(this, "locale", locale);
|
|
52463
52589
|
}
|
|
52464
52590
|
split(mnemonic) {
|
|
@@ -52535,14 +52661,14 @@ var wordlists = {
|
|
|
52535
52661
|
// node_modules/ethers/lib.esm/utils.js
|
|
52536
52662
|
var exports_utils = {};
|
|
52537
52663
|
__export(exports_utils, {
|
|
52538
|
-
zeroPad: () =>
|
|
52664
|
+
zeroPad: () => import_bytes11.zeroPad,
|
|
52539
52665
|
verifyTypedData: () => verifyTypedData,
|
|
52540
52666
|
verifyMessage: () => verifyMessage,
|
|
52541
52667
|
toUtf8String: () => import_strings4.toUtf8String,
|
|
52542
52668
|
toUtf8CodePoints: () => import_strings4.toUtf8CodePoints,
|
|
52543
52669
|
toUtf8Bytes: () => import_strings4.toUtf8Bytes,
|
|
52544
|
-
stripZeros: () =>
|
|
52545
|
-
splitSignature: () =>
|
|
52670
|
+
stripZeros: () => import_bytes11.stripZeros,
|
|
52671
|
+
splitSignature: () => import_bytes11.splitSignature,
|
|
52546
52672
|
soliditySha256: () => import_solidity.sha256,
|
|
52547
52673
|
solidityPack: () => import_solidity.pack,
|
|
52548
52674
|
solidityKeccak256: () => import_solidity.keccak256,
|
|
@@ -52565,29 +52691,29 @@ __export(exports_utils, {
|
|
|
52565
52691
|
namehash: () => import_hash5.namehash,
|
|
52566
52692
|
mnemonicToSeed: () => import_hdnode2.mnemonicToSeed,
|
|
52567
52693
|
mnemonicToEntropy: () => import_hdnode2.mnemonicToEntropy,
|
|
52568
|
-
keccak256: () =>
|
|
52569
|
-
joinSignature: () =>
|
|
52694
|
+
keccak256: () => import_keccak2563.keccak256,
|
|
52695
|
+
joinSignature: () => import_bytes11.joinSignature,
|
|
52570
52696
|
isValidName: () => import_hash5.isValidName,
|
|
52571
52697
|
isValidMnemonic: () => import_hdnode2.isValidMnemonic,
|
|
52572
|
-
isHexString: () =>
|
|
52573
|
-
isBytesLike: () =>
|
|
52574
|
-
isBytes: () =>
|
|
52575
|
-
isAddress: () =>
|
|
52698
|
+
isHexString: () => import_bytes11.isHexString,
|
|
52699
|
+
isBytesLike: () => import_bytes11.isBytesLike,
|
|
52700
|
+
isBytes: () => import_bytes11.isBytes,
|
|
52701
|
+
isAddress: () => isAddress,
|
|
52576
52702
|
id: () => import_hash5.id,
|
|
52577
|
-
hexlify: () =>
|
|
52578
|
-
hexZeroPad: () =>
|
|
52579
|
-
hexValue: () =>
|
|
52580
|
-
hexStripZeros: () =>
|
|
52581
|
-
hexDataSlice: () =>
|
|
52582
|
-
hexDataLength: () =>
|
|
52583
|
-
hexConcat: () =>
|
|
52703
|
+
hexlify: () => import_bytes11.hexlify,
|
|
52704
|
+
hexZeroPad: () => import_bytes11.hexZeroPad,
|
|
52705
|
+
hexValue: () => import_bytes11.hexValue,
|
|
52706
|
+
hexStripZeros: () => import_bytes11.hexStripZeros,
|
|
52707
|
+
hexDataSlice: () => import_bytes11.hexDataSlice,
|
|
52708
|
+
hexDataLength: () => import_bytes11.hexDataLength,
|
|
52709
|
+
hexConcat: () => import_bytes11.hexConcat,
|
|
52584
52710
|
hashMessage: () => import_hash5.hashMessage,
|
|
52585
52711
|
getStatic: () => import_properties17.getStatic,
|
|
52586
52712
|
getJsonWalletAddress: () => import_json_wallets2.getJsonWalletAddress,
|
|
52587
|
-
getIcapAddress: () =>
|
|
52588
|
-
getCreate2Address: () =>
|
|
52589
|
-
getContractAddress: () =>
|
|
52590
|
-
getAddress: () =>
|
|
52713
|
+
getIcapAddress: () => getIcapAddress,
|
|
52714
|
+
getCreate2Address: () => getCreate2Address,
|
|
52715
|
+
getContractAddress: () => getContractAddress,
|
|
52716
|
+
getAddress: () => getAddress,
|
|
52591
52717
|
getAccountPath: () => import_hdnode2.getAccountPath,
|
|
52592
52718
|
formatUnits: () => import_units.formatUnits,
|
|
52593
52719
|
formatEther: () => import_units.formatEther,
|
|
@@ -52599,7 +52725,7 @@ __export(exports_utils, {
|
|
|
52599
52725
|
defaultPath: () => import_hdnode2.defaultPath,
|
|
52600
52726
|
defaultAbiCoder: () => import_abi2.defaultAbiCoder,
|
|
52601
52727
|
deepCopy: () => import_properties17.deepCopy,
|
|
52602
|
-
concat: () =>
|
|
52728
|
+
concat: () => import_bytes11.concat,
|
|
52603
52729
|
computePublicKey: () => import_signing_key2.computePublicKey,
|
|
52604
52730
|
computeHmac: () => import_sha22.computeHmac,
|
|
52605
52731
|
computeAddress: () => import_transactions6.computeAddress,
|
|
@@ -52608,7 +52734,7 @@ __export(exports_utils, {
|
|
|
52608
52734
|
checkProperties: () => import_properties17.checkProperties,
|
|
52609
52735
|
base64: () => base64,
|
|
52610
52736
|
base58: () => import_basex2.Base58,
|
|
52611
|
-
arrayify: () =>
|
|
52737
|
+
arrayify: () => import_bytes11.arrayify,
|
|
52612
52738
|
accessListify: () => import_transactions6.accessListify,
|
|
52613
52739
|
_toEscapedUtf8String: () => import_strings4._toEscapedUtf8String,
|
|
52614
52740
|
_fetchData: () => import_web6._fetchData,
|
|
@@ -52636,14 +52762,13 @@ __export(exports_utils, {
|
|
|
52636
52762
|
AbiCoder: () => import_abi2.AbiCoder
|
|
52637
52763
|
});
|
|
52638
52764
|
var import_abi2 = __toESM(require_lib13());
|
|
52639
|
-
var import_address5 = __toESM(require_lib7());
|
|
52640
52765
|
var base64 = __toESM(require_lib10());
|
|
52641
52766
|
var import_basex2 = __toESM(require_lib16());
|
|
52642
|
-
var
|
|
52767
|
+
var import_bytes11 = __toESM(require_lib2());
|
|
52643
52768
|
var import_hash5 = __toESM(require_lib12());
|
|
52644
52769
|
var import_hdnode2 = __toESM(require_lib20());
|
|
52645
52770
|
var import_json_wallets2 = __toESM(require_lib22());
|
|
52646
|
-
var
|
|
52771
|
+
var import_keccak2563 = __toESM(require_lib5());
|
|
52647
52772
|
var import_sha22 = __toESM(require_lib17());
|
|
52648
52773
|
var import_solidity = __toESM(require_lib24());
|
|
52649
52774
|
var import_random3 = __toESM(require_lib21());
|
|
@@ -52658,10 +52783,10 @@ var import_sha23 = __toESM(require_lib17());
|
|
|
52658
52783
|
var import_strings5 = __toESM(require_lib9());
|
|
52659
52784
|
|
|
52660
52785
|
// node_modules/ethers/lib.esm/_version.js
|
|
52661
|
-
var
|
|
52786
|
+
var version13 = "ethers/5.7.2";
|
|
52662
52787
|
|
|
52663
52788
|
// node_modules/ethers/lib.esm/ethers.js
|
|
52664
|
-
var
|
|
52789
|
+
var logger25 = new Logger(version13);
|
|
52665
52790
|
|
|
52666
52791
|
// node_modules/ethers/lib.esm/index.js
|
|
52667
52792
|
try {
|
|
@@ -53569,7 +53694,7 @@ var contractsRegistry_default = {
|
|
|
53569
53694
|
dai: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
|
|
53570
53695
|
usdt: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
|
|
53571
53696
|
usdt0: "0x01bFF41798a0BcF287b996046Ca68b395DbC1071",
|
|
53572
|
-
velo: "
|
|
53697
|
+
velo: "0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db",
|
|
53573
53698
|
weth: "0x4200000000000000000000000000000000000006",
|
|
53574
53699
|
wbtc: "0x68f180fcCe6836688e9084f035309E29Bf0A2095",
|
|
53575
53700
|
tbtc: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40",
|
|
@@ -53628,6 +53753,9 @@ var contractsRegistry_default = {
|
|
|
53628
53753
|
}
|
|
53629
53754
|
},
|
|
53630
53755
|
mainnet: {
|
|
53756
|
+
aaveV3: {
|
|
53757
|
+
pool: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2"
|
|
53758
|
+
},
|
|
53631
53759
|
uniswapV3: {
|
|
53632
53760
|
router: "0xE592427A0AEce92De3Edee1F18E0157C05861564",
|
|
53633
53761
|
positionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
@@ -54191,8 +54319,8 @@ class MultisendBuilder {
|
|
|
54191
54319
|
data
|
|
54192
54320
|
});
|
|
54193
54321
|
}
|
|
54194
|
-
static new(chainId,
|
|
54195
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${
|
|
54322
|
+
static new(chainId, version14 = "v1_4_1") {
|
|
54323
|
+
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version14}.multisend`));
|
|
54196
54324
|
}
|
|
54197
54325
|
}
|
|
54198
54326
|
// src/integrations/gnosis/safe.L2.abi.ts
|
|
@@ -58432,7 +58560,6 @@ function invariant(condition, message) {
|
|
|
58432
58560
|
var import_decimal = __toESM(require_decimal());
|
|
58433
58561
|
var import_big = __toESM(require_big());
|
|
58434
58562
|
var import_toformat = __toESM(require_toFormat());
|
|
58435
|
-
var import_address6 = __toESM(require_lib7());
|
|
58436
58563
|
function _defineProperties(target, props) {
|
|
58437
58564
|
for (var i2 = 0;i2 < props.length; i2++) {
|
|
58438
58565
|
var descriptor = props[i2];
|
|
@@ -58992,7 +59119,7 @@ var NativeCurrency = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
58992
59119
|
}(BaseCurrency);
|
|
58993
59120
|
function validateAndParseAddress(address) {
|
|
58994
59121
|
try {
|
|
58995
|
-
return
|
|
59122
|
+
return getAddress(address);
|
|
58996
59123
|
} catch (error) {
|
|
58997
59124
|
throw new Error(address + " is not a valid address.");
|
|
58998
59125
|
}
|
|
@@ -59069,13 +59196,13 @@ var Ether = /* @__PURE__ */ function(_NativeCurrency) {
|
|
|
59069
59196
|
return Ether2;
|
|
59070
59197
|
}(NativeCurrency);
|
|
59071
59198
|
Ether._etherCache = {};
|
|
59072
|
-
var
|
|
59199
|
+
var MAX_SAFE_INTEGER2 = /* @__PURE__ */ import_jsbi.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
59073
59200
|
var ZERO = /* @__PURE__ */ import_jsbi.default.BigInt(0);
|
|
59074
59201
|
var ONE2 = /* @__PURE__ */ import_jsbi.default.BigInt(1);
|
|
59075
59202
|
var TWO = /* @__PURE__ */ import_jsbi.default.BigInt(2);
|
|
59076
59203
|
function sqrt(value) {
|
|
59077
59204
|
!import_jsbi.default.greaterThanOrEqual(value, ZERO) && invariant(false, "NEGATIVE");
|
|
59078
|
-
if (import_jsbi.default.lessThan(value,
|
|
59205
|
+
if (import_jsbi.default.lessThan(value, MAX_SAFE_INTEGER2)) {
|
|
59079
59206
|
return import_jsbi.default.BigInt(Math.floor(Math.sqrt(import_jsbi.default.toNumber(value))));
|
|
59080
59207
|
}
|
|
59081
59208
|
var z;
|
|
@@ -59092,7 +59219,6 @@ function sqrt(value) {
|
|
|
59092
59219
|
// node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
59093
59220
|
var import_jsbi2 = __toESM(require_jsbi_umd());
|
|
59094
59221
|
var import_abi3 = __toESM(require_lib13());
|
|
59095
|
-
var import_address7 = __toESM(require_lib7());
|
|
59096
59222
|
var import_solidity2 = __toESM(require_lib24());
|
|
59097
59223
|
// node_modules/@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json
|
|
59098
59224
|
var IMulticall_default = {
|
|
@@ -63028,7 +63154,7 @@ var Q192 = /* @__PURE__ */ import_jsbi2.default.exponentiate(Q96, /* @__PURE__ *
|
|
|
63028
63154
|
function computePoolAddress(_ref) {
|
|
63029
63155
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride } = _ref;
|
|
63030
63156
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
63031
|
-
return
|
|
63157
|
+
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);
|
|
63032
63158
|
}
|
|
63033
63159
|
var LiquidityMath = /* @__PURE__ */ function() {
|
|
63034
63160
|
function LiquidityMath2() {}
|
|
@@ -64401,9 +64527,8 @@ var import_jsbi3 = __toESM(require_jsbi_umd());
|
|
|
64401
64527
|
var import_decimal2 = __toESM(require_decimal());
|
|
64402
64528
|
var import_big2 = __toESM(require_big());
|
|
64403
64529
|
var import_toformat2 = __toESM(require_toFormat());
|
|
64404
|
-
var
|
|
64405
|
-
var
|
|
64406
|
-
var import_keccak2563 = __toESM(require_lib5());
|
|
64530
|
+
var import_bytes12 = __toESM(require_lib2());
|
|
64531
|
+
var import_keccak2564 = __toESM(require_lib5());
|
|
64407
64532
|
var import_strings6 = __toESM(require_lib9());
|
|
64408
64533
|
function _defineProperties3(e, r) {
|
|
64409
64534
|
for (var t = 0;t < r.length; t++) {
|
|
@@ -65108,7 +65233,7 @@ var NativeCurrency2 = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
65108
65233
|
}(BaseCurrency3);
|
|
65109
65234
|
function validateAndParseAddress2(address) {
|
|
65110
65235
|
try {
|
|
65111
|
-
return
|
|
65236
|
+
return getAddress(address);
|
|
65112
65237
|
} catch (error) {
|
|
65113
65238
|
throw new Error(address + " is not a valid address.");
|
|
65114
65239
|
}
|
|
@@ -65212,18 +65337,18 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
65212
65337
|
if (input === undefined) {
|
|
65213
65338
|
input = "0x";
|
|
65214
65339
|
}
|
|
65215
|
-
var prefix2 =
|
|
65216
|
-
var inputHash =
|
|
65217
|
-
var addressBytes =
|
|
65218
|
-
return
|
|
65340
|
+
var prefix2 = import_keccak2564.keccak256(import_strings6.toUtf8Bytes("zksyncCreate2"));
|
|
65341
|
+
var inputHash = import_keccak2564.keccak256(input);
|
|
65342
|
+
var addressBytes = import_keccak2564.keccak256(import_bytes12.concat([prefix2, import_bytes12.hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
65343
|
+
return getAddress(addressBytes);
|
|
65219
65344
|
}
|
|
65220
|
-
var
|
|
65345
|
+
var MAX_SAFE_INTEGER3 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
65221
65346
|
var ZERO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(0);
|
|
65222
65347
|
var ONE4 = /* @__PURE__ */ import_jsbi3.default.BigInt(1);
|
|
65223
65348
|
var TWO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(2);
|
|
65224
65349
|
function sqrt2(value) {
|
|
65225
65350
|
!import_jsbi3.default.greaterThanOrEqual(value, ZERO3) && invariant(false, "NEGATIVE");
|
|
65226
|
-
if (import_jsbi3.default.lessThan(value,
|
|
65351
|
+
if (import_jsbi3.default.lessThan(value, MAX_SAFE_INTEGER3)) {
|
|
65227
65352
|
return import_jsbi3.default.BigInt(Math.floor(Math.sqrt(import_jsbi3.default.toNumber(value))));
|
|
65228
65353
|
}
|
|
65229
65354
|
var z;
|
|
@@ -65240,7 +65365,6 @@ function sqrt2(value) {
|
|
|
65240
65365
|
// node_modules/@uniswap/v4-sdk/node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
65241
65366
|
var import_jsbi4 = __toESM(require_jsbi_umd());
|
|
65242
65367
|
var import_abi4 = __toESM(require_lib13());
|
|
65243
|
-
var import_address9 = __toESM(require_lib7());
|
|
65244
65368
|
var import_solidity3 = __toESM(require_lib24());
|
|
65245
65369
|
function _arrayLikeToArray2(r, a) {
|
|
65246
65370
|
(a == null || a > r.length) && (a = r.length);
|
|
@@ -65692,7 +65816,7 @@ function computePoolAddress2(_ref) {
|
|
|
65692
65816
|
case ChainId2.ZKSYNC:
|
|
65693
65817
|
return computeZksyncCreate2Address(factoryAddress, initCodeHash, salt);
|
|
65694
65818
|
default:
|
|
65695
|
-
return
|
|
65819
|
+
return getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
65696
65820
|
}
|
|
65697
65821
|
}
|
|
65698
65822
|
var FullMath2 = /* @__PURE__ */ function() {
|
|
@@ -69547,7 +69671,7 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69547
69671
|
hookData = "0x",
|
|
69548
69672
|
recipient
|
|
69549
69673
|
}) => {
|
|
69550
|
-
const
|
|
69674
|
+
const getAddress2 = (currency) => {
|
|
69551
69675
|
return currency.address;
|
|
69552
69676
|
};
|
|
69553
69677
|
const commands = exports_ethers.utils.solidityPack(["uint8"], [16 /* V4_SWAP */]);
|
|
@@ -69555,15 +69679,15 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69555
69679
|
const params = [
|
|
69556
69680
|
exports_ethers.utils.defaultAbiCoder.encode(["tuple(tuple(address,address,uint24,int24,address),bool,uint128,uint128,bytes)"], [
|
|
69557
69681
|
[
|
|
69558
|
-
[
|
|
69682
|
+
[getAddress2(pool.currency0), getAddress2(pool.currency1), pool.fee, pool.tickSpacing, pool.hooks],
|
|
69559
69683
|
zeroForOne,
|
|
69560
69684
|
amountIn,
|
|
69561
69685
|
amountOutMinimum,
|
|
69562
69686
|
hookData
|
|
69563
69687
|
]
|
|
69564
69688
|
]),
|
|
69565
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69566
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69689
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress2(pool.currency0) : getAddress2(pool.currency1), amountIn]),
|
|
69690
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress2(pool.currency1) : getAddress2(pool.currency0), amountOutMinimum])
|
|
69567
69691
|
];
|
|
69568
69692
|
const actionsList = [];
|
|
69569
69693
|
actionsList.push(Actions2.SWAP_EXACT_IN_SINGLE);
|
|
@@ -86507,4 +86631,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
86507
86631
|
};
|
|
86508
86632
|
};
|
|
86509
86633
|
|
|
86510
|
-
//# debugId=
|
|
86634
|
+
//# debugId=A18E1B15C0C199E464756E2164756E21
|