damm-sdk 1.4.25 → 1.4.26
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 +4609 -4628
- package/dist/index.cjs.map +15 -16
- package/dist/index.js +436 -546
- package/dist/index.js.map +4 -6
- package/dist/integrations/enso/enso.route.api.d.ts +18 -2
- package/dist/integrations/enso/enso.route.api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/integrations/enso/enso.route.api.ts +31 -6
package/dist/index.js
CHANGED
|
@@ -16298,7 +16298,7 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
16298
16298
|
var exports_process = {};
|
|
16299
16299
|
__export(exports_process, {
|
|
16300
16300
|
versions: () => versions,
|
|
16301
|
-
version: () =>
|
|
16301
|
+
version: () => version6,
|
|
16302
16302
|
umask: () => umask,
|
|
16303
16303
|
title: () => title,
|
|
16304
16304
|
removeListener: () => removeListener,
|
|
@@ -16355,7 +16355,7 @@ function nextTick(fun) {
|
|
|
16355
16355
|
setTimeout(drainQueue, 0);
|
|
16356
16356
|
}
|
|
16357
16357
|
function noop() {}
|
|
16358
|
-
var queue, draining = false, currentQueue, queueIndex = -1, title = "browser", browser = true, env, argv,
|
|
16358
|
+
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) {
|
|
16359
16359
|
return [];
|
|
16360
16360
|
}, binding = function(name) {
|
|
16361
16361
|
throw new Error("process.binding is not supported in browser polyfill");
|
|
@@ -37187,7 +37187,7 @@ var require_lib14 = __commonJS((exports) => {
|
|
|
37187
37187
|
var properties_1 = require_lib4();
|
|
37188
37188
|
var logger_1 = require_lib();
|
|
37189
37189
|
var _version_1 = require__version10();
|
|
37190
|
-
var
|
|
37190
|
+
var logger5 = new logger_1.Logger(_version_1.version);
|
|
37191
37191
|
var _curve = null;
|
|
37192
37192
|
function getCurve() {
|
|
37193
37193
|
if (!_curve) {
|
|
@@ -37200,7 +37200,7 @@ var require_lib14 = __commonJS((exports) => {
|
|
|
37200
37200
|
(0, properties_1.defineReadOnly)(this, "curve", "secp256k1");
|
|
37201
37201
|
(0, properties_1.defineReadOnly)(this, "privateKey", (0, bytes_1.hexlify)(privateKey));
|
|
37202
37202
|
if ((0, bytes_1.hexDataLength)(this.privateKey) !== 32) {
|
|
37203
|
-
|
|
37203
|
+
logger5.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]");
|
|
37204
37204
|
}
|
|
37205
37205
|
var keyPair = getCurve().keyFromPrivate((0, bytes_1.arrayify)(this.privateKey));
|
|
37206
37206
|
(0, properties_1.defineReadOnly)(this, "publicKey", "0x" + keyPair.getPublic(false, "hex"));
|
|
@@ -37216,7 +37216,7 @@ var require_lib14 = __commonJS((exports) => {
|
|
|
37216
37216
|
var keyPair = getCurve().keyFromPrivate((0, bytes_1.arrayify)(this.privateKey));
|
|
37217
37217
|
var digestBytes = (0, bytes_1.arrayify)(digest);
|
|
37218
37218
|
if (digestBytes.length !== 32) {
|
|
37219
|
-
|
|
37219
|
+
logger5.throwArgumentError("bad digest length", "digest", digest);
|
|
37220
37220
|
}
|
|
37221
37221
|
var signature = keyPair.sign(digestBytes, { canonical: true });
|
|
37222
37222
|
return (0, bytes_1.splitSignature)({
|
|
@@ -37261,7 +37261,7 @@ var require_lib14 = __commonJS((exports) => {
|
|
|
37261
37261
|
}
|
|
37262
37262
|
return "0x" + getCurve().keyFromPublic(bytes).getPublic(true, "hex");
|
|
37263
37263
|
}
|
|
37264
|
-
return
|
|
37264
|
+
return logger5.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
37265
37265
|
}
|
|
37266
37266
|
exports.computePublicKey = computePublicKey;
|
|
37267
37267
|
});
|
|
@@ -37315,7 +37315,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37315
37315
|
var signing_key_1 = require_lib14();
|
|
37316
37316
|
var logger_1 = require_lib();
|
|
37317
37317
|
var _version_1 = require__version11();
|
|
37318
|
-
var
|
|
37318
|
+
var logger5 = new logger_1.Logger(_version_1.version);
|
|
37319
37319
|
var TransactionTypes;
|
|
37320
37320
|
(function(TransactionTypes2) {
|
|
37321
37321
|
TransactionTypes2[TransactionTypes2["legacy"] = 0] = "legacy";
|
|
@@ -37364,7 +37364,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37364
37364
|
function formatNumber(value, name) {
|
|
37365
37365
|
var result = (0, bytes_1.stripZeros)(bignumber_1.BigNumber.from(value).toHexString());
|
|
37366
37366
|
if (result.length > 32) {
|
|
37367
|
-
|
|
37367
|
+
logger5.throwArgumentError("invalid length for " + name, "transaction:" + name, value);
|
|
37368
37368
|
}
|
|
37369
37369
|
return result;
|
|
37370
37370
|
}
|
|
@@ -37373,7 +37373,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37373
37373
|
address: (0, address_1.getAddress)(addr),
|
|
37374
37374
|
storageKeys: (storageKeys || []).map(function(storageKey, index) {
|
|
37375
37375
|
if ((0, bytes_1.hexDataLength)(storageKey) !== 32) {
|
|
37376
|
-
|
|
37376
|
+
logger5.throwArgumentError("invalid access list storageKey", "accessList[" + addr + ":" + index + "]", storageKey);
|
|
37377
37377
|
}
|
|
37378
37378
|
return storageKey.toLowerCase();
|
|
37379
37379
|
})
|
|
@@ -37384,7 +37384,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37384
37384
|
return value.map(function(set, index) {
|
|
37385
37385
|
if (Array.isArray(set)) {
|
|
37386
37386
|
if (set.length > 2) {
|
|
37387
|
-
|
|
37387
|
+
logger5.throwArgumentError("access list expected to be [ address, storageKeys[] ]", "value[" + index + "]", set);
|
|
37388
37388
|
}
|
|
37389
37389
|
return accessSetify(set[0], set[1]);
|
|
37390
37390
|
}
|
|
@@ -37414,7 +37414,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37414
37414
|
var gasPrice = bignumber_1.BigNumber.from(transaction.gasPrice);
|
|
37415
37415
|
var maxFeePerGas = bignumber_1.BigNumber.from(transaction.maxFeePerGas || 0);
|
|
37416
37416
|
if (!gasPrice.eq(maxFeePerGas)) {
|
|
37417
|
-
|
|
37417
|
+
logger5.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas", "tx", {
|
|
37418
37418
|
gasPrice,
|
|
37419
37419
|
maxFeePerGas
|
|
37420
37420
|
});
|
|
@@ -37469,12 +37469,12 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37469
37469
|
}
|
|
37470
37470
|
value = (0, bytes_1.arrayify)((0, bytes_1.hexlify)(value, options));
|
|
37471
37471
|
if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {
|
|
37472
|
-
|
|
37472
|
+
logger5.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
37473
37473
|
}
|
|
37474
37474
|
if (fieldInfo.maxLength) {
|
|
37475
37475
|
value = (0, bytes_1.stripZeros)(value);
|
|
37476
37476
|
if (value.length > fieldInfo.maxLength) {
|
|
37477
|
-
|
|
37477
|
+
logger5.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
|
|
37478
37478
|
}
|
|
37479
37479
|
}
|
|
37480
37480
|
raw.push((0, bytes_1.hexlify)(value));
|
|
@@ -37483,7 +37483,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37483
37483
|
if (transaction.chainId != null) {
|
|
37484
37484
|
chainId = transaction.chainId;
|
|
37485
37485
|
if (typeof chainId !== "number") {
|
|
37486
|
-
|
|
37486
|
+
logger5.throwArgumentError("invalid transaction.chainId", "transaction", transaction);
|
|
37487
37487
|
}
|
|
37488
37488
|
} else if (signature && !(0, bytes_1.isBytesLike)(signature) && signature.v > 28) {
|
|
37489
37489
|
chainId = Math.floor((signature.v - 35) / 2);
|
|
@@ -37504,10 +37504,10 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37504
37504
|
raw.pop();
|
|
37505
37505
|
v += chainId * 2 + 8;
|
|
37506
37506
|
if (sig.v > 28 && sig.v !== v) {
|
|
37507
|
-
|
|
37507
|
+
logger5.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", signature);
|
|
37508
37508
|
}
|
|
37509
37509
|
} else if (sig.v !== v) {
|
|
37510
|
-
|
|
37510
|
+
logger5.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", signature);
|
|
37511
37511
|
}
|
|
37512
37512
|
raw.push((0, bytes_1.hexlify)(v));
|
|
37513
37513
|
raw.push((0, bytes_1.stripZeros)((0, bytes_1.arrayify)(sig.r)));
|
|
@@ -37517,7 +37517,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37517
37517
|
function serialize(transaction, signature) {
|
|
37518
37518
|
if (transaction.type == null || transaction.type === 0) {
|
|
37519
37519
|
if (transaction.accessList != null) {
|
|
37520
|
-
|
|
37520
|
+
logger5.throwArgumentError("untyped transactions do not support accessList; include type: 1", "transaction", transaction);
|
|
37521
37521
|
}
|
|
37522
37522
|
return _serialize(transaction, signature);
|
|
37523
37523
|
}
|
|
@@ -37529,7 +37529,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37529
37529
|
default:
|
|
37530
37530
|
break;
|
|
37531
37531
|
}
|
|
37532
|
-
return
|
|
37532
|
+
return logger5.throwError("unsupported transaction type: " + transaction.type, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
37533
37533
|
operation: "serializeTransaction",
|
|
37534
37534
|
transactionType: transaction.type
|
|
37535
37535
|
});
|
|
@@ -37543,7 +37543,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37543
37543
|
}
|
|
37544
37544
|
tx.v = recid;
|
|
37545
37545
|
} catch (error) {
|
|
37546
|
-
|
|
37546
|
+
logger5.throwArgumentError("invalid v for transaction type: 1", "v", fields[0]);
|
|
37547
37547
|
}
|
|
37548
37548
|
tx.r = (0, bytes_1.hexZeroPad)(fields[1], 32);
|
|
37549
37549
|
tx.s = (0, bytes_1.hexZeroPad)(fields[2], 32);
|
|
@@ -37555,7 +37555,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37555
37555
|
function _parseEip1559(payload) {
|
|
37556
37556
|
var transaction = RLP.decode(payload.slice(1));
|
|
37557
37557
|
if (transaction.length !== 9 && transaction.length !== 12) {
|
|
37558
|
-
|
|
37558
|
+
logger5.throwArgumentError("invalid component count for transaction type: 2", "payload", (0, bytes_1.hexlify)(payload));
|
|
37559
37559
|
}
|
|
37560
37560
|
var maxPriorityFeePerGas = handleNumber(transaction[2]);
|
|
37561
37561
|
var maxFeePerGas = handleNumber(transaction[3]);
|
|
@@ -37582,7 +37582,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37582
37582
|
function _parseEip2930(payload) {
|
|
37583
37583
|
var transaction = RLP.decode(payload.slice(1));
|
|
37584
37584
|
if (transaction.length !== 8 && transaction.length !== 11) {
|
|
37585
|
-
|
|
37585
|
+
logger5.throwArgumentError("invalid component count for transaction type: 1", "payload", (0, bytes_1.hexlify)(payload));
|
|
37586
37586
|
}
|
|
37587
37587
|
var tx = {
|
|
37588
37588
|
type: 1,
|
|
@@ -37605,7 +37605,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37605
37605
|
function _parse(rawTransaction) {
|
|
37606
37606
|
var transaction = RLP.decode(rawTransaction);
|
|
37607
37607
|
if (transaction.length !== 9 && transaction.length !== 6) {
|
|
37608
|
-
|
|
37608
|
+
logger5.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
|
|
37609
37609
|
}
|
|
37610
37610
|
var tx = {
|
|
37611
37611
|
nonce: handleNumber(transaction[0]).toNumber(),
|
|
@@ -37664,7 +37664,7 @@ var require_lib15 = __commonJS((exports) => {
|
|
|
37664
37664
|
default:
|
|
37665
37665
|
break;
|
|
37666
37666
|
}
|
|
37667
|
-
return
|
|
37667
|
+
return logger5.throwError("unsupported transaction type: " + payload[0], logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
37668
37668
|
operation: "parseTransaction",
|
|
37669
37669
|
transactionType: payload[0]
|
|
37670
37670
|
});
|
|
@@ -37784,7 +37784,7 @@ var require_browser_sha2 = __commonJS((exports) => {
|
|
|
37784
37784
|
var types_1 = require_types();
|
|
37785
37785
|
var logger_1 = require_lib();
|
|
37786
37786
|
var _version_1 = require__version12();
|
|
37787
|
-
var
|
|
37787
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
37788
37788
|
function ripemd160(data) {
|
|
37789
37789
|
return "0x" + hash_js_1.default.ripemd160().update((0, bytes_1.arrayify)(data)).digest("hex");
|
|
37790
37790
|
}
|
|
@@ -37799,7 +37799,7 @@ var require_browser_sha2 = __commonJS((exports) => {
|
|
|
37799
37799
|
exports.sha512 = sha512;
|
|
37800
37800
|
function computeHmac(algorithm, key, data) {
|
|
37801
37801
|
if (!types_1.SupportedAlgorithm[algorithm]) {
|
|
37802
|
-
|
|
37802
|
+
logger6.throwError("unsupported algorithm " + algorithm, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
37803
37803
|
operation: "hmac",
|
|
37804
37804
|
algorithm
|
|
37805
37805
|
});
|
|
@@ -38674,7 +38674,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38674
38674
|
var wordlists_1 = require_lib19();
|
|
38675
38675
|
var logger_1 = require_lib();
|
|
38676
38676
|
var _version_1 = require__version14();
|
|
38677
|
-
var
|
|
38677
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
38678
38678
|
var N = bignumber_1.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
38679
38679
|
var MasterSecret = (0, strings_1.toUtf8Bytes)("Bitcoin seed");
|
|
38680
38680
|
var HardenedBit = 2147483648;
|
|
@@ -38697,7 +38697,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38697
38697
|
if (typeof wordlist === "string") {
|
|
38698
38698
|
var words = wordlists_1.wordlists[wordlist];
|
|
38699
38699
|
if (words == null) {
|
|
38700
|
-
|
|
38700
|
+
logger6.throwArgumentError("unknown locale", "wordlist", wordlist);
|
|
38701
38701
|
}
|
|
38702
38702
|
return words;
|
|
38703
38703
|
}
|
|
@@ -38852,7 +38852,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38852
38852
|
HDNode2.fromExtendedKey = function(extendedKey) {
|
|
38853
38853
|
var bytes = basex_1.Base58.decode(extendedKey);
|
|
38854
38854
|
if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {
|
|
38855
|
-
|
|
38855
|
+
logger6.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
38856
38856
|
}
|
|
38857
38857
|
var depth = bytes[4];
|
|
38858
38858
|
var parentFingerprint = (0, bytes_1.hexlify)(bytes.slice(5, 9));
|
|
@@ -38870,7 +38870,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38870
38870
|
}
|
|
38871
38871
|
return new HDNode2(_constructorGuard3, (0, bytes_1.hexlify)(key.slice(1)), null, parentFingerprint, chainCode, index, depth, null);
|
|
38872
38872
|
}
|
|
38873
|
-
return
|
|
38873
|
+
return logger6.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
38874
38874
|
};
|
|
38875
38875
|
return HDNode2;
|
|
38876
38876
|
}();
|
|
@@ -38885,7 +38885,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38885
38885
|
exports.mnemonicToSeed = mnemonicToSeed;
|
|
38886
38886
|
function mnemonicToEntropy(mnemonic, wordlist) {
|
|
38887
38887
|
wordlist = getWordlist(wordlist);
|
|
38888
|
-
|
|
38888
|
+
logger6.checkNormalize();
|
|
38889
38889
|
var words = wordlist.split(mnemonic);
|
|
38890
38890
|
if (words.length % 3 !== 0) {
|
|
38891
38891
|
throw new Error("invalid mnemonic");
|
|
@@ -38953,7 +38953,7 @@ var require_lib20 = __commonJS((exports) => {
|
|
|
38953
38953
|
exports.isValidMnemonic = isValidMnemonic;
|
|
38954
38954
|
function getAccountPath(index) {
|
|
38955
38955
|
if (typeof index !== "number" || index < 0 || index >= HardenedBit || index % 1) {
|
|
38956
|
-
|
|
38956
|
+
logger6.throwArgumentError("invalid account index", "index", index);
|
|
38957
38957
|
}
|
|
38958
38958
|
return "m/44'/60'/" + index + "'/0/0";
|
|
38959
38959
|
}
|
|
@@ -38974,7 +38974,7 @@ var require_browser_random = __commonJS((exports) => {
|
|
|
38974
38974
|
var bytes_1 = require_lib2();
|
|
38975
38975
|
var logger_1 = require_lib();
|
|
38976
38976
|
var _version_1 = require__version15();
|
|
38977
|
-
var
|
|
38977
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
38978
38978
|
function getGlobal() {
|
|
38979
38979
|
if (typeof self !== "undefined") {
|
|
38980
38980
|
return self;
|
|
@@ -38990,10 +38990,10 @@ var require_browser_random = __commonJS((exports) => {
|
|
|
38990
38990
|
var anyGlobal = getGlobal();
|
|
38991
38991
|
var crypto2 = anyGlobal.crypto || anyGlobal.msCrypto;
|
|
38992
38992
|
if (!crypto2 || !crypto2.getRandomValues) {
|
|
38993
|
-
|
|
38993
|
+
logger6.warn("WARNING: Missing strong random number source");
|
|
38994
38994
|
crypto2 = {
|
|
38995
38995
|
getRandomValues: function(buffer) {
|
|
38996
|
-
return
|
|
38996
|
+
return logger6.throwError("no secure random source avaialble", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
38997
38997
|
operation: "crypto.getRandomValues"
|
|
38998
38998
|
});
|
|
38999
38999
|
}
|
|
@@ -39001,7 +39001,7 @@ var require_browser_random = __commonJS((exports) => {
|
|
|
39001
39001
|
}
|
|
39002
39002
|
function randomBytes(length) {
|
|
39003
39003
|
if (length <= 0 || length > 1024 || length % 1 || length != length) {
|
|
39004
|
-
|
|
39004
|
+
logger6.throwArgumentError("invalid length", "length", length);
|
|
39005
39005
|
}
|
|
39006
39006
|
var result = new Uint8Array(length);
|
|
39007
39007
|
crypto2.getRandomValues(result);
|
|
@@ -39695,7 +39695,7 @@ var require_crowdsale = __commonJS((exports) => {
|
|
|
39695
39695
|
var properties_1 = require_lib4();
|
|
39696
39696
|
var logger_1 = require_lib();
|
|
39697
39697
|
var _version_1 = require__version16();
|
|
39698
|
-
var
|
|
39698
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
39699
39699
|
var utils_1 = require_utils5();
|
|
39700
39700
|
var CrowdsaleAccount = function(_super) {
|
|
39701
39701
|
__extends(CrowdsaleAccount2, _super);
|
|
@@ -39714,7 +39714,7 @@ var require_crowdsale = __commonJS((exports) => {
|
|
|
39714
39714
|
var ethaddr = (0, address_1.getAddress)((0, utils_1.searchPath)(data, "ethaddr"));
|
|
39715
39715
|
var encseed = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "encseed"));
|
|
39716
39716
|
if (!encseed || encseed.length % 16 !== 0) {
|
|
39717
|
-
|
|
39717
|
+
logger6.throwArgumentError("invalid encseed", "json", json);
|
|
39718
39718
|
}
|
|
39719
39719
|
var key = (0, bytes_1.arrayify)((0, pbkdf2_1.pbkdf2)(password, password, 2000, 32, "sha256")).slice(0, 16);
|
|
39720
39720
|
var iv = encseed.slice(0, 16);
|
|
@@ -40396,7 +40396,7 @@ var require_keystore = __commonJS((exports) => {
|
|
|
40396
40396
|
var utils_1 = require_utils5();
|
|
40397
40397
|
var logger_1 = require_lib();
|
|
40398
40398
|
var _version_1 = require__version16();
|
|
40399
|
-
var
|
|
40399
|
+
var logger6 = new logger_1.Logger(_version_1.version);
|
|
40400
40400
|
function hasMnemonic(value) {
|
|
40401
40401
|
return value != null && value.mnemonic && value.mnemonic.phrase;
|
|
40402
40402
|
}
|
|
@@ -40429,7 +40429,7 @@ var require_keystore = __commonJS((exports) => {
|
|
|
40429
40429
|
}
|
|
40430
40430
|
var privateKey = _decrypt(data, key.slice(0, 16), ciphertext);
|
|
40431
40431
|
if (!privateKey) {
|
|
40432
|
-
|
|
40432
|
+
logger6.throwError("unsupported cipher", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
40433
40433
|
operation: "decrypt"
|
|
40434
40434
|
});
|
|
40435
40435
|
}
|
|
@@ -40483,7 +40483,7 @@ var require_keystore = __commonJS((exports) => {
|
|
|
40483
40483
|
var kdf = (0, utils_1.searchPath)(data, "crypto/kdf");
|
|
40484
40484
|
if (kdf && typeof kdf === "string") {
|
|
40485
40485
|
var throwError = function(name, value) {
|
|
40486
|
-
return
|
|
40486
|
+
return logger6.throwArgumentError("invalid key-derivation function parameters", name, value);
|
|
40487
40487
|
};
|
|
40488
40488
|
if (kdf.toLowerCase() === "scrypt") {
|
|
40489
40489
|
var salt = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/kdfparams/salt"));
|
|
@@ -40520,7 +40520,7 @@ var require_keystore = __commonJS((exports) => {
|
|
|
40520
40520
|
return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);
|
|
40521
40521
|
}
|
|
40522
40522
|
}
|
|
40523
|
-
return
|
|
40523
|
+
return logger6.throwArgumentError("unsupported key-derivation function", "kdf", kdf);
|
|
40524
40524
|
}
|
|
40525
40525
|
function decryptSync(json, password) {
|
|
40526
40526
|
var data = JSON.parse(json);
|
|
@@ -41024,7 +41024,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41024
41024
|
var strings_1 = require_lib9();
|
|
41025
41025
|
var logger_1 = require_lib();
|
|
41026
41026
|
var _version_1 = require__version17();
|
|
41027
|
-
var
|
|
41027
|
+
var logger8 = new logger_1.Logger(_version_1.version);
|
|
41028
41028
|
var geturl_1 = require_browser_geturl();
|
|
41029
41029
|
function staller(duration) {
|
|
41030
41030
|
return new Promise(function(resolve) {
|
|
@@ -41055,10 +41055,10 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41055
41055
|
}
|
|
41056
41056
|
function _fetchData(connection, body, processFunc) {
|
|
41057
41057
|
var attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
41058
|
-
|
|
41058
|
+
logger8.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
41059
41059
|
var throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
|
|
41060
41060
|
var throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
|
|
41061
|
-
|
|
41061
|
+
logger8.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
41062
41062
|
var errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
|
|
41063
41063
|
var headers = {};
|
|
41064
41064
|
var url = null;
|
|
@@ -41071,7 +41071,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41071
41071
|
url = connection;
|
|
41072
41072
|
} else if (typeof connection === "object") {
|
|
41073
41073
|
if (connection == null || connection.url == null) {
|
|
41074
|
-
|
|
41074
|
+
logger8.throwArgumentError("missing URL", "connection.url", connection);
|
|
41075
41075
|
}
|
|
41076
41076
|
url = connection.url;
|
|
41077
41077
|
if (typeof connection.timeout === "number" && connection.timeout > 0) {
|
|
@@ -41088,7 +41088,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41088
41088
|
options.allowGzip = !!connection.allowGzip;
|
|
41089
41089
|
if (connection.user != null && connection.password != null) {
|
|
41090
41090
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
41091
|
-
|
|
41091
|
+
logger8.throwError("basic authentication requires a secure https url", logger_1.Logger.errors.INVALID_ARGUMENT, { argument: "url", url, user: connection.user, password: "[REDACTED]" });
|
|
41092
41092
|
}
|
|
41093
41093
|
var authorization = connection.user + ":" + connection.password;
|
|
41094
41094
|
headers["authorization"] = {
|
|
@@ -41119,7 +41119,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41119
41119
|
}
|
|
41120
41120
|
return Promise.resolve(result);
|
|
41121
41121
|
} catch (error) {
|
|
41122
|
-
|
|
41122
|
+
logger8.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41123
41123
|
body: bodyify(dataMatch[1], dataMatch[2]),
|
|
41124
41124
|
error,
|
|
41125
41125
|
requestBody: null,
|
|
@@ -41153,7 +41153,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41153
41153
|
return;
|
|
41154
41154
|
}
|
|
41155
41155
|
timer = null;
|
|
41156
|
-
reject(
|
|
41156
|
+
reject(logger8.makeError("timeout", logger_1.Logger.errors.TIMEOUT, {
|
|
41157
41157
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
41158
41158
|
requestMethod: options.method,
|
|
41159
41159
|
timeout,
|
|
@@ -41230,7 +41230,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41230
41230
|
response2 = error_1.response;
|
|
41231
41231
|
if (response2 == null) {
|
|
41232
41232
|
runningTimeout.cancel();
|
|
41233
|
-
|
|
41233
|
+
logger8.throwError("missing response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41234
41234
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
41235
41235
|
requestMethod: options.method,
|
|
41236
41236
|
serverError: error_1,
|
|
@@ -41244,7 +41244,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41244
41244
|
body_1 = null;
|
|
41245
41245
|
} else if (!errorPassThrough && (response2.statusCode < 200 || response2.statusCode >= 300)) {
|
|
41246
41246
|
runningTimeout.cancel();
|
|
41247
|
-
|
|
41247
|
+
logger8.throwError("bad response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41248
41248
|
status: response2.statusCode,
|
|
41249
41249
|
headers: response2.headers,
|
|
41250
41250
|
body: bodyify(body_1, response2.headers ? response2.headers["content-type"] : null),
|
|
@@ -41284,7 +41284,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41284
41284
|
return [3, 19];
|
|
41285
41285
|
case 17:
|
|
41286
41286
|
runningTimeout.cancel();
|
|
41287
|
-
|
|
41287
|
+
logger8.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41288
41288
|
body: bodyify(body_1, response2.headers ? response2.headers["content-type"] : null),
|
|
41289
41289
|
error: error_2,
|
|
41290
41290
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -41299,7 +41299,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41299
41299
|
attempt++;
|
|
41300
41300
|
return [3, 1];
|
|
41301
41301
|
case 20:
|
|
41302
|
-
return [2,
|
|
41302
|
+
return [2, logger8.throwError("failed response", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41303
41303
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
41304
41304
|
requestMethod: options.method,
|
|
41305
41305
|
url
|
|
@@ -41318,7 +41318,7 @@ var require_lib23 = __commonJS((exports) => {
|
|
|
41318
41318
|
try {
|
|
41319
41319
|
result = JSON.parse((0, strings_1.toUtf8String)(value));
|
|
41320
41320
|
} catch (error) {
|
|
41321
|
-
|
|
41321
|
+
logger8.throwError("invalid JSON", logger_1.Logger.errors.SERVER_ERROR, {
|
|
41322
41322
|
body: value,
|
|
41323
41323
|
error
|
|
41324
41324
|
});
|
|
@@ -41456,7 +41456,7 @@ var require_bech32 = __commonJS((exports, module) => {
|
|
|
41456
41456
|
}
|
|
41457
41457
|
return chk;
|
|
41458
41458
|
}
|
|
41459
|
-
function
|
|
41459
|
+
function encode(prefix, words, LIMIT) {
|
|
41460
41460
|
LIMIT = LIMIT || 90;
|
|
41461
41461
|
if (prefix.length + 7 + words.length > LIMIT)
|
|
41462
41462
|
throw new TypeError("Exceeds length limit");
|
|
@@ -41581,7 +41581,7 @@ var require_bech32 = __commonJS((exports, module) => {
|
|
|
41581
41581
|
module.exports = {
|
|
41582
41582
|
decodeUnsafe,
|
|
41583
41583
|
decode,
|
|
41584
|
-
encode
|
|
41584
|
+
encode,
|
|
41585
41585
|
toWordsUnsafe,
|
|
41586
41586
|
toWords,
|
|
41587
41587
|
fromWordsUnsafe,
|
|
@@ -41611,7 +41611,7 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41611
41611
|
var Zeros = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
41612
41612
|
var logger_1 = require_lib();
|
|
41613
41613
|
var _version_1 = require__version18();
|
|
41614
|
-
var
|
|
41614
|
+
var logger24 = new logger_1.Logger(_version_1.version);
|
|
41615
41615
|
function _pack(type, value, isArray2) {
|
|
41616
41616
|
switch (type) {
|
|
41617
41617
|
case "address":
|
|
@@ -41634,7 +41634,7 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41634
41634
|
if (match) {
|
|
41635
41635
|
var size2 = parseInt(match[2] || "256");
|
|
41636
41636
|
if (match[2] && String(size2) !== match[2] || size2 % 8 !== 0 || size2 === 0 || size2 > 256) {
|
|
41637
|
-
|
|
41637
|
+
logger24.throwArgumentError("invalid number type", "type", type);
|
|
41638
41638
|
}
|
|
41639
41639
|
if (isArray2) {
|
|
41640
41640
|
size2 = 256;
|
|
@@ -41646,10 +41646,10 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41646
41646
|
if (match) {
|
|
41647
41647
|
var size2 = parseInt(match[1]);
|
|
41648
41648
|
if (String(size2) !== match[1] || size2 === 0 || size2 > 32) {
|
|
41649
|
-
|
|
41649
|
+
logger24.throwArgumentError("invalid bytes type", "type", type);
|
|
41650
41650
|
}
|
|
41651
41651
|
if ((0, bytes_1.arrayify)(value).byteLength !== size2) {
|
|
41652
|
-
|
|
41652
|
+
logger24.throwArgumentError("invalid value for " + type, "value", value);
|
|
41653
41653
|
}
|
|
41654
41654
|
if (isArray2) {
|
|
41655
41655
|
return (0, bytes_1.arrayify)((value + Zeros).substring(0, 66));
|
|
@@ -41661,7 +41661,7 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41661
41661
|
var baseType_1 = match[1];
|
|
41662
41662
|
var count = parseInt(match[2] || String(value.length));
|
|
41663
41663
|
if (count != value.length) {
|
|
41664
|
-
|
|
41664
|
+
logger24.throwArgumentError("invalid array length for " + type, "value", value);
|
|
41665
41665
|
}
|
|
41666
41666
|
var result_1 = [];
|
|
41667
41667
|
value.forEach(function(value2) {
|
|
@@ -41669,11 +41669,11 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41669
41669
|
});
|
|
41670
41670
|
return (0, bytes_1.concat)(result_1);
|
|
41671
41671
|
}
|
|
41672
|
-
return
|
|
41672
|
+
return logger24.throwArgumentError("invalid type", "type", type);
|
|
41673
41673
|
}
|
|
41674
41674
|
function pack(types2, values) {
|
|
41675
41675
|
if (types2.length != values.length) {
|
|
41676
|
-
|
|
41676
|
+
logger24.throwArgumentError("wrong number of values; expected ${ types.length }", "values", values);
|
|
41677
41677
|
}
|
|
41678
41678
|
var tight = [];
|
|
41679
41679
|
types2.forEach(function(type, index) {
|
|
@@ -41682,10 +41682,10 @@ var require_lib24 = __commonJS((exports) => {
|
|
|
41682
41682
|
return (0, bytes_1.hexlify)((0, bytes_1.concat)(tight));
|
|
41683
41683
|
}
|
|
41684
41684
|
exports.pack = pack;
|
|
41685
|
-
function
|
|
41685
|
+
function keccak2563(types2, values) {
|
|
41686
41686
|
return (0, keccak256_1.keccak256)(pack(types2, values));
|
|
41687
41687
|
}
|
|
41688
|
-
exports.keccak256 =
|
|
41688
|
+
exports.keccak256 = keccak2563;
|
|
41689
41689
|
function sha2562(types2, values) {
|
|
41690
41690
|
return (0, sha2_1.sha256)(pack(types2, values));
|
|
41691
41691
|
}
|
|
@@ -41706,7 +41706,7 @@ var require_lib25 = __commonJS((exports) => {
|
|
|
41706
41706
|
var bignumber_1 = require_lib3();
|
|
41707
41707
|
var logger_1 = require_lib();
|
|
41708
41708
|
var _version_1 = require__version19();
|
|
41709
|
-
var
|
|
41709
|
+
var logger24 = new logger_1.Logger(_version_1.version);
|
|
41710
41710
|
var names = [
|
|
41711
41711
|
"wei",
|
|
41712
41712
|
"kwei",
|
|
@@ -41719,7 +41719,7 @@ var require_lib25 = __commonJS((exports) => {
|
|
|
41719
41719
|
function commify(value) {
|
|
41720
41720
|
var comps = String(value).split(".");
|
|
41721
41721
|
if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || comps[1] && !comps[1].match(/^[0-9]*$/) || value === "." || value === "-.") {
|
|
41722
|
-
|
|
41722
|
+
logger24.throwArgumentError("invalid value", "value", value);
|
|
41723
41723
|
}
|
|
41724
41724
|
var whole = comps[0];
|
|
41725
41725
|
var negative = "";
|
|
@@ -41766,7 +41766,7 @@ var require_lib25 = __commonJS((exports) => {
|
|
|
41766
41766
|
exports.formatUnits = formatUnits;
|
|
41767
41767
|
function parseUnits(value, unitName) {
|
|
41768
41768
|
if (typeof value !== "string") {
|
|
41769
|
-
|
|
41769
|
+
logger24.throwArgumentError("value must be a string", "value", value);
|
|
41770
41770
|
}
|
|
41771
41771
|
if (typeof unitName === "string") {
|
|
41772
41772
|
var index = names.indexOf(unitName);
|
|
@@ -43025,7 +43025,7 @@ var require_decimal = __commonJS((exports, module) => {
|
|
|
43025
43025
|
toExpNeg: -7,
|
|
43026
43026
|
toExpPos: 21,
|
|
43027
43027
|
LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
|
|
43028
|
-
}, 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,
|
|
43028
|
+
}, 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 = {};
|
|
43029
43029
|
P.absoluteValue = P.abs = function() {
|
|
43030
43030
|
var x = new this.constructor(this);
|
|
43031
43031
|
if (x.s)
|
|
@@ -43315,7 +43315,7 @@ var require_decimal = __commonJS((exports, module) => {
|
|
|
43315
43315
|
if (!yIsInt) {
|
|
43316
43316
|
if (sign < 0)
|
|
43317
43317
|
throw Error(decimalError + "NaN");
|
|
43318
|
-
} else if ((k = yn < 0 ? -yn : yn) <=
|
|
43318
|
+
} else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
43319
43319
|
r = new Ctor(ONE2);
|
|
43320
43320
|
e = Math.ceil(pr / LOG_BASE + 4);
|
|
43321
43321
|
external = false;
|
|
@@ -44797,7 +44797,7 @@ var require_lib26 = __commonJS((exports) => {
|
|
|
44797
44797
|
var properties_1 = require_lib4();
|
|
44798
44798
|
var logger_1 = require_lib();
|
|
44799
44799
|
var _version_1 = require__version20();
|
|
44800
|
-
var
|
|
44800
|
+
var logger25 = new logger_1.Logger(_version_1.version);
|
|
44801
44801
|
var ForkEvent2 = function(_super) {
|
|
44802
44802
|
__extends(ForkEvent3, _super);
|
|
44803
44803
|
function ForkEvent3() {
|
|
@@ -44814,7 +44814,7 @@ var require_lib26 = __commonJS((exports) => {
|
|
|
44814
44814
|
function BlockForkEvent2(blockHash, expiry) {
|
|
44815
44815
|
var _this = this;
|
|
44816
44816
|
if (!(0, bytes_1.isHexString)(blockHash, 32)) {
|
|
44817
|
-
|
|
44817
|
+
logger25.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
|
44818
44818
|
}
|
|
44819
44819
|
_this = _super.call(this, {
|
|
44820
44820
|
_isForkEvent: true,
|
|
@@ -44832,7 +44832,7 @@ var require_lib26 = __commonJS((exports) => {
|
|
|
44832
44832
|
function TransactionForkEvent2(hash2, expiry) {
|
|
44833
44833
|
var _this = this;
|
|
44834
44834
|
if (!(0, bytes_1.isHexString)(hash2, 32)) {
|
|
44835
|
-
|
|
44835
|
+
logger25.throwArgumentError("invalid transaction hash", "hash", hash2);
|
|
44836
44836
|
}
|
|
44837
44837
|
_this = _super.call(this, {
|
|
44838
44838
|
_isForkEvent: true,
|
|
@@ -44850,10 +44850,10 @@ var require_lib26 = __commonJS((exports) => {
|
|
|
44850
44850
|
function TransactionOrderForkEvent2(beforeHash, afterHash, expiry) {
|
|
44851
44851
|
var _this = this;
|
|
44852
44852
|
if (!(0, bytes_1.isHexString)(beforeHash, 32)) {
|
|
44853
|
-
|
|
44853
|
+
logger25.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
|
44854
44854
|
}
|
|
44855
44855
|
if (!(0, bytes_1.isHexString)(afterHash, 32)) {
|
|
44856
|
-
|
|
44856
|
+
logger25.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
|
44857
44857
|
}
|
|
44858
44858
|
_this = _super.call(this, {
|
|
44859
44859
|
_isForkEvent: true,
|
|
@@ -44870,7 +44870,7 @@ var require_lib26 = __commonJS((exports) => {
|
|
|
44870
44870
|
var Provider2 = function() {
|
|
44871
44871
|
function Provider3() {
|
|
44872
44872
|
var _newTarget = this.constructor;
|
|
44873
|
-
|
|
44873
|
+
logger25.checkAbstract(_newTarget, Provider3);
|
|
44874
44874
|
(0, properties_1.defineReadOnly)(this, "_isProvider", true);
|
|
44875
44875
|
}
|
|
44876
44876
|
Provider3.prototype.getFeeData = function() {
|
|
@@ -45050,7 +45050,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45050
45050
|
var properties_1 = require_lib4();
|
|
45051
45051
|
var logger_1 = require_lib();
|
|
45052
45052
|
var _version_1 = require__version21();
|
|
45053
|
-
var
|
|
45053
|
+
var logger25 = new logger_1.Logger(_version_1.version);
|
|
45054
45054
|
var allowedTransactionKeys4 = [
|
|
45055
45055
|
"accessList",
|
|
45056
45056
|
"ccipReadEnabled",
|
|
@@ -45075,7 +45075,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45075
45075
|
var Signer2 = function() {
|
|
45076
45076
|
function Signer3() {
|
|
45077
45077
|
var _newTarget = this.constructor;
|
|
45078
|
-
|
|
45078
|
+
logger25.checkAbstract(_newTarget, Signer3);
|
|
45079
45079
|
(0, properties_1.defineReadOnly)(this, "_isSigner", true);
|
|
45080
45080
|
}
|
|
45081
45081
|
Signer3.prototype.getBalance = function(blockTag) {
|
|
@@ -45215,7 +45215,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45215
45215
|
Signer3.prototype.checkTransaction = function(transaction) {
|
|
45216
45216
|
for (var key in transaction) {
|
|
45217
45217
|
if (allowedTransactionKeys4.indexOf(key) === -1) {
|
|
45218
|
-
|
|
45218
|
+
logger25.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
|
|
45219
45219
|
}
|
|
45220
45220
|
}
|
|
45221
45221
|
var tx = (0, properties_1.shallowCopy)(transaction);
|
|
@@ -45227,7 +45227,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45227
45227
|
this.getAddress()
|
|
45228
45228
|
]).then(function(result) {
|
|
45229
45229
|
if (result[0].toLowerCase() !== result[1].toLowerCase()) {
|
|
45230
|
-
|
|
45230
|
+
logger25.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
45231
45231
|
}
|
|
45232
45232
|
return result[0];
|
|
45233
45233
|
});
|
|
@@ -45258,7 +45258,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45258
45258
|
case 1:
|
|
45259
45259
|
address = _a2.sent();
|
|
45260
45260
|
if (address == null) {
|
|
45261
|
-
|
|
45261
|
+
logger25.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
45262
45262
|
}
|
|
45263
45263
|
return [2, address];
|
|
45264
45264
|
}
|
|
@@ -45269,9 +45269,9 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45269
45269
|
}
|
|
45270
45270
|
hasEip1559 = tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null;
|
|
45271
45271
|
if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
|
|
45272
|
-
|
|
45272
|
+
logger25.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
|
|
45273
45273
|
} else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
|
|
45274
|
-
|
|
45274
|
+
logger25.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
|
|
45275
45275
|
}
|
|
45276
45276
|
if (!((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)))
|
|
45277
45277
|
return [3, 2];
|
|
@@ -45306,7 +45306,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45306
45306
|
}
|
|
45307
45307
|
} else if (feeData.gasPrice != null) {
|
|
45308
45308
|
if (hasEip1559) {
|
|
45309
|
-
|
|
45309
|
+
logger25.throwError("network does not support EIP-1559", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
45310
45310
|
operation: "populateTransaction"
|
|
45311
45311
|
});
|
|
45312
45312
|
}
|
|
@@ -45315,7 +45315,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45315
45315
|
}
|
|
45316
45316
|
tx.type = 0;
|
|
45317
45317
|
} else {
|
|
45318
|
-
|
|
45318
|
+
logger25.throwError("failed to get consistent fee data", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
45319
45319
|
operation: "signer.getFeeData"
|
|
45320
45320
|
});
|
|
45321
45321
|
}
|
|
@@ -45337,7 +45337,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45337
45337
|
if (forwardErrors2.indexOf(error.code) >= 0) {
|
|
45338
45338
|
throw error;
|
|
45339
45339
|
}
|
|
45340
|
-
return
|
|
45340
|
+
return logger25.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
45341
45341
|
error,
|
|
45342
45342
|
tx
|
|
45343
45343
|
});
|
|
@@ -45351,7 +45351,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45351
45351
|
this.getChainId()
|
|
45352
45352
|
]).then(function(results) {
|
|
45353
45353
|
if (results[1] !== 0 && results[0] !== results[1]) {
|
|
45354
|
-
|
|
45354
|
+
logger25.throwArgumentError("chainId address mismatch", "transaction", transaction);
|
|
45355
45355
|
}
|
|
45356
45356
|
return results[0];
|
|
45357
45357
|
});
|
|
@@ -45365,7 +45365,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45365
45365
|
};
|
|
45366
45366
|
Signer3.prototype._checkProvider = function(operation) {
|
|
45367
45367
|
if (!this.provider) {
|
|
45368
|
-
|
|
45368
|
+
logger25.throwError("missing provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
45369
45369
|
operation: operation || "_checkProvider"
|
|
45370
45370
|
});
|
|
45371
45371
|
}
|
|
@@ -45389,7 +45389,7 @@ var require_lib27 = __commonJS((exports) => {
|
|
|
45389
45389
|
};
|
|
45390
45390
|
VoidSigner3.prototype._fail = function(message, operation) {
|
|
45391
45391
|
return Promise.resolve().then(function() {
|
|
45392
|
-
|
|
45392
|
+
logger25.throwError(message, logger_1.Logger.errors.UNSUPPORTED_OPERATION, { operation });
|
|
45393
45393
|
});
|
|
45394
45394
|
};
|
|
45395
45395
|
VoidSigner3.prototype.signMessage = function(message) {
|
|
@@ -45558,7 +45558,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45558
45558
|
var transactions_1 = require_lib15();
|
|
45559
45559
|
var logger_1 = require_lib();
|
|
45560
45560
|
var _version_1 = require__version22();
|
|
45561
|
-
var
|
|
45561
|
+
var logger25 = new logger_1.Logger(_version_1.version);
|
|
45562
45562
|
function isAccount2(value) {
|
|
45563
45563
|
return value != null && (0, bytes_1.isHexString)(value.privateKey, 32) && value.address != null;
|
|
45564
45564
|
}
|
|
@@ -45577,7 +45577,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45577
45577
|
});
|
|
45578
45578
|
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
|
|
45579
45579
|
if (_this.address !== (0, address_1.getAddress)(privateKey.address)) {
|
|
45580
|
-
|
|
45580
|
+
logger25.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
45581
45581
|
}
|
|
45582
45582
|
if (hasMnemonic2(privateKey)) {
|
|
45583
45583
|
var srcMnemonic_1 = privateKey.mnemonic;
|
|
@@ -45591,7 +45591,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45591
45591
|
var mnemonic = _this.mnemonic;
|
|
45592
45592
|
var node = hdnode_1.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
45593
45593
|
if ((0, transactions_1.computeAddress)(node.privateKey) !== _this.address) {
|
|
45594
|
-
|
|
45594
|
+
logger25.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
45595
45595
|
}
|
|
45596
45596
|
} else {
|
|
45597
45597
|
(0, properties_1.defineReadOnly)(_this, "_mnemonic", function() {
|
|
@@ -45601,7 +45601,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45601
45601
|
} else {
|
|
45602
45602
|
if (signing_key_1.SigningKey.isSigningKey(privateKey)) {
|
|
45603
45603
|
if (privateKey.curve !== "secp256k1") {
|
|
45604
|
-
|
|
45604
|
+
logger25.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
45605
45605
|
}
|
|
45606
45606
|
(0, properties_1.defineReadOnly)(_this, "_signingKey", function() {
|
|
45607
45607
|
return privateKey;
|
|
@@ -45623,7 +45623,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45623
45623
|
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
|
|
45624
45624
|
}
|
|
45625
45625
|
if (provider && !abstract_provider_1.Provider.isProvider(provider)) {
|
|
45626
|
-
|
|
45626
|
+
logger25.throwArgumentError("invalid provider", "provider", provider);
|
|
45627
45627
|
}
|
|
45628
45628
|
(0, properties_1.defineReadOnly)(_this, "provider", provider || null);
|
|
45629
45629
|
return _this;
|
|
@@ -45660,7 +45660,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45660
45660
|
return (0, properties_1.resolveProperties)(transaction).then(function(tx) {
|
|
45661
45661
|
if (tx.from != null) {
|
|
45662
45662
|
if ((0, address_1.getAddress)(tx.from) !== _this.address) {
|
|
45663
|
-
|
|
45663
|
+
logger25.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
45664
45664
|
}
|
|
45665
45665
|
delete tx.from;
|
|
45666
45666
|
}
|
|
@@ -45684,7 +45684,7 @@ var require_lib28 = __commonJS((exports) => {
|
|
|
45684
45684
|
case 0:
|
|
45685
45685
|
return [4, hash_1._TypedDataEncoder.resolveNames(domain, types3, value, function(name) {
|
|
45686
45686
|
if (_this.provider == null) {
|
|
45687
|
-
|
|
45687
|
+
logger25.throwError("cannot resolve ENS names without a provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
|
45688
45688
|
operation: "resolveName",
|
|
45689
45689
|
value: name
|
|
45690
45690
|
});
|
|
@@ -46522,10 +46522,10 @@ var createCall = (call) => {
|
|
|
46522
46522
|
var exports_ethers = {};
|
|
46523
46523
|
__export(exports_ethers, {
|
|
46524
46524
|
wordlists: () => wordlists,
|
|
46525
|
-
version: () =>
|
|
46525
|
+
version: () => version12,
|
|
46526
46526
|
utils: () => exports_utils,
|
|
46527
46527
|
providers: () => exports_lib2,
|
|
46528
|
-
logger: () =>
|
|
46528
|
+
logger: () => logger24,
|
|
46529
46529
|
getDefaultProvider: () => getDefaultProvider,
|
|
46530
46530
|
errors: () => ErrorCode,
|
|
46531
46531
|
constants: () => exports_lib,
|
|
@@ -47100,12 +47100,6 @@ function throwFault(fault, operation, value) {
|
|
|
47100
47100
|
}
|
|
47101
47101
|
return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
|
47102
47102
|
}
|
|
47103
|
-
function _base36To16(value) {
|
|
47104
|
-
return new BN(value, 36).toString(16);
|
|
47105
|
-
}
|
|
47106
|
-
function _base16To36(value) {
|
|
47107
|
-
return new BN(value, 16).toString(36);
|
|
47108
|
-
}
|
|
47109
47103
|
// node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js
|
|
47110
47104
|
var import_bytes2 = __toESM(require_lib2(), 1);
|
|
47111
47105
|
var logger2 = new Logger(version3);
|
|
@@ -47803,136 +47797,14 @@ class VoidSigner extends Signer {
|
|
|
47803
47797
|
}
|
|
47804
47798
|
}
|
|
47805
47799
|
|
|
47806
|
-
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
47807
|
-
var import_bytes3 = __toESM(require_lib2(), 1);
|
|
47808
|
-
var import_keccak2563 = __toESM(require_lib5(), 1);
|
|
47809
|
-
var import_rlp = __toESM(require_lib6(), 1);
|
|
47810
|
-
|
|
47811
|
-
// node_modules/@ethersproject/address/lib.esm/_version.js
|
|
47812
|
-
var version6 = "address/5.7.0";
|
|
47813
|
-
|
|
47814
|
-
// node_modules/@ethersproject/address/lib.esm/index.js
|
|
47815
|
-
var logger5 = new Logger(version6);
|
|
47816
|
-
function getChecksumAddress(address) {
|
|
47817
|
-
if (!import_bytes3.isHexString(address, 20)) {
|
|
47818
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
47819
|
-
}
|
|
47820
|
-
address = address.toLowerCase();
|
|
47821
|
-
const chars = address.substring(2).split("");
|
|
47822
|
-
const expanded = new Uint8Array(40);
|
|
47823
|
-
for (let i2 = 0;i2 < 40; i2++) {
|
|
47824
|
-
expanded[i2] = chars[i2].charCodeAt(0);
|
|
47825
|
-
}
|
|
47826
|
-
const hashed = import_bytes3.arrayify(import_keccak2563.keccak256(expanded));
|
|
47827
|
-
for (let i2 = 0;i2 < 40; i2 += 2) {
|
|
47828
|
-
if (hashed[i2 >> 1] >> 4 >= 8) {
|
|
47829
|
-
chars[i2] = chars[i2].toUpperCase();
|
|
47830
|
-
}
|
|
47831
|
-
if ((hashed[i2 >> 1] & 15) >= 8) {
|
|
47832
|
-
chars[i2 + 1] = chars[i2 + 1].toUpperCase();
|
|
47833
|
-
}
|
|
47834
|
-
}
|
|
47835
|
-
return "0x" + chars.join("");
|
|
47836
|
-
}
|
|
47837
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
47838
|
-
function log10(x) {
|
|
47839
|
-
if (Math.log10) {
|
|
47840
|
-
return Math.log10(x);
|
|
47841
|
-
}
|
|
47842
|
-
return Math.log(x) / Math.LN10;
|
|
47843
|
-
}
|
|
47844
|
-
var ibanLookup = {};
|
|
47845
|
-
for (let i2 = 0;i2 < 10; i2++) {
|
|
47846
|
-
ibanLookup[String(i2)] = String(i2);
|
|
47847
|
-
}
|
|
47848
|
-
for (let i2 = 0;i2 < 26; i2++) {
|
|
47849
|
-
ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2);
|
|
47850
|
-
}
|
|
47851
|
-
var safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
|
47852
|
-
function ibanChecksum(address) {
|
|
47853
|
-
address = address.toUpperCase();
|
|
47854
|
-
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
47855
|
-
let expanded = address.split("").map((c) => {
|
|
47856
|
-
return ibanLookup[c];
|
|
47857
|
-
}).join("");
|
|
47858
|
-
while (expanded.length >= safeDigits) {
|
|
47859
|
-
let block = expanded.substring(0, safeDigits);
|
|
47860
|
-
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
47861
|
-
}
|
|
47862
|
-
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
|
47863
|
-
while (checksum.length < 2) {
|
|
47864
|
-
checksum = "0" + checksum;
|
|
47865
|
-
}
|
|
47866
|
-
return checksum;
|
|
47867
|
-
}
|
|
47868
|
-
function getAddress2(address) {
|
|
47869
|
-
let result = null;
|
|
47870
|
-
if (typeof address !== "string") {
|
|
47871
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
47872
|
-
}
|
|
47873
|
-
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
47874
|
-
if (address.substring(0, 2) !== "0x") {
|
|
47875
|
-
address = "0x" + address;
|
|
47876
|
-
}
|
|
47877
|
-
result = getChecksumAddress(address);
|
|
47878
|
-
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
47879
|
-
logger5.throwArgumentError("bad address checksum", "address", address);
|
|
47880
|
-
}
|
|
47881
|
-
} else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
47882
|
-
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
47883
|
-
logger5.throwArgumentError("bad icap checksum", "address", address);
|
|
47884
|
-
}
|
|
47885
|
-
result = _base36To16(address.substring(4));
|
|
47886
|
-
while (result.length < 40) {
|
|
47887
|
-
result = "0" + result;
|
|
47888
|
-
}
|
|
47889
|
-
result = getChecksumAddress("0x" + result);
|
|
47890
|
-
} else {
|
|
47891
|
-
logger5.throwArgumentError("invalid address", "address", address);
|
|
47892
|
-
}
|
|
47893
|
-
return result;
|
|
47894
|
-
}
|
|
47895
|
-
function isAddress2(address) {
|
|
47896
|
-
try {
|
|
47897
|
-
getAddress2(address);
|
|
47898
|
-
return true;
|
|
47899
|
-
} catch (error) {}
|
|
47900
|
-
return false;
|
|
47901
|
-
}
|
|
47902
|
-
function getIcapAddress(address) {
|
|
47903
|
-
let base36 = _base16To36(getAddress2(address).substring(2)).toUpperCase();
|
|
47904
|
-
while (base36.length < 30) {
|
|
47905
|
-
base36 = "0" + base36;
|
|
47906
|
-
}
|
|
47907
|
-
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
|
47908
|
-
}
|
|
47909
|
-
function getContractAddress(transaction) {
|
|
47910
|
-
let from2 = null;
|
|
47911
|
-
try {
|
|
47912
|
-
from2 = getAddress2(transaction.from);
|
|
47913
|
-
} catch (error) {
|
|
47914
|
-
logger5.throwArgumentError("missing from address", "transaction", transaction);
|
|
47915
|
-
}
|
|
47916
|
-
const nonce = import_bytes3.stripZeros(import_bytes3.arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
47917
|
-
return getAddress2(import_bytes3.hexDataSlice(import_keccak2563.keccak256(import_rlp.encode([from2, nonce])), 12));
|
|
47918
|
-
}
|
|
47919
|
-
function getCreate2Address(from2, salt, initCodeHash) {
|
|
47920
|
-
if (import_bytes3.hexDataLength(salt) !== 32) {
|
|
47921
|
-
logger5.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
|
47922
|
-
}
|
|
47923
|
-
if (import_bytes3.hexDataLength(initCodeHash) !== 32) {
|
|
47924
|
-
logger5.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
47925
|
-
}
|
|
47926
|
-
return getAddress2(import_bytes3.hexDataSlice(import_keccak2563.keccak256(import_bytes3.concat(["0xff", getAddress2(from2), salt, initCodeHash])), 12));
|
|
47927
|
-
}
|
|
47928
|
-
|
|
47929
47800
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
47930
|
-
var
|
|
47801
|
+
var import_address4 = __toESM(require_lib7(), 1);
|
|
47802
|
+
var import_bytes3 = __toESM(require_lib2(), 1);
|
|
47931
47803
|
var import_properties3 = __toESM(require_lib4(), 1);
|
|
47932
47804
|
var import_transactions = __toESM(require_lib15(), 1);
|
|
47933
47805
|
|
|
47934
47806
|
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
47935
|
-
var
|
|
47807
|
+
var version7 = "contracts/5.7.0";
|
|
47936
47808
|
|
|
47937
47809
|
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
47938
47810
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
@@ -47962,7 +47834,7 @@ var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
|
47962
47834
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47963
47835
|
});
|
|
47964
47836
|
};
|
|
47965
|
-
var
|
|
47837
|
+
var logger5 = new Logger(version7);
|
|
47966
47838
|
var allowedTransactionKeys2 = {
|
|
47967
47839
|
chainId: true,
|
|
47968
47840
|
data: true,
|
|
@@ -47983,19 +47855,19 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
47983
47855
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
47984
47856
|
const name = yield nameOrPromise;
|
|
47985
47857
|
if (typeof name !== "string") {
|
|
47986
|
-
|
|
47858
|
+
logger5.throwArgumentError("invalid address or ENS name", "name", name);
|
|
47987
47859
|
}
|
|
47988
47860
|
try {
|
|
47989
|
-
return
|
|
47861
|
+
return import_address4.getAddress(name);
|
|
47990
47862
|
} catch (error) {}
|
|
47991
47863
|
if (!resolver) {
|
|
47992
|
-
|
|
47864
|
+
logger5.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
47993
47865
|
operation: "resolveName"
|
|
47994
47866
|
});
|
|
47995
47867
|
}
|
|
47996
47868
|
const address = yield resolver.resolveName(name);
|
|
47997
47869
|
if (address == null) {
|
|
47998
|
-
|
|
47870
|
+
logger5.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
|
|
47999
47871
|
}
|
|
48000
47872
|
return address;
|
|
48001
47873
|
});
|
|
@@ -48015,7 +47887,7 @@ function resolveAddresses(resolver, value, paramType) {
|
|
|
48015
47887
|
}
|
|
48016
47888
|
if (paramType.baseType === "array") {
|
|
48017
47889
|
if (!Array.isArray(value)) {
|
|
48018
|
-
return Promise.reject(
|
|
47890
|
+
return Promise.reject(logger5.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
|
|
48019
47891
|
argument: "value",
|
|
48020
47892
|
value
|
|
48021
47893
|
}));
|
|
@@ -48031,15 +47903,15 @@ function populateTransaction(contract, fragment, args) {
|
|
|
48031
47903
|
if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
|
|
48032
47904
|
overrides = import_properties3.shallowCopy(args.pop());
|
|
48033
47905
|
}
|
|
48034
|
-
|
|
47906
|
+
logger5.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
|
|
48035
47907
|
if (contract.signer) {
|
|
48036
47908
|
if (overrides.from) {
|
|
48037
47909
|
overrides.from = import_properties3.resolveProperties({
|
|
48038
47910
|
override: resolveName(contract.signer, overrides.from),
|
|
48039
47911
|
signer: contract.signer.getAddress()
|
|
48040
47912
|
}).then((check) => __awaiter3(this, undefined, undefined, function* () {
|
|
48041
|
-
if (
|
|
48042
|
-
|
|
47913
|
+
if (import_address4.getAddress(check.signer) !== check.override) {
|
|
47914
|
+
logger5.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48043
47915
|
operation: "overrides.from"
|
|
48044
47916
|
});
|
|
48045
47917
|
}
|
|
@@ -48088,7 +47960,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
48088
47960
|
}
|
|
48089
47961
|
if (tx.gasLimit == null && fragment.gas != null) {
|
|
48090
47962
|
let intrinsic = 21000;
|
|
48091
|
-
const bytes =
|
|
47963
|
+
const bytes = import_bytes3.arrayify(data);
|
|
48092
47964
|
for (let i2 = 0;i2 < bytes.length; i2++) {
|
|
48093
47965
|
intrinsic += 4;
|
|
48094
47966
|
if (bytes[i2]) {
|
|
@@ -48100,7 +47972,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
48100
47972
|
if (ro.value) {
|
|
48101
47973
|
const roValue = BigNumber.from(ro.value);
|
|
48102
47974
|
if (!roValue.isZero() && !fragment.payable) {
|
|
48103
|
-
|
|
47975
|
+
logger5.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48104
47976
|
operation: "overrides.value",
|
|
48105
47977
|
value: overrides.value
|
|
48106
47978
|
});
|
|
@@ -48126,7 +47998,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
48126
47998
|
delete overrides.ccipReadEnabled;
|
|
48127
47999
|
const leftovers = Object.keys(overrides).filter((key) => overrides[key] != null);
|
|
48128
48000
|
if (leftovers.length) {
|
|
48129
|
-
|
|
48001
|
+
logger5.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48130
48002
|
operation: "overrides",
|
|
48131
48003
|
overrides: leftovers
|
|
48132
48004
|
});
|
|
@@ -48144,7 +48016,7 @@ function buildEstimate(contract, fragment) {
|
|
|
48144
48016
|
return function(...args) {
|
|
48145
48017
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
48146
48018
|
if (!signerOrProvider) {
|
|
48147
|
-
|
|
48019
|
+
logger5.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48148
48020
|
operation: "estimateGas"
|
|
48149
48021
|
});
|
|
48150
48022
|
}
|
|
@@ -48228,7 +48100,7 @@ function buildSend(contract, fragment) {
|
|
|
48228
48100
|
return function(...args) {
|
|
48229
48101
|
return __awaiter3(this, undefined, undefined, function* () {
|
|
48230
48102
|
if (!contract.signer) {
|
|
48231
|
-
|
|
48103
|
+
logger5.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48232
48104
|
operation: "sendTransaction"
|
|
48233
48105
|
});
|
|
48234
48106
|
}
|
|
@@ -48319,7 +48191,7 @@ class FragmentRunningEvent extends RunningEvent {
|
|
|
48319
48191
|
let topic = contractInterface.getEventTopic(fragment);
|
|
48320
48192
|
if (topics) {
|
|
48321
48193
|
if (topic !== topics[0]) {
|
|
48322
|
-
|
|
48194
|
+
logger5.throwArgumentError("topic mismatch", "topics", topics);
|
|
48323
48195
|
}
|
|
48324
48196
|
filter.topics = topics.slice();
|
|
48325
48197
|
} else {
|
|
@@ -48388,7 +48260,7 @@ class BaseContract {
|
|
|
48388
48260
|
import_properties3.defineReadOnly(this, "provider", signerOrProvider);
|
|
48389
48261
|
import_properties3.defineReadOnly(this, "signer", null);
|
|
48390
48262
|
} else {
|
|
48391
|
-
|
|
48263
|
+
logger5.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
|
|
48392
48264
|
}
|
|
48393
48265
|
import_properties3.defineReadOnly(this, "callStatic", {});
|
|
48394
48266
|
import_properties3.defineReadOnly(this, "estimateGas", {});
|
|
@@ -48415,23 +48287,23 @@ class BaseContract {
|
|
|
48415
48287
|
if (filters.length === 1) {
|
|
48416
48288
|
import_properties3.defineReadOnly(this.filters, name, this.filters[filters[0]]);
|
|
48417
48289
|
} else {
|
|
48418
|
-
|
|
48290
|
+
logger5.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
|
|
48419
48291
|
}
|
|
48420
48292
|
});
|
|
48421
48293
|
}
|
|
48422
48294
|
import_properties3.defineReadOnly(this, "_runningEvents", {});
|
|
48423
48295
|
import_properties3.defineReadOnly(this, "_wrappedEmits", {});
|
|
48424
48296
|
if (addressOrName == null) {
|
|
48425
|
-
|
|
48297
|
+
logger5.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
|
|
48426
48298
|
}
|
|
48427
48299
|
import_properties3.defineReadOnly(this, "address", addressOrName);
|
|
48428
48300
|
if (this.provider) {
|
|
48429
48301
|
import_properties3.defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
|
|
48430
48302
|
} else {
|
|
48431
48303
|
try {
|
|
48432
|
-
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(
|
|
48304
|
+
import_properties3.defineReadOnly(this, "resolvedAddress", Promise.resolve(import_address4.getAddress(addressOrName)));
|
|
48433
48305
|
} catch (error) {
|
|
48434
|
-
|
|
48306
|
+
logger5.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48435
48307
|
operation: "new Contract"
|
|
48436
48308
|
});
|
|
48437
48309
|
}
|
|
@@ -48442,7 +48314,7 @@ class BaseContract {
|
|
|
48442
48314
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
48443
48315
|
const fragment = this.interface.functions[signature];
|
|
48444
48316
|
if (uniqueSignatures[signature]) {
|
|
48445
|
-
|
|
48317
|
+
logger5.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
|
|
48446
48318
|
return;
|
|
48447
48319
|
}
|
|
48448
48320
|
uniqueSignatures[signature] = true;
|
|
@@ -48496,7 +48368,7 @@ class BaseContract {
|
|
|
48496
48368
|
});
|
|
48497
48369
|
}
|
|
48498
48370
|
static getContractAddress(transaction) {
|
|
48499
|
-
return getContractAddress(transaction);
|
|
48371
|
+
return import_address4.getContractAddress(transaction);
|
|
48500
48372
|
}
|
|
48501
48373
|
static getInterface(contractInterface) {
|
|
48502
48374
|
if (import_abi7.Interface.isInterface(contractInterface)) {
|
|
@@ -48516,7 +48388,7 @@ class BaseContract {
|
|
|
48516
48388
|
} else {
|
|
48517
48389
|
this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code2) => {
|
|
48518
48390
|
if (code2 === "0x") {
|
|
48519
|
-
|
|
48391
|
+
logger5.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48520
48392
|
contractAddress: this.address,
|
|
48521
48393
|
operation: "getDeployed"
|
|
48522
48394
|
});
|
|
@@ -48529,14 +48401,14 @@ class BaseContract {
|
|
|
48529
48401
|
}
|
|
48530
48402
|
fallback(overrides) {
|
|
48531
48403
|
if (!this.signer) {
|
|
48532
|
-
|
|
48404
|
+
logger5.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
|
|
48533
48405
|
}
|
|
48534
48406
|
const tx = import_properties3.shallowCopy(overrides || {});
|
|
48535
48407
|
["from", "to"].forEach(function(key) {
|
|
48536
48408
|
if (tx[key] == null) {
|
|
48537
48409
|
return;
|
|
48538
48410
|
}
|
|
48539
|
-
|
|
48411
|
+
logger5.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
48540
48412
|
});
|
|
48541
48413
|
tx.to = this.resolvedAddress;
|
|
48542
48414
|
return this.deployed().then(() => {
|
|
@@ -48629,7 +48501,7 @@ class BaseContract {
|
|
|
48629
48501
|
}
|
|
48630
48502
|
_addEventListener(runningEvent, listener, once3) {
|
|
48631
48503
|
if (!this.provider) {
|
|
48632
|
-
|
|
48504
|
+
logger5.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
48633
48505
|
}
|
|
48634
48506
|
runningEvent.addListener(listener, once3);
|
|
48635
48507
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
|
@@ -48660,9 +48532,9 @@ class BaseContract {
|
|
|
48660
48532
|
queryFilter(event, fromBlockOrBlockhash, toBlock) {
|
|
48661
48533
|
const runningEvent = this._getRunningEvent(event);
|
|
48662
48534
|
const filter = import_properties3.shallowCopy(runningEvent.filter);
|
|
48663
|
-
if (typeof fromBlockOrBlockhash === "string" &&
|
|
48535
|
+
if (typeof fromBlockOrBlockhash === "string" && import_bytes3.isHexString(fromBlockOrBlockhash, 32)) {
|
|
48664
48536
|
if (toBlock != null) {
|
|
48665
|
-
|
|
48537
|
+
logger5.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
|
|
48666
48538
|
}
|
|
48667
48539
|
filter.blockHash = fromBlockOrBlockhash;
|
|
48668
48540
|
} else {
|
|
@@ -48755,8 +48627,8 @@ class ContractFactory {
|
|
|
48755
48627
|
let bytecodeHex = null;
|
|
48756
48628
|
if (typeof bytecode === "string") {
|
|
48757
48629
|
bytecodeHex = bytecode;
|
|
48758
|
-
} else if (
|
|
48759
|
-
bytecodeHex =
|
|
48630
|
+
} else if (import_bytes3.isBytes(bytecode)) {
|
|
48631
|
+
bytecodeHex = import_bytes3.hexlify(bytecode);
|
|
48760
48632
|
} else if (bytecode && typeof bytecode.object === "string") {
|
|
48761
48633
|
bytecodeHex = bytecode.object;
|
|
48762
48634
|
} else {
|
|
@@ -48765,11 +48637,11 @@ class ContractFactory {
|
|
|
48765
48637
|
if (bytecodeHex.substring(0, 2) !== "0x") {
|
|
48766
48638
|
bytecodeHex = "0x" + bytecodeHex;
|
|
48767
48639
|
}
|
|
48768
|
-
if (!
|
|
48769
|
-
|
|
48640
|
+
if (!import_bytes3.isHexString(bytecodeHex) || bytecodeHex.length % 2) {
|
|
48641
|
+
logger5.throwArgumentError("invalid bytecode", "bytecode", bytecode);
|
|
48770
48642
|
}
|
|
48771
48643
|
if (signer && !Signer.isSigner(signer)) {
|
|
48772
|
-
|
|
48644
|
+
logger5.throwArgumentError("invalid signer", "signer", signer);
|
|
48773
48645
|
}
|
|
48774
48646
|
import_properties3.defineReadOnly(this, "bytecode", bytecodeHex);
|
|
48775
48647
|
import_properties3.defineReadOnly(this, "interface", import_properties3.getStatic(new.target, "getInterface")(contractInterface));
|
|
@@ -48789,19 +48661,19 @@ class ContractFactory {
|
|
|
48789
48661
|
if (tx[key] == null) {
|
|
48790
48662
|
return;
|
|
48791
48663
|
}
|
|
48792
|
-
|
|
48664
|
+
logger5.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
48793
48665
|
});
|
|
48794
48666
|
if (tx.value) {
|
|
48795
48667
|
const value = BigNumber.from(tx.value);
|
|
48796
48668
|
if (!value.isZero() && !this.interface.deploy.payable) {
|
|
48797
|
-
|
|
48669
|
+
logger5.throwError("non-payable constructor cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48798
48670
|
operation: "overrides.value",
|
|
48799
48671
|
value: tx.value
|
|
48800
48672
|
});
|
|
48801
48673
|
}
|
|
48802
48674
|
}
|
|
48803
|
-
|
|
48804
|
-
tx.data =
|
|
48675
|
+
logger5.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
48676
|
+
tx.data = import_bytes3.hexlify(import_bytes3.concat([
|
|
48805
48677
|
this.bytecode,
|
|
48806
48678
|
this.interface.encodeDeploy(args)
|
|
48807
48679
|
]));
|
|
@@ -48813,7 +48685,7 @@ class ContractFactory {
|
|
|
48813
48685
|
if (args.length === this.interface.deploy.inputs.length + 1) {
|
|
48814
48686
|
overrides = args.pop();
|
|
48815
48687
|
}
|
|
48816
|
-
|
|
48688
|
+
logger5.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
48817
48689
|
const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);
|
|
48818
48690
|
params.push(overrides);
|
|
48819
48691
|
const unsignedTx = this.getDeployTransaction(...params);
|
|
@@ -48833,7 +48705,7 @@ class ContractFactory {
|
|
|
48833
48705
|
}
|
|
48834
48706
|
static fromSolidity(compilerOutput, signer) {
|
|
48835
48707
|
if (compilerOutput == null) {
|
|
48836
|
-
|
|
48708
|
+
logger5.throwError("missing compiler output", Logger.errors.MISSING_ARGUMENT, { argument: "compilerOutput" });
|
|
48837
48709
|
}
|
|
48838
48710
|
if (typeof compilerOutput === "string") {
|
|
48839
48711
|
compilerOutput = JSON.parse(compilerOutput);
|
|
@@ -48851,7 +48723,7 @@ class ContractFactory {
|
|
|
48851
48723
|
return Contract.getInterface(contractInterface);
|
|
48852
48724
|
}
|
|
48853
48725
|
static getContractAddress(tx) {
|
|
48854
|
-
return getContractAddress(tx);
|
|
48726
|
+
return import_address4.getContractAddress(tx);
|
|
48855
48727
|
}
|
|
48856
48728
|
static getContract(address, contractInterface, signer) {
|
|
48857
48729
|
return new Contract(address, contractInterface, signer);
|
|
@@ -48859,10 +48731,11 @@ class ContractFactory {
|
|
|
48859
48731
|
}
|
|
48860
48732
|
|
|
48861
48733
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
48862
|
-
var
|
|
48734
|
+
var import_address5 = __toESM(require_lib7(), 1);
|
|
48735
|
+
var import_bytes4 = __toESM(require_lib2(), 1);
|
|
48863
48736
|
var import_hash = __toESM(require_lib12(), 1);
|
|
48864
48737
|
var import_hdnode = __toESM(require_lib20(), 1);
|
|
48865
|
-
var
|
|
48738
|
+
var import_keccak2563 = __toESM(require_lib5(), 1);
|
|
48866
48739
|
var import_properties4 = __toESM(require_lib4(), 1);
|
|
48867
48740
|
var import_random = __toESM(require_lib21(), 1);
|
|
48868
48741
|
var import_signing_key = __toESM(require_lib14(), 1);
|
|
@@ -48870,7 +48743,7 @@ var import_json_wallets = __toESM(require_lib22(), 1);
|
|
|
48870
48743
|
var import_transactions2 = __toESM(require_lib15(), 1);
|
|
48871
48744
|
|
|
48872
48745
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
48873
|
-
var
|
|
48746
|
+
var version8 = "wallet/5.7.0";
|
|
48874
48747
|
|
|
48875
48748
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
48876
48749
|
var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
@@ -48900,9 +48773,9 @@ var __awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
|
48900
48773
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48901
48774
|
});
|
|
48902
48775
|
};
|
|
48903
|
-
var
|
|
48776
|
+
var logger6 = new Logger(version8);
|
|
48904
48777
|
function isAccount(value) {
|
|
48905
|
-
return value != null &&
|
|
48778
|
+
return value != null && import_bytes4.isHexString(value.privateKey, 32) && value.address != null;
|
|
48906
48779
|
}
|
|
48907
48780
|
function hasMnemonic(value) {
|
|
48908
48781
|
const mnemonic = value.mnemonic;
|
|
@@ -48916,8 +48789,8 @@ class Wallet extends Signer {
|
|
|
48916
48789
|
const signingKey = new import_signing_key.SigningKey(privateKey.privateKey);
|
|
48917
48790
|
import_properties4.defineReadOnly(this, "_signingKey", () => signingKey);
|
|
48918
48791
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
48919
|
-
if (this.address !==
|
|
48920
|
-
|
|
48792
|
+
if (this.address !== import_address5.getAddress(privateKey.address)) {
|
|
48793
|
+
logger6.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
48921
48794
|
}
|
|
48922
48795
|
if (hasMnemonic(privateKey)) {
|
|
48923
48796
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -48929,7 +48802,7 @@ class Wallet extends Signer {
|
|
|
48929
48802
|
const mnemonic = this.mnemonic;
|
|
48930
48803
|
const node = import_hdnode.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
48931
48804
|
if (import_transactions2.computeAddress(node.privateKey) !== this.address) {
|
|
48932
|
-
|
|
48805
|
+
logger6.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
48933
48806
|
}
|
|
48934
48807
|
} else {
|
|
48935
48808
|
import_properties4.defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -48937,7 +48810,7 @@ class Wallet extends Signer {
|
|
|
48937
48810
|
} else {
|
|
48938
48811
|
if (import_signing_key.SigningKey.isSigningKey(privateKey)) {
|
|
48939
48812
|
if (privateKey.curve !== "secp256k1") {
|
|
48940
|
-
|
|
48813
|
+
logger6.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
48941
48814
|
}
|
|
48942
48815
|
import_properties4.defineReadOnly(this, "_signingKey", () => privateKey);
|
|
48943
48816
|
} else {
|
|
@@ -48953,7 +48826,7 @@ class Wallet extends Signer {
|
|
|
48953
48826
|
import_properties4.defineReadOnly(this, "address", import_transactions2.computeAddress(this.publicKey));
|
|
48954
48827
|
}
|
|
48955
48828
|
if (provider && !Provider.isProvider(provider)) {
|
|
48956
|
-
|
|
48829
|
+
logger6.throwArgumentError("invalid provider", "provider", provider);
|
|
48957
48830
|
}
|
|
48958
48831
|
import_properties4.defineReadOnly(this, "provider", provider || null);
|
|
48959
48832
|
}
|
|
@@ -48975,32 +48848,32 @@ class Wallet extends Signer {
|
|
|
48975
48848
|
signTransaction(transaction) {
|
|
48976
48849
|
return import_properties4.resolveProperties(transaction).then((tx) => {
|
|
48977
48850
|
if (tx.from != null) {
|
|
48978
|
-
if (
|
|
48979
|
-
|
|
48851
|
+
if (import_address5.getAddress(tx.from) !== this.address) {
|
|
48852
|
+
logger6.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
48980
48853
|
}
|
|
48981
48854
|
delete tx.from;
|
|
48982
48855
|
}
|
|
48983
|
-
const signature = this._signingKey().signDigest(
|
|
48856
|
+
const signature = this._signingKey().signDigest(import_keccak2563.keccak256(import_transactions2.serialize(tx)));
|
|
48984
48857
|
return import_transactions2.serialize(tx, signature);
|
|
48985
48858
|
});
|
|
48986
48859
|
}
|
|
48987
48860
|
signMessage(message) {
|
|
48988
48861
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
48989
|
-
return
|
|
48862
|
+
return import_bytes4.joinSignature(this._signingKey().signDigest(import_hash.hashMessage(message)));
|
|
48990
48863
|
});
|
|
48991
48864
|
}
|
|
48992
48865
|
_signTypedData(domain, types2, value) {
|
|
48993
48866
|
return __awaiter4(this, undefined, undefined, function* () {
|
|
48994
48867
|
const populated = yield import_hash._TypedDataEncoder.resolveNames(domain, types2, value, (name) => {
|
|
48995
48868
|
if (this.provider == null) {
|
|
48996
|
-
|
|
48869
|
+
logger6.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
48997
48870
|
operation: "resolveName",
|
|
48998
48871
|
value: name
|
|
48999
48872
|
});
|
|
49000
48873
|
}
|
|
49001
48874
|
return this.provider.resolveName(name);
|
|
49002
48875
|
});
|
|
49003
|
-
return
|
|
48876
|
+
return import_bytes4.joinSignature(this._signingKey().signDigest(import_hash._TypedDataEncoder.hash(populated.domain, types2, populated.value)));
|
|
49004
48877
|
});
|
|
49005
48878
|
}
|
|
49006
48879
|
encrypt(password, options, progressCallback) {
|
|
@@ -49022,7 +48895,7 @@ class Wallet extends Signer {
|
|
|
49022
48895
|
options = {};
|
|
49023
48896
|
}
|
|
49024
48897
|
if (options.extraEntropy) {
|
|
49025
|
-
entropy =
|
|
48898
|
+
entropy = import_bytes4.arrayify(import_bytes4.hexDataSlice(import_keccak2563.keccak256(import_bytes4.concat([entropy, options.extraEntropy])), 0, 16));
|
|
49026
48899
|
}
|
|
49027
48900
|
const mnemonic = import_hdnode.entropyToMnemonic(entropy, options.locale);
|
|
49028
48901
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -49113,10 +48986,10 @@ __export(exports_lib2, {
|
|
|
49113
48986
|
});
|
|
49114
48987
|
|
|
49115
48988
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
49116
|
-
var
|
|
48989
|
+
var version9 = "networks/5.7.1";
|
|
49117
48990
|
|
|
49118
48991
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
49119
|
-
var
|
|
48992
|
+
var logger7 = new Logger(version9);
|
|
49120
48993
|
function isRenetworkable(value) {
|
|
49121
48994
|
return value && typeof value.renetwork === "function";
|
|
49122
48995
|
}
|
|
@@ -49311,12 +49184,12 @@ function getNetwork(network) {
|
|
|
49311
49184
|
const standard = networks[network.name];
|
|
49312
49185
|
if (!standard) {
|
|
49313
49186
|
if (typeof network.chainId !== "number") {
|
|
49314
|
-
|
|
49187
|
+
logger7.throwArgumentError("invalid network chainId", "network", network);
|
|
49315
49188
|
}
|
|
49316
49189
|
return network;
|
|
49317
49190
|
}
|
|
49318
49191
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
49319
|
-
|
|
49192
|
+
logger7.throwArgumentError("network chainId mismatch", "network", network);
|
|
49320
49193
|
}
|
|
49321
49194
|
let defaultProvider = network._defaultProvider || null;
|
|
49322
49195
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -49337,7 +49210,7 @@ function getNetwork(network) {
|
|
|
49337
49210
|
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
49338
49211
|
var import_base64 = __toESM(require_lib10(), 1);
|
|
49339
49212
|
var import_basex = __toESM(require_lib16(), 1);
|
|
49340
|
-
var
|
|
49213
|
+
var import_bytes6 = __toESM(require_lib2(), 1);
|
|
49341
49214
|
var import_hash2 = __toESM(require_lib12(), 1);
|
|
49342
49215
|
var import_properties6 = __toESM(require_lib4(), 1);
|
|
49343
49216
|
var import_sha2 = __toESM(require_lib17(), 1);
|
|
@@ -49346,13 +49219,14 @@ var import_web = __toESM(require_lib23(), 1);
|
|
|
49346
49219
|
var import_bech32 = __toESM(require_bech32(), 1);
|
|
49347
49220
|
|
|
49348
49221
|
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
49349
|
-
var
|
|
49222
|
+
var version10 = "providers/5.7.2";
|
|
49350
49223
|
|
|
49351
49224
|
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
49352
|
-
var
|
|
49225
|
+
var import_address6 = __toESM(require_lib7(), 1);
|
|
49226
|
+
var import_bytes5 = __toESM(require_lib2(), 1);
|
|
49353
49227
|
var import_properties5 = __toESM(require_lib4(), 1);
|
|
49354
49228
|
var import_transactions3 = __toESM(require_lib15(), 1);
|
|
49355
|
-
var
|
|
49229
|
+
var logger8 = new Logger(version10);
|
|
49356
49230
|
|
|
49357
49231
|
class Formatter {
|
|
49358
49232
|
constructor() {
|
|
@@ -49509,11 +49383,11 @@ class Formatter {
|
|
|
49509
49383
|
if (!strict && value.substring(0, 2) !== "0x") {
|
|
49510
49384
|
value = "0x" + value;
|
|
49511
49385
|
}
|
|
49512
|
-
if (
|
|
49386
|
+
if (import_bytes5.isHexString(value)) {
|
|
49513
49387
|
return value.toLowerCase();
|
|
49514
49388
|
}
|
|
49515
49389
|
}
|
|
49516
|
-
return
|
|
49390
|
+
return logger8.throwArgumentError("invalid hash", "value", value);
|
|
49517
49391
|
}
|
|
49518
49392
|
data(value, strict) {
|
|
49519
49393
|
const result = this.hex(value, strict);
|
|
@@ -49523,17 +49397,17 @@ class Formatter {
|
|
|
49523
49397
|
return result;
|
|
49524
49398
|
}
|
|
49525
49399
|
address(value) {
|
|
49526
|
-
return
|
|
49400
|
+
return import_address6.getAddress(value);
|
|
49527
49401
|
}
|
|
49528
49402
|
callAddress(value) {
|
|
49529
|
-
if (!
|
|
49403
|
+
if (!import_bytes5.isHexString(value, 32)) {
|
|
49530
49404
|
return null;
|
|
49531
49405
|
}
|
|
49532
|
-
const address =
|
|
49406
|
+
const address = import_address6.getAddress(import_bytes5.hexDataSlice(value, 12));
|
|
49533
49407
|
return address === AddressZero ? null : address;
|
|
49534
49408
|
}
|
|
49535
49409
|
contractAddress(value) {
|
|
49536
|
-
return getContractAddress(value);
|
|
49410
|
+
return import_address6.getContractAddress(value);
|
|
49537
49411
|
}
|
|
49538
49412
|
blockTag(blockTag) {
|
|
49539
49413
|
if (blockTag == null) {
|
|
@@ -49551,15 +49425,15 @@ class Formatter {
|
|
|
49551
49425
|
case "finalized":
|
|
49552
49426
|
return blockTag;
|
|
49553
49427
|
}
|
|
49554
|
-
if (typeof blockTag === "number" ||
|
|
49555
|
-
return
|
|
49428
|
+
if (typeof blockTag === "number" || import_bytes5.isHexString(blockTag)) {
|
|
49429
|
+
return import_bytes5.hexValue(blockTag);
|
|
49556
49430
|
}
|
|
49557
49431
|
throw new Error("invalid blockTag");
|
|
49558
49432
|
}
|
|
49559
49433
|
hash(value, strict) {
|
|
49560
49434
|
const result = this.hex(value, strict);
|
|
49561
|
-
if (
|
|
49562
|
-
return
|
|
49435
|
+
if (import_bytes5.hexDataLength(result) !== 32) {
|
|
49436
|
+
return logger8.throwArgumentError("invalid hash", "value", value);
|
|
49563
49437
|
}
|
|
49564
49438
|
return result;
|
|
49565
49439
|
}
|
|
@@ -49574,10 +49448,10 @@ class Formatter {
|
|
|
49574
49448
|
return null;
|
|
49575
49449
|
}
|
|
49576
49450
|
uint256(value) {
|
|
49577
|
-
if (!
|
|
49451
|
+
if (!import_bytes5.isHexString(value)) {
|
|
49578
49452
|
throw new Error("invalid uint256");
|
|
49579
49453
|
}
|
|
49580
|
-
return
|
|
49454
|
+
return import_bytes5.hexZeroPad(value, 32);
|
|
49581
49455
|
}
|
|
49582
49456
|
_block(value, format2) {
|
|
49583
49457
|
if (value.author != null && value.miner == null) {
|
|
@@ -49616,7 +49490,7 @@ class Formatter {
|
|
|
49616
49490
|
const result = Formatter.check(this.formats.transaction, transaction);
|
|
49617
49491
|
if (transaction.chainId != null) {
|
|
49618
49492
|
let chainId = transaction.chainId;
|
|
49619
|
-
if (
|
|
49493
|
+
if (import_bytes5.isHexString(chainId)) {
|
|
49620
49494
|
chainId = BigNumber.from(chainId).toNumber();
|
|
49621
49495
|
}
|
|
49622
49496
|
result.chainId = chainId;
|
|
@@ -49625,7 +49499,7 @@ class Formatter {
|
|
|
49625
49499
|
if (chainId == null && result.v == null) {
|
|
49626
49500
|
chainId = transaction.chainId;
|
|
49627
49501
|
}
|
|
49628
|
-
if (
|
|
49502
|
+
if (import_bytes5.isHexString(chainId)) {
|
|
49629
49503
|
chainId = BigNumber.from(chainId).toNumber();
|
|
49630
49504
|
}
|
|
49631
49505
|
if (typeof chainId !== "number" && result.v != null) {
|
|
@@ -49658,15 +49532,15 @@ class Formatter {
|
|
|
49658
49532
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
49659
49533
|
if (value2 === 0 || value2 === 1) {
|
|
49660
49534
|
if (result.status != null && result.status !== value2) {
|
|
49661
|
-
|
|
49535
|
+
logger8.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
49662
49536
|
}
|
|
49663
49537
|
result.status = value2;
|
|
49664
49538
|
delete result.root;
|
|
49665
49539
|
} else {
|
|
49666
|
-
|
|
49540
|
+
logger8.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
49667
49541
|
}
|
|
49668
49542
|
} else if (result.root.length !== 66) {
|
|
49669
|
-
|
|
49543
|
+
logger8.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
49670
49544
|
}
|
|
49671
49545
|
}
|
|
49672
49546
|
if (result.status != null) {
|
|
@@ -49787,14 +49661,14 @@ var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
|
49787
49661
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49788
49662
|
});
|
|
49789
49663
|
};
|
|
49790
|
-
var
|
|
49664
|
+
var logger9 = new Logger(version10);
|
|
49791
49665
|
var MAX_CCIP_REDIRECTS = 10;
|
|
49792
49666
|
function checkTopic(topic) {
|
|
49793
49667
|
if (topic == null) {
|
|
49794
49668
|
return "null";
|
|
49795
49669
|
}
|
|
49796
|
-
if (
|
|
49797
|
-
|
|
49670
|
+
if (import_bytes6.hexDataLength(topic) !== 32) {
|
|
49671
|
+
logger9.throwArgumentError("invalid topic", "topic", topic);
|
|
49798
49672
|
}
|
|
49799
49673
|
return topic.toLowerCase();
|
|
49800
49674
|
}
|
|
@@ -49834,7 +49708,7 @@ function deserializeTopics(data) {
|
|
|
49834
49708
|
function getEventTag2(eventName) {
|
|
49835
49709
|
if (typeof eventName === "string") {
|
|
49836
49710
|
eventName = eventName.toLowerCase();
|
|
49837
|
-
if (
|
|
49711
|
+
if (import_bytes6.hexDataLength(eventName) === 32) {
|
|
49838
49712
|
return "tx:" + eventName;
|
|
49839
49713
|
}
|
|
49840
49714
|
if (eventName.indexOf(":") === -1) {
|
|
@@ -49843,7 +49717,7 @@ function getEventTag2(eventName) {
|
|
|
49843
49717
|
} else if (Array.isArray(eventName)) {
|
|
49844
49718
|
return "filter:*:" + serializeTopics(eventName);
|
|
49845
49719
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
49846
|
-
|
|
49720
|
+
logger9.warn("not implemented");
|
|
49847
49721
|
throw new Error("not implemented");
|
|
49848
49722
|
} else if (eventName && typeof eventName === "object") {
|
|
49849
49723
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -49916,10 +49790,10 @@ var coinInfos = {
|
|
|
49916
49790
|
"700": { symbol: "xdai", ilk: "eth" }
|
|
49917
49791
|
};
|
|
49918
49792
|
function bytes32ify(value) {
|
|
49919
|
-
return
|
|
49793
|
+
return import_bytes6.hexZeroPad(BigNumber.from(value).toHexString(), 32);
|
|
49920
49794
|
}
|
|
49921
49795
|
function base58Encode(data) {
|
|
49922
|
-
return import_basex.Base58.encode(
|
|
49796
|
+
return import_basex.Base58.encode(import_bytes6.concat([data, import_bytes6.hexDataSlice(import_sha2.sha256(import_sha2.sha256(data)), 0, 4)]));
|
|
49923
49797
|
}
|
|
49924
49798
|
var matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
|
|
49925
49799
|
var matchers = [
|
|
@@ -49938,9 +49812,9 @@ function _parseBytes(result, start) {
|
|
|
49938
49812
|
if (result === "0x") {
|
|
49939
49813
|
return null;
|
|
49940
49814
|
}
|
|
49941
|
-
const offset = BigNumber.from(
|
|
49942
|
-
const length = BigNumber.from(
|
|
49943
|
-
return
|
|
49815
|
+
const offset = BigNumber.from(import_bytes6.hexDataSlice(result, start, start + 32)).toNumber();
|
|
49816
|
+
const length = BigNumber.from(import_bytes6.hexDataSlice(result, offset, offset + 32)).toNumber();
|
|
49817
|
+
return import_bytes6.hexDataSlice(result, offset + 32, offset + 32 + length);
|
|
49944
49818
|
}
|
|
49945
49819
|
function getIpfsLink(link) {
|
|
49946
49820
|
if (link.match(/^ipfs:\/\/ipfs\//i)) {
|
|
@@ -49948,12 +49822,12 @@ function getIpfsLink(link) {
|
|
|
49948
49822
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
49949
49823
|
link = link.substring(7);
|
|
49950
49824
|
} else {
|
|
49951
|
-
|
|
49825
|
+
logger9.throwArgumentError("unsupported IPFS format", "link", link);
|
|
49952
49826
|
}
|
|
49953
49827
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
49954
49828
|
}
|
|
49955
49829
|
function numPad(value) {
|
|
49956
|
-
const result =
|
|
49830
|
+
const result = import_bytes6.arrayify(value);
|
|
49957
49831
|
if (result.length > 32) {
|
|
49958
49832
|
throw new Error("internal; should not happen");
|
|
49959
49833
|
}
|
|
@@ -49977,13 +49851,13 @@ function encodeBytes2(datas) {
|
|
|
49977
49851
|
byteCount += 32;
|
|
49978
49852
|
}
|
|
49979
49853
|
for (let i2 = 0;i2 < datas.length; i2++) {
|
|
49980
|
-
const data =
|
|
49854
|
+
const data = import_bytes6.arrayify(datas[i2]);
|
|
49981
49855
|
result[i2] = numPad(byteCount);
|
|
49982
49856
|
result.push(numPad(data.length));
|
|
49983
49857
|
result.push(bytesPad(data));
|
|
49984
49858
|
byteCount += 32 + Math.ceil(data.length / 32) * 32;
|
|
49985
49859
|
}
|
|
49986
|
-
return
|
|
49860
|
+
return import_bytes6.hexConcat(result);
|
|
49987
49861
|
}
|
|
49988
49862
|
|
|
49989
49863
|
class Resolver {
|
|
@@ -50015,17 +49889,17 @@ class Resolver {
|
|
|
50015
49889
|
const tx = {
|
|
50016
49890
|
to: this.address,
|
|
50017
49891
|
ccipReadEnabled: true,
|
|
50018
|
-
data:
|
|
49892
|
+
data: import_bytes6.hexConcat([selector, import_hash2.namehash(this.name), parameters || "0x"])
|
|
50019
49893
|
};
|
|
50020
49894
|
let parseBytes = false;
|
|
50021
49895
|
if (yield this.supportsWildcard()) {
|
|
50022
49896
|
parseBytes = true;
|
|
50023
|
-
tx.data =
|
|
49897
|
+
tx.data = import_bytes6.hexConcat(["0x9061b923", encodeBytes2([import_hash2.dnsEncode(this.name), tx.data])]);
|
|
50024
49898
|
}
|
|
50025
49899
|
try {
|
|
50026
49900
|
let result = yield this.provider.call(tx);
|
|
50027
|
-
if (
|
|
50028
|
-
|
|
49901
|
+
if (import_bytes6.arrayify(result).length % 32 === 4) {
|
|
49902
|
+
logger9.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
50029
49903
|
transaction: tx,
|
|
50030
49904
|
data: result
|
|
50031
49905
|
});
|
|
@@ -50054,20 +49928,20 @@ class Resolver {
|
|
|
50054
49928
|
_getAddress(coinType, hexBytes) {
|
|
50055
49929
|
const coinInfo = coinInfos[String(coinType)];
|
|
50056
49930
|
if (coinInfo == null) {
|
|
50057
|
-
|
|
49931
|
+
logger9.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50058
49932
|
operation: `getAddress(${coinType})`
|
|
50059
49933
|
});
|
|
50060
49934
|
}
|
|
50061
49935
|
if (coinInfo.ilk === "eth") {
|
|
50062
49936
|
return this.provider.formatter.address(hexBytes);
|
|
50063
49937
|
}
|
|
50064
|
-
const bytes =
|
|
49938
|
+
const bytes = import_bytes6.arrayify(hexBytes);
|
|
50065
49939
|
if (coinInfo.p2pkh != null) {
|
|
50066
49940
|
const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);
|
|
50067
49941
|
if (p2pkh) {
|
|
50068
49942
|
const length = parseInt(p2pkh[1], 16);
|
|
50069
49943
|
if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
50070
|
-
return base58Encode(
|
|
49944
|
+
return base58Encode(import_bytes6.concat([[coinInfo.p2pkh], "0x" + p2pkh[2]]));
|
|
50071
49945
|
}
|
|
50072
49946
|
}
|
|
50073
49947
|
}
|
|
@@ -50076,23 +49950,23 @@ class Resolver {
|
|
|
50076
49950
|
if (p2sh) {
|
|
50077
49951
|
const length = parseInt(p2sh[1], 16);
|
|
50078
49952
|
if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
50079
|
-
return base58Encode(
|
|
49953
|
+
return base58Encode(import_bytes6.concat([[coinInfo.p2sh], "0x" + p2sh[2]]));
|
|
50080
49954
|
}
|
|
50081
49955
|
}
|
|
50082
49956
|
}
|
|
50083
49957
|
if (coinInfo.prefix != null) {
|
|
50084
49958
|
const length = bytes[1];
|
|
50085
|
-
let
|
|
50086
|
-
if (
|
|
49959
|
+
let version11 = bytes[0];
|
|
49960
|
+
if (version11 === 0) {
|
|
50087
49961
|
if (length !== 20 && length !== 32) {
|
|
50088
|
-
|
|
49962
|
+
version11 = -1;
|
|
50089
49963
|
}
|
|
50090
49964
|
} else {
|
|
50091
|
-
|
|
49965
|
+
version11 = -1;
|
|
50092
49966
|
}
|
|
50093
|
-
if (
|
|
49967
|
+
if (version11 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
50094
49968
|
const words = import_bech32.default.toWords(bytes.slice(2));
|
|
50095
|
-
words.unshift(
|
|
49969
|
+
words.unshift(version11);
|
|
50096
49970
|
return import_bech32.default.encode(coinInfo.prefix, words);
|
|
50097
49971
|
}
|
|
50098
49972
|
}
|
|
@@ -50123,7 +49997,7 @@ class Resolver {
|
|
|
50123
49997
|
}
|
|
50124
49998
|
const address = this._getAddress(coinType, hexBytes);
|
|
50125
49999
|
if (address == null) {
|
|
50126
|
-
|
|
50000
|
+
logger9.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50127
50001
|
operation: `getAddress(${coinType})`,
|
|
50128
50002
|
coinType,
|
|
50129
50003
|
data: hexBytes
|
|
@@ -50166,11 +50040,11 @@ class Resolver {
|
|
|
50166
50040
|
return null;
|
|
50167
50041
|
}
|
|
50168
50042
|
const addr = yield this.provider.formatter.address(comps[0]);
|
|
50169
|
-
const tokenId =
|
|
50043
|
+
const tokenId = import_bytes6.hexZeroPad(BigNumber.from(comps[1]).toHexString(), 32);
|
|
50170
50044
|
if (scheme === "erc721") {
|
|
50171
50045
|
const tokenOwner = this.provider.formatter.callAddress(yield this.provider.call({
|
|
50172
50046
|
to: addr,
|
|
50173
|
-
data:
|
|
50047
|
+
data: import_bytes6.hexConcat(["0x6352211e", tokenId])
|
|
50174
50048
|
}));
|
|
50175
50049
|
if (owner !== tokenOwner) {
|
|
50176
50050
|
return null;
|
|
@@ -50179,7 +50053,7 @@ class Resolver {
|
|
|
50179
50053
|
} else if (scheme === "erc1155") {
|
|
50180
50054
|
const balance = BigNumber.from(yield this.provider.call({
|
|
50181
50055
|
to: addr,
|
|
50182
|
-
data:
|
|
50056
|
+
data: import_bytes6.hexConcat(["0x00fdd58e", import_bytes6.hexZeroPad(owner, 32), tokenId])
|
|
50183
50057
|
}));
|
|
50184
50058
|
if (balance.isZero()) {
|
|
50185
50059
|
return null;
|
|
@@ -50188,7 +50062,7 @@ class Resolver {
|
|
|
50188
50062
|
}
|
|
50189
50063
|
const tx = {
|
|
50190
50064
|
to: this.provider.formatter.address(comps[0]),
|
|
50191
|
-
data:
|
|
50065
|
+
data: import_bytes6.hexConcat([selector, tokenId])
|
|
50192
50066
|
};
|
|
50193
50067
|
let metadataUrl = _parseString(yield this.provider.call(tx), 0);
|
|
50194
50068
|
if (metadataUrl == null) {
|
|
@@ -50263,7 +50137,7 @@ class Resolver {
|
|
|
50263
50137
|
return "sia://" + hash2;
|
|
50264
50138
|
}
|
|
50265
50139
|
}
|
|
50266
|
-
return
|
|
50140
|
+
return logger9.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50267
50141
|
operation: "getContentHash()",
|
|
50268
50142
|
data: hexBytes
|
|
50269
50143
|
});
|
|
@@ -50272,11 +50146,11 @@ class Resolver {
|
|
|
50272
50146
|
getText(key) {
|
|
50273
50147
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
50274
50148
|
let keyBytes = import_strings2.toUtf8Bytes(key);
|
|
50275
|
-
keyBytes =
|
|
50149
|
+
keyBytes = import_bytes6.concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
50276
50150
|
if (keyBytes.length % 32 !== 0) {
|
|
50277
|
-
keyBytes =
|
|
50151
|
+
keyBytes = import_bytes6.concat([keyBytes, import_bytes6.hexZeroPad("0x", 32 - key.length % 32)]);
|
|
50278
50152
|
}
|
|
50279
|
-
const hexBytes = yield this._fetchBytes("0x59d1d43c",
|
|
50153
|
+
const hexBytes = yield this._fetchBytes("0x59d1d43c", import_bytes6.hexlify(keyBytes));
|
|
50280
50154
|
if (hexBytes == null || hexBytes === "0x") {
|
|
50281
50155
|
return null;
|
|
50282
50156
|
}
|
|
@@ -50308,7 +50182,7 @@ class BaseProvider extends Provider {
|
|
|
50308
50182
|
import_properties6.defineReadOnly(this, "_network", knownNetwork);
|
|
50309
50183
|
this.emit("network", knownNetwork, null);
|
|
50310
50184
|
} else {
|
|
50311
|
-
|
|
50185
|
+
logger9.throwArgumentError("invalid network", "network", network);
|
|
50312
50186
|
}
|
|
50313
50187
|
}
|
|
50314
50188
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -50330,7 +50204,7 @@ class BaseProvider extends Provider {
|
|
|
50330
50204
|
network = yield this.detectNetwork();
|
|
50331
50205
|
}
|
|
50332
50206
|
if (!network) {
|
|
50333
|
-
|
|
50207
|
+
logger9.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
50334
50208
|
}
|
|
50335
50209
|
if (this._network == null) {
|
|
50336
50210
|
if (this.anyNetwork) {
|
|
@@ -50386,11 +50260,11 @@ class BaseProvider extends Provider {
|
|
|
50386
50260
|
}
|
|
50387
50261
|
const errorMessage = result.message || "unknown error";
|
|
50388
50262
|
if (result.status >= 400 && result.status < 500) {
|
|
50389
|
-
return
|
|
50263
|
+
return logger9.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
50390
50264
|
}
|
|
50391
50265
|
errorMessages.push(errorMessage);
|
|
50392
50266
|
}
|
|
50393
|
-
return
|
|
50267
|
+
return logger9.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
50394
50268
|
urls,
|
|
50395
50269
|
errorMessages
|
|
50396
50270
|
});
|
|
@@ -50465,8 +50339,8 @@ class BaseProvider extends Provider {
|
|
|
50465
50339
|
this._emitted.block = blockNumber - 1;
|
|
50466
50340
|
}
|
|
50467
50341
|
if (Math.abs(this._emitted.block - blockNumber) > 1000) {
|
|
50468
|
-
|
|
50469
|
-
this.emit("error",
|
|
50342
|
+
logger9.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
50343
|
+
this.emit("error", logger9.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
50470
50344
|
blockNumber,
|
|
50471
50345
|
event: "blockSkew",
|
|
50472
50346
|
previousBlockNumber: this._emitted.block
|
|
@@ -50571,7 +50445,7 @@ class BaseProvider extends Provider {
|
|
|
50571
50445
|
}
|
|
50572
50446
|
detectNetwork() {
|
|
50573
50447
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
50574
|
-
return
|
|
50448
|
+
return logger9.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
50575
50449
|
operation: "provider.detectNetwork"
|
|
50576
50450
|
});
|
|
50577
50451
|
});
|
|
@@ -50594,7 +50468,7 @@ class BaseProvider extends Provider {
|
|
|
50594
50468
|
yield stall(0);
|
|
50595
50469
|
return this._network;
|
|
50596
50470
|
}
|
|
50597
|
-
const error =
|
|
50471
|
+
const error = logger9.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
50598
50472
|
event: "changed",
|
|
50599
50473
|
network,
|
|
50600
50474
|
detectedNetwork: currentNetwork
|
|
@@ -50761,7 +50635,7 @@ class BaseProvider extends Provider {
|
|
|
50761
50635
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
50762
50636
|
reason = "cancelled";
|
|
50763
50637
|
}
|
|
50764
|
-
reject(
|
|
50638
|
+
reject(logger9.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
50765
50639
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
50766
50640
|
reason,
|
|
50767
50641
|
replacement: this._wrapTransaction(tx),
|
|
@@ -50798,7 +50672,7 @@ class BaseProvider extends Provider {
|
|
|
50798
50672
|
if (alreadyDone()) {
|
|
50799
50673
|
return;
|
|
50800
50674
|
}
|
|
50801
|
-
reject(
|
|
50675
|
+
reject(logger9.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
50802
50676
|
}, timeout);
|
|
50803
50677
|
if (timer.unref) {
|
|
50804
50678
|
timer.unref();
|
|
@@ -50822,7 +50696,7 @@ class BaseProvider extends Provider {
|
|
|
50822
50696
|
try {
|
|
50823
50697
|
return BigNumber.from(result);
|
|
50824
50698
|
} catch (error) {
|
|
50825
|
-
return
|
|
50699
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
50826
50700
|
method: "getGasPrice",
|
|
50827
50701
|
result,
|
|
50828
50702
|
error
|
|
@@ -50841,7 +50715,7 @@ class BaseProvider extends Provider {
|
|
|
50841
50715
|
try {
|
|
50842
50716
|
return BigNumber.from(result);
|
|
50843
50717
|
} catch (error) {
|
|
50844
|
-
return
|
|
50718
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
50845
50719
|
method: "getBalance",
|
|
50846
50720
|
params,
|
|
50847
50721
|
result,
|
|
@@ -50861,7 +50735,7 @@ class BaseProvider extends Provider {
|
|
|
50861
50735
|
try {
|
|
50862
50736
|
return BigNumber.from(result).toNumber();
|
|
50863
50737
|
} catch (error) {
|
|
50864
|
-
return
|
|
50738
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
50865
50739
|
method: "getTransactionCount",
|
|
50866
50740
|
params,
|
|
50867
50741
|
result,
|
|
@@ -50879,9 +50753,9 @@ class BaseProvider extends Provider {
|
|
|
50879
50753
|
});
|
|
50880
50754
|
const result = yield this.perform("getCode", params);
|
|
50881
50755
|
try {
|
|
50882
|
-
return
|
|
50756
|
+
return import_bytes6.hexlify(result);
|
|
50883
50757
|
} catch (error) {
|
|
50884
|
-
return
|
|
50758
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
50885
50759
|
method: "getCode",
|
|
50886
50760
|
params,
|
|
50887
50761
|
result,
|
|
@@ -50896,13 +50770,13 @@ class BaseProvider extends Provider {
|
|
|
50896
50770
|
const params = yield import_properties6.resolveProperties({
|
|
50897
50771
|
address: this._getAddress(addressOrName),
|
|
50898
50772
|
blockTag: this._getBlockTag(blockTag),
|
|
50899
|
-
position: Promise.resolve(position).then((p) =>
|
|
50773
|
+
position: Promise.resolve(position).then((p) => import_bytes6.hexValue(p))
|
|
50900
50774
|
});
|
|
50901
50775
|
const result = yield this.perform("getStorageAt", params);
|
|
50902
50776
|
try {
|
|
50903
|
-
return
|
|
50777
|
+
return import_bytes6.hexlify(result);
|
|
50904
50778
|
} catch (error) {
|
|
50905
|
-
return
|
|
50779
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
50906
50780
|
method: "getStorageAt",
|
|
50907
50781
|
params,
|
|
50908
50782
|
result,
|
|
@@ -50912,12 +50786,12 @@ class BaseProvider extends Provider {
|
|
|
50912
50786
|
});
|
|
50913
50787
|
}
|
|
50914
50788
|
_wrapTransaction(tx, hash2, startBlock) {
|
|
50915
|
-
if (hash2 != null &&
|
|
50789
|
+
if (hash2 != null && import_bytes6.hexDataLength(hash2) !== 32) {
|
|
50916
50790
|
throw new Error("invalid response - sendTransaction");
|
|
50917
50791
|
}
|
|
50918
50792
|
const result = tx;
|
|
50919
50793
|
if (hash2 != null && tx.hash !== hash2) {
|
|
50920
|
-
|
|
50794
|
+
logger9.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash2 });
|
|
50921
50795
|
}
|
|
50922
50796
|
result.wait = (confirms, timeout) => __awaiter5(this, undefined, undefined, function* () {
|
|
50923
50797
|
if (confirms == null) {
|
|
@@ -50943,7 +50817,7 @@ class BaseProvider extends Provider {
|
|
|
50943
50817
|
}
|
|
50944
50818
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
50945
50819
|
if (receipt.status === 0) {
|
|
50946
|
-
|
|
50820
|
+
logger9.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
50947
50821
|
transactionHash: tx.hash,
|
|
50948
50822
|
transaction: tx,
|
|
50949
50823
|
receipt
|
|
@@ -50956,7 +50830,7 @@ class BaseProvider extends Provider {
|
|
|
50956
50830
|
sendTransaction(signedTransaction) {
|
|
50957
50831
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
50958
50832
|
yield this.getNetwork();
|
|
50959
|
-
const hexTx = yield Promise.resolve(signedTransaction).then((t) =>
|
|
50833
|
+
const hexTx = yield Promise.resolve(signedTransaction).then((t) => import_bytes6.hexlify(t));
|
|
50960
50834
|
const tx = this.formatter.transaction(signedTransaction);
|
|
50961
50835
|
if (tx.confirmations == null) {
|
|
50962
50836
|
tx.confirmations = 0;
|
|
@@ -51001,7 +50875,7 @@ class BaseProvider extends Provider {
|
|
|
51001
50875
|
if (values[key] == null) {
|
|
51002
50876
|
return;
|
|
51003
50877
|
}
|
|
51004
|
-
tx[key] = Promise.resolve(values[key]).then((v) => v ?
|
|
50878
|
+
tx[key] = Promise.resolve(values[key]).then((v) => v ? import_bytes6.hexlify(v) : null);
|
|
51005
50879
|
});
|
|
51006
50880
|
return this.formatter.transactionRequest(yield import_properties6.resolveProperties(tx));
|
|
51007
50881
|
});
|
|
@@ -51031,19 +50905,19 @@ class BaseProvider extends Provider {
|
|
|
51031
50905
|
_call(transaction, blockTag, attempt) {
|
|
51032
50906
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
51033
50907
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
51034
|
-
|
|
50908
|
+
logger9.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
51035
50909
|
redirects: attempt,
|
|
51036
50910
|
transaction
|
|
51037
50911
|
});
|
|
51038
50912
|
}
|
|
51039
50913
|
const txSender = transaction.to;
|
|
51040
50914
|
const result = yield this.perform("call", { transaction, blockTag });
|
|
51041
|
-
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" &&
|
|
50915
|
+
if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" && import_bytes6.hexDataLength(result) % 32 === 4) {
|
|
51042
50916
|
try {
|
|
51043
|
-
const data =
|
|
51044
|
-
const sender =
|
|
50917
|
+
const data = import_bytes6.hexDataSlice(result, 4);
|
|
50918
|
+
const sender = import_bytes6.hexDataSlice(data, 0, 32);
|
|
51045
50919
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
51046
|
-
|
|
50920
|
+
logger9.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
51047
50921
|
name: "OffchainLookup",
|
|
51048
50922
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
51049
50923
|
transaction,
|
|
@@ -51051,13 +50925,13 @@ class BaseProvider extends Provider {
|
|
|
51051
50925
|
});
|
|
51052
50926
|
}
|
|
51053
50927
|
const urls = [];
|
|
51054
|
-
const urlsOffset = BigNumber.from(
|
|
51055
|
-
const urlsLength = BigNumber.from(
|
|
51056
|
-
const urlsData =
|
|
50928
|
+
const urlsOffset = BigNumber.from(import_bytes6.hexDataSlice(data, 32, 64)).toNumber();
|
|
50929
|
+
const urlsLength = BigNumber.from(import_bytes6.hexDataSlice(data, urlsOffset, urlsOffset + 32)).toNumber();
|
|
50930
|
+
const urlsData = import_bytes6.hexDataSlice(data, urlsOffset + 32);
|
|
51057
50931
|
for (let u = 0;u < urlsLength; u++) {
|
|
51058
50932
|
const url = _parseString(urlsData, u * 32);
|
|
51059
50933
|
if (url == null) {
|
|
51060
|
-
|
|
50934
|
+
logger9.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
51061
50935
|
name: "OffchainLookup",
|
|
51062
50936
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
51063
50937
|
transaction,
|
|
@@ -51067,19 +50941,19 @@ class BaseProvider extends Provider {
|
|
|
51067
50941
|
urls.push(url);
|
|
51068
50942
|
}
|
|
51069
50943
|
const calldata = _parseBytes(data, 64);
|
|
51070
|
-
if (!BigNumber.from(
|
|
51071
|
-
|
|
50944
|
+
if (!BigNumber.from(import_bytes6.hexDataSlice(data, 100, 128)).isZero()) {
|
|
50945
|
+
logger9.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
51072
50946
|
name: "OffchainLookup",
|
|
51073
50947
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
51074
50948
|
transaction,
|
|
51075
50949
|
data: result
|
|
51076
50950
|
});
|
|
51077
50951
|
}
|
|
51078
|
-
const callbackSelector =
|
|
50952
|
+
const callbackSelector = import_bytes6.hexDataSlice(data, 96, 100);
|
|
51079
50953
|
const extraData = _parseBytes(data, 128);
|
|
51080
50954
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
51081
50955
|
if (ccipResult == null) {
|
|
51082
|
-
|
|
50956
|
+
logger9.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
51083
50957
|
name: "OffchainLookup",
|
|
51084
50958
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
51085
50959
|
transaction,
|
|
@@ -51088,7 +50962,7 @@ class BaseProvider extends Provider {
|
|
|
51088
50962
|
}
|
|
51089
50963
|
const tx = {
|
|
51090
50964
|
to: txSender,
|
|
51091
|
-
data:
|
|
50965
|
+
data: import_bytes6.hexConcat([callbackSelector, encodeBytes2([ccipResult, extraData])])
|
|
51092
50966
|
};
|
|
51093
50967
|
return this._call(tx, blockTag, attempt + 1);
|
|
51094
50968
|
} catch (error) {
|
|
@@ -51098,9 +50972,9 @@ class BaseProvider extends Provider {
|
|
|
51098
50972
|
}
|
|
51099
50973
|
}
|
|
51100
50974
|
try {
|
|
51101
|
-
return
|
|
50975
|
+
return import_bytes6.hexlify(result);
|
|
51102
50976
|
} catch (error) {
|
|
51103
|
-
return
|
|
50977
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
51104
50978
|
method: "call",
|
|
51105
50979
|
params: { transaction, blockTag },
|
|
51106
50980
|
result,
|
|
@@ -51130,7 +51004,7 @@ class BaseProvider extends Provider {
|
|
|
51130
51004
|
try {
|
|
51131
51005
|
return BigNumber.from(result);
|
|
51132
51006
|
} catch (error) {
|
|
51133
|
-
return
|
|
51007
|
+
return logger9.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
51134
51008
|
method: "estimateGas",
|
|
51135
51009
|
params,
|
|
51136
51010
|
result,
|
|
@@ -51143,11 +51017,11 @@ class BaseProvider extends Provider {
|
|
|
51143
51017
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
51144
51018
|
addressOrName = yield addressOrName;
|
|
51145
51019
|
if (typeof addressOrName !== "string") {
|
|
51146
|
-
|
|
51020
|
+
logger9.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
51147
51021
|
}
|
|
51148
51022
|
const address = yield this.resolveName(addressOrName);
|
|
51149
51023
|
if (address == null) {
|
|
51150
|
-
|
|
51024
|
+
logger9.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51151
51025
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
51152
51026
|
});
|
|
51153
51027
|
}
|
|
@@ -51162,16 +51036,16 @@ class BaseProvider extends Provider {
|
|
|
51162
51036
|
const params = {
|
|
51163
51037
|
includeTransactions: !!includeTransactions
|
|
51164
51038
|
};
|
|
51165
|
-
if (
|
|
51039
|
+
if (import_bytes6.isHexString(blockHashOrBlockTag, 32)) {
|
|
51166
51040
|
params.blockHash = blockHashOrBlockTag;
|
|
51167
51041
|
} else {
|
|
51168
51042
|
try {
|
|
51169
51043
|
params.blockTag = yield this._getBlockTag(blockHashOrBlockTag);
|
|
51170
|
-
if (
|
|
51044
|
+
if (import_bytes6.isHexString(params.blockTag)) {
|
|
51171
51045
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
51172
51046
|
}
|
|
51173
51047
|
} catch (error) {
|
|
51174
|
-
|
|
51048
|
+
logger9.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
51175
51049
|
}
|
|
51176
51050
|
}
|
|
51177
51051
|
return import_web.poll(() => __awaiter5(this, undefined, undefined, function* () {
|
|
@@ -51303,7 +51177,7 @@ class BaseProvider extends Provider {
|
|
|
51303
51177
|
blockTag = yield blockTag;
|
|
51304
51178
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
51305
51179
|
if (blockTag % 1) {
|
|
51306
|
-
|
|
51180
|
+
logger9.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
51307
51181
|
}
|
|
51308
51182
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
51309
51183
|
blockNumber += blockTag;
|
|
@@ -51344,7 +51218,7 @@ class BaseProvider extends Provider {
|
|
|
51344
51218
|
}
|
|
51345
51219
|
const network = yield this.getNetwork();
|
|
51346
51220
|
if (!network.ensAddress) {
|
|
51347
|
-
|
|
51221
|
+
logger9.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
51348
51222
|
}
|
|
51349
51223
|
try {
|
|
51350
51224
|
const addrData = yield this.call({
|
|
@@ -51362,12 +51236,12 @@ class BaseProvider extends Provider {
|
|
|
51362
51236
|
try {
|
|
51363
51237
|
return Promise.resolve(this.formatter.address(name));
|
|
51364
51238
|
} catch (error) {
|
|
51365
|
-
if (
|
|
51239
|
+
if (import_bytes6.isHexString(name)) {
|
|
51366
51240
|
throw error;
|
|
51367
51241
|
}
|
|
51368
51242
|
}
|
|
51369
51243
|
if (typeof name !== "string") {
|
|
51370
|
-
|
|
51244
|
+
logger9.throwArgumentError("invalid ENS name", "name", name);
|
|
51371
51245
|
}
|
|
51372
51246
|
const resolver = yield this.getResolver(name);
|
|
51373
51247
|
if (!resolver) {
|
|
@@ -51399,7 +51273,7 @@ class BaseProvider extends Provider {
|
|
|
51399
51273
|
getAvatar(nameOrAddress) {
|
|
51400
51274
|
return __awaiter5(this, undefined, undefined, function* () {
|
|
51401
51275
|
let resolver = null;
|
|
51402
|
-
if (
|
|
51276
|
+
if (import_bytes6.isHexString(nameOrAddress)) {
|
|
51403
51277
|
const address = this.formatter.address(nameOrAddress);
|
|
51404
51278
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
51405
51279
|
const resolverAddress = yield this._getResolver(node, "getAvatar");
|
|
@@ -51443,7 +51317,7 @@ class BaseProvider extends Provider {
|
|
|
51443
51317
|
});
|
|
51444
51318
|
}
|
|
51445
51319
|
perform(method, params) {
|
|
51446
|
-
return
|
|
51320
|
+
return logger9.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
51447
51321
|
}
|
|
51448
51322
|
_startEvent(event) {
|
|
51449
51323
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -51554,7 +51428,7 @@ var import_properties10 = __toESM(require_lib4(), 1);
|
|
|
51554
51428
|
var import_properties8 = __toESM(require_lib4(), 1);
|
|
51555
51429
|
|
|
51556
51430
|
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
51557
|
-
var
|
|
51431
|
+
var import_bytes7 = __toESM(require_lib2(), 1);
|
|
51558
51432
|
var import_hash3 = __toESM(require_lib12(), 1);
|
|
51559
51433
|
var import_properties7 = __toESM(require_lib4(), 1);
|
|
51560
51434
|
var import_strings3 = __toESM(require_lib9(), 1);
|
|
@@ -51587,14 +51461,14 @@ var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
|
51587
51461
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
51588
51462
|
});
|
|
51589
51463
|
};
|
|
51590
|
-
var
|
|
51464
|
+
var logger10 = new Logger(version10);
|
|
51591
51465
|
var errorGas = ["call", "estimateGas"];
|
|
51592
51466
|
function spelunk(value, requireData) {
|
|
51593
51467
|
if (value == null) {
|
|
51594
51468
|
return null;
|
|
51595
51469
|
}
|
|
51596
51470
|
if (typeof value.message === "string" && value.message.match("reverted")) {
|
|
51597
|
-
const data =
|
|
51471
|
+
const data = import_bytes7.isHexString(value.data) ? value.data : null;
|
|
51598
51472
|
if (!requireData || data) {
|
|
51599
51473
|
return { message: value.message, data };
|
|
51600
51474
|
}
|
|
@@ -51622,7 +51496,7 @@ function checkError(method, error, params) {
|
|
|
51622
51496
|
if (result) {
|
|
51623
51497
|
return result.data;
|
|
51624
51498
|
}
|
|
51625
|
-
|
|
51499
|
+
logger10.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
51626
51500
|
data: "0x",
|
|
51627
51501
|
transaction,
|
|
51628
51502
|
error
|
|
@@ -51634,7 +51508,7 @@ function checkError(method, error, params) {
|
|
|
51634
51508
|
result = spelunk(error, false);
|
|
51635
51509
|
}
|
|
51636
51510
|
if (result) {
|
|
51637
|
-
|
|
51511
|
+
logger10.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
51638
51512
|
reason: result.message,
|
|
51639
51513
|
method,
|
|
51640
51514
|
transaction,
|
|
@@ -51652,35 +51526,35 @@ function checkError(method, error, params) {
|
|
|
51652
51526
|
}
|
|
51653
51527
|
message = (message || "").toLowerCase();
|
|
51654
51528
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
51655
|
-
|
|
51529
|
+
logger10.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
51656
51530
|
error,
|
|
51657
51531
|
method,
|
|
51658
51532
|
transaction
|
|
51659
51533
|
});
|
|
51660
51534
|
}
|
|
51661
51535
|
if (message.match(/nonce (is )?too low/i)) {
|
|
51662
|
-
|
|
51536
|
+
logger10.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
51663
51537
|
error,
|
|
51664
51538
|
method,
|
|
51665
51539
|
transaction
|
|
51666
51540
|
});
|
|
51667
51541
|
}
|
|
51668
51542
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
51669
|
-
|
|
51543
|
+
logger10.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
51670
51544
|
error,
|
|
51671
51545
|
method,
|
|
51672
51546
|
transaction
|
|
51673
51547
|
});
|
|
51674
51548
|
}
|
|
51675
51549
|
if (message.match(/only replay-protected/i)) {
|
|
51676
|
-
|
|
51550
|
+
logger10.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51677
51551
|
error,
|
|
51678
51552
|
method,
|
|
51679
51553
|
transaction
|
|
51680
51554
|
});
|
|
51681
51555
|
}
|
|
51682
51556
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
51683
|
-
|
|
51557
|
+
logger10.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
51684
51558
|
error,
|
|
51685
51559
|
method,
|
|
51686
51560
|
transaction
|
|
@@ -51727,11 +51601,11 @@ class JsonRpcSigner extends Signer {
|
|
|
51727
51601
|
import_properties7.defineReadOnly(this, "_index", addressOrIndex);
|
|
51728
51602
|
import_properties7.defineReadOnly(this, "_address", null);
|
|
51729
51603
|
} else {
|
|
51730
|
-
|
|
51604
|
+
logger10.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
51731
51605
|
}
|
|
51732
51606
|
}
|
|
51733
51607
|
connect(provider) {
|
|
51734
|
-
return
|
|
51608
|
+
return logger10.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51735
51609
|
operation: "connect"
|
|
51736
51610
|
});
|
|
51737
51611
|
}
|
|
@@ -51744,7 +51618,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51744
51618
|
}
|
|
51745
51619
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
51746
51620
|
if (accounts.length <= this._index) {
|
|
51747
|
-
|
|
51621
|
+
logger10.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51748
51622
|
operation: "getAddress"
|
|
51749
51623
|
});
|
|
51750
51624
|
}
|
|
@@ -51771,7 +51645,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51771
51645
|
}
|
|
51772
51646
|
const address = yield this.provider.resolveName(to);
|
|
51773
51647
|
if (address == null) {
|
|
51774
|
-
|
|
51648
|
+
logger10.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
51775
51649
|
}
|
|
51776
51650
|
return address;
|
|
51777
51651
|
}));
|
|
@@ -51782,7 +51656,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51782
51656
|
}).then(({ tx, sender }) => {
|
|
51783
51657
|
if (tx.from != null) {
|
|
51784
51658
|
if (tx.from.toLowerCase() !== sender) {
|
|
51785
|
-
|
|
51659
|
+
logger10.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
51786
51660
|
}
|
|
51787
51661
|
} else {
|
|
51788
51662
|
tx.from = sender;
|
|
@@ -51792,7 +51666,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51792
51666
|
return hash2;
|
|
51793
51667
|
}, (error) => {
|
|
51794
51668
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
51795
|
-
|
|
51669
|
+
logger10.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
51796
51670
|
action: "sendTransaction",
|
|
51797
51671
|
transaction: tx
|
|
51798
51672
|
});
|
|
@@ -51802,7 +51676,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51802
51676
|
});
|
|
51803
51677
|
}
|
|
51804
51678
|
signTransaction(transaction) {
|
|
51805
|
-
return
|
|
51679
|
+
return logger10.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
51806
51680
|
operation: "signTransaction"
|
|
51807
51681
|
});
|
|
51808
51682
|
}
|
|
@@ -51829,10 +51703,10 @@ class JsonRpcSigner extends Signer {
|
|
|
51829
51703
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
51830
51704
|
const address = yield this.getAddress();
|
|
51831
51705
|
try {
|
|
51832
|
-
return yield this.provider.send("personal_sign", [
|
|
51706
|
+
return yield this.provider.send("personal_sign", [import_bytes7.hexlify(data), address.toLowerCase()]);
|
|
51833
51707
|
} catch (error) {
|
|
51834
51708
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
51835
|
-
|
|
51709
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
51836
51710
|
action: "signMessage",
|
|
51837
51711
|
from: address,
|
|
51838
51712
|
messageData: message
|
|
@@ -51847,10 +51721,10 @@ class JsonRpcSigner extends Signer {
|
|
|
51847
51721
|
const data = typeof message === "string" ? import_strings3.toUtf8Bytes(message) : message;
|
|
51848
51722
|
const address = yield this.getAddress();
|
|
51849
51723
|
try {
|
|
51850
|
-
return yield this.provider.send("eth_sign", [address.toLowerCase(),
|
|
51724
|
+
return yield this.provider.send("eth_sign", [address.toLowerCase(), import_bytes7.hexlify(data)]);
|
|
51851
51725
|
} catch (error) {
|
|
51852
51726
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
51853
|
-
|
|
51727
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
51854
51728
|
action: "_legacySignMessage",
|
|
51855
51729
|
from: address,
|
|
51856
51730
|
messageData: message
|
|
@@ -51873,7 +51747,7 @@ class JsonRpcSigner extends Signer {
|
|
|
51873
51747
|
]);
|
|
51874
51748
|
} catch (error) {
|
|
51875
51749
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
51876
|
-
|
|
51750
|
+
logger10.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
51877
51751
|
action: "_signTypedData",
|
|
51878
51752
|
from: address,
|
|
51879
51753
|
messageData: { domain: populated.domain, types: types2, value: populated.value }
|
|
@@ -51987,14 +51861,14 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
51987
51861
|
try {
|
|
51988
51862
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
51989
51863
|
} catch (error) {
|
|
51990
|
-
return
|
|
51864
|
+
return logger10.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
51991
51865
|
chainId,
|
|
51992
51866
|
event: "invalidNetwork",
|
|
51993
51867
|
serverError: error
|
|
51994
51868
|
});
|
|
51995
51869
|
}
|
|
51996
51870
|
}
|
|
51997
|
-
return
|
|
51871
|
+
return logger10.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
51998
51872
|
event: "noNetwork"
|
|
51999
51873
|
});
|
|
52000
51874
|
});
|
|
@@ -52064,7 +51938,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
52064
51938
|
case "getCode":
|
|
52065
51939
|
return ["eth_getCode", [getLowerCase(params.address), params.blockTag]];
|
|
52066
51940
|
case "getStorageAt":
|
|
52067
|
-
return ["eth_getStorageAt", [getLowerCase(params.address),
|
|
51941
|
+
return ["eth_getStorageAt", [getLowerCase(params.address), import_bytes7.hexZeroPad(params.position, 32), params.blockTag]];
|
|
52068
51942
|
case "sendTransaction":
|
|
52069
51943
|
return ["eth_sendRawTransaction", [params.signedTransaction]];
|
|
52070
51944
|
case "getBlock":
|
|
@@ -52113,7 +51987,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
52113
51987
|
}
|
|
52114
51988
|
const args = this.prepareRequest(method, params);
|
|
52115
51989
|
if (args == null) {
|
|
52116
|
-
|
|
51990
|
+
logger10.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
52117
51991
|
}
|
|
52118
51992
|
try {
|
|
52119
51993
|
return yield this.send(args[0], args[1]);
|
|
@@ -52190,7 +52064,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
52190
52064
|
if (transaction[key] == null) {
|
|
52191
52065
|
return;
|
|
52192
52066
|
}
|
|
52193
|
-
const value =
|
|
52067
|
+
const value = import_bytes7.hexValue(BigNumber.from(transaction[key]));
|
|
52194
52068
|
if (key === "gasLimit") {
|
|
52195
52069
|
key = "gas";
|
|
52196
52070
|
}
|
|
@@ -52200,7 +52074,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
52200
52074
|
if (transaction[key] == null) {
|
|
52201
52075
|
return;
|
|
52202
52076
|
}
|
|
52203
|
-
result[key] =
|
|
52077
|
+
result[key] = import_bytes7.hexlify(transaction[key]);
|
|
52204
52078
|
});
|
|
52205
52079
|
if (transaction.accessList) {
|
|
52206
52080
|
result["accessList"] = import_transactions4.accessListify(transaction.accessList);
|
|
@@ -52217,9 +52091,9 @@ try {
|
|
|
52217
52091
|
throw new Error("inject please");
|
|
52218
52092
|
}
|
|
52219
52093
|
} catch (error) {
|
|
52220
|
-
const
|
|
52094
|
+
const logger11 = new Logger(version10);
|
|
52221
52095
|
WS = function() {
|
|
52222
|
-
|
|
52096
|
+
logger11.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52223
52097
|
operation: "new WebSocket()"
|
|
52224
52098
|
});
|
|
52225
52099
|
};
|
|
@@ -52253,13 +52127,13 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
52253
52127
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52254
52128
|
});
|
|
52255
52129
|
};
|
|
52256
|
-
var
|
|
52130
|
+
var logger11 = new Logger(version10);
|
|
52257
52131
|
var NextId = 1;
|
|
52258
52132
|
|
|
52259
52133
|
class WebSocketProvider extends JsonRpcProvider {
|
|
52260
52134
|
constructor(url, network) {
|
|
52261
52135
|
if (network === "any") {
|
|
52262
|
-
|
|
52136
|
+
logger11.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52263
52137
|
operation: "network:any"
|
|
52264
52138
|
});
|
|
52265
52139
|
}
|
|
@@ -52343,12 +52217,12 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
52343
52217
|
return 0;
|
|
52344
52218
|
}
|
|
52345
52219
|
resetEventsBlock(blockNumber) {
|
|
52346
|
-
|
|
52220
|
+
logger11.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52347
52221
|
operation: "resetEventBlock"
|
|
52348
52222
|
});
|
|
52349
52223
|
}
|
|
52350
52224
|
set pollingInterval(value) {
|
|
52351
|
-
|
|
52225
|
+
logger11.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52352
52226
|
operation: "setPollingInterval"
|
|
52353
52227
|
});
|
|
52354
52228
|
}
|
|
@@ -52361,7 +52235,7 @@ class WebSocketProvider extends JsonRpcProvider {
|
|
|
52361
52235
|
if (!value) {
|
|
52362
52236
|
return;
|
|
52363
52237
|
}
|
|
52364
|
-
|
|
52238
|
+
logger11.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52365
52239
|
operation: "setPolling"
|
|
52366
52240
|
});
|
|
52367
52241
|
}
|
|
@@ -52525,7 +52399,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
52525
52399
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52526
52400
|
});
|
|
52527
52401
|
};
|
|
52528
|
-
var
|
|
52402
|
+
var logger12 = new Logger(version10);
|
|
52529
52403
|
|
|
52530
52404
|
class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
52531
52405
|
detectNetwork() {
|
|
@@ -52537,7 +52411,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
52537
52411
|
if (network == null) {
|
|
52538
52412
|
network = yield _super.detectNetwork.call(this);
|
|
52539
52413
|
if (!network) {
|
|
52540
|
-
|
|
52414
|
+
logger12.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
52541
52415
|
}
|
|
52542
52416
|
if (this._network == null) {
|
|
52543
52417
|
import_properties9.defineReadOnly(this, "_network", network);
|
|
@@ -52551,7 +52425,7 @@ class StaticJsonRpcProvider extends JsonRpcProvider {
|
|
|
52551
52425
|
|
|
52552
52426
|
class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
52553
52427
|
constructor(network, apiKey) {
|
|
52554
|
-
|
|
52428
|
+
logger12.checkAbstract(new.target, UrlJsonRpcProvider);
|
|
52555
52429
|
network = import_properties9.getStatic(new.target, "getNetwork")(network);
|
|
52556
52430
|
apiKey = import_properties9.getStatic(new.target, "getApiKey")(apiKey);
|
|
52557
52431
|
const connection = import_properties9.getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -52565,13 +52439,13 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
52565
52439
|
}
|
|
52566
52440
|
}
|
|
52567
52441
|
_startPending() {
|
|
52568
|
-
|
|
52442
|
+
logger12.warn("WARNING: API provider does not support pending filters");
|
|
52569
52443
|
}
|
|
52570
52444
|
isCommunityResource() {
|
|
52571
52445
|
return false;
|
|
52572
52446
|
}
|
|
52573
52447
|
getSigner(address) {
|
|
52574
|
-
return
|
|
52448
|
+
return logger12.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
52575
52449
|
}
|
|
52576
52450
|
listAccounts() {
|
|
52577
52451
|
return Promise.resolve([]);
|
|
@@ -52580,14 +52454,14 @@ class UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
|
52580
52454
|
return apiKey;
|
|
52581
52455
|
}
|
|
52582
52456
|
static getUrl(network, apiKey) {
|
|
52583
|
-
return
|
|
52457
|
+
return logger12.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
52584
52458
|
operation: "getUrl"
|
|
52585
52459
|
});
|
|
52586
52460
|
}
|
|
52587
52461
|
}
|
|
52588
52462
|
|
|
52589
52463
|
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
52590
|
-
var
|
|
52464
|
+
var logger13 = new Logger(version10);
|
|
52591
52465
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
52592
52466
|
|
|
52593
52467
|
class AlchemyWebSocketProvider extends WebSocketProvider {
|
|
@@ -52611,7 +52485,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
52611
52485
|
return defaultApiKey;
|
|
52612
52486
|
}
|
|
52613
52487
|
if (apiKey && typeof apiKey !== "string") {
|
|
52614
|
-
|
|
52488
|
+
logger13.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
52615
52489
|
}
|
|
52616
52490
|
return apiKey;
|
|
52617
52491
|
}
|
|
@@ -52643,7 +52517,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
52643
52517
|
host = "opt-goerli.g.alchemy.com/v2/";
|
|
52644
52518
|
break;
|
|
52645
52519
|
default:
|
|
52646
|
-
|
|
52520
|
+
logger13.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
52647
52521
|
}
|
|
52648
52522
|
return {
|
|
52649
52523
|
allowGzip: true,
|
|
@@ -52662,7 +52536,7 @@ class AlchemyProvider extends UrlJsonRpcProvider {
|
|
|
52662
52536
|
}
|
|
52663
52537
|
|
|
52664
52538
|
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
52665
|
-
var
|
|
52539
|
+
var logger14 = new Logger(version10);
|
|
52666
52540
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
52667
52541
|
function getHost(name) {
|
|
52668
52542
|
switch (name) {
|
|
@@ -52679,7 +52553,7 @@ function getHost(name) {
|
|
|
52679
52553
|
case "arbitrum":
|
|
52680
52554
|
return "rpc.ankr.com/arbitrum/";
|
|
52681
52555
|
}
|
|
52682
|
-
return
|
|
52556
|
+
return logger14.throwArgumentError("unsupported network", "name", name);
|
|
52683
52557
|
}
|
|
52684
52558
|
|
|
52685
52559
|
class AnkrProvider extends UrlJsonRpcProvider {
|
|
@@ -52742,12 +52616,12 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
52742
52616
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52743
52617
|
});
|
|
52744
52618
|
};
|
|
52745
|
-
var
|
|
52619
|
+
var logger15 = new Logger(version10);
|
|
52746
52620
|
|
|
52747
52621
|
class CloudflareProvider extends UrlJsonRpcProvider {
|
|
52748
52622
|
static getApiKey(apiKey) {
|
|
52749
52623
|
if (apiKey != null) {
|
|
52750
|
-
|
|
52624
|
+
logger15.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
52751
52625
|
}
|
|
52752
52626
|
return null;
|
|
52753
52627
|
}
|
|
@@ -52758,7 +52632,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
52758
52632
|
host = "https://cloudflare-eth.com/";
|
|
52759
52633
|
break;
|
|
52760
52634
|
default:
|
|
52761
|
-
|
|
52635
|
+
logger15.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
52762
52636
|
}
|
|
52763
52637
|
return host;
|
|
52764
52638
|
}
|
|
@@ -52777,7 +52651,7 @@ class CloudflareProvider extends UrlJsonRpcProvider {
|
|
|
52777
52651
|
}
|
|
52778
52652
|
|
|
52779
52653
|
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
52780
|
-
var
|
|
52654
|
+
var import_bytes8 = __toESM(require_lib2(), 1);
|
|
52781
52655
|
var import_properties11 = __toESM(require_lib4(), 1);
|
|
52782
52656
|
var import_transactions5 = __toESM(require_lib15(), 1);
|
|
52783
52657
|
var import_web3 = __toESM(require_lib23(), 1);
|
|
@@ -52808,7 +52682,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
52808
52682
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52809
52683
|
});
|
|
52810
52684
|
};
|
|
52811
|
-
var
|
|
52685
|
+
var logger16 = new Logger(version10);
|
|
52812
52686
|
function getTransactionPostData(transaction) {
|
|
52813
52687
|
const result = {};
|
|
52814
52688
|
for (let key in transaction) {
|
|
@@ -52820,13 +52694,13 @@ function getTransactionPostData(transaction) {
|
|
|
52820
52694
|
continue;
|
|
52821
52695
|
}
|
|
52822
52696
|
if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {
|
|
52823
|
-
value =
|
|
52697
|
+
value = import_bytes8.hexValue(import_bytes8.hexlify(value));
|
|
52824
52698
|
} else if (key === "accessList") {
|
|
52825
52699
|
value = "[" + import_transactions5.accessListify(value).map((set) => {
|
|
52826
52700
|
return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`;
|
|
52827
52701
|
}).join(",") + "]";
|
|
52828
52702
|
} else {
|
|
52829
|
-
value =
|
|
52703
|
+
value = import_bytes8.hexlify(value);
|
|
52830
52704
|
}
|
|
52831
52705
|
result[key] = value;
|
|
52832
52706
|
}
|
|
@@ -52887,10 +52761,10 @@ function checkError2(method, error, transaction) {
|
|
|
52887
52761
|
if (data) {
|
|
52888
52762
|
data = "0x" + data.replace(/^.*0x/i, "");
|
|
52889
52763
|
}
|
|
52890
|
-
if (
|
|
52764
|
+
if (import_bytes8.isHexString(data)) {
|
|
52891
52765
|
return data;
|
|
52892
52766
|
}
|
|
52893
|
-
|
|
52767
|
+
logger16.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
52894
52768
|
error,
|
|
52895
52769
|
data: "0x"
|
|
52896
52770
|
});
|
|
@@ -52908,28 +52782,28 @@ function checkError2(method, error, transaction) {
|
|
|
52908
52782
|
}
|
|
52909
52783
|
message = (message || "").toLowerCase();
|
|
52910
52784
|
if (message.match(/insufficient funds/)) {
|
|
52911
|
-
|
|
52785
|
+
logger16.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
52912
52786
|
error,
|
|
52913
52787
|
method,
|
|
52914
52788
|
transaction
|
|
52915
52789
|
});
|
|
52916
52790
|
}
|
|
52917
52791
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
52918
|
-
|
|
52792
|
+
logger16.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
52919
52793
|
error,
|
|
52920
52794
|
method,
|
|
52921
52795
|
transaction
|
|
52922
52796
|
});
|
|
52923
52797
|
}
|
|
52924
52798
|
if (message.match(/another transaction with same nonce/)) {
|
|
52925
|
-
|
|
52799
|
+
logger16.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
52926
52800
|
error,
|
|
52927
52801
|
method,
|
|
52928
52802
|
transaction
|
|
52929
52803
|
});
|
|
52930
52804
|
}
|
|
52931
52805
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
52932
|
-
|
|
52806
|
+
logger16.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
52933
52807
|
error,
|
|
52934
52808
|
method,
|
|
52935
52809
|
transaction
|
|
@@ -52966,7 +52840,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
52966
52840
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
52967
52841
|
default:
|
|
52968
52842
|
}
|
|
52969
|
-
return
|
|
52843
|
+
return logger16.throwArgumentError("unsupported network", "network", this.network.name);
|
|
52970
52844
|
}
|
|
52971
52845
|
getUrl(module, params) {
|
|
52972
52846
|
const query = Object.keys(params).reduce((accum, key) => {
|
|
@@ -53126,12 +53000,12 @@ class EtherscanProvider extends BaseProvider {
|
|
|
53126
53000
|
}
|
|
53127
53001
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
53128
53002
|
if (params.filter.topics.length > 1) {
|
|
53129
|
-
|
|
53003
|
+
logger16.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
53130
53004
|
}
|
|
53131
53005
|
if (params.filter.topics.length === 1) {
|
|
53132
53006
|
const topic0 = params.filter.topics[0];
|
|
53133
53007
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
53134
|
-
|
|
53008
|
+
logger16.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
53135
53009
|
}
|
|
53136
53010
|
args.topic0 = topic0;
|
|
53137
53011
|
}
|
|
@@ -53197,7 +53071,7 @@ class EtherscanProvider extends BaseProvider {
|
|
|
53197
53071
|
}
|
|
53198
53072
|
|
|
53199
53073
|
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
53200
|
-
var
|
|
53074
|
+
var import_bytes9 = __toESM(require_lib2(), 1);
|
|
53201
53075
|
var import_properties12 = __toESM(require_lib4(), 1);
|
|
53202
53076
|
var import_random2 = __toESM(require_lib21(), 1);
|
|
53203
53077
|
var import_web4 = __toESM(require_lib23(), 1);
|
|
@@ -53228,7 +53102,7 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
53228
53102
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
53229
53103
|
});
|
|
53230
53104
|
};
|
|
53231
|
-
var
|
|
53105
|
+
var logger17 = new Logger(version10);
|
|
53232
53106
|
function now() {
|
|
53233
53107
|
return new Date().getTime();
|
|
53234
53108
|
}
|
|
@@ -53241,7 +53115,7 @@ function checkNetworks(networks2) {
|
|
|
53241
53115
|
}
|
|
53242
53116
|
if (result) {
|
|
53243
53117
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
53244
|
-
|
|
53118
|
+
logger17.throwArgumentError("provider mismatch", "networks", networks2);
|
|
53245
53119
|
}
|
|
53246
53120
|
} else {
|
|
53247
53121
|
result = network;
|
|
@@ -53477,23 +53351,23 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
53477
53351
|
case "getBalance":
|
|
53478
53352
|
case "getTransactionCount":
|
|
53479
53353
|
case "getCode":
|
|
53480
|
-
if (params.blockTag &&
|
|
53354
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
53481
53355
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
53482
53356
|
}
|
|
53483
53357
|
return provider[method](params.address, params.blockTag || "latest");
|
|
53484
53358
|
case "getStorageAt":
|
|
53485
|
-
if (params.blockTag &&
|
|
53359
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
53486
53360
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
53487
53361
|
}
|
|
53488
53362
|
return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");
|
|
53489
53363
|
case "getBlock":
|
|
53490
|
-
if (params.blockTag &&
|
|
53364
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
53491
53365
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
53492
53366
|
}
|
|
53493
53367
|
return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);
|
|
53494
53368
|
case "call":
|
|
53495
53369
|
case "estimateGas":
|
|
53496
|
-
if (params.blockTag &&
|
|
53370
|
+
if (params.blockTag && import_bytes9.isHexString(params.blockTag)) {
|
|
53497
53371
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
53498
53372
|
}
|
|
53499
53373
|
if (method === "call" && params.blockTag) {
|
|
@@ -53505,13 +53379,13 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
53505
53379
|
return provider[method](params.transactionHash);
|
|
53506
53380
|
case "getLogs": {
|
|
53507
53381
|
let filter = params.filter;
|
|
53508
|
-
if (filter.fromBlock &&
|
|
53382
|
+
if (filter.fromBlock && import_bytes9.isHexString(filter.fromBlock) || filter.toBlock && import_bytes9.isHexString(filter.toBlock)) {
|
|
53509
53383
|
provider = yield waitForSync(config, currentBlockNumber);
|
|
53510
53384
|
}
|
|
53511
53385
|
return provider.getLogs(filter);
|
|
53512
53386
|
}
|
|
53513
53387
|
}
|
|
53514
|
-
return
|
|
53388
|
+
return logger17.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
53515
53389
|
method,
|
|
53516
53390
|
params
|
|
53517
53391
|
});
|
|
@@ -53521,7 +53395,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
53521
53395
|
class FallbackProvider extends BaseProvider {
|
|
53522
53396
|
constructor(providers, quorum) {
|
|
53523
53397
|
if (providers.length === 0) {
|
|
53524
|
-
|
|
53398
|
+
logger17.throwArgumentError("missing providers", "providers", providers);
|
|
53525
53399
|
}
|
|
53526
53400
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
53527
53401
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -53541,7 +53415,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
53541
53415
|
}
|
|
53542
53416
|
const weight = config.weight;
|
|
53543
53417
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
53544
|
-
|
|
53418
|
+
logger17.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
53545
53419
|
}
|
|
53546
53420
|
return Object.freeze(config);
|
|
53547
53421
|
});
|
|
@@ -53549,7 +53423,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
53549
53423
|
if (quorum == null) {
|
|
53550
53424
|
quorum = total / 2;
|
|
53551
53425
|
} else if (quorum > total) {
|
|
53552
|
-
|
|
53426
|
+
logger17.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
53553
53427
|
}
|
|
53554
53428
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
53555
53429
|
if (networkOrReady == null) {
|
|
@@ -53706,7 +53580,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
53706
53580
|
}
|
|
53707
53581
|
props[name] = e[name];
|
|
53708
53582
|
});
|
|
53709
|
-
|
|
53583
|
+
logger17.throwError(e.reason || e.message, errorCode, props);
|
|
53710
53584
|
});
|
|
53711
53585
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
53712
53586
|
break;
|
|
@@ -53718,7 +53592,7 @@ class FallbackProvider extends BaseProvider {
|
|
|
53718
53592
|
}
|
|
53719
53593
|
c.cancelled = true;
|
|
53720
53594
|
});
|
|
53721
|
-
return
|
|
53595
|
+
return logger17.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
53722
53596
|
method,
|
|
53723
53597
|
params,
|
|
53724
53598
|
results: configs.map((c) => exposeDebugConfig(c)),
|
|
@@ -53733,7 +53607,7 @@ var IpcProvider = null;
|
|
|
53733
53607
|
|
|
53734
53608
|
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
53735
53609
|
var import_properties13 = __toESM(require_lib4(), 1);
|
|
53736
|
-
var
|
|
53610
|
+
var logger18 = new Logger(version10);
|
|
53737
53611
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
53738
53612
|
|
|
53739
53613
|
class InfuraWebSocketProvider extends WebSocketProvider {
|
|
@@ -53741,7 +53615,7 @@ class InfuraWebSocketProvider extends WebSocketProvider {
|
|
|
53741
53615
|
const provider = new InfuraProvider(network, apiKey);
|
|
53742
53616
|
const connection = provider.connection;
|
|
53743
53617
|
if (connection.password) {
|
|
53744
|
-
|
|
53618
|
+
logger18.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
53745
53619
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
53746
53620
|
});
|
|
53747
53621
|
}
|
|
@@ -53772,8 +53646,8 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
53772
53646
|
if (typeof apiKey === "string") {
|
|
53773
53647
|
apiKeyObj.projectId = apiKey;
|
|
53774
53648
|
} else if (apiKey.projectSecret != null) {
|
|
53775
|
-
|
|
53776
|
-
|
|
53649
|
+
logger18.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
53650
|
+
logger18.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
53777
53651
|
apiKeyObj.projectId = apiKey.projectId;
|
|
53778
53652
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
53779
53653
|
} else if (apiKey.projectId) {
|
|
@@ -53813,7 +53687,7 @@ class InfuraProvider extends UrlJsonRpcProvider {
|
|
|
53813
53687
|
host = "arbitrum-goerli.infura.io";
|
|
53814
53688
|
break;
|
|
53815
53689
|
default:
|
|
53816
|
-
|
|
53690
|
+
logger18.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
53817
53691
|
argument: "network",
|
|
53818
53692
|
value: network
|
|
53819
53693
|
});
|
|
@@ -53906,18 +53780,18 @@ class JsonRpcBatchProvider extends JsonRpcProvider {
|
|
|
53906
53780
|
}
|
|
53907
53781
|
|
|
53908
53782
|
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
53909
|
-
var
|
|
53783
|
+
var logger19 = new Logger(version10);
|
|
53910
53784
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
53911
53785
|
|
|
53912
53786
|
class NodesmithProvider extends UrlJsonRpcProvider {
|
|
53913
53787
|
static getApiKey(apiKey) {
|
|
53914
53788
|
if (apiKey && typeof apiKey !== "string") {
|
|
53915
|
-
|
|
53789
|
+
logger19.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
53916
53790
|
}
|
|
53917
53791
|
return apiKey || defaultApiKey3;
|
|
53918
53792
|
}
|
|
53919
53793
|
static getUrl(network, apiKey) {
|
|
53920
|
-
|
|
53794
|
+
logger19.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
53921
53795
|
let host = null;
|
|
53922
53796
|
switch (network.name) {
|
|
53923
53797
|
case "homestead":
|
|
@@ -53936,14 +53810,14 @@ class NodesmithProvider extends UrlJsonRpcProvider {
|
|
|
53936
53810
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
53937
53811
|
break;
|
|
53938
53812
|
default:
|
|
53939
|
-
|
|
53813
|
+
logger19.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
53940
53814
|
}
|
|
53941
53815
|
return host + "?apiKey=" + apiKey;
|
|
53942
53816
|
}
|
|
53943
53817
|
}
|
|
53944
53818
|
|
|
53945
53819
|
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
53946
|
-
var
|
|
53820
|
+
var logger20 = new Logger(version10);
|
|
53947
53821
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
53948
53822
|
|
|
53949
53823
|
class PocketProvider extends UrlJsonRpcProvider {
|
|
@@ -53963,7 +53837,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
53963
53837
|
} else if (apiKey.applicationId) {
|
|
53964
53838
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
53965
53839
|
} else {
|
|
53966
|
-
|
|
53840
|
+
logger20.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
53967
53841
|
}
|
|
53968
53842
|
return apiKeyObj;
|
|
53969
53843
|
}
|
|
@@ -53992,7 +53866,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
53992
53866
|
host = "eth-ropsten.gateway.pokt.network";
|
|
53993
53867
|
break;
|
|
53994
53868
|
default:
|
|
53995
|
-
|
|
53869
|
+
logger20.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
53996
53870
|
argument: "network",
|
|
53997
53871
|
value: network
|
|
53998
53872
|
});
|
|
@@ -54012,7 +53886,7 @@ class PocketProvider extends UrlJsonRpcProvider {
|
|
|
54012
53886
|
|
|
54013
53887
|
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
54014
53888
|
var import_properties15 = __toESM(require_lib4(), 1);
|
|
54015
|
-
var
|
|
53889
|
+
var logger21 = new Logger(version10);
|
|
54016
53890
|
var _nextId = 1;
|
|
54017
53891
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
54018
53892
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -54096,7 +53970,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
54096
53970
|
class Web3Provider extends JsonRpcProvider {
|
|
54097
53971
|
constructor(provider, network) {
|
|
54098
53972
|
if (provider == null) {
|
|
54099
|
-
|
|
53973
|
+
logger21.throwArgumentError("missing provider", "provider", provider);
|
|
54100
53974
|
}
|
|
54101
53975
|
let path = null;
|
|
54102
53976
|
let jsonRpcFetchFunc = null;
|
|
@@ -54120,7 +53994,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
54120
53994
|
} else if (provider.send) {
|
|
54121
53995
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
54122
53996
|
} else {
|
|
54123
|
-
|
|
53997
|
+
logger21.throwArgumentError("unsupported provider", "provider", provider);
|
|
54124
53998
|
}
|
|
54125
53999
|
if (!path) {
|
|
54126
54000
|
path = "unknown:";
|
|
@@ -54136,7 +54010,7 @@ class Web3Provider extends JsonRpcProvider {
|
|
|
54136
54010
|
}
|
|
54137
54011
|
|
|
54138
54012
|
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
54139
|
-
var
|
|
54013
|
+
var logger22 = new Logger(version10);
|
|
54140
54014
|
function getDefaultProvider(network, options) {
|
|
54141
54015
|
if (network == null) {
|
|
54142
54016
|
network = "homestead";
|
|
@@ -54152,13 +54026,13 @@ function getDefaultProvider(network, options) {
|
|
|
54152
54026
|
case "wss":
|
|
54153
54027
|
return new WebSocketProvider(network);
|
|
54154
54028
|
default:
|
|
54155
|
-
|
|
54029
|
+
logger22.throwArgumentError("unsupported URL scheme", "network", network);
|
|
54156
54030
|
}
|
|
54157
54031
|
}
|
|
54158
54032
|
}
|
|
54159
54033
|
const n = getNetwork(network);
|
|
54160
54034
|
if (!n || !n._defaultProvider) {
|
|
54161
|
-
|
|
54035
|
+
logger22.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
54162
54036
|
operation: "getDefaultProvider",
|
|
54163
54037
|
network
|
|
54164
54038
|
});
|
|
@@ -54183,15 +54057,15 @@ var import_hash4 = __toESM(require_lib12(), 1);
|
|
|
54183
54057
|
var import_properties16 = __toESM(require_lib4(), 1);
|
|
54184
54058
|
|
|
54185
54059
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
54186
|
-
var
|
|
54060
|
+
var version11 = "wordlists/5.7.0";
|
|
54187
54061
|
|
|
54188
54062
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
54189
54063
|
var exportWordlist = false;
|
|
54190
|
-
var
|
|
54064
|
+
var logger23 = new Logger(version11);
|
|
54191
54065
|
|
|
54192
54066
|
class Wordlist {
|
|
54193
54067
|
constructor(locale) {
|
|
54194
|
-
|
|
54068
|
+
logger23.checkAbstract(new.target, Wordlist);
|
|
54195
54069
|
import_properties16.defineReadOnly(this, "locale", locale);
|
|
54196
54070
|
}
|
|
54197
54071
|
split(mnemonic) {
|
|
@@ -54268,14 +54142,14 @@ var wordlists = {
|
|
|
54268
54142
|
// node_modules/ethers/lib.esm/utils.js
|
|
54269
54143
|
var exports_utils = {};
|
|
54270
54144
|
__export(exports_utils, {
|
|
54271
|
-
zeroPad: () =>
|
|
54145
|
+
zeroPad: () => import_bytes10.zeroPad,
|
|
54272
54146
|
verifyTypedData: () => verifyTypedData,
|
|
54273
54147
|
verifyMessage: () => verifyMessage,
|
|
54274
54148
|
toUtf8String: () => import_strings4.toUtf8String,
|
|
54275
54149
|
toUtf8CodePoints: () => import_strings4.toUtf8CodePoints,
|
|
54276
54150
|
toUtf8Bytes: () => import_strings4.toUtf8Bytes,
|
|
54277
|
-
stripZeros: () =>
|
|
54278
|
-
splitSignature: () =>
|
|
54151
|
+
stripZeros: () => import_bytes10.stripZeros,
|
|
54152
|
+
splitSignature: () => import_bytes10.splitSignature,
|
|
54279
54153
|
soliditySha256: () => import_solidity.sha256,
|
|
54280
54154
|
solidityPack: () => import_solidity.pack,
|
|
54281
54155
|
solidityKeccak256: () => import_solidity.keccak256,
|
|
@@ -54298,29 +54172,29 @@ __export(exports_utils, {
|
|
|
54298
54172
|
namehash: () => import_hash5.namehash,
|
|
54299
54173
|
mnemonicToSeed: () => import_hdnode2.mnemonicToSeed,
|
|
54300
54174
|
mnemonicToEntropy: () => import_hdnode2.mnemonicToEntropy,
|
|
54301
|
-
keccak256: () =>
|
|
54302
|
-
joinSignature: () =>
|
|
54175
|
+
keccak256: () => import_keccak2564.keccak256,
|
|
54176
|
+
joinSignature: () => import_bytes10.joinSignature,
|
|
54303
54177
|
isValidName: () => import_hash5.isValidName,
|
|
54304
54178
|
isValidMnemonic: () => import_hdnode2.isValidMnemonic,
|
|
54305
|
-
isHexString: () =>
|
|
54306
|
-
isBytesLike: () =>
|
|
54307
|
-
isBytes: () =>
|
|
54308
|
-
isAddress: () =>
|
|
54179
|
+
isHexString: () => import_bytes10.isHexString,
|
|
54180
|
+
isBytesLike: () => import_bytes10.isBytesLike,
|
|
54181
|
+
isBytes: () => import_bytes10.isBytes,
|
|
54182
|
+
isAddress: () => import_address7.isAddress,
|
|
54309
54183
|
id: () => import_hash5.id,
|
|
54310
|
-
hexlify: () =>
|
|
54311
|
-
hexZeroPad: () =>
|
|
54312
|
-
hexValue: () =>
|
|
54313
|
-
hexStripZeros: () =>
|
|
54314
|
-
hexDataSlice: () =>
|
|
54315
|
-
hexDataLength: () =>
|
|
54316
|
-
hexConcat: () =>
|
|
54184
|
+
hexlify: () => import_bytes10.hexlify,
|
|
54185
|
+
hexZeroPad: () => import_bytes10.hexZeroPad,
|
|
54186
|
+
hexValue: () => import_bytes10.hexValue,
|
|
54187
|
+
hexStripZeros: () => import_bytes10.hexStripZeros,
|
|
54188
|
+
hexDataSlice: () => import_bytes10.hexDataSlice,
|
|
54189
|
+
hexDataLength: () => import_bytes10.hexDataLength,
|
|
54190
|
+
hexConcat: () => import_bytes10.hexConcat,
|
|
54317
54191
|
hashMessage: () => import_hash5.hashMessage,
|
|
54318
54192
|
getStatic: () => import_properties17.getStatic,
|
|
54319
54193
|
getJsonWalletAddress: () => import_json_wallets2.getJsonWalletAddress,
|
|
54320
|
-
getIcapAddress: () => getIcapAddress,
|
|
54321
|
-
getCreate2Address: () => getCreate2Address,
|
|
54322
|
-
getContractAddress: () => getContractAddress,
|
|
54323
|
-
getAddress: () =>
|
|
54194
|
+
getIcapAddress: () => import_address7.getIcapAddress,
|
|
54195
|
+
getCreate2Address: () => import_address7.getCreate2Address,
|
|
54196
|
+
getContractAddress: () => import_address7.getContractAddress,
|
|
54197
|
+
getAddress: () => import_address7.getAddress,
|
|
54324
54198
|
getAccountPath: () => import_hdnode2.getAccountPath,
|
|
54325
54199
|
formatUnits: () => import_units.formatUnits,
|
|
54326
54200
|
formatEther: () => import_units.formatEther,
|
|
@@ -54332,7 +54206,7 @@ __export(exports_utils, {
|
|
|
54332
54206
|
defaultPath: () => import_hdnode2.defaultPath,
|
|
54333
54207
|
defaultAbiCoder: () => import_abi8.defaultAbiCoder,
|
|
54334
54208
|
deepCopy: () => import_properties17.deepCopy,
|
|
54335
|
-
concat: () =>
|
|
54209
|
+
concat: () => import_bytes10.concat,
|
|
54336
54210
|
computePublicKey: () => import_signing_key2.computePublicKey,
|
|
54337
54211
|
computeHmac: () => import_sha22.computeHmac,
|
|
54338
54212
|
computeAddress: () => import_transactions6.computeAddress,
|
|
@@ -54341,7 +54215,7 @@ __export(exports_utils, {
|
|
|
54341
54215
|
checkProperties: () => import_properties17.checkProperties,
|
|
54342
54216
|
base64: () => base64,
|
|
54343
54217
|
base58: () => import_basex2.Base58,
|
|
54344
|
-
arrayify: () =>
|
|
54218
|
+
arrayify: () => import_bytes10.arrayify,
|
|
54345
54219
|
accessListify: () => import_transactions6.accessListify,
|
|
54346
54220
|
_toEscapedUtf8String: () => import_strings4._toEscapedUtf8String,
|
|
54347
54221
|
_fetchData: () => import_web6._fetchData,
|
|
@@ -54369,13 +54243,14 @@ __export(exports_utils, {
|
|
|
54369
54243
|
AbiCoder: () => import_abi8.AbiCoder
|
|
54370
54244
|
});
|
|
54371
54245
|
var import_abi8 = __toESM(require_lib13(), 1);
|
|
54246
|
+
var import_address7 = __toESM(require_lib7(), 1);
|
|
54372
54247
|
var base64 = __toESM(require_lib10(), 1);
|
|
54373
54248
|
var import_basex2 = __toESM(require_lib16(), 1);
|
|
54374
|
-
var
|
|
54249
|
+
var import_bytes10 = __toESM(require_lib2(), 1);
|
|
54375
54250
|
var import_hash5 = __toESM(require_lib12(), 1);
|
|
54376
54251
|
var import_hdnode2 = __toESM(require_lib20(), 1);
|
|
54377
54252
|
var import_json_wallets2 = __toESM(require_lib22(), 1);
|
|
54378
|
-
var
|
|
54253
|
+
var import_keccak2564 = __toESM(require_lib5(), 1);
|
|
54379
54254
|
var import_sha22 = __toESM(require_lib17(), 1);
|
|
54380
54255
|
var import_solidity = __toESM(require_lib24(), 1);
|
|
54381
54256
|
var import_random3 = __toESM(require_lib21(), 1);
|
|
@@ -54390,10 +54265,10 @@ var import_sha23 = __toESM(require_lib17(), 1);
|
|
|
54390
54265
|
var import_strings5 = __toESM(require_lib9(), 1);
|
|
54391
54266
|
|
|
54392
54267
|
// node_modules/ethers/lib.esm/_version.js
|
|
54393
|
-
var
|
|
54268
|
+
var version12 = "ethers/5.7.2";
|
|
54394
54269
|
|
|
54395
54270
|
// node_modules/ethers/lib.esm/ethers.js
|
|
54396
|
-
var
|
|
54271
|
+
var logger24 = new Logger(version12);
|
|
54397
54272
|
|
|
54398
54273
|
// node_modules/ethers/lib.esm/index.js
|
|
54399
54274
|
try {
|
|
@@ -56121,8 +55996,8 @@ class MultisendBuilder {
|
|
|
56121
55996
|
data
|
|
56122
55997
|
});
|
|
56123
55998
|
}
|
|
56124
|
-
static new(chainId,
|
|
56125
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${
|
|
55999
|
+
static new(chainId, version13 = "v1_4_1") {
|
|
56000
|
+
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version13}.multisend`));
|
|
56126
56001
|
}
|
|
56127
56002
|
}
|
|
56128
56003
|
// src/integrations/gnosis/safe.L2.abi.ts
|
|
@@ -60393,6 +60268,7 @@ function invariant(condition, message) {
|
|
|
60393
60268
|
var import_decimal = __toESM(require_decimal(), 1);
|
|
60394
60269
|
var import_big = __toESM(require_big(), 1);
|
|
60395
60270
|
var import_toformat = __toESM(require_toFormat(), 1);
|
|
60271
|
+
var import_address8 = __toESM(require_lib7(), 1);
|
|
60396
60272
|
function _defineProperties(target, props) {
|
|
60397
60273
|
for (var i2 = 0;i2 < props.length; i2++) {
|
|
60398
60274
|
var descriptor = props[i2];
|
|
@@ -60952,7 +60828,7 @@ var NativeCurrency = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
60952
60828
|
}(BaseCurrency);
|
|
60953
60829
|
function validateAndParseAddress(address) {
|
|
60954
60830
|
try {
|
|
60955
|
-
return
|
|
60831
|
+
return import_address8.getAddress(address);
|
|
60956
60832
|
} catch (error) {
|
|
60957
60833
|
throw new Error(address + " is not a valid address.");
|
|
60958
60834
|
}
|
|
@@ -61029,13 +60905,13 @@ var Ether = /* @__PURE__ */ function(_NativeCurrency) {
|
|
|
61029
60905
|
return Ether2;
|
|
61030
60906
|
}(NativeCurrency);
|
|
61031
60907
|
Ether._etherCache = {};
|
|
61032
|
-
var
|
|
60908
|
+
var MAX_SAFE_INTEGER = /* @__PURE__ */ import_jsbi.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
61033
60909
|
var ZERO = /* @__PURE__ */ import_jsbi.default.BigInt(0);
|
|
61034
60910
|
var ONE2 = /* @__PURE__ */ import_jsbi.default.BigInt(1);
|
|
61035
60911
|
var TWO = /* @__PURE__ */ import_jsbi.default.BigInt(2);
|
|
61036
60912
|
function sqrt(value) {
|
|
61037
60913
|
!import_jsbi.default.greaterThanOrEqual(value, ZERO) && invariant(false, "NEGATIVE");
|
|
61038
|
-
if (import_jsbi.default.lessThan(value,
|
|
60914
|
+
if (import_jsbi.default.lessThan(value, MAX_SAFE_INTEGER)) {
|
|
61039
60915
|
return import_jsbi.default.BigInt(Math.floor(Math.sqrt(import_jsbi.default.toNumber(value))));
|
|
61040
60916
|
}
|
|
61041
60917
|
var z;
|
|
@@ -61052,6 +60928,7 @@ function sqrt(value) {
|
|
|
61052
60928
|
// node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
61053
60929
|
var import_jsbi2 = __toESM(require_jsbi_umd(), 1);
|
|
61054
60930
|
var import_abi9 = __toESM(require_lib13(), 1);
|
|
60931
|
+
var import_address9 = __toESM(require_lib7(), 1);
|
|
61055
60932
|
var import_solidity2 = __toESM(require_lib24(), 1);
|
|
61056
60933
|
// node_modules/@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json
|
|
61057
60934
|
var IMulticall_default = {
|
|
@@ -64987,7 +64864,7 @@ var Q192 = /* @__PURE__ */ import_jsbi2.default.exponentiate(Q96, /* @__PURE__ *
|
|
|
64987
64864
|
function computePoolAddress(_ref) {
|
|
64988
64865
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride } = _ref;
|
|
64989
64866
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
64990
|
-
return getCreate2Address(factoryAddress, import_solidity2.keccak256(["bytes"], [import_abi9.defaultAbiCoder.encode(["address", "address", "uint24"], [token0.address, token1.address, fee])]), initCodeHashManualOverride != null ? initCodeHashManualOverride : POOL_INIT_CODE_HASH);
|
|
64867
|
+
return import_address9.getCreate2Address(factoryAddress, import_solidity2.keccak256(["bytes"], [import_abi9.defaultAbiCoder.encode(["address", "address", "uint24"], [token0.address, token1.address, fee])]), initCodeHashManualOverride != null ? initCodeHashManualOverride : POOL_INIT_CODE_HASH);
|
|
64991
64868
|
}
|
|
64992
64869
|
var LiquidityMath = /* @__PURE__ */ function() {
|
|
64993
64870
|
function LiquidityMath2() {}
|
|
@@ -66360,8 +66237,9 @@ var import_jsbi3 = __toESM(require_jsbi_umd(), 1);
|
|
|
66360
66237
|
var import_decimal2 = __toESM(require_decimal(), 1);
|
|
66361
66238
|
var import_big2 = __toESM(require_big(), 1);
|
|
66362
66239
|
var import_toformat2 = __toESM(require_toFormat(), 1);
|
|
66363
|
-
var
|
|
66364
|
-
var
|
|
66240
|
+
var import_address10 = __toESM(require_lib7(), 1);
|
|
66241
|
+
var import_bytes11 = __toESM(require_lib2(), 1);
|
|
66242
|
+
var import_keccak2565 = __toESM(require_lib5(), 1);
|
|
66365
66243
|
var import_strings6 = __toESM(require_lib9(), 1);
|
|
66366
66244
|
function _defineProperties3(e, r) {
|
|
66367
66245
|
for (var t = 0;t < r.length; t++) {
|
|
@@ -67066,7 +66944,7 @@ var NativeCurrency2 = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
67066
66944
|
}(BaseCurrency3);
|
|
67067
66945
|
function validateAndParseAddress2(address) {
|
|
67068
66946
|
try {
|
|
67069
|
-
return
|
|
66947
|
+
return import_address10.getAddress(address);
|
|
67070
66948
|
} catch (error) {
|
|
67071
66949
|
throw new Error(address + " is not a valid address.");
|
|
67072
66950
|
}
|
|
@@ -67170,18 +67048,18 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
67170
67048
|
if (input === undefined) {
|
|
67171
67049
|
input = "0x";
|
|
67172
67050
|
}
|
|
67173
|
-
var prefix2 =
|
|
67174
|
-
var inputHash =
|
|
67175
|
-
var addressBytes =
|
|
67176
|
-
return
|
|
67051
|
+
var prefix2 = import_keccak2565.keccak256(import_strings6.toUtf8Bytes("zksyncCreate2"));
|
|
67052
|
+
var inputHash = import_keccak2565.keccak256(input);
|
|
67053
|
+
var addressBytes = import_keccak2565.keccak256(import_bytes11.concat([prefix2, import_bytes11.hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
67054
|
+
return import_address10.getAddress(addressBytes);
|
|
67177
67055
|
}
|
|
67178
|
-
var
|
|
67056
|
+
var MAX_SAFE_INTEGER2 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
67179
67057
|
var ZERO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(0);
|
|
67180
67058
|
var ONE4 = /* @__PURE__ */ import_jsbi3.default.BigInt(1);
|
|
67181
67059
|
var TWO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(2);
|
|
67182
67060
|
function sqrt2(value) {
|
|
67183
67061
|
!import_jsbi3.default.greaterThanOrEqual(value, ZERO3) && invariant(false, "NEGATIVE");
|
|
67184
|
-
if (import_jsbi3.default.lessThan(value,
|
|
67062
|
+
if (import_jsbi3.default.lessThan(value, MAX_SAFE_INTEGER2)) {
|
|
67185
67063
|
return import_jsbi3.default.BigInt(Math.floor(Math.sqrt(import_jsbi3.default.toNumber(value))));
|
|
67186
67064
|
}
|
|
67187
67065
|
var z;
|
|
@@ -67198,6 +67076,7 @@ function sqrt2(value) {
|
|
|
67198
67076
|
// node_modules/@uniswap/v4-sdk/node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
67199
67077
|
var import_jsbi4 = __toESM(require_jsbi_umd(), 1);
|
|
67200
67078
|
var import_abi10 = __toESM(require_lib13(), 1);
|
|
67079
|
+
var import_address11 = __toESM(require_lib7(), 1);
|
|
67201
67080
|
var import_solidity3 = __toESM(require_lib24(), 1);
|
|
67202
67081
|
function _arrayLikeToArray2(r, a) {
|
|
67203
67082
|
(a == null || a > r.length) && (a = r.length);
|
|
@@ -67649,7 +67528,7 @@ function computePoolAddress2(_ref) {
|
|
|
67649
67528
|
case ChainId2.ZKSYNC:
|
|
67650
67529
|
return computeZksyncCreate2Address(factoryAddress, initCodeHash, salt);
|
|
67651
67530
|
default:
|
|
67652
|
-
return getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
67531
|
+
return import_address11.getCreate2Address(factoryAddress, salt, initCodeHash);
|
|
67653
67532
|
}
|
|
67654
67533
|
}
|
|
67655
67534
|
var FullMath2 = /* @__PURE__ */ function() {
|
|
@@ -71504,7 +71383,7 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
71504
71383
|
hookData = "0x",
|
|
71505
71384
|
recipient
|
|
71506
71385
|
}) => {
|
|
71507
|
-
const
|
|
71386
|
+
const getAddress8 = (currency) => {
|
|
71508
71387
|
return currency.address;
|
|
71509
71388
|
};
|
|
71510
71389
|
const commands = exports_ethers.utils.solidityPack(["uint8"], [16 /* V4_SWAP */]);
|
|
@@ -71512,15 +71391,15 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
71512
71391
|
const params = [
|
|
71513
71392
|
exports_ethers.utils.defaultAbiCoder.encode(["tuple(tuple(address,address,uint24,int24,address),bool,uint128,uint128,bytes)"], [
|
|
71514
71393
|
[
|
|
71515
|
-
[
|
|
71394
|
+
[getAddress8(pool.currency0), getAddress8(pool.currency1), pool.fee, pool.tickSpacing, pool.hooks],
|
|
71516
71395
|
zeroForOne,
|
|
71517
71396
|
amountIn,
|
|
71518
71397
|
amountOutMinimum,
|
|
71519
71398
|
hookData
|
|
71520
71399
|
]
|
|
71521
71400
|
]),
|
|
71522
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
71523
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
71401
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress8(pool.currency0) : getAddress8(pool.currency1), amountIn]),
|
|
71402
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress8(pool.currency1) : getAddress8(pool.currency0), amountOutMinimum])
|
|
71524
71403
|
];
|
|
71525
71404
|
const actionsList = [];
|
|
71526
71405
|
actionsList.push(Actions2.SWAP_EXACT_IN_SINGLE);
|
|
@@ -89586,6 +89465,13 @@ var enso_router_abi_default = [
|
|
|
89586
89465
|
// src/integrations/enso/enso.route.api.ts
|
|
89587
89466
|
var ENSO_API_BASE = "https://api.enso.finance";
|
|
89588
89467
|
|
|
89468
|
+
class EnsoApiKeyMissingError extends Error {
|
|
89469
|
+
constructor() {
|
|
89470
|
+
super("Enso API key required; pass `apiKey`.");
|
|
89471
|
+
this.name = "EnsoApiKeyMissingError";
|
|
89472
|
+
}
|
|
89473
|
+
}
|
|
89474
|
+
|
|
89589
89475
|
class EnsoRouteApiError extends Error {
|
|
89590
89476
|
status;
|
|
89591
89477
|
statusText;
|
|
@@ -89617,6 +89503,9 @@ var fetchEnsoRoute = async (args) => {
|
|
|
89617
89503
|
apiKey,
|
|
89618
89504
|
apiBase = ENSO_API_BASE
|
|
89619
89505
|
} = args;
|
|
89506
|
+
if (!apiKey) {
|
|
89507
|
+
throw new EnsoApiKeyMissingError;
|
|
89508
|
+
}
|
|
89620
89509
|
const params = new URLSearchParams({
|
|
89621
89510
|
chainId: String(chainId),
|
|
89622
89511
|
fromAddress,
|
|
@@ -89626,10 +89515,10 @@ var fetchEnsoRoute = async (args) => {
|
|
|
89626
89515
|
amountIn,
|
|
89627
89516
|
slippage: String(slippageBips)
|
|
89628
89517
|
});
|
|
89629
|
-
const headers = {
|
|
89630
|
-
|
|
89631
|
-
|
|
89632
|
-
}
|
|
89518
|
+
const headers = {
|
|
89519
|
+
Accept: "application/json",
|
|
89520
|
+
Authorization: `Bearer ${apiKey}`
|
|
89521
|
+
};
|
|
89633
89522
|
const response = await fetch(`${apiBase}/api/v1/shortcuts/route?${params.toString()}`, {
|
|
89634
89523
|
headers
|
|
89635
89524
|
});
|
|
@@ -90093,6 +89982,7 @@ export {
|
|
|
90093
89982
|
EnsoUnexpectedRouterError,
|
|
90094
89983
|
EnsoTokenType,
|
|
90095
89984
|
EnsoRouteApiError,
|
|
89985
|
+
EnsoApiKeyMissingError,
|
|
90096
89986
|
erc721_abi_default as ERC721,
|
|
90097
89987
|
ENSO_API_BASE,
|
|
90098
89988
|
DepositToLendleCalldata,
|
|
@@ -90138,4 +90028,4 @@ export {
|
|
|
90138
90028
|
AXELAR_GMP_API_MAINNET
|
|
90139
90029
|
};
|
|
90140
90030
|
|
|
90141
|
-
//# debugId=
|
|
90031
|
+
//# debugId=8C09F9D5BAB8588D64756E2164756E21
|