@dappworks/kit 0.5.22 → 0.5.23
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/{chunk-43PPHYFY.mjs → chunk-BNETRERD.mjs} +52 -530
- package/dist/chunk-BNETRERD.mjs.map +1 -0
- package/dist/{chunk-5RDWJ3BR.mjs → chunk-DCSRCD7W.mjs} +21 -20
- package/dist/chunk-DCSRCD7W.mjs.map +1 -0
- package/dist/{chunk-UNOD2CPN.mjs → chunk-HI5TZD5C.mjs} +3 -3
- package/dist/{chunk-ELOEHZQA.mjs → chunk-SNGWN2DW.mjs} +2 -2
- package/dist/dev.mjs +1 -1
- package/dist/experimental.d.mts +3 -3
- package/dist/form.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/jsontable.mjs +3 -3
- package/dist/metrics.mjs +3 -3
- package/dist/plugins.mjs +1 -1
- package/dist/ui.mjs +2 -2
- package/dist/wallet.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-43PPHYFY.mjs.map +0 -1
- package/dist/chunk-5RDWJ3BR.mjs.map +0 -1
- /package/dist/{chunk-UNOD2CPN.mjs.map → chunk-HI5TZD5C.mjs.map} +0 -0
- /package/dist/{chunk-ELOEHZQA.mjs.map → chunk-SNGWN2DW.mjs.map} +0 -0
|
@@ -6934,10 +6934,10 @@ __export(ethers_exports, {
|
|
|
6934
6934
|
constants: () => lib_exports2,
|
|
6935
6935
|
errors: () => ErrorCode,
|
|
6936
6936
|
getDefaultProvider: () => getDefaultProvider,
|
|
6937
|
-
logger: () =>
|
|
6937
|
+
logger: () => logger46,
|
|
6938
6938
|
providers: () => lib_exports4,
|
|
6939
6939
|
utils: () => utils_exports,
|
|
6940
|
-
version: () =>
|
|
6940
|
+
version: () => version26,
|
|
6941
6941
|
wordlists: () => wordlists
|
|
6942
6942
|
});
|
|
6943
6943
|
|
|
@@ -7010,10 +7010,10 @@ var ErrorCode;
|
|
|
7010
7010
|
})(ErrorCode || (ErrorCode = {}));
|
|
7011
7011
|
var HEX = "0123456789abcdef";
|
|
7012
7012
|
var Logger = class _Logger {
|
|
7013
|
-
constructor(
|
|
7013
|
+
constructor(version27) {
|
|
7014
7014
|
Object.defineProperty(this, "version", {
|
|
7015
7015
|
enumerable: true,
|
|
7016
|
-
value:
|
|
7016
|
+
value: version27,
|
|
7017
7017
|
writable: false
|
|
7018
7018
|
});
|
|
7019
7019
|
}
|
|
@@ -7225,8 +7225,8 @@ var Logger = class _Logger {
|
|
|
7225
7225
|
}
|
|
7226
7226
|
_logLevel = level;
|
|
7227
7227
|
}
|
|
7228
|
-
static from(
|
|
7229
|
-
return new _Logger(
|
|
7228
|
+
static from(version27) {
|
|
7229
|
+
return new _Logger(version27);
|
|
7230
7230
|
}
|
|
7231
7231
|
};
|
|
7232
7232
|
Logger.errors = ErrorCode;
|
|
@@ -17400,7 +17400,7 @@ function poll(func, options) {
|
|
|
17400
17400
|
var import_bech32 = __toESM(require_bech32());
|
|
17401
17401
|
|
|
17402
17402
|
// ../../node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
17403
|
-
var version23 = "providers/5.7.
|
|
17403
|
+
var version23 = "providers/5.7.2";
|
|
17404
17404
|
|
|
17405
17405
|
// ../../node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
17406
17406
|
var logger29 = new Logger(version23);
|
|
@@ -18149,17 +18149,17 @@ var Resolver = class {
|
|
|
18149
18149
|
}
|
|
18150
18150
|
if (coinInfo.prefix != null) {
|
|
18151
18151
|
const length = bytes[1];
|
|
18152
|
-
let
|
|
18153
|
-
if (
|
|
18152
|
+
let version27 = bytes[0];
|
|
18153
|
+
if (version27 === 0) {
|
|
18154
18154
|
if (length !== 20 && length !== 32) {
|
|
18155
|
-
|
|
18155
|
+
version27 = -1;
|
|
18156
18156
|
}
|
|
18157
18157
|
} else {
|
|
18158
|
-
|
|
18158
|
+
version27 = -1;
|
|
18159
18159
|
}
|
|
18160
|
-
if (
|
|
18160
|
+
if (version27 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
18161
18161
|
const words2 = import_bech32.default.toWords(bytes.slice(2));
|
|
18162
|
-
words2.unshift(
|
|
18162
|
+
words2.unshift(version27);
|
|
18163
18163
|
return import_bech32.default.encode(coinInfo.prefix, words2);
|
|
18164
18164
|
}
|
|
18165
18165
|
}
|
|
@@ -19733,7 +19733,7 @@ function checkError(method, error, params) {
|
|
|
19733
19733
|
message = error.responseText;
|
|
19734
19734
|
}
|
|
19735
19735
|
message = (message || "").toLowerCase();
|
|
19736
|
-
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
|
|
19736
|
+
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
19737
19737
|
logger31.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
19738
19738
|
error,
|
|
19739
19739
|
method,
|
|
@@ -19761,7 +19761,7 @@ function checkError(method, error, params) {
|
|
|
19761
19761
|
transaction
|
|
19762
19762
|
});
|
|
19763
19763
|
}
|
|
19764
|
-
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted/)) {
|
|
19764
|
+
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
19765
19765
|
logger31.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
19766
19766
|
error,
|
|
19767
19767
|
method,
|
|
@@ -19916,7 +19916,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
19916
19916
|
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
19917
19917
|
action: "signMessage",
|
|
19918
19918
|
from: address,
|
|
19919
|
-
|
|
19919
|
+
messageData: message
|
|
19920
19920
|
});
|
|
19921
19921
|
}
|
|
19922
19922
|
throw error;
|
|
@@ -19934,7 +19934,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
19934
19934
|
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
19935
19935
|
action: "_legacySignMessage",
|
|
19936
19936
|
from: address,
|
|
19937
|
-
|
|
19937
|
+
messageData: message
|
|
19938
19938
|
});
|
|
19939
19939
|
}
|
|
19940
19940
|
throw error;
|
|
@@ -19957,7 +19957,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
19957
19957
|
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
19958
19958
|
action: "_signTypedData",
|
|
19959
19959
|
from: address,
|
|
19960
|
-
|
|
19960
|
+
messageData: { domain: populated.domain, types, value: populated.value }
|
|
19961
19961
|
});
|
|
19962
19962
|
}
|
|
19963
19963
|
throw error;
|
|
@@ -20214,7 +20214,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
20214
20214
|
const pendingFilter = this.send("eth_newPendingTransactionFilter", []);
|
|
20215
20215
|
this._pendingFilter = pendingFilter;
|
|
20216
20216
|
pendingFilter.then(function(filterId) {
|
|
20217
|
-
function
|
|
20217
|
+
function poll2() {
|
|
20218
20218
|
self2.send("eth_getFilterChanges", [filterId]).then(function(hashes) {
|
|
20219
20219
|
if (self2._pendingFilter != pendingFilter) {
|
|
20220
20220
|
return null;
|
|
@@ -20238,13 +20238,13 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
20238
20238
|
return;
|
|
20239
20239
|
}
|
|
20240
20240
|
setTimeout(function() {
|
|
20241
|
-
|
|
20241
|
+
poll2();
|
|
20242
20242
|
}, 0);
|
|
20243
20243
|
return null;
|
|
20244
20244
|
}).catch((error) => {
|
|
20245
20245
|
});
|
|
20246
20246
|
}
|
|
20247
|
-
|
|
20247
|
+
poll2();
|
|
20248
20248
|
return filterId;
|
|
20249
20249
|
}).catch((error) => {
|
|
20250
20250
|
});
|
|
@@ -20306,9 +20306,9 @@ try {
|
|
|
20306
20306
|
throw new Error("inject please");
|
|
20307
20307
|
}
|
|
20308
20308
|
} catch (error) {
|
|
20309
|
-
const
|
|
20309
|
+
const logger47 = new Logger(version23);
|
|
20310
20310
|
WS = function() {
|
|
20311
|
-
|
|
20311
|
+
logger47.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
20312
20312
|
operation: "new WebSocket()"
|
|
20313
20313
|
});
|
|
20314
20314
|
};
|
|
@@ -20710,17 +20710,8 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
20710
20710
|
case "homestead":
|
|
20711
20711
|
host = "eth-mainnet.alchemyapi.io/v2/";
|
|
20712
20712
|
break;
|
|
20713
|
-
case "ropsten":
|
|
20714
|
-
host = "eth-ropsten.alchemyapi.io/v2/";
|
|
20715
|
-
break;
|
|
20716
|
-
case "rinkeby":
|
|
20717
|
-
host = "eth-rinkeby.alchemyapi.io/v2/";
|
|
20718
|
-
break;
|
|
20719
20713
|
case "goerli":
|
|
20720
|
-
host = "eth-goerli.
|
|
20721
|
-
break;
|
|
20722
|
-
case "kovan":
|
|
20723
|
-
host = "eth-kovan.alchemyapi.io/v2/";
|
|
20714
|
+
host = "eth-goerli.g.alchemy.com/v2/";
|
|
20724
20715
|
break;
|
|
20725
20716
|
case "matic":
|
|
20726
20717
|
host = "polygon-mainnet.g.alchemy.com/v2/";
|
|
@@ -20731,18 +20722,12 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
20731
20722
|
case "arbitrum":
|
|
20732
20723
|
host = "arb-mainnet.g.alchemy.com/v2/";
|
|
20733
20724
|
break;
|
|
20734
|
-
case "arbitrum-rinkeby":
|
|
20735
|
-
host = "arb-rinkeby.g.alchemy.com/v2/";
|
|
20736
|
-
break;
|
|
20737
20725
|
case "arbitrum-goerli":
|
|
20738
20726
|
host = "arb-goerli.g.alchemy.com/v2/";
|
|
20739
20727
|
break;
|
|
20740
20728
|
case "optimism":
|
|
20741
20729
|
host = "opt-mainnet.g.alchemy.com/v2/";
|
|
20742
20730
|
break;
|
|
20743
|
-
case "optimism-kovan":
|
|
20744
|
-
host = "opt-kovan.g.alchemy.com/v2/";
|
|
20745
|
-
break;
|
|
20746
20731
|
case "optimism-goerli":
|
|
20747
20732
|
host = "opt-goerli.g.alchemy.com/v2/";
|
|
20748
20733
|
break;
|
|
@@ -21045,18 +21030,22 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
21045
21030
|
switch (this.network ? this.network.name : "invalid") {
|
|
21046
21031
|
case "homestead":
|
|
21047
21032
|
return "https://api.etherscan.io";
|
|
21048
|
-
case "ropsten":
|
|
21049
|
-
return "https://api-ropsten.etherscan.io";
|
|
21050
|
-
case "rinkeby":
|
|
21051
|
-
return "https://api-rinkeby.etherscan.io";
|
|
21052
|
-
case "kovan":
|
|
21053
|
-
return "https://api-kovan.etherscan.io";
|
|
21054
21033
|
case "goerli":
|
|
21055
21034
|
return "https://api-goerli.etherscan.io";
|
|
21035
|
+
case "sepolia":
|
|
21036
|
+
return "https://api-sepolia.etherscan.io";
|
|
21037
|
+
case "matic":
|
|
21038
|
+
return "https://api.polygonscan.com";
|
|
21039
|
+
case "maticmum":
|
|
21040
|
+
return "https://api-testnet.polygonscan.com";
|
|
21041
|
+
case "arbitrum":
|
|
21042
|
+
return "https://api.arbiscan.io";
|
|
21043
|
+
case "arbitrum-goerli":
|
|
21044
|
+
return "https://api-goerli.arbiscan.io";
|
|
21056
21045
|
case "optimism":
|
|
21057
21046
|
return "https://api-optimistic.etherscan.io";
|
|
21058
|
-
case "optimism-
|
|
21059
|
-
return "https://api-
|
|
21047
|
+
case "optimism-goerli":
|
|
21048
|
+
return "https://api-goerli-optimistic.etherscan.io";
|
|
21060
21049
|
}
|
|
21061
21050
|
return logger37.throwArgumentError("unsupported network", "network", this.network.name);
|
|
21062
21051
|
}
|
|
@@ -21876,18 +21865,12 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
21876
21865
|
case "homestead":
|
|
21877
21866
|
host = "mainnet.infura.io";
|
|
21878
21867
|
break;
|
|
21879
|
-
case "ropsten":
|
|
21880
|
-
host = "ropsten.infura.io";
|
|
21881
|
-
break;
|
|
21882
|
-
case "rinkeby":
|
|
21883
|
-
host = "rinkeby.infura.io";
|
|
21884
|
-
break;
|
|
21885
|
-
case "kovan":
|
|
21886
|
-
host = "kovan.infura.io";
|
|
21887
|
-
break;
|
|
21888
21868
|
case "goerli":
|
|
21889
21869
|
host = "goerli.infura.io";
|
|
21890
21870
|
break;
|
|
21871
|
+
case "sepolia":
|
|
21872
|
+
host = "sepolia.infura.io";
|
|
21873
|
+
break;
|
|
21891
21874
|
case "matic":
|
|
21892
21875
|
host = "polygon-mainnet.infura.io";
|
|
21893
21876
|
break;
|
|
@@ -21897,14 +21880,14 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
21897
21880
|
case "optimism":
|
|
21898
21881
|
host = "optimism-mainnet.infura.io";
|
|
21899
21882
|
break;
|
|
21900
|
-
case "optimism-
|
|
21901
|
-
host = "optimism-
|
|
21883
|
+
case "optimism-goerli":
|
|
21884
|
+
host = "optimism-goerli.infura.io";
|
|
21902
21885
|
break;
|
|
21903
21886
|
case "arbitrum":
|
|
21904
21887
|
host = "arbitrum-mainnet.infura.io";
|
|
21905
21888
|
break;
|
|
21906
|
-
case "arbitrum-
|
|
21907
|
-
host = "arbitrum-
|
|
21889
|
+
case "arbitrum-goerli":
|
|
21890
|
+
host = "arbitrum-goerli.infura.io";
|
|
21908
21891
|
break;
|
|
21909
21892
|
default:
|
|
21910
21893
|
logger39.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
@@ -22291,7 +22274,7 @@ __export(utils_exports, {
|
|
|
22291
22274
|
Utf8ErrorFuncs: () => Utf8ErrorFuncs,
|
|
22292
22275
|
Utf8ErrorReason: () => Utf8ErrorReason,
|
|
22293
22276
|
_TypedDataEncoder: () => TypedDataEncoder,
|
|
22294
|
-
_fetchData: () =>
|
|
22277
|
+
_fetchData: () => _fetchData,
|
|
22295
22278
|
_toEscapedUtf8String: () => _toEscapedUtf8String,
|
|
22296
22279
|
accessListify: () => accessListify,
|
|
22297
22280
|
arrayify: () => arrayify,
|
|
@@ -22310,7 +22293,7 @@ __export(utils_exports, {
|
|
|
22310
22293
|
defineReadOnly: () => defineReadOnly,
|
|
22311
22294
|
dnsEncode: () => dnsEncode,
|
|
22312
22295
|
entropyToMnemonic: () => entropyToMnemonic,
|
|
22313
|
-
fetchJson: () =>
|
|
22296
|
+
fetchJson: () => fetchJson,
|
|
22314
22297
|
formatBytes32String: () => formatBytes32String,
|
|
22315
22298
|
formatEther: () => formatEther,
|
|
22316
22299
|
formatUnits: () => formatUnits,
|
|
@@ -22346,7 +22329,7 @@ __export(utils_exports, {
|
|
|
22346
22329
|
parseEther: () => parseEther,
|
|
22347
22330
|
parseTransaction: () => parse,
|
|
22348
22331
|
parseUnits: () => parseUnits,
|
|
22349
|
-
poll: () =>
|
|
22332
|
+
poll: () => poll,
|
|
22350
22333
|
randomBytes: () => randomBytes,
|
|
22351
22334
|
recoverAddress: () => recoverAddress,
|
|
22352
22335
|
recoverPublicKey: () => recoverPublicKey,
|
|
@@ -22534,473 +22517,11 @@ function parseEther(ether) {
|
|
|
22534
22517
|
return parseUnits(ether, 18);
|
|
22535
22518
|
}
|
|
22536
22519
|
|
|
22537
|
-
// ../../node_modules/ethers/node_modules/@ethersproject/web/lib.esm/_version.js
|
|
22538
|
-
var version26 = "web/5.7.0";
|
|
22539
|
-
|
|
22540
|
-
// ../../node_modules/ethers/node_modules/@ethersproject/web/lib.esm/geturl.js
|
|
22541
|
-
var __awaiter17 = function(thisArg, _arguments, P, generator) {
|
|
22542
|
-
function adopt(value) {
|
|
22543
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
22544
|
-
resolve(value);
|
|
22545
|
-
});
|
|
22546
|
-
}
|
|
22547
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22548
|
-
function fulfilled(value) {
|
|
22549
|
-
try {
|
|
22550
|
-
step(generator.next(value));
|
|
22551
|
-
} catch (e) {
|
|
22552
|
-
reject(e);
|
|
22553
|
-
}
|
|
22554
|
-
}
|
|
22555
|
-
function rejected(value) {
|
|
22556
|
-
try {
|
|
22557
|
-
step(generator["throw"](value));
|
|
22558
|
-
} catch (e) {
|
|
22559
|
-
reject(e);
|
|
22560
|
-
}
|
|
22561
|
-
}
|
|
22562
|
-
function step(result) {
|
|
22563
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22564
|
-
}
|
|
22565
|
-
step((generator = generator.apply(thisArg, [])).next());
|
|
22566
|
-
});
|
|
22567
|
-
};
|
|
22568
|
-
function getUrl2(href, options) {
|
|
22569
|
-
return __awaiter17(this, void 0, void 0, function* () {
|
|
22570
|
-
if (options == null) {
|
|
22571
|
-
options = {};
|
|
22572
|
-
}
|
|
22573
|
-
const request = {
|
|
22574
|
-
method: options.method || "GET",
|
|
22575
|
-
headers: options.headers || {},
|
|
22576
|
-
body: options.body || void 0
|
|
22577
|
-
};
|
|
22578
|
-
if (options.skipFetchSetup !== true) {
|
|
22579
|
-
request.mode = "cors";
|
|
22580
|
-
request.cache = "no-cache";
|
|
22581
|
-
request.credentials = "same-origin";
|
|
22582
|
-
request.redirect = "follow";
|
|
22583
|
-
request.referrer = "client";
|
|
22584
|
-
}
|
|
22585
|
-
if (options.fetchOptions != null) {
|
|
22586
|
-
const opts = options.fetchOptions;
|
|
22587
|
-
if (opts.mode) {
|
|
22588
|
-
request.mode = opts.mode;
|
|
22589
|
-
}
|
|
22590
|
-
if (opts.cache) {
|
|
22591
|
-
request.cache = opts.cache;
|
|
22592
|
-
}
|
|
22593
|
-
if (opts.credentials) {
|
|
22594
|
-
request.credentials = opts.credentials;
|
|
22595
|
-
}
|
|
22596
|
-
if (opts.redirect) {
|
|
22597
|
-
request.redirect = opts.redirect;
|
|
22598
|
-
}
|
|
22599
|
-
if (opts.referrer) {
|
|
22600
|
-
request.referrer = opts.referrer;
|
|
22601
|
-
}
|
|
22602
|
-
}
|
|
22603
|
-
const response = yield fetch(href, request);
|
|
22604
|
-
const body = yield response.arrayBuffer();
|
|
22605
|
-
const headers = {};
|
|
22606
|
-
if (response.headers.forEach) {
|
|
22607
|
-
response.headers.forEach((value, key2) => {
|
|
22608
|
-
headers[key2.toLowerCase()] = value;
|
|
22609
|
-
});
|
|
22610
|
-
} else {
|
|
22611
|
-
response.headers.keys().forEach((key2) => {
|
|
22612
|
-
headers[key2.toLowerCase()] = response.headers.get(key2);
|
|
22613
|
-
});
|
|
22614
|
-
}
|
|
22615
|
-
return {
|
|
22616
|
-
headers,
|
|
22617
|
-
statusCode: response.status,
|
|
22618
|
-
statusMessage: response.statusText,
|
|
22619
|
-
body: arrayify(new Uint8Array(body))
|
|
22620
|
-
};
|
|
22621
|
-
});
|
|
22622
|
-
}
|
|
22623
|
-
|
|
22624
|
-
// ../../node_modules/ethers/node_modules/@ethersproject/web/lib.esm/index.js
|
|
22625
|
-
var __awaiter18 = function(thisArg, _arguments, P, generator) {
|
|
22626
|
-
function adopt(value) {
|
|
22627
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
22628
|
-
resolve(value);
|
|
22629
|
-
});
|
|
22630
|
-
}
|
|
22631
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22632
|
-
function fulfilled(value) {
|
|
22633
|
-
try {
|
|
22634
|
-
step(generator.next(value));
|
|
22635
|
-
} catch (e) {
|
|
22636
|
-
reject(e);
|
|
22637
|
-
}
|
|
22638
|
-
}
|
|
22639
|
-
function rejected(value) {
|
|
22640
|
-
try {
|
|
22641
|
-
step(generator["throw"](value));
|
|
22642
|
-
} catch (e) {
|
|
22643
|
-
reject(e);
|
|
22644
|
-
}
|
|
22645
|
-
}
|
|
22646
|
-
function step(result) {
|
|
22647
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22648
|
-
}
|
|
22649
|
-
step((generator = generator.apply(thisArg, [])).next());
|
|
22650
|
-
});
|
|
22651
|
-
};
|
|
22652
|
-
var logger46 = new Logger(version26);
|
|
22653
|
-
function staller2(duration) {
|
|
22654
|
-
return new Promise((resolve) => {
|
|
22655
|
-
setTimeout(resolve, duration);
|
|
22656
|
-
});
|
|
22657
|
-
}
|
|
22658
|
-
function bodyify2(value, type) {
|
|
22659
|
-
if (value == null) {
|
|
22660
|
-
return null;
|
|
22661
|
-
}
|
|
22662
|
-
if (typeof value === "string") {
|
|
22663
|
-
return value;
|
|
22664
|
-
}
|
|
22665
|
-
if (isBytesLike(value)) {
|
|
22666
|
-
if (type && (type.split("/")[0] === "text" || type.split(";")[0].trim() === "application/json")) {
|
|
22667
|
-
try {
|
|
22668
|
-
return toUtf8String(value);
|
|
22669
|
-
} catch (error) {
|
|
22670
|
-
}
|
|
22671
|
-
}
|
|
22672
|
-
return hexlify(value);
|
|
22673
|
-
}
|
|
22674
|
-
return value;
|
|
22675
|
-
}
|
|
22676
|
-
function _fetchData2(connection, body, processFunc) {
|
|
22677
|
-
const attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
22678
|
-
logger46.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
22679
|
-
const throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
|
|
22680
|
-
const throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
|
|
22681
|
-
logger46.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
22682
|
-
const errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
|
|
22683
|
-
const headers = {};
|
|
22684
|
-
let url = null;
|
|
22685
|
-
const options = {
|
|
22686
|
-
method: "GET"
|
|
22687
|
-
};
|
|
22688
|
-
let allow304 = false;
|
|
22689
|
-
let timeout = 2 * 60 * 1e3;
|
|
22690
|
-
if (typeof connection === "string") {
|
|
22691
|
-
url = connection;
|
|
22692
|
-
} else if (typeof connection === "object") {
|
|
22693
|
-
if (connection == null || connection.url == null) {
|
|
22694
|
-
logger46.throwArgumentError("missing URL", "connection.url", connection);
|
|
22695
|
-
}
|
|
22696
|
-
url = connection.url;
|
|
22697
|
-
if (typeof connection.timeout === "number" && connection.timeout > 0) {
|
|
22698
|
-
timeout = connection.timeout;
|
|
22699
|
-
}
|
|
22700
|
-
if (connection.headers) {
|
|
22701
|
-
for (const key2 in connection.headers) {
|
|
22702
|
-
headers[key2.toLowerCase()] = { key: key2, value: String(connection.headers[key2]) };
|
|
22703
|
-
if (["if-none-match", "if-modified-since"].indexOf(key2.toLowerCase()) >= 0) {
|
|
22704
|
-
allow304 = true;
|
|
22705
|
-
}
|
|
22706
|
-
}
|
|
22707
|
-
}
|
|
22708
|
-
options.allowGzip = !!connection.allowGzip;
|
|
22709
|
-
if (connection.user != null && connection.password != null) {
|
|
22710
|
-
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
22711
|
-
logger46.throwError("basic authentication requires a secure https url", Logger.errors.INVALID_ARGUMENT, { argument: "url", url, user: connection.user, password: "[REDACTED]" });
|
|
22712
|
-
}
|
|
22713
|
-
const authorization = connection.user + ":" + connection.password;
|
|
22714
|
-
headers["authorization"] = {
|
|
22715
|
-
key: "Authorization",
|
|
22716
|
-
value: "Basic " + encode2(toUtf8Bytes(authorization))
|
|
22717
|
-
};
|
|
22718
|
-
}
|
|
22719
|
-
if (connection.skipFetchSetup != null) {
|
|
22720
|
-
options.skipFetchSetup = !!connection.skipFetchSetup;
|
|
22721
|
-
}
|
|
22722
|
-
if (connection.fetchOptions != null) {
|
|
22723
|
-
options.fetchOptions = shallowCopy(connection.fetchOptions);
|
|
22724
|
-
}
|
|
22725
|
-
}
|
|
22726
|
-
const reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i");
|
|
22727
|
-
const dataMatch = url ? url.match(reData) : null;
|
|
22728
|
-
if (dataMatch) {
|
|
22729
|
-
try {
|
|
22730
|
-
const response = {
|
|
22731
|
-
statusCode: 200,
|
|
22732
|
-
statusMessage: "OK",
|
|
22733
|
-
headers: { "content-type": dataMatch[1] },
|
|
22734
|
-
body: decode2(dataMatch[2])
|
|
22735
|
-
};
|
|
22736
|
-
let result = response.body;
|
|
22737
|
-
if (processFunc) {
|
|
22738
|
-
result = processFunc(response.body, response);
|
|
22739
|
-
}
|
|
22740
|
-
return Promise.resolve(result);
|
|
22741
|
-
} catch (error) {
|
|
22742
|
-
logger46.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
22743
|
-
body: bodyify2(dataMatch[1], dataMatch[2]),
|
|
22744
|
-
error,
|
|
22745
|
-
requestBody: null,
|
|
22746
|
-
requestMethod: "GET",
|
|
22747
|
-
url
|
|
22748
|
-
});
|
|
22749
|
-
}
|
|
22750
|
-
}
|
|
22751
|
-
if (body) {
|
|
22752
|
-
options.method = "POST";
|
|
22753
|
-
options.body = body;
|
|
22754
|
-
if (headers["content-type"] == null) {
|
|
22755
|
-
headers["content-type"] = { key: "Content-Type", value: "application/octet-stream" };
|
|
22756
|
-
}
|
|
22757
|
-
if (headers["content-length"] == null) {
|
|
22758
|
-
headers["content-length"] = { key: "Content-Length", value: String(body.length) };
|
|
22759
|
-
}
|
|
22760
|
-
}
|
|
22761
|
-
const flatHeaders = {};
|
|
22762
|
-
Object.keys(headers).forEach((key2) => {
|
|
22763
|
-
const header = headers[key2];
|
|
22764
|
-
flatHeaders[header.key] = header.value;
|
|
22765
|
-
});
|
|
22766
|
-
options.headers = flatHeaders;
|
|
22767
|
-
const runningTimeout = function() {
|
|
22768
|
-
let timer2 = null;
|
|
22769
|
-
const promise = new Promise(function(resolve, reject) {
|
|
22770
|
-
if (timeout) {
|
|
22771
|
-
timer2 = setTimeout(() => {
|
|
22772
|
-
if (timer2 == null) {
|
|
22773
|
-
return;
|
|
22774
|
-
}
|
|
22775
|
-
timer2 = null;
|
|
22776
|
-
reject(logger46.makeError("timeout", Logger.errors.TIMEOUT, {
|
|
22777
|
-
requestBody: bodyify2(options.body, flatHeaders["content-type"]),
|
|
22778
|
-
requestMethod: options.method,
|
|
22779
|
-
timeout,
|
|
22780
|
-
url
|
|
22781
|
-
}));
|
|
22782
|
-
}, timeout);
|
|
22783
|
-
}
|
|
22784
|
-
});
|
|
22785
|
-
const cancel = function() {
|
|
22786
|
-
if (timer2 == null) {
|
|
22787
|
-
return;
|
|
22788
|
-
}
|
|
22789
|
-
clearTimeout(timer2);
|
|
22790
|
-
timer2 = null;
|
|
22791
|
-
};
|
|
22792
|
-
return { promise, cancel };
|
|
22793
|
-
}();
|
|
22794
|
-
const runningFetch = function() {
|
|
22795
|
-
return __awaiter18(this, void 0, void 0, function* () {
|
|
22796
|
-
for (let attempt = 0; attempt < attemptLimit; attempt++) {
|
|
22797
|
-
let response = null;
|
|
22798
|
-
try {
|
|
22799
|
-
response = yield getUrl2(url, options);
|
|
22800
|
-
if (attempt < attemptLimit) {
|
|
22801
|
-
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
22802
|
-
const location = response.headers.location || "";
|
|
22803
|
-
if (options.method === "GET" && location.match(/^https:/)) {
|
|
22804
|
-
url = response.headers.location;
|
|
22805
|
-
continue;
|
|
22806
|
-
}
|
|
22807
|
-
} else if (response.statusCode === 429) {
|
|
22808
|
-
let tryAgain = true;
|
|
22809
|
-
if (throttleCallback) {
|
|
22810
|
-
tryAgain = yield throttleCallback(attempt, url);
|
|
22811
|
-
}
|
|
22812
|
-
if (tryAgain) {
|
|
22813
|
-
let stall3 = 0;
|
|
22814
|
-
const retryAfter = response.headers["retry-after"];
|
|
22815
|
-
if (typeof retryAfter === "string" && retryAfter.match(/^[1-9][0-9]*$/)) {
|
|
22816
|
-
stall3 = parseInt(retryAfter) * 1e3;
|
|
22817
|
-
} else {
|
|
22818
|
-
stall3 = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
|
|
22819
|
-
}
|
|
22820
|
-
yield staller2(stall3);
|
|
22821
|
-
continue;
|
|
22822
|
-
}
|
|
22823
|
-
}
|
|
22824
|
-
}
|
|
22825
|
-
} catch (error) {
|
|
22826
|
-
response = error.response;
|
|
22827
|
-
if (response == null) {
|
|
22828
|
-
runningTimeout.cancel();
|
|
22829
|
-
logger46.throwError("missing response", Logger.errors.SERVER_ERROR, {
|
|
22830
|
-
requestBody: bodyify2(options.body, flatHeaders["content-type"]),
|
|
22831
|
-
requestMethod: options.method,
|
|
22832
|
-
serverError: error,
|
|
22833
|
-
url
|
|
22834
|
-
});
|
|
22835
|
-
}
|
|
22836
|
-
}
|
|
22837
|
-
let body2 = response.body;
|
|
22838
|
-
if (allow304 && response.statusCode === 304) {
|
|
22839
|
-
body2 = null;
|
|
22840
|
-
} else if (!errorPassThrough && (response.statusCode < 200 || response.statusCode >= 300)) {
|
|
22841
|
-
runningTimeout.cancel();
|
|
22842
|
-
logger46.throwError("bad response", Logger.errors.SERVER_ERROR, {
|
|
22843
|
-
status: response.statusCode,
|
|
22844
|
-
headers: response.headers,
|
|
22845
|
-
body: bodyify2(body2, response.headers ? response.headers["content-type"] : null),
|
|
22846
|
-
requestBody: bodyify2(options.body, flatHeaders["content-type"]),
|
|
22847
|
-
requestMethod: options.method,
|
|
22848
|
-
url
|
|
22849
|
-
});
|
|
22850
|
-
}
|
|
22851
|
-
if (processFunc) {
|
|
22852
|
-
try {
|
|
22853
|
-
const result = yield processFunc(body2, response);
|
|
22854
|
-
runningTimeout.cancel();
|
|
22855
|
-
return result;
|
|
22856
|
-
} catch (error) {
|
|
22857
|
-
if (error.throttleRetry && attempt < attemptLimit) {
|
|
22858
|
-
let tryAgain = true;
|
|
22859
|
-
if (throttleCallback) {
|
|
22860
|
-
tryAgain = yield throttleCallback(attempt, url);
|
|
22861
|
-
}
|
|
22862
|
-
if (tryAgain) {
|
|
22863
|
-
const timeout2 = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
|
|
22864
|
-
yield staller2(timeout2);
|
|
22865
|
-
continue;
|
|
22866
|
-
}
|
|
22867
|
-
}
|
|
22868
|
-
runningTimeout.cancel();
|
|
22869
|
-
logger46.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
22870
|
-
body: bodyify2(body2, response.headers ? response.headers["content-type"] : null),
|
|
22871
|
-
error,
|
|
22872
|
-
requestBody: bodyify2(options.body, flatHeaders["content-type"]),
|
|
22873
|
-
requestMethod: options.method,
|
|
22874
|
-
url
|
|
22875
|
-
});
|
|
22876
|
-
}
|
|
22877
|
-
}
|
|
22878
|
-
runningTimeout.cancel();
|
|
22879
|
-
return body2;
|
|
22880
|
-
}
|
|
22881
|
-
return logger46.throwError("failed response", Logger.errors.SERVER_ERROR, {
|
|
22882
|
-
requestBody: bodyify2(options.body, flatHeaders["content-type"]),
|
|
22883
|
-
requestMethod: options.method,
|
|
22884
|
-
url
|
|
22885
|
-
});
|
|
22886
|
-
});
|
|
22887
|
-
}();
|
|
22888
|
-
return Promise.race([runningTimeout.promise, runningFetch]);
|
|
22889
|
-
}
|
|
22890
|
-
function fetchJson2(connection, json, processFunc) {
|
|
22891
|
-
let processJsonFunc = (value, response) => {
|
|
22892
|
-
let result = null;
|
|
22893
|
-
if (value != null) {
|
|
22894
|
-
try {
|
|
22895
|
-
result = JSON.parse(toUtf8String(value));
|
|
22896
|
-
} catch (error) {
|
|
22897
|
-
logger46.throwError("invalid JSON", Logger.errors.SERVER_ERROR, {
|
|
22898
|
-
body: value,
|
|
22899
|
-
error
|
|
22900
|
-
});
|
|
22901
|
-
}
|
|
22902
|
-
}
|
|
22903
|
-
if (processFunc) {
|
|
22904
|
-
result = processFunc(result, response);
|
|
22905
|
-
}
|
|
22906
|
-
return result;
|
|
22907
|
-
};
|
|
22908
|
-
let body = null;
|
|
22909
|
-
if (json != null) {
|
|
22910
|
-
body = toUtf8Bytes(json);
|
|
22911
|
-
const updated = typeof connection === "string" ? { url: connection } : shallowCopy(connection);
|
|
22912
|
-
if (updated.headers) {
|
|
22913
|
-
const hasContentType = Object.keys(updated.headers).filter((k) => k.toLowerCase() === "content-type").length !== 0;
|
|
22914
|
-
if (!hasContentType) {
|
|
22915
|
-
updated.headers = shallowCopy(updated.headers);
|
|
22916
|
-
updated.headers["content-type"] = "application/json";
|
|
22917
|
-
}
|
|
22918
|
-
} else {
|
|
22919
|
-
updated.headers = { "content-type": "application/json" };
|
|
22920
|
-
}
|
|
22921
|
-
connection = updated;
|
|
22922
|
-
}
|
|
22923
|
-
return _fetchData2(connection, body, processJsonFunc);
|
|
22924
|
-
}
|
|
22925
|
-
function poll2(func, options) {
|
|
22926
|
-
if (!options) {
|
|
22927
|
-
options = {};
|
|
22928
|
-
}
|
|
22929
|
-
options = shallowCopy(options);
|
|
22930
|
-
if (options.floor == null) {
|
|
22931
|
-
options.floor = 0;
|
|
22932
|
-
}
|
|
22933
|
-
if (options.ceiling == null) {
|
|
22934
|
-
options.ceiling = 1e4;
|
|
22935
|
-
}
|
|
22936
|
-
if (options.interval == null) {
|
|
22937
|
-
options.interval = 250;
|
|
22938
|
-
}
|
|
22939
|
-
return new Promise(function(resolve, reject) {
|
|
22940
|
-
let timer2 = null;
|
|
22941
|
-
let done = false;
|
|
22942
|
-
const cancel = () => {
|
|
22943
|
-
if (done) {
|
|
22944
|
-
return false;
|
|
22945
|
-
}
|
|
22946
|
-
done = true;
|
|
22947
|
-
if (timer2) {
|
|
22948
|
-
clearTimeout(timer2);
|
|
22949
|
-
}
|
|
22950
|
-
return true;
|
|
22951
|
-
};
|
|
22952
|
-
if (options.timeout) {
|
|
22953
|
-
timer2 = setTimeout(() => {
|
|
22954
|
-
if (cancel()) {
|
|
22955
|
-
reject(new Error("timeout"));
|
|
22956
|
-
}
|
|
22957
|
-
}, options.timeout);
|
|
22958
|
-
}
|
|
22959
|
-
const retryLimit = options.retryLimit;
|
|
22960
|
-
let attempt = 0;
|
|
22961
|
-
function check() {
|
|
22962
|
-
return func().then(function(result) {
|
|
22963
|
-
if (result !== void 0) {
|
|
22964
|
-
if (cancel()) {
|
|
22965
|
-
resolve(result);
|
|
22966
|
-
}
|
|
22967
|
-
} else if (options.oncePoll) {
|
|
22968
|
-
options.oncePoll.once("poll", check);
|
|
22969
|
-
} else if (options.onceBlock) {
|
|
22970
|
-
options.onceBlock.once("block", check);
|
|
22971
|
-
} else if (!done) {
|
|
22972
|
-
attempt++;
|
|
22973
|
-
if (attempt > retryLimit) {
|
|
22974
|
-
if (cancel()) {
|
|
22975
|
-
reject(new Error("retry limit reached"));
|
|
22976
|
-
}
|
|
22977
|
-
return;
|
|
22978
|
-
}
|
|
22979
|
-
let timeout = options.interval * parseInt(String(Math.random() * Math.pow(2, attempt)));
|
|
22980
|
-
if (timeout < options.floor) {
|
|
22981
|
-
timeout = options.floor;
|
|
22982
|
-
}
|
|
22983
|
-
if (timeout > options.ceiling) {
|
|
22984
|
-
timeout = options.ceiling;
|
|
22985
|
-
}
|
|
22986
|
-
setTimeout(check, timeout);
|
|
22987
|
-
}
|
|
22988
|
-
return null;
|
|
22989
|
-
}, function(error) {
|
|
22990
|
-
if (cancel()) {
|
|
22991
|
-
reject(error);
|
|
22992
|
-
}
|
|
22993
|
-
});
|
|
22994
|
-
}
|
|
22995
|
-
check();
|
|
22996
|
-
});
|
|
22997
|
-
}
|
|
22998
|
-
|
|
22999
22520
|
// ../../node_modules/ethers/lib.esm/_version.js
|
|
23000
|
-
var
|
|
22521
|
+
var version26 = "ethers/5.7.2";
|
|
23001
22522
|
|
|
23002
22523
|
// ../../node_modules/ethers/lib.esm/ethers.js
|
|
23003
|
-
var
|
|
22524
|
+
var logger46 = new Logger(version26);
|
|
23004
22525
|
|
|
23005
22526
|
// ../../node_modules/ethers/lib.esm/index.js
|
|
23006
22527
|
try {
|
|
@@ -23551,17 +23072,18 @@ var WalletStore = class _WalletStore {
|
|
|
23551
23072
|
}
|
|
23552
23073
|
return receipt;
|
|
23553
23074
|
} catch (error) {
|
|
23554
|
-
console.log(error, "xty");
|
|
23555
23075
|
toast.dismiss();
|
|
23556
23076
|
onError == null ? void 0 : onError(error);
|
|
23557
|
-
console.log(error
|
|
23077
|
+
console.log(error);
|
|
23558
23078
|
/reason="[A-Za-z0-9_ :"]*/g.exec(error == null ? void 0 : error.message);
|
|
23559
23079
|
if (((_a = error == null ? void 0 : error.message) == null ? void 0 : _a.includes("rejected")) || ((_b = error == null ? void 0 : error.message) == null ? void 0 : _b.includes("cancel")) || String(error).toLowerCase().includes("rejected") || String(error).toLowerCase().includes("user denied")) {
|
|
23560
23080
|
autoAlert && toast.error("User rejected transaction");
|
|
23081
|
+
onError == null ? void 0 : onError(error);
|
|
23561
23082
|
return;
|
|
23562
23083
|
}
|
|
23563
23084
|
if ((_c = error == null ? void 0 : error.message) == null ? void 0 : _c.includes("Price slippage check")) {
|
|
23564
23085
|
autoAlert && toast.error("The latest pool price has changed, please try to increase the slippage tolerance or reload the page.");
|
|
23086
|
+
onError == null ? void 0 : onError(error);
|
|
23565
23087
|
return;
|
|
23566
23088
|
}
|
|
23567
23089
|
if (error == null ? void 0 : error.message.includes("viem")) {
|
|
@@ -23677,4 +23199,4 @@ js-sha3/src/sha3.js:
|
|
|
23677
23199
|
|
|
23678
23200
|
export { AppProvider, AutoMan, BigNumberInputState, BigNumberState, ConnectLedger, DisconnectLedger, ObjectPool, PromiseHook, StorageListState, StorageState, WalletConfigStore, WalletHistoryStore, WalletRpcStore, WalletStore };
|
|
23679
23201
|
//# sourceMappingURL=out.js.map
|
|
23680
|
-
//# sourceMappingURL=chunk-
|
|
23202
|
+
//# sourceMappingURL=chunk-BNETRERD.mjs.map
|