@dappworks/kit 0.5.16 → 0.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PromiseState-Bu2EgqSY.d.ts → PromiseState-CmvDXcdg.d.ts} +2 -1
- package/dist/{chunk-FF4WXUZW.mjs → chunk-5RDWJ3BR.mjs} +9 -10
- package/dist/chunk-5RDWJ3BR.mjs.map +1 -0
- package/dist/{chunk-TFZQGO6G.mjs → chunk-ELOEHZQA.mjs} +2 -2
- package/dist/{chunk-43PPHYFY.mjs → chunk-I3PECBV3.mjs} +31 -505
- package/dist/chunk-I3PECBV3.mjs.map +1 -0
- package/dist/{chunk-TSUKTLY3.mjs → chunk-TEGU7RN3.mjs} +10 -5
- package/dist/chunk-TEGU7RN3.mjs.map +1 -0
- package/dist/{chunk-YUBFWA4C.mjs → chunk-UNOD2CPN.mjs} +3 -3
- package/dist/dev.mjs +1 -1
- package/dist/experimental.mjs +1 -1
- package/dist/form.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/jsontable.mjs +3 -3
- package/dist/metrics.mjs +3 -3
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +1 -1
- package/dist/ui.mjs +2 -2
- package/dist/wallet.mjs +3 -3
- package/package.json +2 -2
- package/dist/chunk-43PPHYFY.mjs.map +0 -1
- package/dist/chunk-FF4WXUZW.mjs.map +0 -1
- package/dist/chunk-TSUKTLY3.mjs.map +0 -1
- /package/dist/{chunk-TFZQGO6G.mjs.map → chunk-ELOEHZQA.mjs.map} +0 -0
- /package/dist/{chunk-YUBFWA4C.mjs.map → chunk-UNOD2CPN.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;
|
|
@@ -16701,7 +16701,7 @@ __export(lib_exports4, {
|
|
|
16701
16701
|
});
|
|
16702
16702
|
|
|
16703
16703
|
// ../../node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
16704
|
-
var version21 = "networks/5.7.
|
|
16704
|
+
var version21 = "networks/5.7.0";
|
|
16705
16705
|
|
|
16706
16706
|
// ../../node_modules/@ethersproject/networks/lib.esm/index.js
|
|
16707
16707
|
var logger27 = new Logger(version21);
|
|
@@ -16733,7 +16733,7 @@ function ethDefaultProvider(network) {
|
|
|
16733
16733
|
}
|
|
16734
16734
|
}
|
|
16735
16735
|
if (providers.PocketProvider && options.pocket !== "-") {
|
|
16736
|
-
const skip = ["goerli", "ropsten", "rinkeby"
|
|
16736
|
+
const skip = ["goerli", "ropsten", "rinkeby"];
|
|
16737
16737
|
try {
|
|
16738
16738
|
const provider = new providers.PocketProvider(network, options.pocket);
|
|
16739
16739
|
if (provider.network && skip.indexOf(provider.network.name) === -1) {
|
|
@@ -16831,11 +16831,6 @@ var networks = {
|
|
|
16831
16831
|
_defaultProvider: ethDefaultProvider("goerli")
|
|
16832
16832
|
},
|
|
16833
16833
|
kintsugi: { chainId: 1337702, name: "kintsugi" },
|
|
16834
|
-
sepolia: {
|
|
16835
|
-
chainId: 11155111,
|
|
16836
|
-
name: "sepolia",
|
|
16837
|
-
_defaultProvider: ethDefaultProvider("sepolia")
|
|
16838
|
-
},
|
|
16839
16834
|
// ETC (See: #351)
|
|
16840
16835
|
classic: {
|
|
16841
16836
|
chainId: 61,
|
|
@@ -16930,7 +16925,7 @@ function getNetwork(network) {
|
|
|
16930
16925
|
}
|
|
16931
16926
|
|
|
16932
16927
|
// ../../node_modules/@ethersproject/web/lib.esm/_version.js
|
|
16933
|
-
var version22 = "web/5.7.
|
|
16928
|
+
var version22 = "web/5.7.0";
|
|
16934
16929
|
|
|
16935
16930
|
// ../../node_modules/@ethersproject/web/lib.esm/geturl.js
|
|
16936
16931
|
var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
@@ -17068,11 +17063,6 @@ function bodyify(value, type) {
|
|
|
17068
17063
|
}
|
|
17069
17064
|
return value;
|
|
17070
17065
|
}
|
|
17071
|
-
function unpercent(value) {
|
|
17072
|
-
return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {
|
|
17073
|
-
return String.fromCharCode(parseInt(code, 16));
|
|
17074
|
-
}));
|
|
17075
|
-
}
|
|
17076
17066
|
function _fetchData(connection, body, processFunc) {
|
|
17077
17067
|
const attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
17078
17068
|
logger28.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
@@ -17123,15 +17113,15 @@ function _fetchData(connection, body, processFunc) {
|
|
|
17123
17113
|
options.fetchOptions = shallowCopy(connection.fetchOptions);
|
|
17124
17114
|
}
|
|
17125
17115
|
}
|
|
17126
|
-
const reData = new RegExp("^data:([
|
|
17116
|
+
const reData = new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$", "i");
|
|
17127
17117
|
const dataMatch = url ? url.match(reData) : null;
|
|
17128
17118
|
if (dataMatch) {
|
|
17129
17119
|
try {
|
|
17130
17120
|
const response = {
|
|
17131
17121
|
statusCode: 200,
|
|
17132
17122
|
statusMessage: "OK",
|
|
17133
|
-
headers: { "content-type": dataMatch[1]
|
|
17134
|
-
body:
|
|
17123
|
+
headers: { "content-type": dataMatch[1] },
|
|
17124
|
+
body: decode2(dataMatch[2])
|
|
17135
17125
|
};
|
|
17136
17126
|
let result = response.body;
|
|
17137
17127
|
if (processFunc) {
|
|
@@ -18149,17 +18139,17 @@ var Resolver = class {
|
|
|
18149
18139
|
}
|
|
18150
18140
|
if (coinInfo.prefix != null) {
|
|
18151
18141
|
const length = bytes[1];
|
|
18152
|
-
let
|
|
18153
|
-
if (
|
|
18142
|
+
let version27 = bytes[0];
|
|
18143
|
+
if (version27 === 0) {
|
|
18154
18144
|
if (length !== 20 && length !== 32) {
|
|
18155
|
-
|
|
18145
|
+
version27 = -1;
|
|
18156
18146
|
}
|
|
18157
18147
|
} else {
|
|
18158
|
-
|
|
18148
|
+
version27 = -1;
|
|
18159
18149
|
}
|
|
18160
|
-
if (
|
|
18150
|
+
if (version27 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
18161
18151
|
const words2 = import_bech32.default.toWords(bytes.slice(2));
|
|
18162
|
-
words2.unshift(
|
|
18152
|
+
words2.unshift(version27);
|
|
18163
18153
|
return import_bech32.default.encode(coinInfo.prefix, words2);
|
|
18164
18154
|
}
|
|
18165
18155
|
}
|
|
@@ -20214,7 +20204,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
20214
20204
|
const pendingFilter = this.send("eth_newPendingTransactionFilter", []);
|
|
20215
20205
|
this._pendingFilter = pendingFilter;
|
|
20216
20206
|
pendingFilter.then(function(filterId) {
|
|
20217
|
-
function
|
|
20207
|
+
function poll2() {
|
|
20218
20208
|
self2.send("eth_getFilterChanges", [filterId]).then(function(hashes) {
|
|
20219
20209
|
if (self2._pendingFilter != pendingFilter) {
|
|
20220
20210
|
return null;
|
|
@@ -20238,13 +20228,13 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
20238
20228
|
return;
|
|
20239
20229
|
}
|
|
20240
20230
|
setTimeout(function() {
|
|
20241
|
-
|
|
20231
|
+
poll2();
|
|
20242
20232
|
}, 0);
|
|
20243
20233
|
return null;
|
|
20244
20234
|
}).catch((error) => {
|
|
20245
20235
|
});
|
|
20246
20236
|
}
|
|
20247
|
-
|
|
20237
|
+
poll2();
|
|
20248
20238
|
return filterId;
|
|
20249
20239
|
}).catch((error) => {
|
|
20250
20240
|
});
|
|
@@ -20306,9 +20296,9 @@ try {
|
|
|
20306
20296
|
throw new Error("inject please");
|
|
20307
20297
|
}
|
|
20308
20298
|
} catch (error) {
|
|
20309
|
-
const
|
|
20299
|
+
const logger47 = new Logger(version23);
|
|
20310
20300
|
WS = function() {
|
|
20311
|
-
|
|
20301
|
+
logger47.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
20312
20302
|
operation: "new WebSocket()"
|
|
20313
20303
|
});
|
|
20314
20304
|
};
|
|
@@ -22291,7 +22281,7 @@ __export(utils_exports, {
|
|
|
22291
22281
|
Utf8ErrorFuncs: () => Utf8ErrorFuncs,
|
|
22292
22282
|
Utf8ErrorReason: () => Utf8ErrorReason,
|
|
22293
22283
|
_TypedDataEncoder: () => TypedDataEncoder,
|
|
22294
|
-
_fetchData: () =>
|
|
22284
|
+
_fetchData: () => _fetchData,
|
|
22295
22285
|
_toEscapedUtf8String: () => _toEscapedUtf8String,
|
|
22296
22286
|
accessListify: () => accessListify,
|
|
22297
22287
|
arrayify: () => arrayify,
|
|
@@ -22310,7 +22300,7 @@ __export(utils_exports, {
|
|
|
22310
22300
|
defineReadOnly: () => defineReadOnly,
|
|
22311
22301
|
dnsEncode: () => dnsEncode,
|
|
22312
22302
|
entropyToMnemonic: () => entropyToMnemonic,
|
|
22313
|
-
fetchJson: () =>
|
|
22303
|
+
fetchJson: () => fetchJson,
|
|
22314
22304
|
formatBytes32String: () => formatBytes32String,
|
|
22315
22305
|
formatEther: () => formatEther,
|
|
22316
22306
|
formatUnits: () => formatUnits,
|
|
@@ -22346,7 +22336,7 @@ __export(utils_exports, {
|
|
|
22346
22336
|
parseEther: () => parseEther,
|
|
22347
22337
|
parseTransaction: () => parse,
|
|
22348
22338
|
parseUnits: () => parseUnits,
|
|
22349
|
-
poll: () =>
|
|
22339
|
+
poll: () => poll,
|
|
22350
22340
|
randomBytes: () => randomBytes,
|
|
22351
22341
|
recoverAddress: () => recoverAddress,
|
|
22352
22342
|
recoverPublicKey: () => recoverPublicKey,
|
|
@@ -22534,473 +22524,11 @@ function parseEther(ether) {
|
|
|
22534
22524
|
return parseUnits(ether, 18);
|
|
22535
22525
|
}
|
|
22536
22526
|
|
|
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
22527
|
// ../../node_modules/ethers/lib.esm/_version.js
|
|
23000
|
-
var
|
|
22528
|
+
var version26 = "ethers/5.7.0";
|
|
23001
22529
|
|
|
23002
22530
|
// ../../node_modules/ethers/lib.esm/ethers.js
|
|
23003
|
-
var
|
|
22531
|
+
var logger46 = new Logger(version26);
|
|
23004
22532
|
|
|
23005
22533
|
// ../../node_modules/ethers/lib.esm/index.js
|
|
23006
22534
|
try {
|
|
@@ -23509,14 +23037,12 @@ var WalletStore = class _WalletStore {
|
|
|
23509
23037
|
if (this.isLedger) {
|
|
23510
23038
|
const ledger = await GlobalLedgerSigner();
|
|
23511
23039
|
console.log(ledger, "ledger signer");
|
|
23512
|
-
|
|
23040
|
+
hash3 = await ledger.sendTransaction({
|
|
23513
23041
|
to: address,
|
|
23514
23042
|
data,
|
|
23515
23043
|
value: value ? BigInt(value) : void 0,
|
|
23516
|
-
from: this.account
|
|
23517
|
-
type: 0
|
|
23044
|
+
from: this.account
|
|
23518
23045
|
});
|
|
23519
|
-
hash3 = tx == null ? void 0 : tx.hash;
|
|
23520
23046
|
} else {
|
|
23521
23047
|
hash3 = await this.walletClient.sendTransaction({
|
|
23522
23048
|
account: this.account,
|
|
@@ -23677,4 +23203,4 @@ js-sha3/src/sha3.js:
|
|
|
23677
23203
|
|
|
23678
23204
|
export { AppProvider, AutoMan, BigNumberInputState, BigNumberState, ConnectLedger, DisconnectLedger, ObjectPool, PromiseHook, StorageListState, StorageState, WalletConfigStore, WalletHistoryStore, WalletRpcStore, WalletStore };
|
|
23679
23205
|
//# sourceMappingURL=out.js.map
|
|
23680
|
-
//# sourceMappingURL=chunk-
|
|
23206
|
+
//# sourceMappingURL=chunk-I3PECBV3.mjs.map
|