damm-sdk 1.2.17 → 1.2.18
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 +427 -601
- package/dist/index.cjs.map +4 -6
- package/dist/index.js +7 -60
- package/dist/index.js.map +4 -4
- package/dist/integrations/lagoonV1/lagoon.v1.d.ts +0 -19
- package/dist/integrations/lagoonV1/lagoon.v1.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/integrations/lagoonV1/lagoon.v1.ts +0 -66
- package/src/lib/contractsRegistry.json +5 -3
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: () => version6,
|
|
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, version6 = "", 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 logger5 = 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
|
+
logger5.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
|
+
logger5.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 logger5.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 logger5 = 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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", signature);
|
|
35699
35699
|
}
|
|
35700
35700
|
} else if (sig.v !== v) {
|
|
35701
|
-
|
|
35701
|
+
logger5.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
|
+
logger5.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 logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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
|
+
logger5.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 logger5.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 logger6 = 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
|
+
logger6.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 logger6 = 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
|
+
logger6.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
|
+
logger6.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 logger6.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
|
+
logger6.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
|
+
logger6.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 logger6 = 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
|
+
logger6.warn("WARNING: Missing strong random number source");
|
|
37185
37185
|
crypto2 = {
|
|
37186
37186
|
getRandomValues: function(buffer) {
|
|
37187
|
-
return
|
|
37187
|
+
return logger6.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
|
+
logger6.throwArgumentError("invalid length", "length", length);
|
|
37196
37196
|
}
|
|
37197
37197
|
var result = new Uint8Array(length);
|
|
37198
37198
|
crypto2.getRandomValues(result);
|
|
@@ -37232,7 +37232,7 @@ var require_lib21 = __commonJS((exports2) => {
|
|
|
37232
37232
|
} });
|
|
37233
37233
|
});
|
|
37234
37234
|
|
|
37235
|
-
// node_modules
|
|
37235
|
+
// node_modules/aes-js/index.js
|
|
37236
37236
|
var require_aes_js = __commonJS((exports2, module2) => {
|
|
37237
37237
|
(function(root) {
|
|
37238
37238
|
function checkInt2(value) {
|
|
@@ -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 logger6 = 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
|
+
logger6.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 logger6 = 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
|
+
logger6.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 logger6.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 logger6.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 logger8 = 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
|
+
logger8.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
|
+
logger8.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
|
+
logger8.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
|
+
logger8.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
|
+
logger8.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(logger8.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
|
+
logger8.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
|
+
logger8.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
|
+
logger8.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, logger8.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
|
+
logger8.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 encode(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,
|
|
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 logger24 = 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
|
+
logger24.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
|
+
logger24.throwArgumentError("invalid bytes type", "type", type);
|
|
39841
39841
|
}
|
|
39842
39842
|
if ((0, bytes_1.arrayify)(value).byteLength !== size2) {
|
|
39843
|
-
|
|
39843
|
+
logger24.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
|
+
logger24.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 logger24.throwArgumentError("invalid type", "type", type);
|
|
39864
39864
|
}
|
|
39865
39865
|
function pack(types2, values) {
|
|
39866
39866
|
if (types2.length != values.length) {
|
|
39867
|
-
|
|
39867
|
+
logger24.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 keccak2562(types2, values) {
|
|
39877
39877
|
return (0, keccak256_1.keccak256)(pack(types2, values));
|
|
39878
39878
|
}
|
|
39879
|
-
exports2.keccak256 =
|
|
39879
|
+
exports2.keccak256 = keccak2562;
|
|
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 logger24 = 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
|
+
logger24.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
|
+
logger24.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_INTEGER = 9007199254740991, MAX_E = mathfloor(MAX_SAFE_INTEGER / 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_INTEGER) {
|
|
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 logger25 = 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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
|
43045
43045
|
}
|
|
43046
43046
|
if (!(0, bytes_1.isHexString)(afterHash, 32)) {
|
|
43047
|
-
|
|
43047
|
+
logger25.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
|
+
logger25.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 logger25 = 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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
|
|
43464
43464
|
} else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
|
|
43465
|
-
|
|
43465
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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 logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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 logger25 = 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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.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
|
+
logger25.throwError("cannot resolve ENS names without a provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
43879
43879
|
operation: "resolveName",
|
|
43880
43880
|
value: name
|
|
43881
43881
|
});
|
|
@@ -44302,7 +44302,6 @@ __export(exports_src, {
|
|
|
44302
44302
|
withdrawCollateralMorphoBlueTrx: () => withdrawCollateralMorphoBlueTrx,
|
|
44303
44303
|
updateTotalAssetsLifespanTrx: () => updateTotalAssetsLifespanTrx,
|
|
44304
44304
|
updateOrderTrx: () => updateOrderTrx,
|
|
44305
|
-
unpauseVaultTrx: () => unpauseVaultTrx,
|
|
44306
44305
|
uniswapV4SwapTrx: () => uniswapV4SwapTrx,
|
|
44307
44306
|
uniswapV4FinalizeActions: () => uniswapV4FinalizeActions,
|
|
44308
44307
|
uniswapV4AddTakePair: () => uniswapV4AddTakePair,
|
|
@@ -44355,7 +44354,6 @@ __export(exports_src, {
|
|
|
44355
44354
|
repayMorphoBlueTrx: () => repayMorphoBlueTrx,
|
|
44356
44355
|
redeemMorphoVaultTrx: () => redeemMorphoVaultTrx,
|
|
44357
44356
|
receiveMessageFromCctpTrx: () => receiveMessageFromCctpTrx,
|
|
44358
|
-
pauseVaultTrx: () => pauseVaultTrx,
|
|
44359
44357
|
merklClaimTrx: () => merklClaimTrx,
|
|
44360
44358
|
merklClaimCalldata: () => merklClaimCalldata,
|
|
44361
44359
|
merklAbi: () => merkl_distributor_abi_default,
|
|
@@ -44363,7 +44361,6 @@ __export(exports_src, {
|
|
|
44363
44361
|
lagoonV1VaultAbi: () => vault_abi_default,
|
|
44364
44362
|
lagoonV1SiloAbi: () => silo_abi_default,
|
|
44365
44363
|
lagoonV1FactoryAbi: () => factory_abi_default,
|
|
44366
|
-
initiateVaultClosingTrx: () => initiateVaultClosingTrx,
|
|
44367
44364
|
gnosisTrx: () => gnosisTrx,
|
|
44368
44365
|
getGnosisTrxSimulationResult: () => getGnosisTrxSimulationResult,
|
|
44369
44366
|
getAddressOrThrow: () => getAddressOrThrow,
|
|
@@ -44381,7 +44378,6 @@ __export(exports_src, {
|
|
|
44381
44378
|
createVaultProxyTrx: () => createVaultProxyTrx,
|
|
44382
44379
|
createOrderTrx: () => createOrderTrx,
|
|
44383
44380
|
createCall: () => createCall,
|
|
44384
|
-
closeVaultTrx: () => closeVaultTrx,
|
|
44385
44381
|
claimFundingFeesTrx: () => claimFundingFeesTrx,
|
|
44386
44382
|
cancelOrderTrx: () => cancelOrderTrx,
|
|
44387
44383
|
calculateDeterministicVaultAddress: () => calculateDeterministicVaultAddress,
|
|
@@ -44405,7 +44401,6 @@ __export(exports_src, {
|
|
|
44405
44401
|
WithdrawCollateralMorphoBlueCalldata: () => WithdrawCollateralMorphoBlueCalldata,
|
|
44406
44402
|
UpdateTotalAssetsLifespanCalldata: () => UpdateTotalAssetsLifespanCalldata,
|
|
44407
44403
|
UpdateOrderCalldata: () => UpdateOrderCalldata,
|
|
44408
|
-
UnpauseVaultCalldata: () => UnpauseVaultCalldata,
|
|
44409
44404
|
UniswapV4Token: () => UniswapV4Token,
|
|
44410
44405
|
UniswapV4RouterAbi: () => swap_router_abi_default,
|
|
44411
44406
|
UniswapV4PositionManagerAbi: () => position_manager_abi_default2,
|
|
@@ -44470,7 +44465,6 @@ __export(exports_src, {
|
|
|
44470
44465
|
QuoteSendTrx: () => QuoteSendTrx,
|
|
44471
44466
|
QuoteSendCalldata: () => QuoteSendCalldata,
|
|
44472
44467
|
Permit2Abi: () => permit2_abi_default,
|
|
44473
|
-
PauseVaultCalldata: () => PauseVaultCalldata,
|
|
44474
44468
|
PERMIT2_ADDRESS_CANONICAL: () => PERMIT2_ADDRESS_CANONICAL,
|
|
44475
44469
|
OrderType: () => OrderType,
|
|
44476
44470
|
OFTAdapterAbi: () => oft_adapter_abi_default,
|
|
@@ -44479,7 +44473,6 @@ __export(exports_src, {
|
|
|
44479
44473
|
MorphoVaultAbi: () => morpho_vault_abi_default,
|
|
44480
44474
|
MorphoBlueAbi: () => morpho_blue_abi_default,
|
|
44481
44475
|
LendlePoolAbi: () => lendle_pool_abi_default,
|
|
44482
|
-
InitiateClosingCalldata: () => InitiateClosingCalldata,
|
|
44483
44476
|
GMX_EXCHANGE_ROUTER_ARB: () => GMX_EXCHANGE_ROUTER_ARB,
|
|
44484
44477
|
GMXExchangeRouterAbi: () => exchange_router_abi_default,
|
|
44485
44478
|
Erc721Abi: () => erc721_abi_default2,
|
|
@@ -44495,7 +44488,6 @@ __export(exports_src, {
|
|
|
44495
44488
|
CreateVaultProxyCalldata: () => CreateVaultProxyCalldata,
|
|
44496
44489
|
CreateOrderCalldata: () => CreateOrderCalldata,
|
|
44497
44490
|
Commands: () => Commands,
|
|
44498
|
-
CloseVaultCalldata: () => CloseVaultCalldata,
|
|
44499
44491
|
ClaimFundingFeesCalldata: () => ClaimFundingFeesCalldata,
|
|
44500
44492
|
CctpTokenMessengerV2Abi: () => token_messenger_v2_abi_default,
|
|
44501
44493
|
CctpMessageTransmitterV2Abi: () => message_transmitter_v2_abi_default,
|
|
@@ -44927,10 +44919,10 @@ var createCall = (call) => {
|
|
|
44927
44919
|
var exports_ethers = {};
|
|
44928
44920
|
__export(exports_ethers, {
|
|
44929
44921
|
wordlists: () => wordlists,
|
|
44930
|
-
version: () =>
|
|
44922
|
+
version: () => version12,
|
|
44931
44923
|
utils: () => exports_utils,
|
|
44932
44924
|
providers: () => exports_lib2,
|
|
44933
|
-
logger: () =>
|
|
44925
|
+
logger: () => logger24,
|
|
44934
44926
|
getDefaultProvider: () => getDefaultProvider,
|
|
44935
44927
|
errors: () => ErrorCode,
|
|
44936
44928
|
constants: () => exports_lib,
|
|
@@ -45505,12 +45497,6 @@ function throwFault(fault, operation, value) {
|
|
|
45505
45497
|
}
|
|
45506
45498
|
return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
|
45507
45499
|
}
|
|
45508
|
-
function _base36To16(value) {
|
|
45509
|
-
return new BN(value, 36).toString(16);
|
|
45510
|
-
}
|
|
45511
|
-
function _base16To36(value) {
|
|
45512
|
-
return new BN(value, 16).toString(36);
|
|
45513
|
-
}
|
|
45514
45500
|
// node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js
|
|
45515
45501
|
var import_bytes2 = __toESM(require_lib2());
|
|
45516
45502
|
var logger2 = new Logger(version3);
|
|
@@ -46208,136 +46194,14 @@ class VoidSigner extends Signer {
|
|
|
46208
46194
|
}
|
|
46209
46195
|
}
|
|
46210
46196
|
|
|
46211
|
-
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46212
|
-
var import_bytes3 = __toESM(require_lib2());
|
|
46213
|
-
var import_keccak256 = __toESM(require_lib5());
|
|
46214
|
-
var import_rlp = __toESM(require_lib6());
|
|
46215
|
-
|
|
46216
|
-
// node_modules/@ethersproject/address/lib.esm/_version.js
|
|
46217
|
-
var version6 = "address/5.7.0";
|
|
46218
|
-
|
|
46219
|
-
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
46220
|
-
var logger5 = new Logger(version6);
|
|
46221
|
-
function getChecksumAddress(address) {
|
|
46222
|
-
if (!import_bytes3.isHexString(address, 20)) {
|
|
46223
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
46224
|
-
}
|
|
46225
|
-
address = address.toLowerCase();
|
|
46226
|
-
const chars = address.substring(2).split("");
|
|
46227
|
-
const expanded = new Uint8Array(40);
|
|
46228
|
-
for (let i2 = 0;i2 < 40; i2++) {
|
|
46229
|
-
expanded[i2] = chars[i2].charCodeAt(0);
|
|
46230
|
-
}
|
|
46231
|
-
const hashed = import_bytes3.arrayify(import_keccak256.keccak256(expanded));
|
|
46232
|
-
for (let i2 = 0;i2 < 40; i2 += 2) {
|
|
46233
|
-
if (hashed[i2 >> 1] >> 4 >= 8) {
|
|
46234
|
-
chars[i2] = chars[i2].toUpperCase();
|
|
46235
|
-
}
|
|
46236
|
-
if ((hashed[i2 >> 1] & 15) >= 8) {
|
|
46237
|
-
chars[i2 + 1] = chars[i2 + 1].toUpperCase();
|
|
46238
|
-
}
|
|
46239
|
-
}
|
|
46240
|
-
return "0x" + chars.join("");
|
|
46241
|
-
}
|
|
46242
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
46243
|
-
function log10(x) {
|
|
46244
|
-
if (Math.log10) {
|
|
46245
|
-
return Math.log10(x);
|
|
46246
|
-
}
|
|
46247
|
-
return Math.log(x) / Math.LN10;
|
|
46248
|
-
}
|
|
46249
|
-
var ibanLookup = {};
|
|
46250
|
-
for (let i2 = 0;i2 < 10; i2++) {
|
|
46251
|
-
ibanLookup[String(i2)] = String(i2);
|
|
46252
|
-
}
|
|
46253
|
-
for (let i2 = 0;i2 < 26; i2++) {
|
|
46254
|
-
ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2);
|
|
46255
|
-
}
|
|
46256
|
-
var safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
46257
|
-
function ibanChecksum(address) {
|
|
46258
|
-
address = address.toUpperCase();
|
|
46259
|
-
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
46260
|
-
let expanded = address.split("").map((c) => {
|
|
46261
|
-
return ibanLookup[c];
|
|
46262
|
-
}).join("");
|
|
46263
|
-
while (expanded.length >= safeDigits) {
|
|
46264
|
-
let block = expanded.substring(0, safeDigits);
|
|
46265
|
-
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
46266
|
-
}
|
|
46267
|
-
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
|
46268
|
-
while (checksum.length < 2) {
|
|
46269
|
-
checksum = "0" + checksum;
|
|
46270
|
-
}
|
|
46271
|
-
return checksum;
|
|
46272
|
-
}
|
|
46273
|
-
function getAddress(address) {
|
|
46274
|
-
let result = null;
|
|
46275
|
-
if (typeof address !== "string") {
|
|
46276
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
46277
|
-
}
|
|
46278
|
-
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
46279
|
-
if (address.substring(0, 2) !== "0x") {
|
|
46280
|
-
address = "0x" + address;
|
|
46281
|
-
}
|
|
46282
|
-
result = getChecksumAddress(address);
|
|
46283
|
-
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
46284
|
-
logger5.throwArgumentError("bad address checksum", "address", address);
|
|
46285
|
-
}
|
|
46286
|
-
} else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
46287
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
46288
|
-
logger5.throwArgumentError("bad icap checksum", "address", address);
|
|
46289
|
-
}
|
|
46290
|
-
result = _base36To16(address.substring(4));
|
|
46291
|
-
while (result.length < 40) {
|
|
46292
|
-
result = "0" + result;
|
|
46293
|
-
}
|
|
46294
|
-
result = getChecksumAddress("0x" + result);
|
|
46295
|
-
} else {
|
|
46296
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
46297
|
-
}
|
|
46298
|
-
return result;
|
|
46299
|
-
}
|
|
46300
|
-
function isAddress(address) {
|
|
46301
|
-
try {
|
|
46302
|
-
getAddress(address);
|
|
46303
|
-
return true;
|
|
46304
|
-
} catch (error) {}
|
|
46305
|
-
return false;
|
|
46306
|
-
}
|
|
46307
|
-
function getIcapAddress(address) {
|
|
46308
|
-
let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();
|
|
46309
|
-
while (base36.length < 30) {
|
|
46310
|
-
base36 = "0" + base36;
|
|
46311
|
-
}
|
|
46312
|
-
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
|
46313
|
-
}
|
|
46314
|
-
function getContractAddress(transaction) {
|
|
46315
|
-
let from2 = null;
|
|
46316
|
-
try {
|
|
46317
|
-
from2 = getAddress(transaction.from);
|
|
46318
|
-
} catch (error) {
|
|
46319
|
-
logger5.throwArgumentError("missing from address", "transaction", transaction);
|
|
46320
|
-
}
|
|
46321
|
-
const nonce = import_bytes3.stripZeros(import_bytes3.arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
46322
|
-
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_rlp.encode([from2, nonce])), 12));
|
|
46323
|
-
}
|
|
46324
|
-
function getCreate2Address(from2, salt, initCodeHash) {
|
|
46325
|
-
if (import_bytes3.hexDataLength(salt) !== 32) {
|
|
46326
|
-
logger5.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
|
46327
|
-
}
|
|
46328
|
-
if (import_bytes3.hexDataLength(initCodeHash) !== 32) {
|
|
46329
|
-
logger5.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
46330
|
-
}
|
|
46331
|
-
return getAddress(import_bytes3.hexDataSlice(import_keccak256.keccak256(import_bytes3.concat(["0xff", getAddress(from2), salt, initCodeHash])), 12));
|
|
46332
|
-
}
|
|
46333
|
-
|
|
46334
46197
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46335
|
-
var
|
|
46198
|
+
var import_address2 = __toESM(require_lib7());
|
|
46199
|
+
var import_bytes3 = __toESM(require_lib2());
|
|
46336
46200
|
var import_properties3 = __toESM(require_lib4());
|
|
46337
46201
|
var import_transactions = __toESM(require_lib15());
|
|
46338
46202
|
|
|
46339
46203
|
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
46340
|
-
var
|
|
46204
|
+
var version7 = "contracts/5.7.0";
|
|
46341
46205
|
|
|
46342
46206
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
46343
46207
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
@@ -46367,7 +46231,7 @@ var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
|
46367
46231
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46368
46232
|
});
|
|
46369
46233
|
};
|
|
46370
|
-
var
|
|
46234
|
+
var logger5 = new Logger(version7);
|
|
46371
46235
|
var allowedTransactionKeys2 = {
|
|
46372
46236
|
chainId: true,
|
|
46373
46237
|
data: true,
|
|
@@ -46388,19 +46252,19 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
46388
46252
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46389
46253
|
const name = yield nameOrPromise;
|
|
46390
46254
|
if (typeof name !== "string") {
|
|
46391
|
-
|
|
46255
|
+
logger5.throwArgumentError("invalid address or ENS name", "name", name);
|
|
46392
46256
|
}
|
|
46393
46257
|
try {
|
|
46394
|
-
return getAddress(name);
|
|
46258
|
+
return import_address2.getAddress(name);
|
|
46395
46259
|
} catch (error) {}
|
|
46396
46260
|
if (!resolver) {
|
|
46397
|
-
|
|
46261
|
+
logger5.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46398
46262
|
operation: "resolveName"
|
|
46399
46263
|
});
|
|
46400
46264
|
}
|
|
46401
46265
|
const address = yield resolver.resolveName(name);
|
|
46402
46266
|
if (address == null) {
|
|
46403
|
-
|
|
46267
|
+
logger5.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
|
|
46404
46268
|
}
|
|
46405
46269
|
return address;
|
|
46406
46270
|
});
|
|
@@ -46420,7 +46284,7 @@ function resolveAddresses(resolver, value, paramType) {
|
|
|
46420
46284
|
}
|
|
46421
46285
|
if (paramType.baseType === "array") {
|
|
46422
46286
|
if (!Array.isArray(value)) {
|
|
46423
|
-
return Promise.reject(
|
|
46287
|
+
return Promise.reject(logger5.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
|
|
46424
46288
|
argument: "value",
|
|
46425
46289
|
value
|
|
46426
46290
|
}));
|
|
@@ -46436,15 +46300,15 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46436
46300
|
if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
|
|
46437
46301
|
overrides = import_properties3.shallowCopy(args.pop());
|
|
46438
46302
|
}
|
|
46439
|
-
|
|
46303
|
+
logger5.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
|
|
46440
46304
|
if (contract.signer) {
|
|
46441
46305
|
if (overrides.from) {
|
|
46442
46306
|
overrides.from = import_properties3.resolveProperties({
|
|
46443
46307
|
override: resolveName(contract.signer, overrides.from),
|
|
46444
46308
|
signer: contract.signer.getAddress()
|
|
46445
46309
|
}).then((check) => __awaiter3(this, undefined, undefined, function* () {
|
|
46446
|
-
if (getAddress(check.signer) !== check.override) {
|
|
46447
|
-
|
|
46310
|
+
if (import_address2.getAddress(check.signer) !== check.override) {
|
|
46311
|
+
logger5.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46448
46312
|
operation: "overrides.from"
|
|
46449
46313
|
});
|
|
46450
46314
|
}
|
|
@@ -46493,7 +46357,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46493
46357
|
}
|
|
46494
46358
|
if (tx.gasLimit == null && fragment.gas != null) {
|
|
46495
46359
|
let intrinsic = 21000;
|
|
46496
|
-
const bytes =
|
|
46360
|
+
const bytes = import_bytes3.arrayify(data);
|
|
46497
46361
|
for (let i2 = 0;i2 < bytes.length; i2++) {
|
|
46498
46362
|
intrinsic += 4;
|
|
46499
46363
|
if (bytes[i2]) {
|
|
@@ -46505,7 +46369,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46505
46369
|
if (ro.value) {
|
|
46506
46370
|
const roValue = BigNumber.from(ro.value);
|
|
46507
46371
|
if (!roValue.isZero() && !fragment.payable) {
|
|
46508
|
-
|
|
46372
|
+
logger5.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46509
46373
|
operation: "overrides.value",
|
|
46510
46374
|
value: overrides.value
|
|
46511
46375
|
});
|
|
@@ -46531,7 +46395,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
46531
46395
|
delete overrides.ccipReadEnabled;
|
|
46532
46396
|
const leftovers = Object.keys(overrides).filter((key) => overrides[key] != null);
|
|
46533
46397
|
if (leftovers.length) {
|
|
46534
|
-
|
|
46398
|
+
logger5.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46535
46399
|
operation: "overrides",
|
|
46536
46400
|
overrides: leftovers
|
|
46537
46401
|
});
|
|
@@ -46549,7 +46413,7 @@ function buildEstimate(contract, fragment) {
|
|
|
46549
46413
|
return function(...args) {
|
|
46550
46414
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46551
46415
|
if (!signerOrProvider) {
|
|
46552
|
-
|
|
46416
|
+
logger5.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46553
46417
|
operation: "estimateGas"
|
|
46554
46418
|
});
|
|
46555
46419
|
}
|
|
@@ -46633,7 +46497,7 @@ function buildSend(contract, fragment) {
|
|
|
46633
46497
|
return function(...args) {
|
|
46634
46498
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
46635
46499
|
if (!contract.signer) {
|
|
46636
|
-
|
|
46500
|
+
logger5.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46637
46501
|
operation: "sendTransaction"
|
|
46638
46502
|
});
|
|
46639
46503
|
}
|
|
@@ -46724,7 +46588,7 @@ class FragmentRunningEvent extends RunningEvent {
|
|
|
46724
46588
|
let topic = contractInterface.getEventTopic(fragment);
|
|
46725
46589
|
if (topics) {
|
|
46726
46590
|
if (topic !== topics[0]) {
|
|
46727
|
-
|
|
46591
|
+
logger5.throwArgumentError("topic mismatch", "topics", topics);
|
|
46728
46592
|
}
|
|
46729
46593
|
filter.topics = topics.slice();
|
|
46730
46594
|
} else {
|
|
@@ -46793,7 +46657,7 @@ class BaseContract {
|
|
|
46793
46657
|
import_properties3.defineReadOnly(this, "provider", signerOrProvider);
|
|
46794
46658
|
import_properties3.defineReadOnly(this, "signer", null);
|
|
46795
46659
|
} else {
|
|
46796
|
-
|
|
46660
|
+
logger5.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
|
|
46797
46661
|
}
|
|
46798
46662
|
import_properties3.defineReadOnly(this, "callStatic", {});
|
|
46799
46663
|
import_properties3.defineReadOnly(this, "estimateGas", {});
|
|
@@ -46820,23 +46684,23 @@ class BaseContract {
|
|
|
46820
46684
|
if (filters.length === 1) {
|
|
46821
46685
|
import_properties3.defineReadOnly(this.filters, name, this.filters[filters[0]]);
|
|
46822
46686
|
} else {
|
|
46823
|
-
|
|
46687
|
+
logger5.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
|
|
46824
46688
|
}
|
|
46825
46689
|
});
|
|
46826
46690
|
}
|
|
46827
46691
|
import_properties3.defineReadOnly(this, "_runningEvents", {});
|
|
46828
46692
|
import_properties3.defineReadOnly(this, "_wrappedEmits", {});
|
|
46829
46693
|
if (addressOrName == null) {
|
|
46830
|
-
|
|
46694
|
+
logger5.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
|
|
46831
46695
|
}
|
|
46832
46696
|
import_properties3.defineReadOnly(this, "address", addressOrName);
|
|
46833
46697
|
if (this.provider) {
|
|
46834
46698
|
import_properties3.defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
|
|
46835
46699
|
} else {
|
|
46836
46700
|
try {
|
|
46837
|
-
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
|
|
46701
|
+
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(import_address2.getAddress(addressOrName)));
|
|
46838
46702
|
} catch (error) {
|
|
46839
|
-
|
|
46703
|
+
logger5.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46840
46704
|
operation: "new Contract"
|
|
46841
46705
|
});
|
|
46842
46706
|
}
|
|
@@ -46847,7 +46711,7 @@ class BaseContract {
|
|
|
46847
46711
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
46848
46712
|
const fragment = this.interface.functions[signature];
|
|
46849
46713
|
if (uniqueSignatures[signature]) {
|
|
46850
|
-
|
|
46714
|
+
logger5.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
|
|
46851
46715
|
return;
|
|
46852
46716
|
}
|
|
46853
46717
|
uniqueSignatures[signature] = true;
|
|
@@ -46901,7 +46765,7 @@ class BaseContract {
|
|
|
46901
46765
|
});
|
|
46902
46766
|
}
|
|
46903
46767
|
static getContractAddress(transaction) {
|
|
46904
|
-
return getContractAddress(transaction);
|
|
46768
|
+
return import_address2.getContractAddress(transaction);
|
|
46905
46769
|
}
|
|
46906
46770
|
static getInterface(contractInterface) {
|
|
46907
46771
|
if (import_abi.Interface.isInterface(contractInterface)) {
|
|
@@ -46921,7 +46785,7 @@ class BaseContract {
|
|
|
46921
46785
|
} else {
|
|
46922
46786
|
this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code2) => {
|
|
46923
46787
|
if (code2 === "0x") {
|
|
46924
|
-
|
|
46788
|
+
logger5.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
46925
46789
|
contractAddress: this.address,
|
|
46926
46790
|
operation: "getDeployed"
|
|
46927
46791
|
});
|
|
@@ -46934,14 +46798,14 @@ class BaseContract {
|
|
|
46934
46798
|
}
|
|
46935
46799
|
fallback(overrides) {
|
|
46936
46800
|
if (!this.signer) {
|
|
46937
|
-
|
|
46801
|
+
logger5.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
|
|
46938
46802
|
}
|
|
46939
46803
|
const tx = import_properties3.shallowCopy(overrides || {});
|
|
46940
46804
|
["from", "to"].forEach(function(key) {
|
|
46941
46805
|
if (tx[key] == null) {
|
|
46942
46806
|
return;
|
|
46943
46807
|
}
|
|
46944
|
-
|
|
46808
|
+
logger5.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
46945
46809
|
});
|
|
46946
46810
|
tx.to = this.resolvedAddress;
|
|
46947
46811
|
return this.deployed().then(() => {
|
|
@@ -47034,7 +46898,7 @@ class BaseContract {
|
|
|
47034
46898
|
}
|
|
47035
46899
|
_addEventListener(runningEvent, listener, once3) {
|
|
47036
46900
|
if (!this.provider) {
|
|
47037
|
-
|
|
46901
|
+
logger5.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
47038
46902
|
}
|
|
47039
46903
|
runningEvent.addListener(listener, once3);
|
|
47040
46904
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
|
@@ -47065,9 +46929,9 @@ class BaseContract {
|
|
|
47065
46929
|
queryFilter(event, fromBlockOrBlockhash, toBlock) {
|
|
47066
46930
|
const runningEvent = this._getRunningEvent(event);
|
|
47067
46931
|
const filter = import_properties3.shallowCopy(runningEvent.filter);
|
|
47068
|
-
if (typeof fromBlockOrBlockhash === "string" &&
|
|
46932
|
+
if (typeof fromBlockOrBlockhash === "string" && import_bytes3.isHexString(fromBlockOrBlockhash, 32)) {
|
|
47069
46933
|
if (toBlock != null) {
|
|
47070
|
-
|
|
46934
|
+
logger5.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
|
|
47071
46935
|
}
|
|
47072
46936
|
filter.blockHash = fromBlockOrBlockhash;
|
|
47073
46937
|
} else {
|
|
@@ -47160,8 +47024,8 @@ class ContractFactory {
|
|
|
47160
47024
|
let bytecodeHex = null;
|
|
47161
47025
|
if (typeof bytecode === "string") {
|
|
47162
47026
|
bytecodeHex = bytecode;
|
|
47163
|
-
} else if (
|
|
47164
|
-
bytecodeHex =
|
|
47027
|
+
} else if (import_bytes3.isBytes(bytecode)) {
|
|
47028
|
+
bytecodeHex = import_bytes3.hexlify(bytecode);
|
|
47165
47029
|
} else if (bytecode && typeof bytecode.object === "string") {
|
|
47166
47030
|
bytecodeHex = bytecode.object;
|
|
47167
47031
|
} else {
|
|
@@ -47170,11 +47034,11 @@ class ContractFactory {
|
|
|
47170
47034
|
if (bytecodeHex.substring(0, 2) !== "0x") {
|
|
47171
47035
|
bytecodeHex = "0x" + bytecodeHex;
|
|
47172
47036
|
}
|
|
47173
|
-
if (!
|
|
47174
|
-
|
|
47037
|
+
if (!import_bytes3.isHexString(bytecodeHex) || bytecodeHex.length % 2) {
|
|
47038
|
+
logger5.throwArgumentError("invalid bytecode", "bytecode", bytecode);
|
|
47175
47039
|
}
|
|
47176
47040
|
if (signer && !Signer.isSigner(signer)) {
|
|
47177
|
-
|
|
47041
|
+
logger5.throwArgumentError("invalid signer", "signer", signer);
|
|
47178
47042
|
}
|
|
47179
47043
|
import_properties3.defineReadOnly(this, "bytecode", bytecodeHex);
|
|
47180
47044
|
import_properties3.defineReadOnly(this, "interface", import_properties3.getStatic(new.target, "getInterface")(contractInterface));
|
|
@@ -47194,19 +47058,19 @@ class ContractFactory {
|
|
|
47194
47058
|
if (tx[key] == null) {
|
|
47195
47059
|
return;
|
|
47196
47060
|
}
|
|
47197
|
-
|
|
47061
|
+
logger5.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
47198
47062
|
});
|
|
47199
47063
|
if (tx.value) {
|
|
47200
47064
|
const value = BigNumber.from(tx.value);
|
|
47201
47065
|
if (!value.isZero() && !this.interface.deploy.payable) {
|
|
47202
|
-
|
|
47066
|
+
logger5.throwError("non-payable constructor cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47203
47067
|
operation: "overrides.value",
|
|
47204
47068
|
value: tx.value
|
|
47205
47069
|
});
|
|
47206
47070
|
}
|
|
47207
47071
|
}
|
|
47208
|
-
|
|
47209
|
-
tx.data =
|
|
47072
|
+
logger5.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47073
|
+
tx.data = import_bytes3.hexlify(import_bytes3.concat([
|
|
47210
47074
|
this.bytecode,
|
|
47211
47075
|
this.interface.encodeDeploy(args)
|
|
47212
47076
|
]));
|
|
@@ -47218,7 +47082,7 @@ class ContractFactory {
|
|
|
47218
47082
|
if (args.length === this.interface.deploy.inputs.length + 1) {
|
|
47219
47083
|
overrides = args.pop();
|
|
47220
47084
|
}
|
|
47221
|
-
|
|
47085
|
+
logger5.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
47222
47086
|
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
|
47223
47087
|
params.push(overrides);
|
|
47224
47088
|
const unsignedTx = this.getDeployTransaction(...params);
|
|
@@ -47238,7 +47102,7 @@ class ContractFactory {
|
|
|
47238
47102
|
}
|
|
47239
47103
|
static fromSolidity(compilerOutput, signer) {
|
|
47240
47104
|
if (compilerOutput == null) {
|
|
47241
|
-
|
|
47105
|
+
logger5.throwError("missing compiler output", Logger.errors.MISSING_ARGUMENT, { argument: "compilerOutput" });
|
|
47242
47106
|
}
|
|
47243
47107
|
if (typeof compilerOutput === "string") {
|
|
47244
47108
|
compilerOutput = JSON.parse(compilerOutput);
|
|
@@ -47256,7 +47120,7 @@ class ContractFactory {
|
|
|
47256
47120
|
return Contract.getInterface(contractInterface);
|
|
47257
47121
|
}
|
|
47258
47122
|
static getContractAddress(tx) {
|
|
47259
|
-
return getContractAddress(tx);
|
|
47123
|
+
return import_address2.getContractAddress(tx);
|
|
47260
47124
|
}
|
|
47261
47125
|
static getContract(address, contractInterface, signer) {
|
|
47262
47126
|
return new Contract(address, contractInterface, signer);
|
|
@@ -47264,10 +47128,11 @@ class ContractFactory {
|
|
|
47264
47128
|
}
|
|
47265
47129
|
|
|
47266
47130
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47267
|
-
var
|
|
47131
|
+
var import_address3 = __toESM(require_lib7());
|
|
47132
|
+
var import_bytes4 = __toESM(require_lib2());
|
|
47268
47133
|
var import_hash = __toESM(require_lib12());
|
|
47269
47134
|
var import_hdnode = __toESM(require_lib20());
|
|
47270
|
-
var
|
|
47135
|
+
var import_keccak256 = __toESM(require_lib5());
|
|
47271
47136
|
var import_properties4 = __toESM(require_lib4());
|
|
47272
47137
|
var import_random = __toESM(require_lib21());
|
|
47273
47138
|
var import_signing_key = __toESM(require_lib14());
|
|
@@ -47275,7 +47140,7 @@ var import_json_wallets = __toESM(require_lib22());
|
|
|
47275
47140
|
var import_transactions2 = __toESM(require_lib15());
|
|
47276
47141
|
|
|
47277
47142
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
47278
|
-
var
|
|
47143
|
+
var version8 = "wallet/5.7.0";
|
|
47279
47144
|
|
|
47280
47145
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
47281
47146
|
var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
@@ -47305,9 +47170,9 @@ var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
|
47305
47170
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47306
47171
|
});
|
|
47307
47172
|
};
|
|
47308
|
-
var
|
|
47173
|
+
var logger6 = new Logger(version8);
|
|
47309
47174
|
function isAccount(value) {
|
|
47310
|
-
return value != null &&
|
|
47175
|
+
return value != null && import_bytes4.isHexString(value.privateKey, 32) && value.address != null;
|
|
47311
47176
|
}
|
|
47312
47177
|
function hasMnemonic(value) {
|
|
47313
47178
|
const mnemonic = value.mnemonic;
|
|
@@ -47321,8 +47186,8 @@ class Wallet extends Signer {
|
|
|
47321
47186
|
const signingKey = new import_signing_key.SigningKey(privateKey.privateKey);
|
|
47322
47187
|
import_properties4.defineReadOnly(this, "_signingKey", () => signingKey);
|
|
47323
47188
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47324
|
-
if (this.address !== getAddress(privateKey.address)) {
|
|
47325
|
-
|
|
47189
|
+
if (this.address !== import_address3.getAddress(privateKey.address)) {
|
|
47190
|
+
logger6.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
47326
47191
|
}
|
|
47327
47192
|
if (hasMnemonic(privateKey)) {
|
|
47328
47193
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -47334,7 +47199,7 @@ class Wallet extends Signer {
|
|
|
47334
47199
|
const mnemonic = this.mnemonic;
|
|
47335
47200
|
const node = import_hdnode.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
47336
47201
|
if (import_transactions2.computeAddress(node.privateKey) !== this.address) {
|
|
47337
|
-
|
|
47202
|
+
logger6.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
47338
47203
|
}
|
|
47339
47204
|
} else {
|
|
47340
47205
|
import_properties4.defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -47342,7 +47207,7 @@ class Wallet extends Signer {
|
|
|
47342
47207
|
} else {
|
|
47343
47208
|
if (import_signing_key.SigningKey.isSigningKey(privateKey)) {
|
|
47344
47209
|
if (privateKey.curve !== "secp256k1") {
|
|
47345
|
-
|
|
47210
|
+
logger6.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
47346
47211
|
}
|
|
47347
47212
|
import_properties4.defineReadOnly(this, "_signingKey", () => privateKey);
|
|
47348
47213
|
} else {
|
|
@@ -47358,7 +47223,7 @@ class Wallet extends Signer {
|
|
|
47358
47223
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
47359
47224
|
}
|
|
47360
47225
|
if (provider && !Provider.isProvider(provider)) {
|
|
47361
|
-
|
|
47226
|
+
logger6.throwArgumentError("invalid provider", "provider", provider);
|
|
47362
47227
|
}
|
|
47363
47228
|
import_properties4.defineReadOnly(this, "provider", provider || null);
|
|
47364
47229
|
}
|
|
@@ -47380,32 +47245,32 @@ class Wallet extends Signer {
|
|
|
47380
47245
|
signTransaction(transaction) {
|
|
47381
47246
|
return import_properties4.resolveProperties(transaction).then((tx) => {
|
|
47382
47247
|
if (tx.from != null) {
|
|
47383
|
-
if (getAddress(tx.from) !== this.address) {
|
|
47384
|
-
|
|
47248
|
+
if (import_address3.getAddress(tx.from) !== this.address) {
|
|
47249
|
+
logger6.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
47385
47250
|
}
|
|
47386
47251
|
delete tx.from;
|
|
47387
47252
|
}
|
|
47388
|
-
const signature = this._signingKey().signDigest(
|
|
47253
|
+
const signature = this._signingKey().signDigest(import_keccak256.keccak256(import_transactions2.serialize(tx)));
|
|
47389
47254
|
return import_transactions2.serialize(tx, signature);
|
|
47390
47255
|
});
|
|
47391
47256
|
}
|
|
47392
47257
|
signMessage(message) {
|
|
47393
47258
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47394
|
-
return
|
|
47259
|
+
return import_bytes4.joinSignature(this._signingKey().signDigest(import_hash.hashMessage(message)));
|
|
47395
47260
|
});
|
|
47396
47261
|
}
|
|
47397
47262
|
_signTypedData(domain, types2, value) {
|
|
47398
47263
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
47399
47264
|
const populated = yield import_hash._TypedDataEncoder.resolveNames(domain, types2, value, (name) => {
|
|
47400
47265
|
if (this.provider == null) {
|
|
47401
|
-
|
|
47266
|
+
logger6.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47402
47267
|
operation: "resolveName",
|
|
47403
47268
|
value: name
|
|
47404
47269
|
});
|
|
47405
47270
|
}
|
|
47406
47271
|
return this.provider.resolveName(name);
|
|
47407
47272
|
});
|
|
47408
|
-
return
|
|
47273
|
+
return import_bytes4.joinSignature(this._signingKey().signDigest(import_hash._TypedDataEncoder.hash(populated.domain, types2, populated.value)));
|
|
47409
47274
|
});
|
|
47410
47275
|
}
|
|
47411
47276
|
encrypt(password, options, progressCallback) {
|
|
@@ -47427,7 +47292,7 @@ class Wallet extends Signer {
|
|
|
47427
47292
|
options = {};
|
|
47428
47293
|
}
|
|
47429
47294
|
if (options.extraEntropy) {
|
|
47430
|
-
entropy =
|
|
47295
|
+
entropy = import_bytes4.arrayify(import_bytes4.hexDataSlice(import_keccak256.keccak256(import_bytes4.concat([entropy, options.extraEntropy])), 0, 16));
|
|
47431
47296
|
}
|
|
47432
47297
|
const mnemonic = import_hdnode.entropyToMnemonic(entropy, options.locale);
|
|
47433
47298
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -47518,10 +47383,10 @@ __export(exports_lib2, {
|
|
|
47518
47383
|
});
|
|
47519
47384
|
|
|
47520
47385
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
47521
|
-
var
|
|
47386
|
+
var version9 = "networks/5.7.1";
|
|
47522
47387
|
|
|
47523
47388
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
47524
|
-
var
|
|
47389
|
+
var logger7 = new Logger(version9);
|
|
47525
47390
|
function isRenetworkable(value) {
|
|
47526
47391
|
return value && typeof value.renetwork === "function";
|
|
47527
47392
|
}
|
|
@@ -47716,12 +47581,12 @@ function getNetwork(network) {
|
|
|
47716
47581
|
const standard = networks[network.name];
|
|
47717
47582
|
if (!standard) {
|
|
47718
47583
|
if (typeof network.chainId !== "number") {
|
|
47719
|
-
|
|
47584
|
+
logger7.throwArgumentError("invalid network chainId", "network", network);
|
|
47720
47585
|
}
|
|
47721
47586
|
return network;
|
|
47722
47587
|
}
|
|
47723
47588
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
47724
|
-
|
|
47589
|
+
logger7.throwArgumentError("network chainId mismatch", "network", network);
|
|
47725
47590
|
}
|
|
47726
47591
|
let defaultProvider = network._defaultProvider || null;
|
|
47727
47592
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -47742,7 +47607,7 @@ function getNetwork(network) {
|
|
|
47742
47607
|
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
47743
47608
|
var import_base64 = __toESM(require_lib10());
|
|
47744
47609
|
var import_basex = __toESM(require_lib16());
|
|
47745
|
-
var
|
|
47610
|
+
var import_bytes6 = __toESM(require_lib2());
|
|
47746
47611
|
var import_hash2 = __toESM(require_lib12());
|
|
47747
47612
|
var import_properties6 = __toESM(require_lib4());
|
|
47748
47613
|
var import_sha2 = __toESM(require_lib17());
|
|
@@ -47751,13 +47616,14 @@ var import_web = __toESM(require_lib23());
|
|
|
47751
47616
|
var import_bech32 = __toESM(require_bech32());
|
|
47752
47617
|
|
|
47753
47618
|
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
47754
|
-
var
|
|
47619
|
+
var version10 = "providers/5.7.2";
|
|
47755
47620
|
|
|
47756
47621
|
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
47757
|
-
var
|
|
47622
|
+
var import_address4 = __toESM(require_lib7());
|
|
47623
|
+
var import_bytes5 = __toESM(require_lib2());
|
|
47758
47624
|
var import_properties5 = __toESM(require_lib4());
|
|
47759
47625
|
var import_transactions3 = __toESM(require_lib15());
|
|
47760
|
-
var
|
|
47626
|
+
var logger8 = new Logger(version10);
|
|
47761
47627
|
|
|
47762
47628
|
class Formatter {
|
|
47763
47629
|
constructor() {
|
|
@@ -47914,11 +47780,11 @@ class Formatter {
|
|
|
47914
47780
|
if (!strict && value.substring(0, 2) !== "0x") {
|
|
47915
47781
|
value = "0x" + value;
|
|
47916
47782
|
}
|
|
47917
|
-
if (
|
|
47783
|
+
if (import_bytes5.isHexString(value)) {
|
|
47918
47784
|
return value.toLowerCase();
|
|
47919
47785
|
}
|
|
47920
47786
|
}
|
|
47921
|
-
return
|
|
47787
|
+
return logger8.throwArgumentError("invalid hash", "value", value);
|
|
47922
47788
|
}
|
|
47923
47789
|
data(value, strict) {
|
|
47924
47790
|
const result = this.hex(value, strict);
|
|
@@ -47928,17 +47794,17 @@ class Formatter {
|
|
|
47928
47794
|
return result;
|
|
47929
47795
|
}
|
|
47930
47796
|
address(value) {
|
|
47931
|
-
return getAddress(value);
|
|
47797
|
+
return import_address4.getAddress(value);
|
|
47932
47798
|
}
|
|
47933
47799
|
callAddress(value) {
|
|
47934
|
-
if (!
|
|
47800
|
+
if (!import_bytes5.isHexString(value, 32)) {
|
|
47935
47801
|
return null;
|
|
47936
47802
|
}
|
|
47937
|
-
const address = getAddress(
|
|
47803
|
+
const address = import_address4.getAddress(import_bytes5.hexDataSlice(value, 12));
|
|
47938
47804
|
return address === AddressZero ? null : address;
|
|
47939
47805
|
}
|
|
47940
47806
|
contractAddress(value) {
|
|
47941
|
-
return getContractAddress(value);
|
|
47807
|
+
return import_address4.getContractAddress(value);
|
|
47942
47808
|
}
|
|
47943
47809
|
blockTag(blockTag) {
|
|
47944
47810
|
if (blockTag == null) {
|
|
@@ -47956,15 +47822,15 @@ class Formatter {
|
|
|
47956
47822
|
case "finalized":
|
|
47957
47823
|
return blockTag;
|
|
47958
47824
|
}
|
|
47959
|
-
if (typeof blockTag === "number" ||
|
|
47960
|
-
return
|
|
47825
|
+
if (typeof blockTag === "number" || import_bytes5.isHexString(blockTag)) {
|
|
47826
|
+
return import_bytes5.hexValue(blockTag);
|
|
47961
47827
|
}
|
|
47962
47828
|
throw new Error("invalid blockTag");
|
|
47963
47829
|
}
|
|
47964
47830
|
hash(value, strict) {
|
|
47965
47831
|
const result = this.hex(value, strict);
|
|
47966
|
-
if (
|
|
47967
|
-
return
|
|
47832
|
+
if (import_bytes5.hexDataLength(result) !== 32) {
|
|
47833
|
+
return logger8.throwArgumentError("invalid hash", "value", value);
|
|
47968
47834
|
}
|
|
47969
47835
|
return result;
|
|
47970
47836
|
}
|
|
@@ -47979,10 +47845,10 @@ class Formatter {
|
|
|
47979
47845
|
return null;
|
|
47980
47846
|
}
|
|
47981
47847
|
uint256(value) {
|
|
47982
|
-
if (!
|
|
47848
|
+
if (!import_bytes5.isHexString(value)) {
|
|
47983
47849
|
throw new Error("invalid uint256");
|
|
47984
47850
|
}
|
|
47985
|
-
return
|
|
47851
|
+
return import_bytes5.hexZeroPad(value, 32);
|
|
47986
47852
|
}
|
|
47987
47853
|
_block(value, format2) {
|
|
47988
47854
|
if (value.author != null && value.miner == null) {
|
|
@@ -48021,7 +47887,7 @@ class Formatter {
|
|
|
48021
47887
|
const result = Formatter.check(this.formats.transaction, transaction);
|
|
48022
47888
|
if (transaction.chainId != null) {
|
|
48023
47889
|
let chainId = transaction.chainId;
|
|
48024
|
-
if (
|
|
47890
|
+
if (import_bytes5.isHexString(chainId)) {
|
|
48025
47891
|
chainId = BigNumber.from(chainId).toNumber();
|
|
48026
47892
|
}
|
|
48027
47893
|
result.chainId = chainId;
|
|
@@ -48030,7 +47896,7 @@ class Formatter {
|
|
|
48030
47896
|
if (chainId == null && result.v == null) {
|
|
48031
47897
|
chainId = transaction.chainId;
|
|
48032
47898
|
}
|
|
48033
|
-
if (
|
|
47899
|
+
if (import_bytes5.isHexString(chainId)) {
|
|
48034
47900
|
chainId = BigNumber.from(chainId).toNumber();
|
|
48035
47901
|
}
|
|
48036
47902
|
if (typeof chainId !== "number" && result.v != null) {
|
|
@@ -48063,15 +47929,15 @@ class Formatter {
|
|
|
48063
47929
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
48064
47930
|
if (value2 === 0 || value2 === 1) {
|
|
48065
47931
|
if (result.status != null && result.status !== value2) {
|
|
48066
|
-
|
|
47932
|
+
logger8.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
48067
47933
|
}
|
|
48068
47934
|
result.status = value2;
|
|
48069
47935
|
delete result.root;
|
|
48070
47936
|
} else {
|
|
48071
|
-
|
|
47937
|
+
logger8.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
48072
47938
|
}
|
|
48073
47939
|
} else if (result.root.length !== 66) {
|
|
48074
|
-
|
|
47940
|
+
logger8.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
48075
47941
|
}
|
|
48076
47942
|
}
|
|
48077
47943
|
if (result.status != null) {
|
|
@@ -48192,14 +48058,14 @@ var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
|
48192
48058
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48193
48059
|
});
|
|
48194
48060
|
};
|
|
48195
|
-
var
|
|
48061
|
+
var logger9 = new Logger(version10);
|
|
48196
48062
|
var MAX_CCIP_REDIRECTS = 10;
|
|
48197
48063
|
function checkTopic(topic) {
|
|
48198
48064
|
if (topic == null) {
|
|
48199
48065
|
return "null";
|
|
48200
48066
|
}
|
|
48201
|
-
if (
|
|
48202
|
-
|
|
48067
|
+
if (import_bytes6.hexDataLength(topic) !== 32) {
|
|
48068
|
+
logger9.throwArgumentError("invalid topic", "topic", topic);
|
|
48203
48069
|
}
|
|
48204
48070
|
return topic.toLowerCase();
|
|
48205
48071
|
}
|
|
@@ -48239,7 +48105,7 @@ function deserializeTopics(data) {
|
|
|
48239
48105
|
function getEventTag2(eventName) {
|
|
48240
48106
|
if (typeof eventName === "string") {
|
|
48241
48107
|
eventName = eventName.toLowerCase();
|
|
48242
|
-
if (
|
|
48108
|
+
if (import_bytes6.hexDataLength(eventName) === 32) {
|
|
48243
48109
|
return "tx:" + eventName;
|
|
48244
48110
|
}
|
|
48245
48111
|
if (eventName.indexOf(":") === -1) {
|
|
@@ -48248,7 +48114,7 @@ function getEventTag2(eventName) {
|
|
|
48248
48114
|
} else if (Array.isArray(eventName)) {
|
|
48249
48115
|
return "filter:*:" + serializeTopics(eventName);
|
|
48250
48116
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
48251
|
-
|
|
48117
|
+
logger9.warn("not implemented");
|
|
48252
48118
|
throw new Error("not implemented");
|
|
48253
48119
|
} else if (eventName && typeof eventName === "object") {
|
|
48254
48120
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -48321,10 +48187,10 @@ var coinInfos = {
|
|
|
48321
48187
|
"700": { symbol: "xdai", ilk: "eth" }
|
|
48322
48188
|
};
|
|
48323
48189
|
function bytes32ify(value) {
|
|
48324
|
-
return
|
|
48190
|
+
return import_bytes6.hexZeroPad(BigNumber.from(value).toHexString(), 32);
|
|
48325
48191
|
}
|
|
48326
48192
|
function base58Encode(data) {
|
|
48327
|
-
return import_basex.Base58.encode(
|
|
48193
|
+
return import_basex.Base58.encode(import_bytes6.concat([data, import_bytes6.hexDataSlice(import_sha2.sha256(import_sha2.sha256(data)), 0, 4)]));
|
|
48328
48194
|
}
|
|
48329
48195
|
var matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
|
|
48330
48196
|
var matchers = [
|
|
@@ -48343,9 +48209,9 @@ function _parseBytes(result, start) {
|
|
|
48343
48209
|
if (result === "0x") {
|
|
48344
48210
|
return null;
|
|
48345
48211
|
}
|
|
48346
|
-
const offset = BigNumber.from(
|
|
48347
|
-
const length = BigNumber.from(
|
|
48348
|
-
return
|
|
48212
|
+
const offset = BigNumber.from(import_bytes6.hexDataSlice(result, start, start + 32)).toNumber();
|
|
48213
|
+
const length = BigNumber.from(import_bytes6.hexDataSlice(result, offset, offset + 32)).toNumber();
|
|
48214
|
+
return import_bytes6.hexDataSlice(result, offset + 32, offset + 32 + length);
|
|
48349
48215
|
}
|
|
48350
48216
|
function getIpfsLink(link) {
|
|
48351
48217
|
if (link.match(/^ipfs:\/\/ipfs\//i)) {
|
|
@@ -48353,12 +48219,12 @@ function getIpfsLink(link) {
|
|
|
48353
48219
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
48354
48220
|
link = link.substring(7);
|
|
48355
48221
|
} else {
|
|
48356
|
-
|
|
48222
|
+
logger9.throwArgumentError("unsupported IPFS format", "link", link);
|
|
48357
48223
|
}
|
|
48358
48224
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
48359
48225
|
}
|
|
48360
48226
|
function numPad(value) {
|
|
48361
|
-
const result =
|
|
48227
|
+
const result = import_bytes6.arrayify(value);
|
|
48362
48228
|
if (result.length > 32) {
|
|
48363
48229
|
throw new Error("internal; should not happen");
|
|
48364
48230
|
}
|
|
@@ -48382,13 +48248,13 @@ function encodeBytes(datas) {
|
|
|
48382
48248
|
byteCount += 32;
|
|
48383
48249
|
}
|
|
48384
48250
|
for (let i2 = 0;i2 < datas.length; i2++) {
|
|
48385
|
-
const data =
|
|
48251
|
+
const data = import_bytes6.arrayify(datas[i2]);
|
|
48386
48252
|
result[i2] = numPad(byteCount);
|
|
48387
48253
|
result.push(numPad(data.length));
|
|
48388
48254
|
result.push(bytesPad(data));
|
|
48389
48255
|
byteCount += 32 + Math.ceil(data.length / 32) * 32;
|
|
48390
48256
|
}
|
|
48391
|
-
return
|
|
48257
|
+
return import_bytes6.hexConcat(result);
|
|
48392
48258
|
}
|
|
48393
48259
|
|
|
48394
48260
|
class Resolver {
|
|
@@ -48420,17 +48286,17 @@ class Resolver {
|
|
|
48420
48286
|
const tx = {
|
|
48421
48287
|
to: this.address,
|
|
48422
48288
|
ccipReadEnabled: true,
|
|
48423
|
-
data:
|
|
48289
|
+
data: import_bytes6.hexConcat([selector, import_hash2.namehash(this.name), parameters || "0x"])
|
|
48424
48290
|
};
|
|
48425
48291
|
let parseBytes = false;
|
|
48426
48292
|
if (yield this.supportsWildcard()) {
|
|
48427
48293
|
parseBytes = true;
|
|
48428
|
-
tx.data =
|
|
48294
|
+
tx.data = import_bytes6.hexConcat(["0x9061b923", encodeBytes([import_hash2.dnsEncode(this.name), tx.data])]);
|
|
48429
48295
|
}
|
|
48430
48296
|
try {
|
|
48431
48297
|
let result = yield this.provider.call(tx);
|
|
48432
|
-
if (
|
|
48433
|
-
|
|
48298
|
+
if (import_bytes6.arrayify(result).length % 32 === 4) {
|
|
48299
|
+
logger9.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
48434
48300
|
transaction: tx,
|
|
48435
48301
|
data: result
|
|
48436
48302
|
});
|
|
@@ -48459,20 +48325,20 @@ class Resolver {
|
|
|
48459
48325
|
_getAddress(coinType, hexBytes) {
|
|
48460
48326
|
const coinInfo = coinInfos[String(coinType)];
|
|
48461
48327
|
if (coinInfo == null) {
|
|
48462
|
-
|
|
48328
|
+
logger9.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48463
48329
|
operation: `getAddress(${coinType})`
|
|
48464
48330
|
});
|
|
48465
48331
|
}
|
|
48466
48332
|
if (coinInfo.ilk === "eth") {
|
|
48467
48333
|
return this.provider.formatter.address(hexBytes);
|
|
48468
48334
|
}
|
|
48469
|
-
const bytes =
|
|
48335
|
+
const bytes = import_bytes6.arrayify(hexBytes);
|
|
48470
48336
|
if (coinInfo.p2pkh != null) {
|
|
48471
48337
|
const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);
|
|
48472
48338
|
if (p2pkh) {
|
|
48473
48339
|
const length = parseInt(p2pkh[1], 16);
|
|
48474
48340
|
if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48475
|
-
return base58Encode(
|
|
48341
|
+
return base58Encode(import_bytes6.concat([[coinInfo.p2pkh], "0x" + p2pkh[2]]));
|
|
48476
48342
|
}
|
|
48477
48343
|
}
|
|
48478
48344
|
}
|
|
@@ -48481,23 +48347,23 @@ class Resolver {
|
|
|
48481
48347
|
if (p2sh) {
|
|
48482
48348
|
const length = parseInt(p2sh[1], 16);
|
|
48483
48349
|
if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
48484
|
-
return base58Encode(
|
|
48350
|
+
return base58Encode(import_bytes6.concat([[coinInfo.p2sh], "0x" + p2sh[2]]));
|
|
48485
48351
|
}
|
|
48486
48352
|
}
|
|
48487
48353
|
}
|
|
48488
48354
|
if (coinInfo.prefix != null) {
|
|
48489
48355
|
const length = bytes[1];
|
|
48490
|
-
let
|
|
48491
|
-
if (
|
|
48356
|
+
let version11 = bytes[0];
|
|
48357
|
+
if (version11 === 0) {
|
|
48492
48358
|
if (length !== 20 && length !== 32) {
|
|
48493
|
-
|
|
48359
|
+
version11 = -1;
|
|
48494
48360
|
}
|
|
48495
48361
|
} else {
|
|
48496
|
-
|
|
48362
|
+
version11 = -1;
|
|
48497
48363
|
}
|
|
48498
|
-
if (
|
|
48364
|
+
if (version11 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
48499
48365
|
const words = import_bech32.default.toWords(bytes.slice(2));
|
|
48500
|
-
words.unshift(
|
|
48366
|
+
words.unshift(version11);
|
|
48501
48367
|
return import_bech32.default.encode(coinInfo.prefix, words);
|
|
48502
48368
|
}
|
|
48503
48369
|
}
|
|
@@ -48528,7 +48394,7 @@ class Resolver {
|
|
|
48528
48394
|
}
|
|
48529
48395
|
const address = this._getAddress(coinType, hexBytes);
|
|
48530
48396
|
if (address == null) {
|
|
48531
|
-
|
|
48397
|
+
logger9.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48532
48398
|
operation: `getAddress(${coinType})`,
|
|
48533
48399
|
coinType,
|
|
48534
48400
|
data: hexBytes
|
|
@@ -48571,11 +48437,11 @@ class Resolver {
|
|
|
48571
48437
|
return null;
|
|
48572
48438
|
}
|
|
48573
48439
|
const addr = yield this.provider.formatter.address(comps[0]);
|
|
48574
|
-
const tokenId =
|
|
48440
|
+
const tokenId = import_bytes6.hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);
|
|
48575
48441
|
if (scheme === "erc721") {
|
|
48576
48442
|
const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({
|
|
48577
48443
|
to: addr,
|
|
48578
|
-
data:
|
|
48444
|
+
data: import_bytes6.hexConcat(["0x6352211e", tokenId])
|
|
48579
48445
|
}));
|
|
48580
48446
|
if (owner !== tokenOwner) {
|
|
48581
48447
|
return null;
|
|
@@ -48584,7 +48450,7 @@ class Resolver {
|
|
|
48584
48450
|
} else if (scheme === "erc1155") {
|
|
48585
48451
|
const balance = BigNumber.from(yield this.provider.call({
|
|
48586
48452
|
to: addr,
|
|
48587
|
-
data:
|
|
48453
|
+
data: import_bytes6.hexConcat(["0x00fdd58e", import_bytes6.hexZeroPad(owner, 32), tokenId])
|
|
48588
48454
|
}));
|
|
48589
48455
|
if (balance.isZero()) {
|
|
48590
48456
|
return null;
|
|
@@ -48593,7 +48459,7 @@ class Resolver {
|
|
|
48593
48459
|
}
|
|
48594
48460
|
const tx = {
|
|
48595
48461
|
to: this.provider.formatter.address(comps[0]),
|
|
48596
|
-
data:
|
|
48462
|
+
data: import_bytes6.hexConcat([selector, tokenId])
|
|
48597
48463
|
};
|
|
48598
48464
|
let metadataUrl = _parseString(yield this.provider.call(tx), 0);
|
|
48599
48465
|
if (metadataUrl == null) {
|
|
@@ -48668,7 +48534,7 @@ class Resolver {
|
|
|
48668
48534
|
return "sia://" + hash;
|
|
48669
48535
|
}
|
|
48670
48536
|
}
|
|
48671
|
-
return
|
|
48537
|
+
return logger9.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48672
48538
|
operation: "getContentHash()",
|
|
48673
48539
|
data: hexBytes
|
|
48674
48540
|
});
|
|
@@ -48677,11 +48543,11 @@ class Resolver {
|
|
|
48677
48543
|
getText(key) {
|
|
48678
48544
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48679
48545
|
let keyBytes = import_strings2.toUtf8Bytes(key);
|
|
48680
|
-
keyBytes =
|
|
48546
|
+
keyBytes = import_bytes6.concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
48681
48547
|
if (keyBytes.length % 32 !== 0) {
|
|
48682
|
-
keyBytes =
|
|
48548
|
+
keyBytes = import_bytes6.concat([keyBytes, import_bytes6.hexZeroPad("0x", 32 - key.length % 32)]);
|
|
48683
48549
|
}
|
|
48684
|
-
const hexBytes = yield this._fetchBytes("0x59d1d43c",
|
|
48550
|
+
const hexBytes = yield this._fetchBytes("0x59d1d43c", import_bytes6.hexlify(keyBytes));
|
|
48685
48551
|
if (hexBytes == null || hexBytes === "0x") {
|
|
48686
48552
|
return null;
|
|
48687
48553
|
}
|
|
@@ -48713,7 +48579,7 @@ class BaseProvider extends Provider {
|
|
|
48713
48579
|
import_properties6.defineReadOnly(this, "_network", knownNetwork);
|
|
48714
48580
|
this.emit("network", knownNetwork, null);
|
|
48715
48581
|
} else {
|
|
48716
|
-
|
|
48582
|
+
logger9.throwArgumentError("invalid network", "network", network);
|
|
48717
48583
|
}
|
|
48718
48584
|
}
|
|
48719
48585
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -48735,7 +48601,7 @@ class BaseProvider extends Provider {
|
|
|
48735
48601
|
network = yield this.detectNetwork();
|
|
48736
48602
|
}
|
|
48737
48603
|
if (!network) {
|
|
48738
|
-
|
|
48604
|
+
logger9.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
48739
48605
|
}
|
|
48740
48606
|
if (this._network == null) {
|
|
48741
48607
|
if (this.anyNetwork) {
|
|
@@ -48791,11 +48657,11 @@ class BaseProvider extends Provider {
|
|
|
48791
48657
|
}
|
|
48792
48658
|
const errorMessage = result.message || "unknown error";
|
|
48793
48659
|
if (result.status >= 400 && result.status < 500) {
|
|
48794
|
-
return
|
|
48660
|
+
return logger9.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
48795
48661
|
}
|
|
48796
48662
|
errorMessages.push(errorMessage);
|
|
48797
48663
|
}
|
|
48798
|
-
return
|
|
48664
|
+
return logger9.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
48799
48665
|
urls,
|
|
48800
48666
|
errorMessages
|
|
48801
48667
|
});
|
|
@@ -48870,8 +48736,8 @@ class BaseProvider extends Provider {
|
|
|
48870
48736
|
this._emitted.block = blockNumber - 1;
|
|
48871
48737
|
}
|
|
48872
48738
|
if (Math.abs(this._emitted.block - blockNumber) > 1000) {
|
|
48873
|
-
|
|
48874
|
-
this.emit("error",
|
|
48739
|
+
logger9.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
48740
|
+
this.emit("error", logger9.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
48875
48741
|
blockNumber,
|
|
48876
48742
|
event: "blockSkew",
|
|
48877
48743
|
previousBlockNumber: this._emitted.block
|
|
@@ -48976,7 +48842,7 @@ class BaseProvider extends Provider {
|
|
|
48976
48842
|
}
|
|
48977
48843
|
detectNetwork() {
|
|
48978
48844
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
48979
|
-
return
|
|
48845
|
+
return logger9.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48980
48846
|
operation: "provider.detectNetwork"
|
|
48981
48847
|
});
|
|
48982
48848
|
});
|
|
@@ -48999,7 +48865,7 @@ class BaseProvider extends Provider {
|
|
|
48999
48865
|
yield stall(0);
|
|
49000
48866
|
return this._network;
|
|
49001
48867
|
}
|
|
49002
|
-
const error =
|
|
48868
|
+
const error = logger9.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
49003
48869
|
event: "changed",
|
|
49004
48870
|
network,
|
|
49005
48871
|
detectedNetwork: currentNetwork
|
|
@@ -49166,7 +49032,7 @@ class BaseProvider extends Provider {
|
|
|
49166
49032
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
49167
49033
|
reason = "cancelled";
|
|
49168
49034
|
}
|
|
49169
|
-
reject(
|
|
49035
|
+
reject(logger9.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
49170
49036
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
49171
49037
|
reason,
|
|
49172
49038
|
replacement: this._wrapTransaction(tx),
|
|
@@ -49203,7 +49069,7 @@ class BaseProvider extends Provider {
|
|
|
49203
49069
|
if (alreadyDone()) {
|
|
49204
49070
|
return;
|
|
49205
49071
|
}
|
|
49206
|
-
reject(
|
|
49072
|
+
reject(logger9.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
49207
49073
|
}, timeout);
|
|
49208
49074
|
if (timer.unref) {
|
|
49209
49075
|
timer.unref();
|
|
@@ -49227,7 +49093,7 @@ class BaseProvider extends Provider {
|
|
|
49227
49093
|
try {
|
|
49228
49094
|
return BigNumber.from(result);
|
|
49229
49095
|
} catch (error) {
|
|
49230
|
-
return
|
|
49096
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49231
49097
|
method: "getGasPrice",
|
|
49232
49098
|
result,
|
|
49233
49099
|
error
|
|
@@ -49246,7 +49112,7 @@ class BaseProvider extends Provider {
|
|
|
49246
49112
|
try {
|
|
49247
49113
|
return BigNumber.from(result);
|
|
49248
49114
|
} catch (error) {
|
|
49249
|
-
return
|
|
49115
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49250
49116
|
method: "getBalance",
|
|
49251
49117
|
params,
|
|
49252
49118
|
result,
|
|
@@ -49266,7 +49132,7 @@ class BaseProvider extends Provider {
|
|
|
49266
49132
|
try {
|
|
49267
49133
|
return BigNumber.from(result).toNumber();
|
|
49268
49134
|
} catch (error) {
|
|
49269
|
-
return
|
|
49135
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49270
49136
|
method: "getTransactionCount",
|
|
49271
49137
|
params,
|
|
49272
49138
|
result,
|
|
@@ -49284,9 +49150,9 @@ class BaseProvider extends Provider {
|
|
|
49284
49150
|
});
|
|
49285
49151
|
const result = yield this.perform("getCode", params);
|
|
49286
49152
|
try {
|
|
49287
|
-
return
|
|
49153
|
+
return import_bytes6.hexlify(result);
|
|
49288
49154
|
} catch (error) {
|
|
49289
|
-
return
|
|
49155
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49290
49156
|
method: "getCode",
|
|
49291
49157
|
params,
|
|
49292
49158
|
result,
|
|
@@ -49301,13 +49167,13 @@ class BaseProvider extends Provider {
|
|
|
49301
49167
|
const params = yield import_properties6.resolveProperties({
|
|
49302
49168
|
address: this._getAddress(addressOrName),
|
|
49303
49169
|
blockTag: this._getBlockTag(blockTag),
|
|
49304
|
-
position: Promise.resolve(position).then((p) =>
|
|
49170
|
+
position: Promise.resolve(position).then((p) => import_bytes6.hexValue(p))
|
|
49305
49171
|
});
|
|
49306
49172
|
const result = yield this.perform("getStorageAt", params);
|
|
49307
49173
|
try {
|
|
49308
|
-
return
|
|
49174
|
+
return import_bytes6.hexlify(result);
|
|
49309
49175
|
} catch (error) {
|
|
49310
|
-
return
|
|
49176
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49311
49177
|
method: "getStorageAt",
|
|
49312
49178
|
params,
|
|
49313
49179
|
result,
|
|
@@ -49317,12 +49183,12 @@ class BaseProvider extends Provider {
|
|
|
49317
49183
|
});
|
|
49318
49184
|
}
|
|
49319
49185
|
_wrapTransaction(tx, hash, startBlock) {
|
|
49320
|
-
if (hash != null &&
|
|
49186
|
+
if (hash != null && import_bytes6.hexDataLength(hash) !== 32) {
|
|
49321
49187
|
throw new Error("invalid response - sendTransaction");
|
|
49322
49188
|
}
|
|
49323
49189
|
const result = tx;
|
|
49324
49190
|
if (hash != null && tx.hash !== hash) {
|
|
49325
|
-
|
|
49191
|
+
logger9.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
|
49326
49192
|
}
|
|
49327
49193
|
result.wait = (confirms, timeout) => __awaiter5(this, undefined, undefined, function* () {
|
|
49328
49194
|
if (confirms == null) {
|
|
@@ -49348,7 +49214,7 @@ class BaseProvider extends Provider {
|
|
|
49348
49214
|
}
|
|
49349
49215
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
49350
49216
|
if (receipt.status === 0) {
|
|
49351
|
-
|
|
49217
|
+
logger9.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
49352
49218
|
transactionHash: tx.hash,
|
|
49353
49219
|
transaction: tx,
|
|
49354
49220
|
receipt
|
|
@@ -49361,7 +49227,7 @@ class BaseProvider extends Provider {
|
|
|
49361
49227
|
sendTransaction(signedTransaction) {
|
|
49362
49228
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49363
49229
|
yield this.getNetwork();
|
|
49364
|
-
const hexTx = yield Promise.resolve(signedTransaction).then((t) =>
|
|
49230
|
+
const hexTx = yield Promise.resolve(signedTransaction).then((t) => import_bytes6.hexlify(t));
|
|
49365
49231
|
const tx = this.formatter.transaction(signedTransaction);
|
|
49366
49232
|
if (tx.confirmations == null) {
|
|
49367
49233
|
tx.confirmations = 0;
|
|
@@ -49406,7 +49272,7 @@ class BaseProvider extends Provider {
|
|
|
49406
49272
|
if (values[key] == null) {
|
|
49407
49273
|
return;
|
|
49408
49274
|
}
|
|
49409
|
-
tx[key] = Promise.resolve(values[key]).then((v) => v ?
|
|
49275
|
+
tx[key] = Promise.resolve(values[key]).then((v) => v ? import_bytes6.hexlify(v) : null);
|
|
49410
49276
|
});
|
|
49411
49277
|
return this.formatter.transactionRequest(yield import_properties6.resolveProperties(tx));
|
|
49412
49278
|
});
|
|
@@ -49436,19 +49302,19 @@ class BaseProvider extends Provider {
|
|
|
49436
49302
|
_call(transaction, blockTag, attempt) {
|
|
49437
49303
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49438
49304
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
49439
|
-
|
|
49305
|
+
logger9.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
49440
49306
|
redirects: attempt,
|
|
49441
49307
|
transaction
|
|
49442
49308
|
});
|
|
49443
49309
|
}
|
|
49444
49310
|
const txSender = transaction.to;
|
|
49445
49311
|
const result = yield this.perform("call", { transaction, blockTag });
|
|
49446
|
-
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" &&
|
|
49312
|
+
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" && import_bytes6.hexDataLength(result) % 32 === 4) {
|
|
49447
49313
|
try {
|
|
49448
|
-
const data =
|
|
49449
|
-
const sender =
|
|
49314
|
+
const data = import_bytes6.hexDataSlice(result, 4);
|
|
49315
|
+
const sender = import_bytes6.hexDataSlice(data, 0, 32);
|
|
49450
49316
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
49451
|
-
|
|
49317
|
+
logger9.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
49452
49318
|
name: "OffchainLookup",
|
|
49453
49319
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49454
49320
|
transaction,
|
|
@@ -49456,13 +49322,13 @@ class BaseProvider extends Provider {
|
|
|
49456
49322
|
});
|
|
49457
49323
|
}
|
|
49458
49324
|
const urls = [];
|
|
49459
|
-
const urlsOffset = BigNumber.from(
|
|
49460
|
-
const urlsLength = BigNumber.from(
|
|
49461
|
-
const urlsData =
|
|
49325
|
+
const urlsOffset = BigNumber.from(import_bytes6.hexDataSlice(data, 32, 64)).toNumber();
|
|
49326
|
+
const urlsLength = BigNumber.from(import_bytes6.hexDataSlice(data, urlsOffset, urlsOffset + 32)).toNumber();
|
|
49327
|
+
const urlsData = import_bytes6.hexDataSlice(data, urlsOffset + 32);
|
|
49462
49328
|
for (let u = 0;u < urlsLength; u++) {
|
|
49463
49329
|
const url = _parseString(urlsData, u * 32);
|
|
49464
49330
|
if (url == null) {
|
|
49465
|
-
|
|
49331
|
+
logger9.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
49466
49332
|
name: "OffchainLookup",
|
|
49467
49333
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49468
49334
|
transaction,
|
|
@@ -49472,19 +49338,19 @@ class BaseProvider extends Provider {
|
|
|
49472
49338
|
urls.push(url);
|
|
49473
49339
|
}
|
|
49474
49340
|
const calldata = _parseBytes(data, 64);
|
|
49475
|
-
if (!BigNumber.from(
|
|
49476
|
-
|
|
49341
|
+
if (!BigNumber.from(import_bytes6.hexDataSlice(data, 100, 128)).isZero()) {
|
|
49342
|
+
logger9.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
49477
49343
|
name: "OffchainLookup",
|
|
49478
49344
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49479
49345
|
transaction,
|
|
49480
49346
|
data: result
|
|
49481
49347
|
});
|
|
49482
49348
|
}
|
|
49483
|
-
const callbackSelector =
|
|
49349
|
+
const callbackSelector = import_bytes6.hexDataSlice(data, 96, 100);
|
|
49484
49350
|
const extraData = _parseBytes(data, 128);
|
|
49485
49351
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
49486
49352
|
if (ccipResult == null) {
|
|
49487
|
-
|
|
49353
|
+
logger9.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
49488
49354
|
name: "OffchainLookup",
|
|
49489
49355
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
49490
49356
|
transaction,
|
|
@@ -49493,7 +49359,7 @@ class BaseProvider extends Provider {
|
|
|
49493
49359
|
}
|
|
49494
49360
|
const tx = {
|
|
49495
49361
|
to: txSender,
|
|
49496
|
-
data:
|
|
49362
|
+
data: import_bytes6.hexConcat([callbackSelector, encodeBytes([ccipResult, extraData])])
|
|
49497
49363
|
};
|
|
49498
49364
|
return this._call(tx, blockTag, attempt + 1);
|
|
49499
49365
|
} catch (error) {
|
|
@@ -49503,9 +49369,9 @@ class BaseProvider extends Provider {
|
|
|
49503
49369
|
}
|
|
49504
49370
|
}
|
|
49505
49371
|
try {
|
|
49506
|
-
return
|
|
49372
|
+
return import_bytes6.hexlify(result);
|
|
49507
49373
|
} catch (error) {
|
|
49508
|
-
return
|
|
49374
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49509
49375
|
method: "call",
|
|
49510
49376
|
params: { transaction, blockTag },
|
|
49511
49377
|
result,
|
|
@@ -49535,7 +49401,7 @@ class BaseProvider extends Provider {
|
|
|
49535
49401
|
try {
|
|
49536
49402
|
return BigNumber.from(result);
|
|
49537
49403
|
} catch (error) {
|
|
49538
|
-
return
|
|
49404
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
49539
49405
|
method: "estimateGas",
|
|
49540
49406
|
params,
|
|
49541
49407
|
result,
|
|
@@ -49548,11 +49414,11 @@ class BaseProvider extends Provider {
|
|
|
49548
49414
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49549
49415
|
addressOrName = yield addressOrName;
|
|
49550
49416
|
if (typeof addressOrName !== "string") {
|
|
49551
|
-
|
|
49417
|
+
logger9.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
49552
49418
|
}
|
|
49553
49419
|
const address = yield this.resolveName(addressOrName);
|
|
49554
49420
|
if (address == null) {
|
|
49555
|
-
|
|
49421
|
+
logger9.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
49556
49422
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
49557
49423
|
});
|
|
49558
49424
|
}
|
|
@@ -49567,16 +49433,16 @@ class BaseProvider extends Provider {
|
|
|
49567
49433
|
const params = {
|
|
49568
49434
|
includeTransactions: !!includeTransactions
|
|
49569
49435
|
};
|
|
49570
|
-
if (
|
|
49436
|
+
if (import_bytes6.isHexString(blockHashOrBlockTag, 32)) {
|
|
49571
49437
|
params.blockHash = blockHashOrBlockTag;
|
|
49572
49438
|
} else {
|
|
49573
49439
|
try {
|
|
49574
49440
|
params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);
|
|
49575
|
-
if (
|
|
49441
|
+
if (import_bytes6.isHexString(params.blockTag)) {
|
|
49576
49442
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
49577
49443
|
}
|
|
49578
49444
|
} catch (error) {
|
|
49579
|
-
|
|
49445
|
+
logger9.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
49580
49446
|
}
|
|
49581
49447
|
}
|
|
49582
49448
|
return import_web.poll(() => __awaiter5(this, undefined, undefined, function* () {
|
|
@@ -49708,7 +49574,7 @@ class BaseProvider extends Provider {
|
|
|
49708
49574
|
blockTag = yield blockTag;
|
|
49709
49575
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
49710
49576
|
if (blockTag % 1) {
|
|
49711
|
-
|
|
49577
|
+
logger9.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
49712
49578
|
}
|
|
49713
49579
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
49714
49580
|
blockNumber += blockTag;
|
|
@@ -49749,7 +49615,7 @@ class BaseProvider extends Provider {
|
|
|
49749
49615
|
}
|
|
49750
49616
|
const network = yield this.getNetwork();
|
|
49751
49617
|
if (!network.ensAddress) {
|
|
49752
|
-
|
|
49618
|
+
logger9.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
49753
49619
|
}
|
|
49754
49620
|
try {
|
|
49755
49621
|
const addrData = yield this.call({
|
|
@@ -49767,12 +49633,12 @@ class BaseProvider extends Provider {
|
|
|
49767
49633
|
try {
|
|
49768
49634
|
return Promise.resolve(this.formatter.address(name));
|
|
49769
49635
|
} catch (error) {
|
|
49770
|
-
if (
|
|
49636
|
+
if (import_bytes6.isHexString(name)) {
|
|
49771
49637
|
throw error;
|
|
49772
49638
|
}
|
|
49773
49639
|
}
|
|
49774
49640
|
if (typeof name !== "string") {
|
|
49775
|
-
|
|
49641
|
+
logger9.throwArgumentError("invalid ENS name", "name", name);
|
|
49776
49642
|
}
|
|
49777
49643
|
const resolver = yield this.getResolver(name);
|
|
49778
49644
|
if (!resolver) {
|
|
@@ -49804,7 +49670,7 @@ class BaseProvider extends Provider {
|
|
|
49804
49670
|
getAvatar(nameOrAddress) {
|
|
49805
49671
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
49806
49672
|
let resolver = null;
|
|
49807
|
-
if (
|
|
49673
|
+
if (import_bytes6.isHexString(nameOrAddress)) {
|
|
49808
49674
|
const address = this.formatter.address(nameOrAddress);
|
|
49809
49675
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
49810
49676
|
const resolverAddress = yield this._getResolver(node, "getAvatar");
|
|
@@ -49848,7 +49714,7 @@ class BaseProvider extends Provider {
|
|
|
49848
49714
|
});
|
|
49849
49715
|
}
|
|
49850
49716
|
perform(method, params) {
|
|
49851
|
-
return
|
|
49717
|
+
return logger9.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
49852
49718
|
}
|
|
49853
49719
|
_startEvent(event) {
|
|
49854
49720
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -49959,7 +49825,7 @@ var import_properties10 = __toESM(require_lib4());
|
|
|
49959
49825
|
var import_properties8 = __toESM(require_lib4());
|
|
49960
49826
|
|
|
49961
49827
|
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
49962
|
-
var
|
|
49828
|
+
var import_bytes7 = __toESM(require_lib2());
|
|
49963
49829
|
var import_hash3 = __toESM(require_lib12());
|
|
49964
49830
|
var import_properties7 = __toESM(require_lib4());
|
|
49965
49831
|
var import_strings3 = __toESM(require_lib9());
|
|
@@ -49992,14 +49858,14 @@ var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
|
49992
49858
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49993
49859
|
});
|
|
49994
49860
|
};
|
|
49995
|
-
var
|
|
49861
|
+
var logger10 = new Logger(version10);
|
|
49996
49862
|
var errorGas = ["call", "estimateGas"];
|
|
49997
49863
|
function spelunk(value, requireData) {
|
|
49998
49864
|
if (value == null) {
|
|
49999
49865
|
return null;
|
|
50000
49866
|
}
|
|
50001
49867
|
if (typeof value.message === "string" && value.message.match("reverted")) {
|
|
50002
|
-
const data =
|
|
49868
|
+
const data = import_bytes7.isHexString(value.data) ? value.data : null;
|
|
50003
49869
|
if (!requireData || data) {
|
|
50004
49870
|
return { message: value.message, data };
|
|
50005
49871
|
}
|
|
@@ -50027,7 +49893,7 @@ function checkError(method, error, params) {
|
|
|
50027
49893
|
if (result) {
|
|
50028
49894
|
return result.data;
|
|
50029
49895
|
}
|
|
50030
|
-
|
|
49896
|
+
logger10.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
50031
49897
|
data: "0x",
|
|
50032
49898
|
transaction,
|
|
50033
49899
|
error
|
|
@@ -50039,7 +49905,7 @@ function checkError(method, error, params) {
|
|
|
50039
49905
|
result = spelunk(error, false);
|
|
50040
49906
|
}
|
|
50041
49907
|
if (result) {
|
|
50042
|
-
|
|
49908
|
+
logger10.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
50043
49909
|
reason: result.message,
|
|
50044
49910
|
method,
|
|
50045
49911
|
transaction,
|
|
@@ -50057,35 +49923,35 @@ function checkError(method, error, params) {
|
|
|
50057
49923
|
}
|
|
50058
49924
|
message = (message || "").toLowerCase();
|
|
50059
49925
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
50060
|
-
|
|
49926
|
+
logger10.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
50061
49927
|
error,
|
|
50062
49928
|
method,
|
|
50063
49929
|
transaction
|
|
50064
49930
|
});
|
|
50065
49931
|
}
|
|
50066
49932
|
if (message.match(/nonce (is )?too low/i)) {
|
|
50067
|
-
|
|
49933
|
+
logger10.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
50068
49934
|
error,
|
|
50069
49935
|
method,
|
|
50070
49936
|
transaction
|
|
50071
49937
|
});
|
|
50072
49938
|
}
|
|
50073
49939
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
50074
|
-
|
|
49940
|
+
logger10.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
50075
49941
|
error,
|
|
50076
49942
|
method,
|
|
50077
49943
|
transaction
|
|
50078
49944
|
});
|
|
50079
49945
|
}
|
|
50080
49946
|
if (message.match(/only replay-protected/i)) {
|
|
50081
|
-
|
|
49947
|
+
logger10.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50082
49948
|
error,
|
|
50083
49949
|
method,
|
|
50084
49950
|
transaction
|
|
50085
49951
|
});
|
|
50086
49952
|
}
|
|
50087
49953
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
50088
|
-
|
|
49954
|
+
logger10.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
50089
49955
|
error,
|
|
50090
49956
|
method,
|
|
50091
49957
|
transaction
|
|
@@ -50132,11 +49998,11 @@ class JsonRpcSigner extends Signer {
|
|
|
50132
49998
|
import_properties7.defineReadOnly(this, "_index", addressOrIndex);
|
|
50133
49999
|
import_properties7.defineReadOnly(this, "_address", null);
|
|
50134
50000
|
} else {
|
|
50135
|
-
|
|
50001
|
+
logger10.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
50136
50002
|
}
|
|
50137
50003
|
}
|
|
50138
50004
|
connect(provider) {
|
|
50139
|
-
return
|
|
50005
|
+
return logger10.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50140
50006
|
operation: "connect"
|
|
50141
50007
|
});
|
|
50142
50008
|
}
|
|
@@ -50149,7 +50015,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50149
50015
|
}
|
|
50150
50016
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
50151
50017
|
if (accounts.length <= this._index) {
|
|
50152
|
-
|
|
50018
|
+
logger10.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50153
50019
|
operation: "getAddress"
|
|
50154
50020
|
});
|
|
50155
50021
|
}
|
|
@@ -50176,7 +50042,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50176
50042
|
}
|
|
50177
50043
|
const address = yield this.provider.resolveName(to);
|
|
50178
50044
|
if (address == null) {
|
|
50179
|
-
|
|
50045
|
+
logger10.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
50180
50046
|
}
|
|
50181
50047
|
return address;
|
|
50182
50048
|
}));
|
|
@@ -50187,7 +50053,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50187
50053
|
}).then(({ tx, sender }) => {
|
|
50188
50054
|
if (tx.from != null) {
|
|
50189
50055
|
if (tx.from.toLowerCase() !== sender) {
|
|
50190
|
-
|
|
50056
|
+
logger10.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
50191
50057
|
}
|
|
50192
50058
|
} else {
|
|
50193
50059
|
tx.from = sender;
|
|
@@ -50197,7 +50063,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50197
50063
|
return hash;
|
|
50198
50064
|
}, (error) => {
|
|
50199
50065
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50200
|
-
|
|
50066
|
+
logger10.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
50201
50067
|
action: "sendTransaction",
|
|
50202
50068
|
transaction: tx
|
|
50203
50069
|
});
|
|
@@ -50207,7 +50073,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50207
50073
|
});
|
|
50208
50074
|
}
|
|
50209
50075
|
signTransaction(transaction) {
|
|
50210
|
-
return
|
|
50076
|
+
return logger10.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50211
50077
|
operation: "signTransaction"
|
|
50212
50078
|
});
|
|
50213
50079
|
}
|
|
@@ -50234,10 +50100,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50234
50100
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50235
50101
|
const address = yield this.getAddress();
|
|
50236
50102
|
try {
|
|
50237
|
-
return yield this.provider.send("personal_sign", [
|
|
50103
|
+
return yield this.provider.send("personal_sign", [import_bytes7.hexlify(data), address.toLowerCase()]);
|
|
50238
50104
|
} catch (error) {
|
|
50239
50105
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50240
|
-
|
|
50106
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50241
50107
|
action: "signMessage",
|
|
50242
50108
|
from: address,
|
|
50243
50109
|
messageData: message
|
|
@@ -50252,10 +50118,10 @@ class JsonRpcSigner extends Signer {
|
|
|
50252
50118
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
50253
50119
|
const address = yield this.getAddress();
|
|
50254
50120
|
try {
|
|
50255
|
-
return yield this.provider.send("eth_sign", [address.toLowerCase(),
|
|
50121
|
+
return yield this.provider.send("eth_sign", [address.toLowerCase(), import_bytes7.hexlify(data)]);
|
|
50256
50122
|
} catch (error) {
|
|
50257
50123
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50258
|
-
|
|
50124
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50259
50125
|
action: "_legacySignMessage",
|
|
50260
50126
|
from: address,
|
|
50261
50127
|
messageData: message
|
|
@@ -50278,7 +50144,7 @@ class JsonRpcSigner extends Signer {
|
|
|
50278
50144
|
]);
|
|
50279
50145
|
} catch (error) {
|
|
50280
50146
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
50281
|
-
|
|
50147
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
50282
50148
|
action: "_signTypedData",
|
|
50283
50149
|
from: address,
|
|
50284
50150
|
messageData: { domain: populated.domain, types: types2, value: populated.value }
|
|
@@ -50392,14 +50258,14 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50392
50258
|
try {
|
|
50393
50259
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
50394
50260
|
} catch (error) {
|
|
50395
|
-
return
|
|
50261
|
+
return logger10.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50396
50262
|
chainId,
|
|
50397
50263
|
event: "invalidNetwork",
|
|
50398
50264
|
serverError: error
|
|
50399
50265
|
});
|
|
50400
50266
|
}
|
|
50401
50267
|
}
|
|
50402
|
-
return
|
|
50268
|
+
return logger10.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
50403
50269
|
event: "noNetwork"
|
|
50404
50270
|
});
|
|
50405
50271
|
});
|
|
@@ -50469,7 +50335,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50469
50335
|
case "getCode":
|
|
50470
50336
|
return ["eth_getCode", [getLowerCase(params.address), params.blockTag]];
|
|
50471
50337
|
case "getStorageAt":
|
|
50472
|
-
return ["eth_getStorageAt", [getLowerCase(params.address),
|
|
50338
|
+
return ["eth_getStorageAt", [getLowerCase(params.address), import_bytes7.hexZeroPad(params.position, 32), params.blockTag]];
|
|
50473
50339
|
case "sendTransaction":
|
|
50474
50340
|
return ["eth_sendRawTransaction", [params.signedTransaction]];
|
|
50475
50341
|
case "getBlock":
|
|
@@ -50518,7 +50384,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50518
50384
|
}
|
|
50519
50385
|
const args = this.prepareRequest(method, params);
|
|
50520
50386
|
if (args == null) {
|
|
50521
|
-
|
|
50387
|
+
logger10.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
50522
50388
|
}
|
|
50523
50389
|
try {
|
|
50524
50390
|
return yield this.send(args[0], args[1]);
|
|
@@ -50595,7 +50461,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50595
50461
|
if (transaction[key] == null) {
|
|
50596
50462
|
return;
|
|
50597
50463
|
}
|
|
50598
|
-
const value =
|
|
50464
|
+
const value = import_bytes7.hexValue(BigNumber.from(transaction[key]));
|
|
50599
50465
|
if (key === "gasLimit") {
|
|
50600
50466
|
key = "gas";
|
|
50601
50467
|
}
|
|
@@ -50605,7 +50471,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
50605
50471
|
if (transaction[key] == null) {
|
|
50606
50472
|
return;
|
|
50607
50473
|
}
|
|
50608
|
-
result[key] =
|
|
50474
|
+
result[key] = import_bytes7.hexlify(transaction[key]);
|
|
50609
50475
|
});
|
|
50610
50476
|
if (transaction.accessList) {
|
|
50611
50477
|
result["accessList"] = import_transactions4.accessListify(transaction.accessList);
|
|
@@ -50622,9 +50488,9 @@ try {
|
|
|
50622
50488
|
throw new Error("inject please");
|
|
50623
50489
|
}
|
|
50624
50490
|
} catch (error) {
|
|
50625
|
-
const
|
|
50491
|
+
const logger11 = new Logger(version10);
|
|
50626
50492
|
WS = function() {
|
|
50627
|
-
|
|
50493
|
+
logger11.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50628
50494
|
operation: "new WebSocket()"
|
|
50629
50495
|
});
|
|
50630
50496
|
};
|
|
@@ -50658,13 +50524,13 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
50658
50524
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50659
50525
|
});
|
|
50660
50526
|
};
|
|
50661
|
-
var
|
|
50527
|
+
var logger11 = new Logger(version10);
|
|
50662
50528
|
var NextId = 1;
|
|
50663
50529
|
|
|
50664
50530
|
class WebSocketProvider extends JsonRpcProvider {
|
|
50665
50531
|
constructor(url, network) {
|
|
50666
50532
|
if (network === "any") {
|
|
50667
|
-
|
|
50533
|
+
logger11.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50668
50534
|
operation: "network:any"
|
|
50669
50535
|
});
|
|
50670
50536
|
}
|
|
@@ -50748,12 +50614,12 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50748
50614
|
return 0;
|
|
50749
50615
|
}
|
|
50750
50616
|
resetEventsBlock(blockNumber) {
|
|
50751
|
-
|
|
50617
|
+
logger11.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50752
50618
|
operation: "resetEventBlock"
|
|
50753
50619
|
});
|
|
50754
50620
|
}
|
|
50755
50621
|
set pollingInterval(value) {
|
|
50756
|
-
|
|
50622
|
+
logger11.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50757
50623
|
operation: "setPollingInterval"
|
|
50758
50624
|
});
|
|
50759
50625
|
}
|
|
@@ -50766,7 +50632,7 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
50766
50632
|
if (!value) {
|
|
50767
50633
|
return;
|
|
50768
50634
|
}
|
|
50769
|
-
|
|
50635
|
+
logger11.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50770
50636
|
operation: "setPolling"
|
|
50771
50637
|
});
|
|
50772
50638
|
}
|
|
@@ -50930,7 +50796,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
50930
50796
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50931
50797
|
});
|
|
50932
50798
|
};
|
|
50933
|
-
var
|
|
50799
|
+
var logger12 = new Logger(version10);
|
|
50934
50800
|
|
|
50935
50801
|
class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
50936
50802
|
detectNetwork() {
|
|
@@ -50942,7 +50808,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50942
50808
|
if (network == null) {
|
|
50943
50809
|
network = yield _super.detectNetwork.call(this);
|
|
50944
50810
|
if (!network) {
|
|
50945
|
-
|
|
50811
|
+
logger12.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
50946
50812
|
}
|
|
50947
50813
|
if (this._network == null) {
|
|
50948
50814
|
import_properties9.defineReadOnly(this, "_network", network);
|
|
@@ -50956,7 +50822,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
50956
50822
|
|
|
50957
50823
|
class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
50958
50824
|
constructor(network, apiKey) {
|
|
50959
|
-
|
|
50825
|
+
logger12.checkAbstract(new.target, UrlJsonRpcProvider);
|
|
50960
50826
|
network = import_properties9.getStatic(new.target, "getNetwork")(network);
|
|
50961
50827
|
apiKey = import_properties9.getStatic(new.target, "getApiKey")(apiKey);
|
|
50962
50828
|
const connection = import_properties9.getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -50970,13 +50836,13 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50970
50836
|
}
|
|
50971
50837
|
}
|
|
50972
50838
|
_startPending() {
|
|
50973
|
-
|
|
50839
|
+
logger12.warn("WARNING: API provider does not support pending filters");
|
|
50974
50840
|
}
|
|
50975
50841
|
isCommunityResource() {
|
|
50976
50842
|
return false;
|
|
50977
50843
|
}
|
|
50978
50844
|
getSigner(address) {
|
|
50979
|
-
return
|
|
50845
|
+
return logger12.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
50980
50846
|
}
|
|
50981
50847
|
listAccounts() {
|
|
50982
50848
|
return Promise.resolve([]);
|
|
@@ -50985,14 +50851,14 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
50985
50851
|
return apiKey;
|
|
50986
50852
|
}
|
|
50987
50853
|
static getUrl(network, apiKey) {
|
|
50988
|
-
return
|
|
50854
|
+
return logger12.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
50989
50855
|
operation: "getUrl"
|
|
50990
50856
|
});
|
|
50991
50857
|
}
|
|
50992
50858
|
}
|
|
50993
50859
|
|
|
50994
50860
|
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
50995
|
-
var
|
|
50861
|
+
var logger13 = new Logger(version10);
|
|
50996
50862
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
50997
50863
|
|
|
50998
50864
|
class AlchemyWebSocketProvider extends WebSocketProvider {
|
|
@@ -51016,7 +50882,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
51016
50882
|
return defaultApiKey;
|
|
51017
50883
|
}
|
|
51018
50884
|
if (apiKey && typeof apiKey !== "string") {
|
|
51019
|
-
|
|
50885
|
+
logger13.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
51020
50886
|
}
|
|
51021
50887
|
return apiKey;
|
|
51022
50888
|
}
|
|
@@ -51048,7 +50914,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
51048
50914
|
host = "opt-goerli.g.alchemy.com/v2/";
|
|
51049
50915
|
break;
|
|
51050
50916
|
default:
|
|
51051
|
-
|
|
50917
|
+
logger13.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
51052
50918
|
}
|
|
51053
50919
|
return {
|
|
51054
50920
|
allowGzip: true,
|
|
@@ -51067,7 +50933,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
51067
50933
|
}
|
|
51068
50934
|
|
|
51069
50935
|
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
51070
|
-
var
|
|
50936
|
+
var logger14 = new Logger(version10);
|
|
51071
50937
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
51072
50938
|
function getHost(name) {
|
|
51073
50939
|
switch (name) {
|
|
@@ -51084,7 +50950,7 @@ function getHost(name) {
|
|
|
51084
50950
|
case "arbitrum":
|
|
51085
50951
|
return "rpc.ankr.com/arbitrum/";
|
|
51086
50952
|
}
|
|
51087
|
-
return
|
|
50953
|
+
return logger14.throwArgumentError("unsupported network", "name", name);
|
|
51088
50954
|
}
|
|
51089
50955
|
|
|
51090
50956
|
class AnkrProvider extends UrlJsonRpcProvider {
|
|
@@ -51147,12 +51013,12 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
51147
51013
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51148
51014
|
});
|
|
51149
51015
|
};
|
|
51150
|
-
var
|
|
51016
|
+
var logger15 = new Logger(version10);
|
|
51151
51017
|
|
|
51152
51018
|
class CloudflareProvider extends UrlJsonRpcProvider {
|
|
51153
51019
|
static getApiKey(apiKey) {
|
|
51154
51020
|
if (apiKey != null) {
|
|
51155
|
-
|
|
51021
|
+
logger15.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
51156
51022
|
}
|
|
51157
51023
|
return null;
|
|
51158
51024
|
}
|
|
@@ -51163,7 +51029,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
51163
51029
|
host = "https://cloudflare-eth.com/";
|
|
51164
51030
|
break;
|
|
51165
51031
|
default:
|
|
51166
|
-
|
|
51032
|
+
logger15.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
51167
51033
|
}
|
|
51168
51034
|
return host;
|
|
51169
51035
|
}
|
|
@@ -51182,7 +51048,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
51182
51048
|
}
|
|
51183
51049
|
|
|
51184
51050
|
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
51185
|
-
var
|
|
51051
|
+
var import_bytes8 = __toESM(require_lib2());
|
|
51186
51052
|
var import_properties11 = __toESM(require_lib4());
|
|
51187
51053
|
var import_transactions5 = __toESM(require_lib15());
|
|
51188
51054
|
var import_web3 = __toESM(require_lib23());
|
|
@@ -51213,7 +51079,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
51213
51079
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51214
51080
|
});
|
|
51215
51081
|
};
|
|
51216
|
-
var
|
|
51082
|
+
var logger16 = new Logger(version10);
|
|
51217
51083
|
function getTransactionPostData(transaction) {
|
|
51218
51084
|
const result = {};
|
|
51219
51085
|
for (let key in transaction) {
|
|
@@ -51225,13 +51091,13 @@ function getTransactionPostData(transaction) {
|
|
|
51225
51091
|
continue;
|
|
51226
51092
|
}
|
|
51227
51093
|
if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {
|
|
51228
|
-
value =
|
|
51094
|
+
value = import_bytes8.hexValue(import_bytes8.hexlify(value));
|
|
51229
51095
|
} else if (key === "accessList") {
|
|
51230
51096
|
value = "[" + import_transactions5.accessListify(value).map((set) => {
|
|
51231
51097
|
return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`;
|
|
51232
51098
|
}).join(",") + "]";
|
|
51233
51099
|
} else {
|
|
51234
|
-
value =
|
|
51100
|
+
value = import_bytes8.hexlify(value);
|
|
51235
51101
|
}
|
|
51236
51102
|
result[key] = value;
|
|
51237
51103
|
}
|
|
@@ -51292,10 +51158,10 @@ function checkError2(method, error, transaction) {
|
|
|
51292
51158
|
if (data) {
|
|
51293
51159
|
data = "0x" + data.replace(/^.*0x/i, "");
|
|
51294
51160
|
}
|
|
51295
|
-
if (
|
|
51161
|
+
if (import_bytes8.isHexString(data)) {
|
|
51296
51162
|
return data;
|
|
51297
51163
|
}
|
|
51298
|
-
|
|
51164
|
+
logger16.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
51299
51165
|
error,
|
|
51300
51166
|
data: "0x"
|
|
51301
51167
|
});
|
|
@@ -51313,28 +51179,28 @@ function checkError2(method, error, transaction) {
|
|
|
51313
51179
|
}
|
|
51314
51180
|
message = (message || "").toLowerCase();
|
|
51315
51181
|
if (message.match(/insufficient funds/)) {
|
|
51316
|
-
|
|
51182
|
+
logger16.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
51317
51183
|
error,
|
|
51318
51184
|
method,
|
|
51319
51185
|
transaction
|
|
51320
51186
|
});
|
|
51321
51187
|
}
|
|
51322
51188
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
51323
|
-
|
|
51189
|
+
logger16.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
51324
51190
|
error,
|
|
51325
51191
|
method,
|
|
51326
51192
|
transaction
|
|
51327
51193
|
});
|
|
51328
51194
|
}
|
|
51329
51195
|
if (message.match(/another transaction with same nonce/)) {
|
|
51330
|
-
|
|
51196
|
+
logger16.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
51331
51197
|
error,
|
|
51332
51198
|
method,
|
|
51333
51199
|
transaction
|
|
51334
51200
|
});
|
|
51335
51201
|
}
|
|
51336
51202
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
51337
|
-
|
|
51203
|
+
logger16.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
51338
51204
|
error,
|
|
51339
51205
|
method,
|
|
51340
51206
|
transaction
|
|
@@ -51371,7 +51237,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51371
51237
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
51372
51238
|
default:
|
|
51373
51239
|
}
|
|
51374
|
-
return
|
|
51240
|
+
return logger16.throwArgumentError("unsupported network", "network", this.network.name);
|
|
51375
51241
|
}
|
|
51376
51242
|
getUrl(module2, params) {
|
|
51377
51243
|
const query = Object.keys(params).reduce((accum, key) => {
|
|
@@ -51531,12 +51397,12 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51531
51397
|
}
|
|
51532
51398
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
51533
51399
|
if (params.filter.topics.length > 1) {
|
|
51534
|
-
|
|
51400
|
+
logger16.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
51535
51401
|
}
|
|
51536
51402
|
if (params.filter.topics.length === 1) {
|
|
51537
51403
|
const topic0 = params.filter.topics[0];
|
|
51538
51404
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
51539
|
-
|
|
51405
|
+
logger16.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
51540
51406
|
}
|
|
51541
51407
|
args.topic0 = topic0;
|
|
51542
51408
|
}
|
|
@@ -51602,7 +51468,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
51602
51468
|
}
|
|
51603
51469
|
|
|
51604
51470
|
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
51605
|
-
var
|
|
51471
|
+
var import_bytes9 = __toESM(require_lib2());
|
|
51606
51472
|
var import_properties12 = __toESM(require_lib4());
|
|
51607
51473
|
var import_random2 = __toESM(require_lib21());
|
|
51608
51474
|
var import_web4 = __toESM(require_lib23());
|
|
@@ -51633,7 +51499,7 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
51633
51499
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51634
51500
|
});
|
|
51635
51501
|
};
|
|
51636
|
-
var
|
|
51502
|
+
var logger17 = new Logger(version10);
|
|
51637
51503
|
function now() {
|
|
51638
51504
|
return new Date().getTime();
|
|
51639
51505
|
}
|
|
@@ -51646,7 +51512,7 @@ function checkNetworks(networks2) {
|
|
|
51646
51512
|
}
|
|
51647
51513
|
if (result) {
|
|
51648
51514
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
51649
|
-
|
|
51515
|
+
logger17.throwArgumentError("provider mismatch", "networks", networks2);
|
|
51650
51516
|
}
|
|
51651
51517
|
} else {
|
|
51652
51518
|
result = network;
|
|
@@ -51882,23 +51748,23 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51882
51748
|
case "getBalance":
|
|
51883
51749
|
case "getTransactionCount":
|
|
51884
51750
|
case "getCode":
|
|
51885
|
-
if (params.blockTag &&
|
|
51751
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
51886
51752
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51887
51753
|
}
|
|
51888
51754
|
return provider[method](params.address, params.blockTag || "latest");
|
|
51889
51755
|
case "getStorageAt":
|
|
51890
|
-
if (params.blockTag &&
|
|
51756
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
51891
51757
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51892
51758
|
}
|
|
51893
51759
|
return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");
|
|
51894
51760
|
case "getBlock":
|
|
51895
|
-
if (params.blockTag &&
|
|
51761
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
51896
51762
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51897
51763
|
}
|
|
51898
51764
|
return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);
|
|
51899
51765
|
case "call":
|
|
51900
51766
|
case "estimateGas":
|
|
51901
|
-
if (params.blockTag &&
|
|
51767
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
51902
51768
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51903
51769
|
}
|
|
51904
51770
|
if (method === "call" && params.blockTag) {
|
|
@@ -51910,13 +51776,13 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51910
51776
|
return provider[method](params.transactionHash);
|
|
51911
51777
|
case "getLogs": {
|
|
51912
51778
|
let filter = params.filter;
|
|
51913
|
-
if (filter.fromBlock &&
|
|
51779
|
+
if (filter.fromBlock && import_bytes9.isHexString(filter.fromBlock) || filter.toBlock && import_bytes9.isHexString(filter.toBlock)) {
|
|
51914
51780
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
51915
51781
|
}
|
|
51916
51782
|
return provider.getLogs(filter);
|
|
51917
51783
|
}
|
|
51918
51784
|
}
|
|
51919
|
-
return
|
|
51785
|
+
return logger17.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
51920
51786
|
method,
|
|
51921
51787
|
params
|
|
51922
51788
|
});
|
|
@@ -51926,7 +51792,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
51926
51792
|
class FallbackProvider extends BaseProvider {
|
|
51927
51793
|
constructor(providers, quorum) {
|
|
51928
51794
|
if (providers.length === 0) {
|
|
51929
|
-
|
|
51795
|
+
logger17.throwArgumentError("missing providers", "providers", providers);
|
|
51930
51796
|
}
|
|
51931
51797
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
51932
51798
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -51946,7 +51812,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51946
51812
|
}
|
|
51947
51813
|
const weight = config.weight;
|
|
51948
51814
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
51949
|
-
|
|
51815
|
+
logger17.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
51950
51816
|
}
|
|
51951
51817
|
return Object.freeze(config);
|
|
51952
51818
|
});
|
|
@@ -51954,7 +51820,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
51954
51820
|
if (quorum == null) {
|
|
51955
51821
|
quorum = total / 2;
|
|
51956
51822
|
} else if (quorum > total) {
|
|
51957
|
-
|
|
51823
|
+
logger17.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
51958
51824
|
}
|
|
51959
51825
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
51960
51826
|
if (networkOrReady == null) {
|
|
@@ -52111,7 +51977,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
52111
51977
|
}
|
|
52112
51978
|
props[name] = e[name];
|
|
52113
51979
|
});
|
|
52114
|
-
|
|
51980
|
+
logger17.throwError(e.reason || e.message, errorCode, props);
|
|
52115
51981
|
});
|
|
52116
51982
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
52117
51983
|
break;
|
|
@@ -52123,7 +51989,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
52123
51989
|
}
|
|
52124
51990
|
c.cancelled = true;
|
|
52125
51991
|
});
|
|
52126
|
-
return
|
|
51992
|
+
return logger17.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
52127
51993
|
method,
|
|
52128
51994
|
params,
|
|
52129
51995
|
results: configs.map((c) => exposeDebugConfig(c)),
|
|
@@ -52138,7 +52004,7 @@ var IpcProvider = null;
|
|
|
52138
52004
|
|
|
52139
52005
|
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
52140
52006
|
var import_properties13 = __toESM(require_lib4());
|
|
52141
|
-
var
|
|
52007
|
+
var logger18 = new Logger(version10);
|
|
52142
52008
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
52143
52009
|
|
|
52144
52010
|
class InfuraWebSocketProvider extends WebSocketProvider {
|
|
@@ -52146,7 +52012,7 @@ class InfuraWebSocketProvider extends WebSocketProvider {
|
|
|
52146
52012
|
const provider = new InfuraProvider(network, apiKey);
|
|
52147
52013
|
const connection = provider.connection;
|
|
52148
52014
|
if (connection.password) {
|
|
52149
|
-
|
|
52015
|
+
logger18.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52150
52016
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
52151
52017
|
});
|
|
52152
52018
|
}
|
|
@@ -52177,8 +52043,8 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52177
52043
|
if (typeof apiKey === "string") {
|
|
52178
52044
|
apiKeyObj.projectId = apiKey;
|
|
52179
52045
|
} else if (apiKey.projectSecret != null) {
|
|
52180
|
-
|
|
52181
|
-
|
|
52046
|
+
logger18.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
52047
|
+
logger18.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
52182
52048
|
apiKeyObj.projectId = apiKey.projectId;
|
|
52183
52049
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
52184
52050
|
} else if (apiKey.projectId) {
|
|
@@ -52218,7 +52084,7 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
52218
52084
|
host = "arbitrum-goerli.infura.io";
|
|
52219
52085
|
break;
|
|
52220
52086
|
default:
|
|
52221
|
-
|
|
52087
|
+
logger18.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52222
52088
|
argument: "network",
|
|
52223
52089
|
value: network
|
|
52224
52090
|
});
|
|
@@ -52311,18 +52177,18 @@ class JsonRpcBatchProvider extends JsonRpcProvider {
|
|
|
52311
52177
|
}
|
|
52312
52178
|
|
|
52313
52179
|
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
52314
|
-
var
|
|
52180
|
+
var logger19 = new Logger(version10);
|
|
52315
52181
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
52316
52182
|
|
|
52317
52183
|
class NodesmithProvider extends UrlJsonRpcProvider {
|
|
52318
52184
|
static getApiKey(apiKey) {
|
|
52319
52185
|
if (apiKey && typeof apiKey !== "string") {
|
|
52320
|
-
|
|
52186
|
+
logger19.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
52321
52187
|
}
|
|
52322
52188
|
return apiKey || defaultApiKey3;
|
|
52323
52189
|
}
|
|
52324
52190
|
static getUrl(network, apiKey) {
|
|
52325
|
-
|
|
52191
|
+
logger19.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
52326
52192
|
let host = null;
|
|
52327
52193
|
switch (network.name) {
|
|
52328
52194
|
case "homestead":
|
|
@@ -52341,14 +52207,14 @@ class NodesmithProvider extends UrlJsonRpcProvider {
|
|
|
52341
52207
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
52342
52208
|
break;
|
|
52343
52209
|
default:
|
|
52344
|
-
|
|
52210
|
+
logger19.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
52345
52211
|
}
|
|
52346
52212
|
return host + "?apiKey=" + apiKey;
|
|
52347
52213
|
}
|
|
52348
52214
|
}
|
|
52349
52215
|
|
|
52350
52216
|
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
52351
|
-
var
|
|
52217
|
+
var logger20 = new Logger(version10);
|
|
52352
52218
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
52353
52219
|
|
|
52354
52220
|
class PocketProvider extends UrlJsonRpcProvider {
|
|
@@ -52368,7 +52234,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52368
52234
|
} else if (apiKey.applicationId) {
|
|
52369
52235
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
52370
52236
|
} else {
|
|
52371
|
-
|
|
52237
|
+
logger20.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
52372
52238
|
}
|
|
52373
52239
|
return apiKeyObj;
|
|
52374
52240
|
}
|
|
@@ -52397,7 +52263,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52397
52263
|
host = "eth-ropsten.gateway.pokt.network";
|
|
52398
52264
|
break;
|
|
52399
52265
|
default:
|
|
52400
|
-
|
|
52266
|
+
logger20.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
52401
52267
|
argument: "network",
|
|
52402
52268
|
value: network
|
|
52403
52269
|
});
|
|
@@ -52417,7 +52283,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
52417
52283
|
|
|
52418
52284
|
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
52419
52285
|
var import_properties15 = __toESM(require_lib4());
|
|
52420
|
-
var
|
|
52286
|
+
var logger21 = new Logger(version10);
|
|
52421
52287
|
var _nextId = 1;
|
|
52422
52288
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
52423
52289
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -52501,7 +52367,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
52501
52367
|
class Web3Provider extends JsonRpcProvider {
|
|
52502
52368
|
constructor(provider, network) {
|
|
52503
52369
|
if (provider == null) {
|
|
52504
|
-
|
|
52370
|
+
logger21.throwArgumentError("missing provider", "provider", provider);
|
|
52505
52371
|
}
|
|
52506
52372
|
let path = null;
|
|
52507
52373
|
let jsonRpcFetchFunc = null;
|
|
@@ -52525,7 +52391,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52525
52391
|
} else if (provider.send) {
|
|
52526
52392
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
52527
52393
|
} else {
|
|
52528
|
-
|
|
52394
|
+
logger21.throwArgumentError("unsupported provider", "provider", provider);
|
|
52529
52395
|
}
|
|
52530
52396
|
if (!path) {
|
|
52531
52397
|
path = "unknown:";
|
|
@@ -52541,7 +52407,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
52541
52407
|
}
|
|
52542
52408
|
|
|
52543
52409
|
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
52544
|
-
var
|
|
52410
|
+
var logger22 = new Logger(version10);
|
|
52545
52411
|
function getDefaultProvider(network, options) {
|
|
52546
52412
|
if (network == null) {
|
|
52547
52413
|
network = "homestead";
|
|
@@ -52557,13 +52423,13 @@ function getDefaultProvider(network, options) {
|
|
|
52557
52423
|
case "wss":
|
|
52558
52424
|
return new WebSocketProvider(network);
|
|
52559
52425
|
default:
|
|
52560
|
-
|
|
52426
|
+
logger22.throwArgumentError("unsupported URL scheme", "network", network);
|
|
52561
52427
|
}
|
|
52562
52428
|
}
|
|
52563
52429
|
}
|
|
52564
52430
|
const n = getNetwork(network);
|
|
52565
52431
|
if (!n || !n._defaultProvider) {
|
|
52566
|
-
|
|
52432
|
+
logger22.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
52567
52433
|
operation: "getDefaultProvider",
|
|
52568
52434
|
network
|
|
52569
52435
|
});
|
|
@@ -52588,15 +52454,15 @@ var import_hash4 = __toESM(require_lib12());
|
|
|
52588
52454
|
var import_properties16 = __toESM(require_lib4());
|
|
52589
52455
|
|
|
52590
52456
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
52591
|
-
var
|
|
52457
|
+
var version11 = "wordlists/5.7.0";
|
|
52592
52458
|
|
|
52593
52459
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
52594
52460
|
var exportWordlist = false;
|
|
52595
|
-
var
|
|
52461
|
+
var logger23 = new Logger(version11);
|
|
52596
52462
|
|
|
52597
52463
|
class Wordlist {
|
|
52598
52464
|
constructor(locale) {
|
|
52599
|
-
|
|
52465
|
+
logger23.checkAbstract(new.target, Wordlist);
|
|
52600
52466
|
import_properties16.defineReadOnly(this, "locale", locale);
|
|
52601
52467
|
}
|
|
52602
52468
|
split(mnemonic) {
|
|
@@ -52673,14 +52539,14 @@ var wordlists = {
|
|
|
52673
52539
|
// node_modules/ethers/lib.esm/utils.js
|
|
52674
52540
|
var exports_utils = {};
|
|
52675
52541
|
__export(exports_utils, {
|
|
52676
|
-
zeroPad: () =>
|
|
52542
|
+
zeroPad: () => import_bytes10.zeroPad,
|
|
52677
52543
|
verifyTypedData: () => verifyTypedData,
|
|
52678
52544
|
verifyMessage: () => verifyMessage,
|
|
52679
52545
|
toUtf8String: () => import_strings4.toUtf8String,
|
|
52680
52546
|
toUtf8CodePoints: () => import_strings4.toUtf8CodePoints,
|
|
52681
52547
|
toUtf8Bytes: () => import_strings4.toUtf8Bytes,
|
|
52682
|
-
stripZeros: () =>
|
|
52683
|
-
splitSignature: () =>
|
|
52548
|
+
stripZeros: () => import_bytes10.stripZeros,
|
|
52549
|
+
splitSignature: () => import_bytes10.splitSignature,
|
|
52684
52550
|
soliditySha256: () => import_solidity.sha256,
|
|
52685
52551
|
solidityPack: () => import_solidity.pack,
|
|
52686
52552
|
solidityKeccak256: () => import_solidity.keccak256,
|
|
@@ -52703,29 +52569,29 @@ __export(exports_utils, {
|
|
|
52703
52569
|
namehash: () => import_hash5.namehash,
|
|
52704
52570
|
mnemonicToSeed: () => import_hdnode2.mnemonicToSeed,
|
|
52705
52571
|
mnemonicToEntropy: () => import_hdnode2.mnemonicToEntropy,
|
|
52706
|
-
keccak256: () =>
|
|
52707
|
-
joinSignature: () =>
|
|
52572
|
+
keccak256: () => import_keccak2562.keccak256,
|
|
52573
|
+
joinSignature: () => import_bytes10.joinSignature,
|
|
52708
52574
|
isValidName: () => import_hash5.isValidName,
|
|
52709
52575
|
isValidMnemonic: () => import_hdnode2.isValidMnemonic,
|
|
52710
|
-
isHexString: () =>
|
|
52711
|
-
isBytesLike: () =>
|
|
52712
|
-
isBytes: () =>
|
|
52713
|
-
isAddress: () => isAddress,
|
|
52576
|
+
isHexString: () => import_bytes10.isHexString,
|
|
52577
|
+
isBytesLike: () => import_bytes10.isBytesLike,
|
|
52578
|
+
isBytes: () => import_bytes10.isBytes,
|
|
52579
|
+
isAddress: () => import_address5.isAddress,
|
|
52714
52580
|
id: () => import_hash5.id,
|
|
52715
|
-
hexlify: () =>
|
|
52716
|
-
hexZeroPad: () =>
|
|
52717
|
-
hexValue: () =>
|
|
52718
|
-
hexStripZeros: () =>
|
|
52719
|
-
hexDataSlice: () =>
|
|
52720
|
-
hexDataLength: () =>
|
|
52721
|
-
hexConcat: () =>
|
|
52581
|
+
hexlify: () => import_bytes10.hexlify,
|
|
52582
|
+
hexZeroPad: () => import_bytes10.hexZeroPad,
|
|
52583
|
+
hexValue: () => import_bytes10.hexValue,
|
|
52584
|
+
hexStripZeros: () => import_bytes10.hexStripZeros,
|
|
52585
|
+
hexDataSlice: () => import_bytes10.hexDataSlice,
|
|
52586
|
+
hexDataLength: () => import_bytes10.hexDataLength,
|
|
52587
|
+
hexConcat: () => import_bytes10.hexConcat,
|
|
52722
52588
|
hashMessage: () => import_hash5.hashMessage,
|
|
52723
52589
|
getStatic: () => import_properties17.getStatic,
|
|
52724
52590
|
getJsonWalletAddress: () => import_json_wallets2.getJsonWalletAddress,
|
|
52725
|
-
getIcapAddress: () => getIcapAddress,
|
|
52726
|
-
getCreate2Address: () => getCreate2Address,
|
|
52727
|
-
getContractAddress: () => getContractAddress,
|
|
52728
|
-
getAddress: () => getAddress,
|
|
52591
|
+
getIcapAddress: () => import_address5.getIcapAddress,
|
|
52592
|
+
getCreate2Address: () => import_address5.getCreate2Address,
|
|
52593
|
+
getContractAddress: () => import_address5.getContractAddress,
|
|
52594
|
+
getAddress: () => import_address5.getAddress,
|
|
52729
52595
|
getAccountPath: () => import_hdnode2.getAccountPath,
|
|
52730
52596
|
formatUnits: () => import_units.formatUnits,
|
|
52731
52597
|
formatEther: () => import_units.formatEther,
|
|
@@ -52737,7 +52603,7 @@ __export(exports_utils, {
|
|
|
52737
52603
|
defaultPath: () => import_hdnode2.defaultPath,
|
|
52738
52604
|
defaultAbiCoder: () => import_abi2.defaultAbiCoder,
|
|
52739
52605
|
deepCopy: () => import_properties17.deepCopy,
|
|
52740
|
-
concat: () =>
|
|
52606
|
+
concat: () => import_bytes10.concat,
|
|
52741
52607
|
computePublicKey: () => import_signing_key2.computePublicKey,
|
|
52742
52608
|
computeHmac: () => import_sha22.computeHmac,
|
|
52743
52609
|
computeAddress: () => import_transactions6.computeAddress,
|
|
@@ -52746,7 +52612,7 @@ __export(exports_utils, {
|
|
|
52746
52612
|
checkProperties: () => import_properties17.checkProperties,
|
|
52747
52613
|
base64: () => base64,
|
|
52748
52614
|
base58: () => import_basex2.Base58,
|
|
52749
|
-
arrayify: () =>
|
|
52615
|
+
arrayify: () => import_bytes10.arrayify,
|
|
52750
52616
|
accessListify: () => import_transactions6.accessListify,
|
|
52751
52617
|
_toEscapedUtf8String: () => import_strings4._toEscapedUtf8String,
|
|
52752
52618
|
_fetchData: () => import_web6._fetchData,
|
|
@@ -52774,13 +52640,14 @@ __export(exports_utils, {
|
|
|
52774
52640
|
AbiCoder: () => import_abi2.AbiCoder
|
|
52775
52641
|
});
|
|
52776
52642
|
var import_abi2 = __toESM(require_lib13());
|
|
52643
|
+
var import_address5 = __toESM(require_lib7());
|
|
52777
52644
|
var base64 = __toESM(require_lib10());
|
|
52778
52645
|
var import_basex2 = __toESM(require_lib16());
|
|
52779
|
-
var
|
|
52646
|
+
var import_bytes10 = __toESM(require_lib2());
|
|
52780
52647
|
var import_hash5 = __toESM(require_lib12());
|
|
52781
52648
|
var import_hdnode2 = __toESM(require_lib20());
|
|
52782
52649
|
var import_json_wallets2 = __toESM(require_lib22());
|
|
52783
|
-
var
|
|
52650
|
+
var import_keccak2562 = __toESM(require_lib5());
|
|
52784
52651
|
var import_sha22 = __toESM(require_lib17());
|
|
52785
52652
|
var import_solidity = __toESM(require_lib24());
|
|
52786
52653
|
var import_random3 = __toESM(require_lib21());
|
|
@@ -52795,10 +52662,10 @@ var import_sha23 = __toESM(require_lib17());
|
|
|
52795
52662
|
var import_strings5 = __toESM(require_lib9());
|
|
52796
52663
|
|
|
52797
52664
|
// node_modules/ethers/lib.esm/_version.js
|
|
52798
|
-
var
|
|
52665
|
+
var version12 = "ethers/5.7.2";
|
|
52799
52666
|
|
|
52800
52667
|
// node_modules/ethers/lib.esm/ethers.js
|
|
52801
|
-
var
|
|
52668
|
+
var logger24 = new Logger(version12);
|
|
52802
52669
|
|
|
52803
52670
|
// node_modules/ethers/lib.esm/index.js
|
|
52804
52671
|
try {
|
|
@@ -53906,9 +53773,11 @@ var contractsRegistry_default = {
|
|
|
53906
53773
|
"13w": "0xbd3f9814eB946E617f1d774A6762cDbec0bf087A"
|
|
53907
53774
|
}
|
|
53908
53775
|
},
|
|
53909
|
-
|
|
53910
|
-
|
|
53911
|
-
|
|
53776
|
+
gearbox: {
|
|
53777
|
+
poolV3: "0x9396dcbf78fc526bb003665337c5e73b699571ef"
|
|
53778
|
+
},
|
|
53779
|
+
superbridge: {
|
|
53780
|
+
l1StandardBridgeBase: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35"
|
|
53912
53781
|
},
|
|
53913
53782
|
zodiac: {
|
|
53914
53783
|
rolesModule: "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
|
|
@@ -54384,8 +54253,8 @@ class MultisendBuilder {
|
|
|
54384
54253
|
data
|
|
54385
54254
|
});
|
|
54386
54255
|
}
|
|
54387
|
-
static new(chainId,
|
|
54388
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${
|
|
54256
|
+
static new(chainId, version13 = "v1_4_1") {
|
|
54257
|
+
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version13}.multisend`));
|
|
54389
54258
|
}
|
|
54390
54259
|
}
|
|
54391
54260
|
// src/integrations/gnosis/safe.L2.abi.ts
|
|
@@ -58625,6 +58494,7 @@ function invariant(condition, message) {
|
|
|
58625
58494
|
var import_decimal = __toESM(require_decimal());
|
|
58626
58495
|
var import_big = __toESM(require_big());
|
|
58627
58496
|
var import_toformat = __toESM(require_toFormat());
|
|
58497
|
+
var import_address6 = __toESM(require_lib7());
|
|
58628
58498
|
function _defineProperties(target, props) {
|
|
58629
58499
|
for (var i2 = 0;i2 < props.length; i2++) {
|
|
58630
58500
|
var descriptor = props[i2];
|
|
@@ -59184,7 +59054,7 @@ var NativeCurrency = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
59184
59054
|
}(BaseCurrency);
|
|
59185
59055
|
function validateAndParseAddress(address) {
|
|
59186
59056
|
try {
|
|
59187
|
-
return getAddress(address);
|
|
59057
|
+
return import_address6.getAddress(address);
|
|
59188
59058
|
} catch (error) {
|
|
59189
59059
|
throw new Error(address + " is not a valid address.");
|
|
59190
59060
|
}
|
|
@@ -59261,13 +59131,13 @@ var Ether = /* @__PURE__ */ function(_NativeCurrency) {
|
|
|
59261
59131
|
return Ether2;
|
|
59262
59132
|
}(NativeCurrency);
|
|
59263
59133
|
Ether._etherCache = {};
|
|
59264
|
-
var
|
|
59134
|
+
var MAX_SAFE_INTEGER = /* @__PURE__ */ import_jsbi.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
59265
59135
|
var ZERO = /* @__PURE__ */ import_jsbi.default.BigInt(0);
|
|
59266
59136
|
var ONE2 = /* @__PURE__ */ import_jsbi.default.BigInt(1);
|
|
59267
59137
|
var TWO = /* @__PURE__ */ import_jsbi.default.BigInt(2);
|
|
59268
59138
|
function sqrt(value) {
|
|
59269
59139
|
!import_jsbi.default.greaterThanOrEqual(value, ZERO) && invariant(false, "NEGATIVE");
|
|
59270
|
-
if (import_jsbi.default.lessThan(value,
|
|
59140
|
+
if (import_jsbi.default.lessThan(value, MAX_SAFE_INTEGER)) {
|
|
59271
59141
|
return import_jsbi.default.BigInt(Math.floor(Math.sqrt(import_jsbi.default.toNumber(value))));
|
|
59272
59142
|
}
|
|
59273
59143
|
var z;
|
|
@@ -59284,6 +59154,7 @@ function sqrt(value) {
|
|
|
59284
59154
|
// node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
59285
59155
|
var import_jsbi2 = __toESM(require_jsbi_umd());
|
|
59286
59156
|
var import_abi3 = __toESM(require_lib13());
|
|
59157
|
+
var import_address7 = __toESM(require_lib7());
|
|
59287
59158
|
var import_solidity2 = __toESM(require_lib24());
|
|
59288
59159
|
// node_modules/@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json
|
|
59289
59160
|
var IMulticall_default = {
|
|
@@ -63219,7 +63090,7 @@ var Q192 = /* @__PURE__ */ import_jsbi2.default.exponentiate(Q96, /* @__PURE__ *
|
|
|
63219
63090
|
function computePoolAddress(_ref) {
|
|
63220
63091
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride } = _ref;
|
|
63221
63092
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
63222
|
-
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);
|
|
63093
|
+
return import_address7.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);
|
|
63223
63094
|
}
|
|
63224
63095
|
var LiquidityMath = /* @__PURE__ */ function() {
|
|
63225
63096
|
function LiquidityMath2() {}
|
|
@@ -64592,8 +64463,9 @@ var import_jsbi3 = __toESM(require_jsbi_umd());
|
|
|
64592
64463
|
var import_decimal2 = __toESM(require_decimal());
|
|
64593
64464
|
var import_big2 = __toESM(require_big());
|
|
64594
64465
|
var import_toformat2 = __toESM(require_toFormat());
|
|
64595
|
-
var
|
|
64596
|
-
var
|
|
64466
|
+
var import_address8 = __toESM(require_lib7());
|
|
64467
|
+
var import_bytes11 = __toESM(require_lib2());
|
|
64468
|
+
var import_keccak2563 = __toESM(require_lib5());
|
|
64597
64469
|
var import_strings6 = __toESM(require_lib9());
|
|
64598
64470
|
function _defineProperties3(e, r) {
|
|
64599
64471
|
for (var t = 0;t < r.length; t++) {
|
|
@@ -65298,7 +65170,7 @@ var NativeCurrency2 = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
65298
65170
|
}(BaseCurrency3);
|
|
65299
65171
|
function validateAndParseAddress2(address) {
|
|
65300
65172
|
try {
|
|
65301
|
-
return getAddress(address);
|
|
65173
|
+
return import_address8.getAddress(address);
|
|
65302
65174
|
} catch (error) {
|
|
65303
65175
|
throw new Error(address + " is not a valid address.");
|
|
65304
65176
|
}
|
|
@@ -65402,18 +65274,18 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
65402
65274
|
if (input === undefined) {
|
|
65403
65275
|
input = "0x";
|
|
65404
65276
|
}
|
|
65405
|
-
var prefix2 =
|
|
65406
|
-
var inputHash =
|
|
65407
|
-
var addressBytes =
|
|
65408
|
-
return getAddress(addressBytes);
|
|
65277
|
+
var prefix2 = import_keccak2563.keccak256(import_strings6.toUtf8Bytes("zksyncCreate2"));
|
|
65278
|
+
var inputHash = import_keccak2563.keccak256(input);
|
|
65279
|
+
var addressBytes = import_keccak2563.keccak256(import_bytes11.concat([prefix2, import_bytes11.hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
65280
|
+
return import_address8.getAddress(addressBytes);
|
|
65409
65281
|
}
|
|
65410
|
-
var
|
|
65282
|
+
var MAX_SAFE_INTEGER2 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
65411
65283
|
var ZERO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(0);
|
|
65412
65284
|
var ONE4 = /* @__PURE__ */ import_jsbi3.default.BigInt(1);
|
|
65413
65285
|
var TWO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(2);
|
|
65414
65286
|
function sqrt2(value) {
|
|
65415
65287
|
!import_jsbi3.default.greaterThanOrEqual(value, ZERO3) && invariant(false, "NEGATIVE");
|
|
65416
|
-
if (import_jsbi3.default.lessThan(value,
|
|
65288
|
+
if (import_jsbi3.default.lessThan(value, MAX_SAFE_INTEGER2)) {
|
|
65417
65289
|
return import_jsbi3.default.BigInt(Math.floor(Math.sqrt(import_jsbi3.default.toNumber(value))));
|
|
65418
65290
|
}
|
|
65419
65291
|
var z;
|
|
@@ -65430,6 +65302,7 @@ function sqrt2(value) {
|
|
|
65430
65302
|
// node_modules/@uniswap/v4-sdk/node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
65431
65303
|
var import_jsbi4 = __toESM(require_jsbi_umd());
|
|
65432
65304
|
var import_abi4 = __toESM(require_lib13());
|
|
65305
|
+
var import_address9 = __toESM(require_lib7());
|
|
65433
65306
|
var import_solidity3 = __toESM(require_lib24());
|
|
65434
65307
|
function _arrayLikeToArray2(r, a) {
|
|
65435
65308
|
(a == null || a > r.length) && (a = r.length);
|
|
@@ -65881,7 +65754,7 @@ function computePoolAddress2(_ref) {
|
|
|
65881
65754
|
case ChainId2.ZKSYNC:
|
|
65882
65755
|
return computeZksyncCreate2Address(factoryAddress, initCodeHash, salt);
|
|
65883
65756
|
default:
|
|
65884
|
-
return getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
65757
|
+
return import_address9.getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
65885
65758
|
}
|
|
65886
65759
|
}
|
|
65887
65760
|
var FullMath2 = /* @__PURE__ */ function() {
|
|
@@ -69736,7 +69609,7 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69736
69609
|
hookData = "0x",
|
|
69737
69610
|
recipient
|
|
69738
69611
|
}) => {
|
|
69739
|
-
const
|
|
69612
|
+
const getAddress7 = (currency) => {
|
|
69740
69613
|
return currency.address;
|
|
69741
69614
|
};
|
|
69742
69615
|
const commands = exports_ethers.utils.solidityPack(["uint8"], [16 /* V4_SWAP */]);
|
|
@@ -69744,15 +69617,15 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
69744
69617
|
const params = [
|
|
69745
69618
|
exports_ethers.utils.defaultAbiCoder.encode(["tuple(tuple(address,address,uint24,int24,address),bool,uint128,uint128,bytes)"], [
|
|
69746
69619
|
[
|
|
69747
|
-
[
|
|
69620
|
+
[getAddress7(pool.currency0), getAddress7(pool.currency1), pool.fee, pool.tickSpacing, pool.hooks],
|
|
69748
69621
|
zeroForOne,
|
|
69749
69622
|
amountIn,
|
|
69750
69623
|
amountOutMinimum,
|
|
69751
69624
|
hookData
|
|
69752
69625
|
]
|
|
69753
69626
|
]),
|
|
69754
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69755
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
69627
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress7(pool.currency0) : getAddress7(pool.currency1), amountIn]),
|
|
69628
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress7(pool.currency1) : getAddress7(pool.currency0), amountOutMinimum])
|
|
69756
69629
|
];
|
|
69757
69630
|
const actionsList = [];
|
|
69758
69631
|
actionsList.push(Actions2.SWAP_EXACT_IN_SINGLE);
|
|
@@ -77178,53 +77051,6 @@ var revokeFromVaultWhitelistTrx = ({
|
|
|
77178
77051
|
});
|
|
77179
77052
|
};
|
|
77180
77053
|
var OPTIN_PROXY_CREATION_BYTECODE = "0x60c060405260405161154038038061154083398101604081905261002291610490565b61002c85856100a8565b8161003782826101b8565b5050828260405161004790610454565b6001600160a01b0390921682526020820152604001604051809103905ff080158015610075573d5f803e3d5ffd5b506001600160a01b031660805261009361008e60805190565b610216565b5050506001600160a01b031660a052506105f7565b5f6001600160a01b03831661011e57816001600160a01b03166345f55b3c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610117919061057b565b90506101b2565b6001600160a01b03821663f3c665f7610135610262565b856040518363ffffffff1660e01b8152600401610153929190610594565b602060405180830381865afa15801561016e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061019291906105ae565b6101af5760405163474245d760e11b815260040160405180910390fd5b50815b92915050565b6101c18261027f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561020a5761020582826102e5565b505050565b610212610358565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61023f610379565b8260405161024e929190610594565b60405180910390a161025f81610398565b50565b5f61027a5f5f80516020611520833981519152610389565b905090565b806001600160a01b03163b5f036102b45780604051634c9c8ce360e01b81526004016102ab91906105cd565b60405180910390fd5b805f805160206115208339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b60605f80846001600160a01b03168460405161030191906105e1565b5f60405180830381855af49150503d805f8114610339576040519150601f19603f3d011682016040523d82523d5f602084013e61033e565b606091505b50909250905061034f8583836103d5565b95945050505050565b34156103775760405163b398979f60e01b815260040160405180910390fd5b565b5f5f805160206115008339815191525b546001600160a01b0316919050565b6001600160a01b0381166103c1575f604051633173bdd160e11b81526004016102ab91906105cd565b805f805160206115008339815191526102c4565b6060826103ea576103e58261042b565b610424565b815115801561040157506001600160a01b0384163b155b156104215783604051639996b31560e01b81526004016102ab91906105cd565b50805b9392505050565b80511561043b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b61095180610baf83390190565b80516001600160a01b0381168114610477575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f805f805f60a086880312156104a4575f80fd5b6104ad86610461565b94506104bb60208701610461565b93506104c960408701610461565b6060870151608088015191945092506001600160401b038111156104eb575f80fd5b8601601f810188136104fb575f80fd5b80516001600160401b038111156105145761051461047c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156105425761054261047c565b6040528181528282016020018a1015610559575f80fd5b8160208401602083015e5f602083830101528093505050509295509295909350565b5f6020828403121561058b575f80fd5b61042482610461565b6001600160a01b0392831681529116602082015260400190565b5f602082840312156105be575f80fd5b81518015158114610424575f80fd5b6001600160a01b0391909116815260200190565b5f82518060208501845e5f920191825250919050565b60805160a05161059361061c5f395f81816038015260f401525f607201526105935ff3fe60806040526004361061001d575f3560e01c806306433b1b14610027575b610025610070565b005b348015610032575f80fd5b5061005a7f000000000000000000000000000000000000000000000000000000000000000081565b60405161006791906103eb565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036101c2575f356001600160e01b03191663278f794360e11b146100d2576040516334ad5dbb60e21b815260040160405180910390fd5b5f806100e136600481846103ff565b8101906100ee919061043a565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f3c665f76101296101cc565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610173573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101979190610508565b6101b45760405163474245d760e11b815260040160405180910390fd5b6101be82826101f0565b5050565b6101ca61024a565b565b5f6101eb5f8051602061053e833981519152546001600160a01b031690565b905090565b6101f98261025a565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156102425761023d82826102bd565b505050565b6101be61032f565b6101ca6102556101cc565b61034e565b806001600160a01b03163b5f0361028f5780604051634c9c8ce360e01b815260040161028691906103eb565b60405180910390fd5b5f8051602061053e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102d99190610527565b5f60405180830381855af49150503d805f8114610311576040519150601f19603f3d011682016040523d82523d5f602084013e610316565b606091505b509150915061032685838361036c565b95945050505050565b34156101ca5760405163b398979f60e01b815260040160405180910390fd5b365f80375f80365f845af43d5f803e808015610368573d5ff35b3d5ffd5b6060826103815761037c826103c2565b6103bb565b815115801561039857506001600160a01b0384163b155b156103b85783604051639996b31560e01b815260040161028691906103eb565b50805b9392505050565b8051156103d25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0391909116815260200190565b5f808585111561040d575f80fd5b83861115610419575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561044b575f80fd5b82356001600160a01b0381168114610461575f80fd5b915060208301356001600160401b0381111561047b575f80fd5b8301601f8101851361048b575f80fd5b80356001600160401b038111156104a4576104a4610426565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104d2576104d2610426565b6040528181528282016020018710156104e9575f80fd5b816020840160208301375f602083830101528093505050509250929050565b5f60208284031215610518575f80fd5b815180151581146103bb575f80fd5b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122054a7e97969c29f5ce4c21e7feeef7fb958d11e31d8152e7ae4ea8a848a71848c64736f6c634300081a0033608060405234801561000f575f80fd5b5060405161095138038061095183398101604081905261002e91610158565b81806001600160a01b03811661005e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61006781610109565b5050620151808110156100925760405163013ccc8d60e01b8152620151806004820152602401610055565b62278d008111156100bb57604051630b94129b60e31b815262278d006004820152602401610055565b5f1960018190556003556005819055604080518281525f60208201527fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee910160405180910390a1505061018f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8060408385031215610169575f80fd5b82516001600160a01b038116811461017f575f80fd5b6020939093015192949293505050565b6107b58061019c5f395ff3fe6080604052600436106100b7575f3560e01c8063033f8dbc146100bb5780634125ff90146100e3578063432efade146100f9578063554f94db1461011a578063657081b31461012e5780636a42b8f81461014d578063715018a6146101625780638b677b03146101765780638da5cb5b146101a25780639623609d146101b65780639f81aed7146101c9578063a36f141c146101df578063ad3cb1cc146101f4578063f2fde38b14610231578063f6b12cf914610250575b5f80fd5b3480156100c6575f80fd5b506100d060045481565b6040519081526020015b60405180910390f35b3480156100ee575f80fd5b506100d062278d0081565b348015610104575f80fd5b506101186101133660046105a6565b610265565b005b348015610125575f80fd5b50610118610326565b348015610139575f80fd5b506101186101483660046105d1565b6103a8565b348015610158575f80fd5b506100d060055481565b34801561016d575f80fd5b50610118610420565b348015610181575f80fd5b50600254610195906001600160a01b031681565b6040516100da91906105f3565b3480156101ad575f80fd5b50610195610433565b6101186101c436600461061b565b610441565b3480156101d4575f80fd5b506100d06201518081565b3480156101ea575f80fd5b506100d060035481565b3480156101ff575f80fd5b50610224604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100da919061071d565b34801561023c575f80fd5b5061011861024b3660046105d1565b6104e8565b34801561025b575f80fd5b506100d060015481565b61026d610525565b6201518081101561029b5760405163013ccc8d60e01b81526201518060048201526024015b60405180910390fd5b62278d008111156102c457604051630b94129b60e31b815262278d006004820152602401610292565b60048190556005546102d6904261072f565b60038190556005546004546040805192835260208301919091528101919091527fab7d3921ca5710b1f874b995128f2d434b8b28080cc90e5b7ae542d01a41dd6e9060600160405180910390a150565b61032e610525565b60035442101561035157604051634040f3a760e01b815260040160405180910390fd5b7fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee60045460055460405161038f929190918252602082015260400190565b60405180910390a1600480546005555f90555f19600355565b6103b0610525565b600280546001600160a01b0319166001600160a01b0383161790556005546103d8904261072f565b60018190556002546040519182526001600160a01b0316907fb995d606597d17deae0e0b28f4668c00c67c22d7bed7b95db2a5ac7f1b96aa2b9060200160405180910390a250565b610428610525565b6104315f610557565b565b5f546001600160a01b031690565b610449610525565b60015442101561046c57604051634040f3a760e01b815260040160405180910390fd5b60025460405163278f794360e11b81526001600160a01b0380861692634f1ef2869234926104a09216908690600401610754565b5f604051808303818588803b1580156104b7575f80fd5b505af11580156104c9573d5f803e3d5ffd5b5050600280546001600160a01b031916905550505f1960015550505050565b6104f0610525565b6001600160a01b038116610519575f604051631e4fbdf760e01b815260040161029291906105f3565b61052281610557565b50565b3361052e610433565b6001600160a01b031614610431573360405163118cdaa760e01b815260040161029291906105f3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156105b6575f80fd5b5035919050565b6001600160a01b0381168114610522575f80fd5b5f602082840312156105e1575f80fd5b81356105ec816105bd565b9392505050565b6001600160a01b0391909116815260200190565b634e487b7160e01b5f52604160045260245ffd5b5f805f6060848603121561062d575f80fd5b8335610638816105bd565b92506020840135610648816105bd565b915060408401356001600160401b03811115610662575f80fd5b8401601f81018613610672575f80fd5b80356001600160401b0381111561068b5761068b610607565b604051601f8201601f19908116603f011681016001600160401b03811182821017156106b9576106b9610607565b6040528181528282016020018810156106d0575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6105ec60208301846106ef565b8082018082111561074e57634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03831681526040602082018190525f90610777908301846106ef565b94935050505056fea2646970667358221220e27ebccd00d28ef8e1c57bfd0e4ffadef9ac6d95a3f3cc646f6f86755492f76564736f6c634300081a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
77181
|
-
var PauseVaultCalldata = () => {
|
|
77182
|
-
return vaultInterface.encodeFunctionData("pause", []);
|
|
77183
|
-
};
|
|
77184
|
-
var pauseVaultTrx = ({ vault }) => {
|
|
77185
|
-
return createCall({
|
|
77186
|
-
operation: 0,
|
|
77187
|
-
to: vault,
|
|
77188
|
-
value: 0n,
|
|
77189
|
-
data: PauseVaultCalldata()
|
|
77190
|
-
});
|
|
77191
|
-
};
|
|
77192
|
-
var UnpauseVaultCalldata = () => {
|
|
77193
|
-
return vaultInterface.encodeFunctionData("unpause", []);
|
|
77194
|
-
};
|
|
77195
|
-
var unpauseVaultTrx = ({ vault }) => {
|
|
77196
|
-
return createCall({
|
|
77197
|
-
operation: 0,
|
|
77198
|
-
to: vault,
|
|
77199
|
-
value: 0n,
|
|
77200
|
-
data: UnpauseVaultCalldata()
|
|
77201
|
-
});
|
|
77202
|
-
};
|
|
77203
|
-
var InitiateClosingCalldata = () => {
|
|
77204
|
-
return vaultInterface.encodeFunctionData("initiateClosing", []);
|
|
77205
|
-
};
|
|
77206
|
-
var initiateVaultClosingTrx = ({ vault }) => {
|
|
77207
|
-
return createCall({
|
|
77208
|
-
operation: 0,
|
|
77209
|
-
to: vault,
|
|
77210
|
-
value: 0n,
|
|
77211
|
-
data: InitiateClosingCalldata()
|
|
77212
|
-
});
|
|
77213
|
-
};
|
|
77214
|
-
var CloseVaultCalldata = ({ newTotalAssets }) => {
|
|
77215
|
-
return vaultInterface.encodeFunctionData("close", [newTotalAssets]);
|
|
77216
|
-
};
|
|
77217
|
-
var closeVaultTrx = ({
|
|
77218
|
-
vault,
|
|
77219
|
-
newTotalAssets
|
|
77220
|
-
}) => {
|
|
77221
|
-
return createCall({
|
|
77222
|
-
operation: 0,
|
|
77223
|
-
to: vault,
|
|
77224
|
-
value: 0n,
|
|
77225
|
-
data: CloseVaultCalldata({ newTotalAssets })
|
|
77226
|
-
});
|
|
77227
|
-
};
|
|
77228
77054
|
var calculateDeterministicVaultAddress = ({
|
|
77229
77055
|
factoryAddress,
|
|
77230
77056
|
registry,
|
|
@@ -86763,4 +86589,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
86763
86589
|
};
|
|
86764
86590
|
};
|
|
86765
86591
|
|
|
86766
|
-
//# debugId=
|
|
86592
|
+
//# debugId=ACD2105AF80642ED64756E2164756E21
|