@rhinestone/deposit-modal 0.0.0-dev-20261007123232 → 0.0.0-dev-20261007142713
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/{BankOnrampStep-37WGJIO4.cjs → BankOnrampStep-5WDZUARD.cjs} +11 -11
- package/dist/{BankOnrampStep-JUFVAVIS.mjs → BankOnrampStep-HLNRQ7T5.mjs} +4 -4
- package/dist/{DepositModalReown-6GHQQNMW.mjs → DepositModalReown-SKSORQUM.mjs} +3 -3
- package/dist/{DepositModalReown-UBVBTDF3.cjs → DepositModalReown-SSR5CLK7.cjs} +16 -16
- package/dist/WithdrawModal-RCPEI6RF.cjs +12 -0
- package/dist/{WithdrawModal-A3IW3SXX.mjs → WithdrawModal-W4XTHXB3.mjs} +3 -3
- package/dist/{chunk-ITLGT5C5.mjs → chunk-3T5HP5NY.mjs} +1 -1
- package/dist/{chunk-UUGROFL6.mjs → chunk-3Y3VX6HJ.mjs} +68 -104
- package/dist/{chunk-E6LUVX6Q.cjs → chunk-5YWOJNGJ.cjs} +1 -1
- package/dist/{chunk-FYNIS26C.mjs → chunk-637CUDYR.mjs} +1 -1
- package/dist/{chunk-B4THBLY7.mjs → chunk-B2G6SKD2.mjs} +1 -1
- package/dist/{chunk-MD6EFUBO.cjs → chunk-EROOO5Q5.cjs} +311 -258
- package/dist/{chunk-GCXBWEVD.mjs → chunk-IEVRAF7C.mjs} +67 -14
- package/dist/{chunk-HKWTABVW.cjs → chunk-L3IDZIBA.cjs} +420 -456
- package/dist/{chunk-WVSX6PLI.mjs → chunk-MVZPFHRU.mjs} +1 -1
- package/dist/{chunk-5PS2QNOU.cjs → chunk-OTXF4QSV.cjs} +2 -2
- package/dist/{chunk-UGIKPKMY.mjs → chunk-RFSIVTXV.mjs} +1 -1
- package/dist/{chunk-3VTLHPMC.cjs → chunk-RJSHSKS5.cjs} +2 -2
- package/dist/{chunk-GDOFONYI.cjs → chunk-UPPAHPYR.cjs} +58 -58
- package/dist/{chunk-INWUGACR.cjs → chunk-UZUZWBA2.cjs} +3 -3
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/onramp.cjs +4 -4
- package/dist/onramp.mjs +3 -3
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/WithdrawModal-3AAAZV34.cjs +0 -12
|
@@ -45,7 +45,7 @@ var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunk5YWOJNGJcjs = require('./chunk-5YWOJNGJ.cjs');
|
|
49
49
|
|
|
50
50
|
// src/components/ui/Modal.tsx
|
|
51
51
|
|
|
@@ -423,6 +423,54 @@ function catalogExplorerTxUrl(chain, txHash) {
|
|
|
423
423
|
return `${chain.explorer.url}${chain.explorer.txPath}${txHash}`;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
// src/core/hosted-order.ts
|
|
427
|
+
var RANK = {
|
|
428
|
+
awaiting_payment: 0,
|
|
429
|
+
paying: 1,
|
|
430
|
+
paid: 2,
|
|
431
|
+
sent: 3
|
|
432
|
+
};
|
|
433
|
+
function hostedOrderState(order) {
|
|
434
|
+
const { receipt, conversion, delivery } = order.stages;
|
|
435
|
+
const deliveryTxHash = "txHash" in delivery ? delivery.txHash : null;
|
|
436
|
+
const outcome = order.status === "refunded" ? "refunded" : order.status === "failed" && !deliveryTxHash ? receipt.status === "failed" && receipt.reason === "cancelled" ? "cancelled" : "failed" : null;
|
|
437
|
+
const progress = deliveryTxHash ? "sent" : receipt.status === "completed" || conversion.status !== "not_started" ? "paid" : receipt.status === "processing" || receipt.status === "on_hold" ? "paying" : "awaiting_payment";
|
|
438
|
+
return { progress, outcome, deliveryTxHash };
|
|
439
|
+
}
|
|
440
|
+
function hostedOrderStateFromSwapped(status, txHash) {
|
|
441
|
+
const deliveryTxHash = _nullishCoalesce(txHash, () => ( null));
|
|
442
|
+
switch (status) {
|
|
443
|
+
case "payment_pending":
|
|
444
|
+
return { progress: "awaiting_payment", outcome: null, deliveryTxHash };
|
|
445
|
+
case "wallet_order_registered":
|
|
446
|
+
case "wallet_order_confirmed":
|
|
447
|
+
return { progress: "paying", outcome: null, deliveryTxHash };
|
|
448
|
+
case "order_completed":
|
|
449
|
+
return {
|
|
450
|
+
progress: deliveryTxHash ? "sent" : "paid",
|
|
451
|
+
outcome: null,
|
|
452
|
+
deliveryTxHash
|
|
453
|
+
};
|
|
454
|
+
case "order_broadcasted":
|
|
455
|
+
return { progress: "sent", outcome: null, deliveryTxHash };
|
|
456
|
+
case "order_cancelled":
|
|
457
|
+
return { progress: "awaiting_payment", outcome: "cancelled", deliveryTxHash };
|
|
458
|
+
default:
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function mergeHostedOrderState(previous, next) {
|
|
463
|
+
if (!previous) return next;
|
|
464
|
+
return {
|
|
465
|
+
progress: RANK[next.progress] >= RANK[previous.progress] ? next.progress : previous.progress,
|
|
466
|
+
outcome: _nullishCoalesce(next.outcome, () => ( previous.outcome)),
|
|
467
|
+
deliveryTxHash: _nullishCoalesce(next.deliveryTxHash, () => ( previous.deliveryTxHash))
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function hasReached(state, progress) {
|
|
471
|
+
return state ? RANK[state.progress] >= RANK[progress] : false;
|
|
472
|
+
}
|
|
473
|
+
|
|
426
474
|
// src/core/deposit-asset-helpers.ts
|
|
427
475
|
function getAssetId(asset) {
|
|
428
476
|
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
@@ -795,7 +843,7 @@ function createDepositService(baseUrl, options) {
|
|
|
795
843
|
method === "GET" ? assetsGetUrl(ids, fields) : apiUrl("/assets"),
|
|
796
844
|
{
|
|
797
845
|
method,
|
|
798
|
-
headers:
|
|
846
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
799
847
|
body: method === "QUERY" ? JSON.stringify({ ids, fields }) : void 0,
|
|
800
848
|
cache: "no-store",
|
|
801
849
|
signal
|
|
@@ -889,7 +937,7 @@ function createDepositService(baseUrl, options) {
|
|
|
889
937
|
try {
|
|
890
938
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
891
939
|
method: "GET",
|
|
892
|
-
headers:
|
|
940
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, )
|
|
893
941
|
});
|
|
894
942
|
if (!response.ok) {
|
|
895
943
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -916,7 +964,7 @@ function createDepositService(baseUrl, options) {
|
|
|
916
964
|
try {
|
|
917
965
|
const response = await fetch(apiUrl("/chains"), {
|
|
918
966
|
method: "GET",
|
|
919
|
-
headers:
|
|
967
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, )
|
|
920
968
|
});
|
|
921
969
|
if (!response.ok) {
|
|
922
970
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -962,7 +1010,7 @@ function createDepositService(baseUrl, options) {
|
|
|
962
1010
|
const label = kind === "fiat" ? "Swapped widget URL" : "Swapped Connect URL";
|
|
963
1011
|
const response = await fetch(apiUrl("/onramp/orders"), {
|
|
964
1012
|
method: "POST",
|
|
965
|
-
headers:
|
|
1013
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
966
1014
|
body: JSON.stringify({
|
|
967
1015
|
provider: "swapped",
|
|
968
1016
|
kind,
|
|
@@ -1003,7 +1051,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1003
1051
|
});
|
|
1004
1052
|
const response = await fetch(url, {
|
|
1005
1053
|
method: "POST",
|
|
1006
|
-
headers:
|
|
1054
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1007
1055
|
body: JSON.stringify({ account: params })
|
|
1008
1056
|
});
|
|
1009
1057
|
if (!response.ok) {
|
|
@@ -1038,7 +1086,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1038
1086
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1039
1087
|
const response = await fetch(url, {
|
|
1040
1088
|
method: "GET",
|
|
1041
|
-
headers:
|
|
1089
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, )
|
|
1042
1090
|
});
|
|
1043
1091
|
if (!response.ok) {
|
|
1044
1092
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1089,7 +1137,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1089
1137
|
});
|
|
1090
1138
|
const response = await fetch(url, {
|
|
1091
1139
|
method: "GET",
|
|
1092
|
-
headers:
|
|
1140
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, )
|
|
1093
1141
|
});
|
|
1094
1142
|
if (!response.ok) {
|
|
1095
1143
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1118,7 +1166,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1118
1166
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1119
1167
|
const response = await fetch(url, {
|
|
1120
1168
|
method: "GET",
|
|
1121
|
-
headers:
|
|
1169
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, )
|
|
1122
1170
|
});
|
|
1123
1171
|
if (!response.ok) {
|
|
1124
1172
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1154,7 +1202,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1154
1202
|
);
|
|
1155
1203
|
const response = await fetch(url, {
|
|
1156
1204
|
method: "GET",
|
|
1157
|
-
headers:
|
|
1205
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1158
1206
|
cache: "no-store"
|
|
1159
1207
|
});
|
|
1160
1208
|
if (!response.ok) {
|
|
@@ -1182,7 +1230,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1182
1230
|
);
|
|
1183
1231
|
const response = await fetch(url, {
|
|
1184
1232
|
method: "GET",
|
|
1185
|
-
headers:
|
|
1233
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1186
1234
|
cache: "no-store"
|
|
1187
1235
|
});
|
|
1188
1236
|
if (!response.ok) {
|
|
@@ -1206,7 +1254,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1206
1254
|
);
|
|
1207
1255
|
const response = await fetch(url, {
|
|
1208
1256
|
method: "GET",
|
|
1209
|
-
headers:
|
|
1257
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1210
1258
|
cache: "no-store"
|
|
1211
1259
|
});
|
|
1212
1260
|
if (!response.ok) {
|
|
@@ -1228,7 +1276,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1228
1276
|
async getPositions(address) {
|
|
1229
1277
|
const url = apiUrl(`/positions/${address}`);
|
|
1230
1278
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1231
|
-
const response = await fetch(url, { headers:
|
|
1279
|
+
const response = await fetch(url, { headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ) });
|
|
1232
1280
|
if (!response.ok) {
|
|
1233
1281
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1234
1282
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1262,7 +1310,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1262
1310
|
});
|
|
1263
1311
|
const response = await fetch(url, {
|
|
1264
1312
|
method: "POST",
|
|
1265
|
-
headers:
|
|
1313
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1266
1314
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1267
1315
|
});
|
|
1268
1316
|
if (!response.ok) {
|
|
@@ -1298,7 +1346,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1298
1346
|
});
|
|
1299
1347
|
const response = await fetch(url, {
|
|
1300
1348
|
method: "POST",
|
|
1301
|
-
headers:
|
|
1349
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1302
1350
|
body: JSON.stringify({
|
|
1303
1351
|
depositWallet,
|
|
1304
1352
|
owner,
|
|
@@ -1340,7 +1388,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1340
1388
|
});
|
|
1341
1389
|
const response = await fetch(url, {
|
|
1342
1390
|
method: "GET",
|
|
1343
|
-
headers:
|
|
1391
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1344
1392
|
cache: "no-store"
|
|
1345
1393
|
});
|
|
1346
1394
|
if (!response.ok) {
|
|
@@ -1390,7 +1438,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1390
1438
|
});
|
|
1391
1439
|
const response = await fetch(url, {
|
|
1392
1440
|
method: "GET",
|
|
1393
|
-
headers:
|
|
1441
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1394
1442
|
cache: "no-store"
|
|
1395
1443
|
});
|
|
1396
1444
|
if (!response.ok) {
|
|
@@ -1444,7 +1492,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1444
1492
|
try {
|
|
1445
1493
|
const response = await fetch(url, {
|
|
1446
1494
|
method: "POST",
|
|
1447
|
-
headers:
|
|
1495
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1448
1496
|
body: JSON.stringify(body),
|
|
1449
1497
|
cache: "no-store",
|
|
1450
1498
|
signal
|
|
@@ -1494,7 +1542,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1494
1542
|
try {
|
|
1495
1543
|
const response = await fetch(url, {
|
|
1496
1544
|
method: "POST",
|
|
1497
|
-
headers:
|
|
1545
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1498
1546
|
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1499
1547
|
cache: "no-store",
|
|
1500
1548
|
signal
|
|
@@ -1597,7 +1645,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1597
1645
|
try {
|
|
1598
1646
|
response = await fetch(url, {
|
|
1599
1647
|
method: "POST",
|
|
1600
|
-
headers:
|
|
1648
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1601
1649
|
body: JSON.stringify(params)
|
|
1602
1650
|
});
|
|
1603
1651
|
} catch (error) {
|
|
@@ -1681,7 +1729,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1681
1729
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1682
1730
|
const response = await fetch(url, {
|
|
1683
1731
|
method: "GET",
|
|
1684
|
-
headers:
|
|
1732
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1685
1733
|
cache: "no-store"
|
|
1686
1734
|
});
|
|
1687
1735
|
if (!response.ok) {
|
|
@@ -1728,7 +1776,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1728
1776
|
try {
|
|
1729
1777
|
const response = await fetch(url, {
|
|
1730
1778
|
method: "GET",
|
|
1731
|
-
headers:
|
|
1779
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1732
1780
|
cache: "no-store"
|
|
1733
1781
|
});
|
|
1734
1782
|
if (!response.ok) {
|
|
@@ -1816,7 +1864,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1816
1864
|
try {
|
|
1817
1865
|
const response = await fetch(url, {
|
|
1818
1866
|
method: "GET",
|
|
1819
|
-
headers:
|
|
1867
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1820
1868
|
cache: "no-store"
|
|
1821
1869
|
});
|
|
1822
1870
|
if (!response.ok) {
|
|
@@ -1841,7 +1889,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1841
1889
|
const url = apiUrl(`/onramp/orders/${encodeURIComponent(orderId)}`);
|
|
1842
1890
|
const response = await fetch(url, {
|
|
1843
1891
|
method: "GET",
|
|
1844
|
-
headers:
|
|
1892
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
1845
1893
|
cache: "no-store"
|
|
1846
1894
|
});
|
|
1847
1895
|
if (!response.ok) return null;
|
|
@@ -1855,20 +1903,10 @@ function createDepositService(baseUrl, options) {
|
|
|
1855
1903
|
}
|
|
1856
1904
|
};
|
|
1857
1905
|
}
|
|
1858
|
-
var SWAPPED_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1859
|
-
"payment_pending",
|
|
1860
|
-
"order_completed",
|
|
1861
|
-
"order_broadcasted",
|
|
1862
|
-
"order_cancelled"
|
|
1863
|
-
]);
|
|
1864
1906
|
function swappedOrderFromView(orderId, raw) {
|
|
1865
1907
|
if (!raw || typeof raw !== "object") return null;
|
|
1866
1908
|
const view = raw;
|
|
1867
|
-
if (view.provider !== "swapped") return null;
|
|
1868
|
-
const status = view.providerStatus;
|
|
1869
|
-
if (typeof status !== "string" || !SWAPPED_ORDER_STATUSES.has(status)) {
|
|
1870
|
-
return null;
|
|
1871
|
-
}
|
|
1909
|
+
if (view.provider !== "swapped" || !isOrderShape(view)) return null;
|
|
1872
1910
|
const number = (v) => {
|
|
1873
1911
|
const n = typeof v === "string" && v.trim() ? Number(v) : v;
|
|
1874
1912
|
return typeof n === "number" && Number.isFinite(n) ? n : null;
|
|
@@ -1882,17 +1920,29 @@ function swappedOrderFromView(orderId, raw) {
|
|
|
1882
1920
|
const usdNet = number(_optionalChain([view, 'access', _50 => _50.fiat, 'optionalAccess', _51 => _51.usd, 'optionalAccess', _52 => _52.net]));
|
|
1883
1921
|
return {
|
|
1884
1922
|
orderId,
|
|
1885
|
-
|
|
1923
|
+
...hostedOrderState(view),
|
|
1886
1924
|
orderCrypto: text(_optionalChain([view, 'access', _53 => _53.crypto, 'optionalAccess', _54 => _54.asset])),
|
|
1887
1925
|
orderCryptoAmount: text(_optionalChain([view, 'access', _55 => _55.crypto, 'optionalAccess', _56 => _56.amount])),
|
|
1888
|
-
transactionId: text(_optionalChain([view, 'access', _57 => _57.stages, 'optionalAccess', _58 => _58.delivery, 'optionalAccess', _59 => _59.txHash])),
|
|
1889
1926
|
receivedAt: text(view.updatedAt),
|
|
1890
1927
|
paidAmountUsd: _nullishCoalesce(usdTotal, () => ( usdNet)),
|
|
1891
|
-
paidAmountEur: _nullishCoalesce(number(_optionalChain([view, 'access',
|
|
1928
|
+
paidAmountEur: _nullishCoalesce(number(_optionalChain([view, 'access', _57 => _57.fiat, 'optionalAccess', _58 => _58.eur, 'optionalAccess', _59 => _59.total])), () => ( number(_optionalChain([view, 'access', _60 => _60.fiat, 'optionalAccess', _61 => _61.eur, 'optionalAccess', _62 => _62.net])))),
|
|
1892
1929
|
onrampFeeUsd: usdTotal !== null && usdNet !== null && usdTotal > usdNet ? Number((usdTotal - usdNet).toFixed(2)) : null,
|
|
1893
|
-
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access',
|
|
1930
|
+
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access', _63 => _63.rail, 'optionalAccess', _64 => _64.method]), () => ( _optionalChain([view, 'access', _65 => _65.rail, 'optionalAccess', _66 => _66.connection]))))
|
|
1894
1931
|
};
|
|
1895
1932
|
}
|
|
1933
|
+
var ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1934
|
+
"pending",
|
|
1935
|
+
"processing",
|
|
1936
|
+
"completed",
|
|
1937
|
+
"failed",
|
|
1938
|
+
"refunded"
|
|
1939
|
+
]);
|
|
1940
|
+
function isOrderShape(view) {
|
|
1941
|
+
const stages = view.stages;
|
|
1942
|
+
return ORDER_STATUSES.has(view.status) && ["receipt", "conversion", "delivery"].every(
|
|
1943
|
+
(name) => typeof _optionalChain([stages, 'optionalAccess', _67 => _67[name], 'optionalAccess', _68 => _68.status]) === "string"
|
|
1944
|
+
);
|
|
1945
|
+
}
|
|
1896
1946
|
function parseAssetItem(raw, fields) {
|
|
1897
1947
|
if (!raw || typeof raw !== "object") return void 0;
|
|
1898
1948
|
const record = raw;
|
|
@@ -1920,16 +1970,16 @@ function parseAssetItem(raw, fields) {
|
|
|
1920
1970
|
}
|
|
1921
1971
|
function normalizeDirectPortfolio(data) {
|
|
1922
1972
|
const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
|
|
1923
|
-
_optionalChain([data, 'optionalAccess',
|
|
1973
|
+
_optionalChain([data, 'optionalAccess', _69 => _69.data]),
|
|
1924
1974
|
"tokens"
|
|
1925
1975
|
))), () => ( []));
|
|
1926
|
-
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess',
|
|
1976
|
+
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _70 => _70.data]), "totalUsd"))), () => ( 0));
|
|
1927
1977
|
const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
|
|
1928
1978
|
return { tokens, totalUsd };
|
|
1929
1979
|
}
|
|
1930
1980
|
function extractOrchestratorPortfolio(data) {
|
|
1931
1981
|
const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
|
|
1932
|
-
_optionalChain([data, 'optionalAccess',
|
|
1982
|
+
_optionalChain([data, 'optionalAccess', _71 => _71.data]),
|
|
1933
1983
|
"portfolio"
|
|
1934
1984
|
)));
|
|
1935
1985
|
if (!portfolio || !Array.isArray(portfolio)) return null;
|
|
@@ -1940,7 +1990,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1940
1990
|
for (const tokenData of data.portfolio || []) {
|
|
1941
1991
|
const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
|
|
1942
1992
|
for (const chainBalance of chainBalances) {
|
|
1943
|
-
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access',
|
|
1993
|
+
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _72 => _72.balance, 'optionalAccess', _73 => _73.unlocked]), () => ( "0"));
|
|
1944
1994
|
const normalizedName = tokenData.tokenName.trim();
|
|
1945
1995
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1946
1996
|
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( runtimeEvmAddress(chainBalance.chainId, normalizedName)));
|
|
@@ -1977,18 +2027,18 @@ function normalizeDirectToken(token) {
|
|
|
1977
2027
|
if (chainId === null) return null;
|
|
1978
2028
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1979
2029
|
if (!symbol) return null;
|
|
1980
|
-
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call',
|
|
2030
|
+
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _74 => _74(token, "balance"), 'optionalAccess', _75 => _75.toString, 'call', _76 => _76()]))), () => ( _optionalChain([extractNumber, 'call', _77 => _77(token, "amount"), 'optionalAccess', _78 => _78.toString, 'call', _79 => _79()]))), () => ( _optionalChain([extractNumber, 'call', _80 => _80(token, "value"), 'optionalAccess', _81 => _81.toString, 'call', _82 => _82()]))), () => ( _optionalChain([extractNumber, 'call', _83 => _83(token, "rawBalance"), 'optionalAccess', _84 => _84.toString, 'call', _85 => _85()])));
|
|
1981
2031
|
if (!balanceValue) return null;
|
|
1982
2032
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1983
2033
|
token.token,
|
|
1984
2034
|
"address"
|
|
1985
|
-
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call',
|
|
2035
|
+
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call', _86 => _86(void 0, symbol), 'optionalAccess', _87 => _87.address]) : typeof chainId === "number" ? runtimeEvmAddress(chainId, symbol) : void 0)));
|
|
1986
2036
|
if (!address) return null;
|
|
1987
2037
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
1988
2038
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1989
2039
|
const hyperCore = chainId === "hypercore" ? hyperCoreSourceToken(address, symbol) : void 0;
|
|
1990
|
-
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
1991
|
-
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
2040
|
+
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _88 => _88.symbol]), () => ( symbol));
|
|
2041
|
+
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _89 => _89.decimals]), () => ( backendDecimals)), () => ( 18));
|
|
1992
2042
|
return {
|
|
1993
2043
|
chainId,
|
|
1994
2044
|
address,
|
|
@@ -2010,7 +2060,7 @@ function hyperCoreSourceToken(address, symbol) {
|
|
|
2010
2060
|
}
|
|
2011
2061
|
function extractTokenAddress(tokenData, chainId) {
|
|
2012
2062
|
const token = tokenData;
|
|
2013
|
-
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access',
|
|
2063
|
+
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _90 => _90.addresses, 'optionalAccess', _91 => _91[chainId]]))), () => ( _optionalChain([token, 'access', _92 => _92.token, 'optionalAccess', _93 => _93.address]))), () => ( _optionalChain([token, 'access', _94 => _94.token, 'optionalAccess', _95 => _95.addresses, 'optionalAccess', _96 => _96[chainId]])));
|
|
2014
2064
|
}
|
|
2015
2065
|
function extractArray(data, key) {
|
|
2016
2066
|
if (!data || typeof data !== "object") return null;
|
|
@@ -2040,7 +2090,7 @@ function extractNumericString(data, key) {
|
|
|
2040
2090
|
// src/core/rpc.ts
|
|
2041
2091
|
|
|
2042
2092
|
function rpcUrlFor(rpcUrls, chain) {
|
|
2043
|
-
const url = _optionalChain([rpcUrls, 'optionalAccess',
|
|
2093
|
+
const url = _optionalChain([rpcUrls, 'optionalAccess', _97 => _97[chain], 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
2044
2094
|
return url ? url : void 0;
|
|
2045
2095
|
}
|
|
2046
2096
|
var RpcUrlsContext = _react.createContext.call(void 0, void 0);
|
|
@@ -2050,7 +2100,7 @@ function useRpcUrls() {
|
|
|
2050
2100
|
}
|
|
2051
2101
|
function rpcUrlsKey(rpcUrls) {
|
|
2052
2102
|
if (!rpcUrls) return "";
|
|
2053
|
-
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess',
|
|
2103
|
+
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]), () => ( ""))]).filter(([, url]) => url !== "").map(([chain, url]) => `${chain}=${url}`).sort().join("|");
|
|
2054
2104
|
}
|
|
2055
2105
|
function useStableRpcUrls(rpcUrls) {
|
|
2056
2106
|
const key = rpcUrlsKey(rpcUrls);
|
|
@@ -2072,15 +2122,15 @@ function useStableRpcUrls(rpcUrls) {
|
|
|
2072
2122
|
|
|
2073
2123
|
function findListed(options, chain, token) {
|
|
2074
2124
|
const normalize2 = (value) => chain === "solana" ? value : value.toLowerCase();
|
|
2075
|
-
return _optionalChain([options, 'access',
|
|
2125
|
+
return _optionalChain([options, 'access', _102 => _102.tokens, 'access', _103 => _103[String(chain)], 'optionalAccess', _104 => _104.find, 'call', _105 => _105(
|
|
2076
2126
|
(listed) => normalize2(listed.address) === normalize2(token)
|
|
2077
2127
|
)]);
|
|
2078
2128
|
}
|
|
2079
2129
|
function isExcludedByRestrictedList(options, chain, token) {
|
|
2080
|
-
return Boolean(_optionalChain([options, 'optionalAccess',
|
|
2130
|
+
return Boolean(_optionalChain([options, 'optionalAccess', _106 => _106.restricted]) && !findListed(options, chain, token));
|
|
2081
2131
|
}
|
|
2082
2132
|
function findDepositBounds(options, chain, token) {
|
|
2083
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2133
|
+
if (!_optionalChain([options, 'optionalAccess', _107 => _107.restricted])) return void 0;
|
|
2084
2134
|
const entry = findListed(options, chain, token);
|
|
2085
2135
|
if (!entry || entry.minAmount === void 0 && entry.maxAmount === void 0) {
|
|
2086
2136
|
return void 0;
|
|
@@ -2093,7 +2143,7 @@ function findDepositBounds(options, chain, token) {
|
|
|
2093
2143
|
};
|
|
2094
2144
|
}
|
|
2095
2145
|
function boundMessage(bounds, bound) {
|
|
2096
|
-
const raw = _optionalChain([bounds, 'optionalAccess',
|
|
2146
|
+
const raw = _optionalChain([bounds, 'optionalAccess', _108 => _108[bound]]);
|
|
2097
2147
|
if (!bounds || raw === void 0) return null;
|
|
2098
2148
|
const amount = new Intl.NumberFormat("en-US", {
|
|
2099
2149
|
maximumFractionDigits: Math.min(bounds.decimals, 20)
|
|
@@ -2192,7 +2242,7 @@ async function loadViemChains() {
|
|
|
2192
2242
|
viemChainsPromise = Promise.resolve().then(() => _interopRequireWildcard(require("viem/chains"))).then((module) => {
|
|
2193
2243
|
const map = /* @__PURE__ */ new Map();
|
|
2194
2244
|
for (const value of Object.values(module)) {
|
|
2195
|
-
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access',
|
|
2245
|
+
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access', _109 => _109.rpcUrls, 'optionalAccess', _110 => _110.default, 'optionalAccess', _111 => _111.http, 'optionalAccess', _112 => _112.length])) {
|
|
2196
2246
|
const chain = value;
|
|
2197
2247
|
const existing = map.get(chain.id);
|
|
2198
2248
|
if (existing) existing.push(chain);
|
|
@@ -2206,7 +2256,7 @@ async function loadViemChains() {
|
|
|
2206
2256
|
return viemChainsPromise;
|
|
2207
2257
|
}
|
|
2208
2258
|
function pickViemChain(candidates, chain) {
|
|
2209
|
-
if (!_optionalChain([candidates, 'optionalAccess',
|
|
2259
|
+
if (!_optionalChain([candidates, 'optionalAccess', _113 => _113.length])) return void 0;
|
|
2210
2260
|
if (candidates.length === 1) return candidates[0];
|
|
2211
2261
|
const sameNetworkClass = candidates.filter(
|
|
2212
2262
|
(candidate) => Boolean(candidate.testnet) === chain.testnet
|
|
@@ -2222,10 +2272,10 @@ function pickViemChain(candidates, chain) {
|
|
|
2222
2272
|
}
|
|
2223
2273
|
function resolveRpcUrls(chain, override, viemChains) {
|
|
2224
2274
|
const urls = [];
|
|
2225
|
-
if (_optionalChain([override, 'optionalAccess',
|
|
2275
|
+
if (_optionalChain([override, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()])) urls.push(override.trim());
|
|
2226
2276
|
if (chain.publicRpcUrl) urls.push(chain.publicRpcUrl);
|
|
2227
2277
|
if (chain.chainId !== null && chain.vmType === "evm") {
|
|
2228
|
-
const http2 = _optionalChain([pickViemChain, 'call',
|
|
2278
|
+
const http2 = _optionalChain([pickViemChain, 'call', _116 => _116(_optionalChain([viemChains, 'optionalAccess', _117 => _117.get, 'call', _118 => _118(chain.chainId)]), chain), 'optionalAccess', _119 => _119.rpcUrls, 'optionalAccess', _120 => _120.default, 'optionalAccess', _121 => _121.http]);
|
|
2229
2279
|
if (http2) urls.push(...http2);
|
|
2230
2280
|
}
|
|
2231
2281
|
return [...new Set(urls)];
|
|
@@ -2234,7 +2284,7 @@ function toViemChain(chain, override, viemChains) {
|
|
|
2234
2284
|
if (chain.vmType !== "evm" || chain.chainId === null) return null;
|
|
2235
2285
|
const rpcUrls = resolveRpcUrls(chain, override, viemChains);
|
|
2236
2286
|
if (rpcUrls.length === 0) return null;
|
|
2237
|
-
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess',
|
|
2287
|
+
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess', _122 => _122.get, 'call', _123 => _123(chain.chainId)]), chain);
|
|
2238
2288
|
if (bundled) {
|
|
2239
2289
|
if (rpcUrls[0] === bundled.rpcUrls.default.http[0]) return bundled;
|
|
2240
2290
|
return _viem.defineChain.call(void 0, {
|
|
@@ -2265,7 +2315,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2265
2315
|
for (const entry of catalog.all) {
|
|
2266
2316
|
const chain = toViemChain(
|
|
2267
2317
|
entry,
|
|
2268
|
-
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess',
|
|
2318
|
+
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess', _124 => _124[entry.chainId]]),
|
|
2269
2319
|
viemChains
|
|
2270
2320
|
);
|
|
2271
2321
|
if (chain) chains.push(chain);
|
|
@@ -2274,7 +2324,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2274
2324
|
}
|
|
2275
2325
|
function needsViemChains(catalog, overrides) {
|
|
2276
2326
|
return catalog.all.some(
|
|
2277
|
-
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess',
|
|
2327
|
+
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess', _125 => _125[chain.chainId], 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()])
|
|
2278
2328
|
);
|
|
2279
2329
|
}
|
|
2280
2330
|
|
|
@@ -2354,9 +2404,9 @@ function publishRuntimeChainMeta(catalog) {
|
|
|
2354
2404
|
iconUrl: _nullishCoalesce(chain.iconUrl, () => ( void 0)),
|
|
2355
2405
|
nativeSymbol: chain.nativeToken.symbol,
|
|
2356
2406
|
nativeDecimals: chain.nativeToken.decimals,
|
|
2357
|
-
explorerUrl: _optionalChain([chain, 'access',
|
|
2358
|
-
explorerTxPath: _optionalChain([chain, 'access',
|
|
2359
|
-
explorerAddressPath: _optionalChain([chain, 'access',
|
|
2407
|
+
explorerUrl: _optionalChain([chain, 'access', _128 => _128.explorer, 'optionalAccess', _129 => _129.url]),
|
|
2408
|
+
explorerTxPath: _optionalChain([chain, 'access', _130 => _130.explorer, 'optionalAccess', _131 => _131.txPath]),
|
|
2409
|
+
explorerAddressPath: _optionalChain([chain, 'access', _132 => _132.explorer, 'optionalAccess', _133 => _133.addressPath])
|
|
2360
2410
|
}));
|
|
2361
2411
|
})
|
|
2362
2412
|
);
|
|
@@ -2429,7 +2479,7 @@ function useTargetTokens() {
|
|
|
2429
2479
|
const { catalog, shortlist } = useChainCatalog();
|
|
2430
2480
|
return _react.useMemo.call(void 0, () => {
|
|
2431
2481
|
return (chainId) => {
|
|
2432
|
-
const fromShortlist = _optionalChain([shortlist, 'optionalAccess',
|
|
2482
|
+
const fromShortlist = _optionalChain([shortlist, 'optionalAccess', _134 => _134[String(chainId)]]);
|
|
2433
2483
|
if (fromShortlist) {
|
|
2434
2484
|
return fromShortlist.map((token) => ({
|
|
2435
2485
|
symbol: token.symbol,
|
|
@@ -2437,8 +2487,8 @@ function useTargetTokens() {
|
|
|
2437
2487
|
decimals: token.decimals
|
|
2438
2488
|
}));
|
|
2439
2489
|
}
|
|
2440
|
-
const entry = _optionalChain([catalog, 'optionalAccess',
|
|
2441
|
-
return Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
2490
|
+
const entry = _optionalChain([catalog, 'optionalAccess', _135 => _135.byChainId, 'access', _136 => _136.get, 'call', _137 => _137(chainId)]);
|
|
2491
|
+
return Array.isArray(_optionalChain([entry, 'optionalAccess', _138 => _138.supportedTokens])) ? entry.supportedTokens.map((token) => ({
|
|
2442
2492
|
symbol: token.symbol,
|
|
2443
2493
|
address: token.address,
|
|
2444
2494
|
decimals: token.decimals
|
|
@@ -2448,12 +2498,12 @@ function useTargetTokens() {
|
|
|
2448
2498
|
}
|
|
2449
2499
|
function createDepositOffer(state, retry) {
|
|
2450
2500
|
const options = state.status === "ready" ? state.options : null;
|
|
2451
|
-
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2452
|
-
const listed = (chain) => _optionalChain([options, 'optionalAccess',
|
|
2501
|
+
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.restricted]), () => ( false));
|
|
2502
|
+
const listed = (chain) => _optionalChain([options, 'optionalAccess', _140 => _140.tokens, 'access', _141 => _141[String(chain)]]);
|
|
2453
2503
|
const isChainOffered = (chain) => {
|
|
2454
2504
|
if (!options) return false;
|
|
2455
2505
|
const entry = listed(chain);
|
|
2456
|
-
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2506
|
+
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess', _142 => _142.length]), () => ( 0))) > 0 : _optionalChain([entry, 'optionalAccess', _143 => _143.length]) !== 0;
|
|
2457
2507
|
};
|
|
2458
2508
|
return {
|
|
2459
2509
|
status: state.status,
|
|
@@ -2503,7 +2553,7 @@ function useChainName() {
|
|
|
2503
2553
|
if (!catalog) return _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId);
|
|
2504
2554
|
const key = catalogKeyForChain(chainId);
|
|
2505
2555
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2506
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2556
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _144 => _144.name]), () => ( _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId)));
|
|
2507
2557
|
};
|
|
2508
2558
|
}, [catalog]);
|
|
2509
2559
|
}
|
|
@@ -2527,7 +2577,7 @@ function useExplorerTxUrl() {
|
|
|
2527
2577
|
return (chainId, txHash) => {
|
|
2528
2578
|
if (chainId === "hypercore") return _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2529
2579
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2530
|
-
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess',
|
|
2580
|
+
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess', _145 => _145.byChainId, 'access', _146 => _146.get, 'call', _147 => _147(key)]) : _optionalChain([catalog, 'optionalAccess', _148 => _148.byCaip2, 'access', _149 => _149.get, 'call', _150 => _150(key)]);
|
|
2531
2581
|
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2532
2582
|
};
|
|
2533
2583
|
}, [catalog]);
|
|
@@ -2590,7 +2640,7 @@ function ChainCatalogProvider({
|
|
|
2590
2640
|
service.getTopTokens().then(
|
|
2591
2641
|
(result) => {
|
|
2592
2642
|
if (!active) return;
|
|
2593
|
-
if (!_optionalChain([result, 'optionalAccess',
|
|
2643
|
+
if (!_optionalChain([result, 'optionalAccess', _151 => _151.ok])) {
|
|
2594
2644
|
setDepositOptions({ status: "error" });
|
|
2595
2645
|
return;
|
|
2596
2646
|
}
|
|
@@ -2762,22 +2812,22 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2762
2812
|
if (result.routeMissing) routeMissing = true;
|
|
2763
2813
|
meta.set(id, {
|
|
2764
2814
|
...previous,
|
|
2765
|
-
status: _optionalChain([previous, 'optionalAccess',
|
|
2815
|
+
status: _optionalChain([previous, 'optionalAccess', _152 => _152.status]) === "ready" ? "ready" : "failed",
|
|
2766
2816
|
retryAt: at + ASSET_RETRY_MS
|
|
2767
2817
|
});
|
|
2768
2818
|
continue;
|
|
2769
2819
|
}
|
|
2770
2820
|
const item = result.items[id];
|
|
2771
|
-
const code = _optionalChain([item, 'optionalAccess',
|
|
2821
|
+
const code = _optionalChain([item, 'optionalAccess', _153 => _153.error, 'optionalAccess', _154 => _154.code]);
|
|
2772
2822
|
if (!item || code && TERMINAL_ITEM_ERRORS.has(code)) {
|
|
2773
2823
|
meta.set(id, { status: "missing" });
|
|
2774
2824
|
continue;
|
|
2775
2825
|
}
|
|
2776
2826
|
meta.set(id, {
|
|
2777
2827
|
status: "ready",
|
|
2778
|
-
symbol: _nullishCoalesce(item.symbol, () => ( _optionalChain([previous, 'optionalAccess',
|
|
2779
|
-
decimals: _nullishCoalesce(item.decimals, () => ( _optionalChain([previous, 'optionalAccess',
|
|
2780
|
-
logo: _nullishCoalesce(item.logo, () => ( _optionalChain([previous, 'optionalAccess',
|
|
2828
|
+
symbol: _nullishCoalesce(item.symbol, () => ( _optionalChain([previous, 'optionalAccess', _155 => _155.symbol]))),
|
|
2829
|
+
decimals: _nullishCoalesce(item.decimals, () => ( _optionalChain([previous, 'optionalAccess', _156 => _156.decimals]))),
|
|
2830
|
+
logo: _nullishCoalesce(item.logo, () => ( _optionalChain([previous, 'optionalAccess', _157 => _157.logo]))),
|
|
2781
2831
|
retryAt: code ? at + ASSET_RETRY_MS : void 0
|
|
2782
2832
|
});
|
|
2783
2833
|
}
|
|
@@ -2790,7 +2840,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2790
2840
|
for (const id of ids) {
|
|
2791
2841
|
priceInFlight.delete(id);
|
|
2792
2842
|
prices.set(id, {
|
|
2793
|
-
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access',
|
|
2843
|
+
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access', _158 => _158.items, 'access', _159 => _159[id], 'optionalAccess', _160 => _160.priceUsd]), () => ( null)) : null,
|
|
2794
2844
|
at
|
|
2795
2845
|
});
|
|
2796
2846
|
}
|
|
@@ -2844,7 +2894,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2844
2894
|
requestMeta,
|
|
2845
2895
|
requestPrices,
|
|
2846
2896
|
peekMeta,
|
|
2847
|
-
peekPrice: (id) => _optionalChain([prices, 'access',
|
|
2897
|
+
peekPrice: (id) => _optionalChain([prices, 'access', _161 => _161.get, 'call', _162 => _162(id), 'optionalAccess', _163 => _163.usd]),
|
|
2848
2898
|
async resolveMeta(refs) {
|
|
2849
2899
|
const ids = idsFor(refs);
|
|
2850
2900
|
requestMeta(refs);
|
|
@@ -2860,7 +2910,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2860
2910
|
if (!id) return null;
|
|
2861
2911
|
requestPrices([ref]);
|
|
2862
2912
|
await settled(() => !priceInFlight.has(id) && !priceQueue.has(id));
|
|
2863
|
-
return _nullishCoalesce(_optionalChain([prices, 'access',
|
|
2913
|
+
return _nullishCoalesce(_optionalChain([prices, 'access', _164 => _164.get, 'call', _165 => _165(id), 'optionalAccess', _166 => _166.usd]), () => ( null));
|
|
2864
2914
|
}
|
|
2865
2915
|
};
|
|
2866
2916
|
}
|
|
@@ -3045,10 +3095,10 @@ function createIngestTransport(options) {
|
|
|
3045
3095
|
}
|
|
3046
3096
|
function interruptForUnload() {
|
|
3047
3097
|
for (const wake of [...sleepers]) wake();
|
|
3048
|
-
_optionalChain([mintAbort, 'optionalAccess',
|
|
3098
|
+
_optionalChain([mintAbort, 'optionalAccess', _167 => _167.abort, 'call', _168 => _168()]);
|
|
3049
3099
|
}
|
|
3050
3100
|
function retryDelay(response, attempt) {
|
|
3051
|
-
const seconds = Number(_optionalChain([response, 'access',
|
|
3101
|
+
const seconds = Number(_optionalChain([response, 'access', _169 => _169.headers, 'optionalAccess', _170 => _170.get, 'optionalCall', _171 => _171("Retry-After")]));
|
|
3052
3102
|
if (Number.isFinite(seconds) && seconds > 0) {
|
|
3053
3103
|
return Math.min(seconds * 1e3, MAX_BACKOFF_MS);
|
|
3054
3104
|
}
|
|
@@ -3063,8 +3113,8 @@ function createIngestTransport(options) {
|
|
|
3063
3113
|
try {
|
|
3064
3114
|
response = await fetchImpl(mintUrl, {
|
|
3065
3115
|
method: "POST",
|
|
3066
|
-
headers:
|
|
3067
|
-
signal: _optionalChain([controller, 'optionalAccess',
|
|
3116
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
3117
|
+
signal: _optionalChain([controller, 'optionalAccess', _172 => _172.signal])
|
|
3068
3118
|
});
|
|
3069
3119
|
} catch (e8) {
|
|
3070
3120
|
if (urgency !== DISMISSAL) {
|
|
@@ -3239,7 +3289,7 @@ function createIngestTransport(options) {
|
|
|
3239
3289
|
}
|
|
3240
3290
|
},
|
|
3241
3291
|
flush(flushOptions) {
|
|
3242
|
-
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess',
|
|
3292
|
+
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess', _173 => _173.terminal]), () => ( false));
|
|
3243
3293
|
if (disposed && !dismissal) return;
|
|
3244
3294
|
clearFlushTimer();
|
|
3245
3295
|
void run(dismissal ? DISMISSAL : IDLE);
|
|
@@ -3254,11 +3304,11 @@ function createIngestTransport(options) {
|
|
|
3254
3304
|
};
|
|
3255
3305
|
}
|
|
3256
3306
|
function randomUuid() {
|
|
3257
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
3307
|
+
if (typeof _optionalChain([globalThis, 'access', _174 => _174.crypto, 'optionalAccess', _175 => _175.randomUUID]) === "function") {
|
|
3258
3308
|
return globalThis.crypto.randomUUID();
|
|
3259
3309
|
}
|
|
3260
3310
|
const bytes = new Uint8Array(16);
|
|
3261
|
-
_optionalChain([globalThis, 'access',
|
|
3311
|
+
_optionalChain([globalThis, 'access', _176 => _176.crypto, 'optionalAccess', _177 => _177.getRandomValues, 'optionalCall', _178 => _178(bytes)]);
|
|
3262
3312
|
if (!bytes.some(Boolean)) {
|
|
3263
3313
|
for (let index = 0; index < bytes.length; index += 1) {
|
|
3264
3314
|
bytes[index] = Math.floor(Math.random() * 256);
|
|
@@ -3272,7 +3322,7 @@ function randomUuid() {
|
|
|
3272
3322
|
function resolveProxyOrigin(backendUrl) {
|
|
3273
3323
|
if (!backendUrl.trim()) return null;
|
|
3274
3324
|
try {
|
|
3275
|
-
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access',
|
|
3325
|
+
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access', _179 => _179.location, 'optionalAccess', _180 => _180.href]));
|
|
3276
3326
|
return origin.startsWith("http") ? origin : null;
|
|
3277
3327
|
} catch (e11) {
|
|
3278
3328
|
return null;
|
|
@@ -3324,13 +3374,13 @@ function AnalyticsSession(props) {
|
|
|
3324
3374
|
type: "analytics_ingest_failure",
|
|
3325
3375
|
session_id: sessionIdRef.current,
|
|
3326
3376
|
modal,
|
|
3327
|
-
widget_version:
|
|
3377
|
+
widget_version: _chunk5YWOJNGJcjs.MODAL_VERSION,
|
|
3328
3378
|
timestamp: nowRef.current().toISOString(),
|
|
3329
3379
|
reason,
|
|
3330
3380
|
...status === void 0 ? {} : { status },
|
|
3331
3381
|
dropped_events: droppedEvents
|
|
3332
3382
|
};
|
|
3333
|
-
_optionalChain([onEventRef, 'access',
|
|
3383
|
+
_optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182(event)]);
|
|
3334
3384
|
},
|
|
3335
3385
|
[modal]
|
|
3336
3386
|
);
|
|
@@ -3352,7 +3402,7 @@ function AnalyticsSession(props) {
|
|
|
3352
3402
|
proxyOrigin,
|
|
3353
3403
|
sessionId: sessionIdRef.current,
|
|
3354
3404
|
modal,
|
|
3355
|
-
widgetVersion:
|
|
3405
|
+
widgetVersion: _chunk5YWOJNGJcjs.MODAL_VERSION,
|
|
3356
3406
|
sessionProperties: sessionPropertiesRef.current,
|
|
3357
3407
|
onFailure: (failure) => emitFailure(failure),
|
|
3358
3408
|
fetchImpl: props.fetchImpl,
|
|
@@ -3369,7 +3419,7 @@ function AnalyticsSession(props) {
|
|
|
3369
3419
|
const enqueue = _react.useCallback.call(void 0,
|
|
3370
3420
|
(event) => {
|
|
3371
3421
|
try {
|
|
3372
|
-
_optionalChain([ingestRef, 'access',
|
|
3422
|
+
_optionalChain([ingestRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.transport, 'optionalAccess', _185 => _185.enqueue, 'call', _186 => _186(
|
|
3373
3423
|
event
|
|
3374
3424
|
)]);
|
|
3375
3425
|
} catch (e12) {
|
|
@@ -3408,12 +3458,12 @@ function AnalyticsSession(props) {
|
|
|
3408
3458
|
...payload,
|
|
3409
3459
|
session_id: sessionIdRef.current,
|
|
3410
3460
|
modal,
|
|
3411
|
-
widget_version:
|
|
3461
|
+
widget_version: _chunk5YWOJNGJcjs.MODAL_VERSION,
|
|
3412
3462
|
timestamp: nowRef.current().toISOString(),
|
|
3413
3463
|
session_properties: sessionPropertiesRef.current,
|
|
3414
3464
|
funding_method: fundingMethod
|
|
3415
3465
|
};
|
|
3416
|
-
_optionalChain([onEventRef, 'access',
|
|
3466
|
+
_optionalChain([onEventRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188(
|
|
3417
3467
|
event
|
|
3418
3468
|
)]);
|
|
3419
3469
|
enqueue(event);
|
|
@@ -3427,11 +3477,11 @@ function AnalyticsSession(props) {
|
|
|
3427
3477
|
...payload,
|
|
3428
3478
|
session_id: sessionIdRef.current,
|
|
3429
3479
|
modal,
|
|
3430
|
-
widget_version:
|
|
3480
|
+
widget_version: _chunk5YWOJNGJcjs.MODAL_VERSION,
|
|
3431
3481
|
timestamp: nowRef.current().toISOString(),
|
|
3432
3482
|
session_properties: sessionPropertiesRef.current
|
|
3433
3483
|
};
|
|
3434
|
-
_optionalChain([onEventRef, 'access',
|
|
3484
|
+
_optionalChain([onEventRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190(event)]);
|
|
3435
3485
|
enqueue(event);
|
|
3436
3486
|
},
|
|
3437
3487
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3443,11 +3493,11 @@ function AnalyticsSession(props) {
|
|
|
3443
3493
|
...payload,
|
|
3444
3494
|
session_id: sessionIdRef.current,
|
|
3445
3495
|
modal,
|
|
3446
|
-
widget_version:
|
|
3496
|
+
widget_version: _chunk5YWOJNGJcjs.MODAL_VERSION,
|
|
3447
3497
|
timestamp: nowRef.current().toISOString(),
|
|
3448
3498
|
session_properties: sessionPropertiesRef.current
|
|
3449
3499
|
};
|
|
3450
|
-
_optionalChain([onEventRef, 'access',
|
|
3500
|
+
_optionalChain([onEventRef, 'access', _191 => _191.current, 'optionalCall', _192 => _192(event)]);
|
|
3451
3501
|
enqueue(event);
|
|
3452
3502
|
},
|
|
3453
3503
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3506,7 +3556,7 @@ function toRecoverableDeposit(row, options = {}) {
|
|
|
3506
3556
|
};
|
|
3507
3557
|
}
|
|
3508
3558
|
function isDepositSelfDestination(row, destination) {
|
|
3509
|
-
const depositAddress = _optionalChain([row, 'access',
|
|
3559
|
+
const depositAddress = _optionalChain([row, 'access', _193 => _193.depositAddress, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]);
|
|
3510
3560
|
const candidate = destination.trim();
|
|
3511
3561
|
if (!depositAddress || !candidate) return false;
|
|
3512
3562
|
return depositAddress.toLowerCase() === candidate.toLowerCase();
|
|
@@ -3559,7 +3609,7 @@ var STATUS_LABEL = {
|
|
|
3559
3609
|
};
|
|
3560
3610
|
function filterVisibleDeposits(deposits) {
|
|
3561
3611
|
const sourceHashes = new Set(
|
|
3562
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
3612
|
+
deposits.map((d) => _optionalChain([d, 'access', _196 => _196.sourceTxHash, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198()])).filter((h) => Boolean(h))
|
|
3563
3613
|
);
|
|
3564
3614
|
return deposits.filter(
|
|
3565
3615
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -3628,7 +3678,7 @@ function HistoryEntryButton({
|
|
|
3628
3678
|
(badge || unread) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
3679
|
"span",
|
|
3630
3680
|
{
|
|
3631
|
-
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
3681
|
+
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess', _199 => _199.state]), () => ( "progress"))}`,
|
|
3632
3682
|
"aria-hidden": "true"
|
|
3633
3683
|
}
|
|
3634
3684
|
)
|
|
@@ -3678,7 +3728,7 @@ function CdnIcon({
|
|
|
3678
3728
|
}
|
|
3679
3729
|
const isLoading = loadedSrc !== src;
|
|
3680
3730
|
const settleIfAlreadyComplete = (el) => {
|
|
3681
|
-
if (_optionalChain([el, 'optionalAccess',
|
|
3731
|
+
if (_optionalChain([el, 'optionalAccess', _200 => _200.complete])) setLoadedSrc(src);
|
|
3682
3732
|
};
|
|
3683
3733
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3684
3734
|
"img",
|
|
@@ -3915,8 +3965,8 @@ function toPaymentView(order) {
|
|
|
3915
3965
|
const progress = toPaymentProgress(order);
|
|
3916
3966
|
return {
|
|
3917
3967
|
id: order.id,
|
|
3918
|
-
amount: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3919
|
-
currency: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3968
|
+
amount: _nullishCoalesce(_optionalChain([order, 'access', _201 => _201.fiat, 'access', _202 => _202.charged, 'optionalAccess', _203 => _203.total]), () => ( "")),
|
|
3969
|
+
currency: _nullishCoalesce(_optionalChain([order, 'access', _204 => _204.fiat, 'access', _205 => _205.charged, 'optionalAccess', _206 => _206.currency]), () => ( "")),
|
|
3920
3970
|
progress,
|
|
3921
3971
|
terminal: TERMINAL.has(progress)
|
|
3922
3972
|
};
|
|
@@ -4051,12 +4101,12 @@ function BankOrderCard({
|
|
|
4051
4101
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
4102
|
HistoryTransactionLink,
|
|
4053
4103
|
{
|
|
4054
|
-
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4055
|
-
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4104
|
+
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _207 => _207.chain]), () => ( order.deliveryChain)),
|
|
4105
|
+
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _208 => _208.txHash]), () => ( deliveryTxHash)),
|
|
4056
4106
|
label: "Crypto deposit"
|
|
4057
4107
|
}
|
|
4058
4108
|
),
|
|
4059
|
-
_optionalChain([deposit, 'optionalAccess',
|
|
4109
|
+
_optionalChain([deposit, 'optionalAccess', _209 => _209.destinationTxHash]) !== _optionalChain([deposit, 'optionalAccess', _210 => _210.txHash]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryTransactionLink, { chainId: _optionalChain([deposit, 'optionalAccess', _211 => _211.targetChain]), txHash: _optionalChain([deposit, 'optionalAccess', _212 => _212.destinationTxHash]), label: "Final settlement" }),
|
|
4060
4110
|
(needsHelp || status === "failed") && support && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4061
4111
|
"a",
|
|
4062
4112
|
{
|
|
@@ -4084,7 +4134,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4084
4134
|
const entry = useAssetMetadata([token])[_nullishCoalesce(id, () => ( ""))];
|
|
4085
4135
|
const classes = `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd();
|
|
4086
4136
|
const badge = _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-token-initials", "aria-hidden": "true", children: (_nullishCoalesce(symbol, () => ( ""))).trim().slice(0, 1).toUpperCase() })));
|
|
4087
|
-
if (_optionalChain([entry, 'optionalAccess',
|
|
4137
|
+
if (_optionalChain([entry, 'optionalAccess', _213 => _213.status]) === "pending") {
|
|
4088
4138
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4089
4139
|
"span",
|
|
4090
4140
|
{
|
|
@@ -4097,7 +4147,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4097
4147
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4098
4148
|
CdnIcon,
|
|
4099
4149
|
{
|
|
4100
|
-
src: _optionalChain([entry, 'optionalAccess',
|
|
4150
|
+
src: _optionalChain([entry, 'optionalAccess', _214 => _214.status]) === "ready" ? entry.logo : void 0,
|
|
4101
4151
|
className: classes,
|
|
4102
4152
|
fallback: badge
|
|
4103
4153
|
}
|
|
@@ -4204,23 +4254,23 @@ function resolveCuratedToken(token, chain) {
|
|
|
4204
4254
|
return void 0;
|
|
4205
4255
|
}
|
|
4206
4256
|
function resolveTokenDisplay(token, chain, asset, fallback) {
|
|
4207
|
-
const pending = _optionalChain([asset, 'optionalAccess',
|
|
4257
|
+
const pending = _optionalChain([asset, 'optionalAccess', _215 => _215.status]) === "pending";
|
|
4208
4258
|
const curated = token !== void 0 && chain !== void 0 ? resolveCuratedToken(token, chain) : void 0;
|
|
4209
|
-
const fromAsset = _optionalChain([asset, 'optionalAccess',
|
|
4259
|
+
const fromAsset = _optionalChain([asset, 'optionalAccess', _216 => _216.status]) === "ready" ? asset : void 0;
|
|
4210
4260
|
const hyperCore = chain !== void 0 && isHyperCore(chain);
|
|
4211
4261
|
const native = token !== void 0 && chain !== void 0 && isNativeSpelling(chain, token);
|
|
4212
|
-
const curatedSymbol = native ? _nullishCoalesce(_optionalChain([curated, 'optionalAccess',
|
|
4213
|
-
const decimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
4262
|
+
const curatedSymbol = native ? _nullishCoalesce(_optionalChain([curated, 'optionalAccess', _217 => _217.symbol]), () => ( _optionalChain([fromAsset, 'optionalAccess', _218 => _218.symbol]))) : _nullishCoalesce(_optionalChain([fromAsset, 'optionalAccess', _219 => _219.symbol]), () => ( _optionalChain([curated, 'optionalAccess', _220 => _220.symbol])));
|
|
4263
|
+
const decimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _221 => _221.decimals]), () => ( _optionalChain([curated, 'optionalAccess', _222 => _222.decimals]))), () => ( (hyperCore ? void 0 : _optionalChain([fromAsset, 'optionalAccess', _223 => _223.decimals]))));
|
|
4214
4264
|
return {
|
|
4215
|
-
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
4265
|
+
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess', _224 => _224.symbol]))), () => ( "Token")),
|
|
4216
4266
|
decimals,
|
|
4217
|
-
logo: _optionalChain([fromAsset, 'optionalAccess',
|
|
4267
|
+
logo: _optionalChain([fromAsset, 'optionalAccess', _225 => _225.logo]),
|
|
4218
4268
|
curated: curatedSymbol !== void 0,
|
|
4219
4269
|
pending
|
|
4220
4270
|
};
|
|
4221
4271
|
}
|
|
4222
4272
|
function toAssetRef(ref) {
|
|
4223
|
-
return _optionalChain([ref, 'optionalAccess',
|
|
4273
|
+
return _optionalChain([ref, 'optionalAccess', _226 => _226.chain]) !== void 0 && ref.address ? { chain: ref.chain, address: ref.address } : void 0;
|
|
4224
4274
|
}
|
|
4225
4275
|
function useTokenDisplays(refs) {
|
|
4226
4276
|
const { catalog } = useChainCatalog();
|
|
@@ -4231,16 +4281,16 @@ function useTokenDisplays(refs) {
|
|
|
4231
4281
|
);
|
|
4232
4282
|
const assets = useAssetMetadata(refs.map(toAssetRef));
|
|
4233
4283
|
const key = refs.map(
|
|
4234
|
-
(ref) => `${String(_optionalChain([ref, 'optionalAccess',
|
|
4284
|
+
(ref) => `${String(_optionalChain([ref, 'optionalAccess', _227 => _227.chain]))}:${_nullishCoalesce(_optionalChain([ref, 'optionalAccess', _228 => _228.address]), () => ( ""))}:${_nullishCoalesce(_optionalChain([ref, 'optionalAccess', _229 => _229.fallback, 'optionalAccess', _230 => _230.symbol]), () => ( ""))}:${_nullishCoalesce(_optionalChain([ref, 'optionalAccess', _231 => _231.fallback, 'optionalAccess', _232 => _232.decimals]), () => ( ""))}`
|
|
4235
4285
|
).join("|");
|
|
4236
4286
|
return _react.useMemo.call(void 0,
|
|
4237
4287
|
() => refs.map((ref) => {
|
|
4238
|
-
const id = assetIdFor(_optionalChain([ref, 'optionalAccess',
|
|
4288
|
+
const id = assetIdFor(_optionalChain([ref, 'optionalAccess', _233 => _233.chain]), _optionalChain([ref, 'optionalAccess', _234 => _234.address]));
|
|
4239
4289
|
return resolveTokenDisplay(
|
|
4240
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4241
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4290
|
+
_optionalChain([ref, 'optionalAccess', _235 => _235.address]),
|
|
4291
|
+
_optionalChain([ref, 'optionalAccess', _236 => _236.chain]),
|
|
4242
4292
|
id ? assets[id] : void 0,
|
|
4243
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4293
|
+
_optionalChain([ref, 'optionalAccess', _237 => _237.fallback])
|
|
4244
4294
|
);
|
|
4245
4295
|
}),
|
|
4246
4296
|
// `refs` enters through `key`.
|
|
@@ -4311,7 +4361,7 @@ function DepositHistoryPanel({
|
|
|
4311
4361
|
}) {
|
|
4312
4362
|
const rootRef = _react.useRef.call(void 0, null);
|
|
4313
4363
|
_react.useEffect.call(void 0, () => {
|
|
4314
|
-
_optionalChain([rootRef, 'access',
|
|
4364
|
+
_optionalChain([rootRef, 'access', _238 => _238.current, 'optionalAccess', _239 => _239.toggleAttribute, 'call', _240 => _240("inert", Boolean(obscured))]);
|
|
4315
4365
|
}, [obscured]);
|
|
4316
4366
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
4317
4367
|
(e) => {
|
|
@@ -4345,7 +4395,7 @@ function DepositHistoryPanel({
|
|
|
4345
4395
|
_react.useEffect.call(void 0, () => {
|
|
4346
4396
|
const nextBoundary = timingPresentations.reduce(
|
|
4347
4397
|
(earliest, presentation) => {
|
|
4348
|
-
const next = _optionalChain([presentation, 'optionalAccess',
|
|
4398
|
+
const next = _optionalChain([presentation, 'optionalAccess', _241 => _241.nextTransitionAtMs]);
|
|
4349
4399
|
if (next === void 0) return earliest;
|
|
4350
4400
|
return earliest === void 0 || next < earliest ? next : earliest;
|
|
4351
4401
|
},
|
|
@@ -4419,7 +4469,7 @@ function DepositHistoryPanel({
|
|
|
4419
4469
|
]
|
|
4420
4470
|
}
|
|
4421
4471
|
),
|
|
4422
|
-
(isLoading || _optionalChain([bankHistory, 'optionalAccess',
|
|
4472
|
+
(isLoading || _optionalChain([bankHistory, 'optionalAccess', _242 => _242.loading])) && deposits.length === 0 && !_optionalChain([bankHistory, 'optionalAccess', _243 => _243.orders, 'access', _244 => _244.length]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4423
4473
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.HistoryIcon, {}) }),
|
|
4424
4474
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4425
4475
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
@@ -4433,18 +4483,18 @@ function DepositHistoryPanel({
|
|
|
4433
4483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
4434
4484
|
] })
|
|
4435
4485
|
] }),
|
|
4436
|
-
_optionalChain([bankHistory, 'optionalAccess',
|
|
4437
|
-
!isLoading && !error && !_optionalChain([bankHistory, 'optionalAccess',
|
|
4486
|
+
_optionalChain([bankHistory, 'optionalAccess', _245 => _245.error]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { role: "status", children: bankHistory.error }),
|
|
4487
|
+
!isLoading && !error && !_optionalChain([bankHistory, 'optionalAccess', _246 => _246.loading]) && !_optionalChain([bankHistory, 'optionalAccess', _247 => _247.error]) && !_optionalChain([bankHistory, 'optionalAccess', _248 => _248.orders, 'access', _249 => _249.length]) && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4438
4488
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.HistoryIcon, {}) }),
|
|
4439
4489
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4440
4490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
4441
4491
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
4442
4492
|
] })
|
|
4443
4493
|
] }),
|
|
4444
|
-
(visibleDeposits.length > 0 || Boolean(_optionalChain([bankHistory, 'optionalAccess',
|
|
4494
|
+
(visibleDeposits.length > 0 || Boolean(_optionalChain([bankHistory, 'optionalAccess', _250 => _250.orders, 'access', _251 => _251.length]))) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
4445
4495
|
[
|
|
4446
4496
|
...visibleDeposits.filter(
|
|
4447
|
-
(deposit) => !_optionalChain([bankHistory, 'optionalAccess',
|
|
4497
|
+
(deposit) => !_optionalChain([bankHistory, 'optionalAccess', _252 => _252.orders, 'access', _253 => _253.some, 'call', _254 => _254(
|
|
4448
4498
|
(order) => order.stages.delivery.status === "completed" && order.stages.delivery.depositId === deposit.id
|
|
4449
4499
|
)])
|
|
4450
4500
|
).map((deposit, i) => ({
|
|
@@ -4463,7 +4513,7 @@ function DepositHistoryPanel({
|
|
|
4463
4513
|
deposit.txHash || i
|
|
4464
4514
|
)
|
|
4465
4515
|
})),
|
|
4466
|
-
...(_nullishCoalesce(_optionalChain([bankHistory, 'optionalAccess',
|
|
4516
|
+
...(_nullishCoalesce(_optionalChain([bankHistory, 'optionalAccess', _255 => _255.orders]), () => ( []))).map((order) => {
|
|
4467
4517
|
const delivery = order.stages.delivery;
|
|
4468
4518
|
const linked = delivery.status === "completed" ? visibleDeposits.find(
|
|
4469
4519
|
(deposit) => deposit.id === delivery.depositId
|
|
@@ -4485,7 +4535,7 @@ function DepositHistoryPanel({
|
|
|
4485
4535
|
};
|
|
4486
4536
|
})
|
|
4487
4537
|
].sort((a, b) => b.createdAt.localeCompare(a.createdAt)).map((entry) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: entry.content }, entry.id)),
|
|
4488
|
-
_optionalChain([bankHistory, 'optionalAccess',
|
|
4538
|
+
_optionalChain([bankHistory, 'optionalAccess', _256 => _256.hasMore]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4489
4539
|
"button",
|
|
4490
4540
|
{
|
|
4491
4541
|
type: "button",
|
|
@@ -4549,7 +4599,7 @@ function HistoryCard({
|
|
|
4549
4599
|
setExpanded(next);
|
|
4550
4600
|
const depositId = _nullishCoalesce(deposit.id, () => ( deposit.txHash));
|
|
4551
4601
|
if (!next || !depositId) return;
|
|
4552
|
-
_optionalChain([onRowView, 'optionalCall',
|
|
4602
|
+
_optionalChain([onRowView, 'optionalCall', _257 => _257({
|
|
4553
4603
|
depositId,
|
|
4554
4604
|
status,
|
|
4555
4605
|
recoverable: eligible !== null,
|
|
@@ -4622,7 +4672,7 @@ function HistoryCard({
|
|
|
4622
4672
|
recoverable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4623
4673
|
Button,
|
|
4624
4674
|
{
|
|
4625
|
-
onClick: () => _optionalChain([onRecover, 'optionalCall',
|
|
4675
|
+
onClick: () => _optionalChain([onRecover, 'optionalCall', _258 => _258(recoverable)]),
|
|
4626
4676
|
fullWidth: true,
|
|
4627
4677
|
className: "rs-history-card-recover",
|
|
4628
4678
|
children: [
|
|
@@ -4687,7 +4737,7 @@ function ListRow({
|
|
|
4687
4737
|
if (disabled) return;
|
|
4688
4738
|
if (e.key === "Enter" || e.key === " ") {
|
|
4689
4739
|
e.preventDefault();
|
|
4690
|
-
_optionalChain([onClick, 'optionalCall',
|
|
4740
|
+
_optionalChain([onClick, 'optionalCall', _259 => _259(e)]);
|
|
4691
4741
|
}
|
|
4692
4742
|
};
|
|
4693
4743
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4697,7 +4747,7 @@ function ListRow({
|
|
|
4697
4747
|
role: "button",
|
|
4698
4748
|
tabIndex: disabled ? -1 : 0,
|
|
4699
4749
|
"aria-disabled": disabled || void 0,
|
|
4700
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
4750
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _260 => _260(e)]),
|
|
4701
4751
|
onKeyDown: handleKey,
|
|
4702
4752
|
children: inner
|
|
4703
4753
|
}
|
|
@@ -4755,7 +4805,7 @@ var RECOVERY_LOOKUP_MISS_COPY = {
|
|
|
4755
4805
|
};
|
|
4756
4806
|
function classifyRecoveryLookup(rows, options = {}) {
|
|
4757
4807
|
const inScope = options.recipient ? rows.filter(
|
|
4758
|
-
(row) => _optionalChain([row, 'access',
|
|
4808
|
+
(row) => _optionalChain([row, 'access', _261 => _261.recipient, 'optionalAccess', _262 => _262.toLowerCase, 'call', _263 => _263()]) === _optionalChain([options, 'access', _264 => _264.recipient, 'optionalAccess', _265 => _265.toLowerCase, 'call', _266 => _266()])
|
|
4759
4809
|
) : rows;
|
|
4760
4810
|
const eligible = inScope.map((row) => toRecoverableDeposit(row, options)).filter((deposit) => deposit !== null);
|
|
4761
4811
|
return {
|
|
@@ -4783,7 +4833,7 @@ function RecoveryLookupScreen({
|
|
|
4783
4833
|
const valid = isRecoveryTxHash(trimmed);
|
|
4784
4834
|
_react.useEffect.call(void 0, () => {
|
|
4785
4835
|
if (trimmed.length > 0 && !valid) {
|
|
4786
|
-
_optionalChain([onInvalidRef, 'access',
|
|
4836
|
+
_optionalChain([onInvalidRef, 'access', _267 => _267.current, 'optionalCall', _268 => _268()]);
|
|
4787
4837
|
}
|
|
4788
4838
|
}, [trimmed, valid, onInvalidRef]);
|
|
4789
4839
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -5080,7 +5130,7 @@ async function submitSignedRecovery(params) {
|
|
|
5080
5130
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
5081
5131
|
// every other backend call. Without it this path would be invisible in the
|
|
5082
5132
|
// per-client version telemetry the processor records.
|
|
5083
|
-
headers:
|
|
5133
|
+
headers: _chunk5YWOJNGJcjs.serviceHeaders.call(void 0, ),
|
|
5084
5134
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
5085
5135
|
// precision well before that range.
|
|
5086
5136
|
body: JSON.stringify({ depositId, destination, signature })
|
|
@@ -5550,17 +5600,17 @@ function HistoryFallbackFlow({
|
|
|
5550
5600
|
),
|
|
5551
5601
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list", children: matches.map((match, i) => {
|
|
5552
5602
|
const display = matchDisplays[i];
|
|
5553
|
-
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess',
|
|
5603
|
+
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess', _269 => _269.symbol]), () => ( "Token"));
|
|
5554
5604
|
const { amount, chainName } = describeRecoveryDeposit({
|
|
5555
5605
|
chainId: match.sourceChainId,
|
|
5556
5606
|
amountRaw: match.amountRaw,
|
|
5557
5607
|
symbol,
|
|
5558
|
-
decimals: _optionalChain([display, 'optionalAccess',
|
|
5608
|
+
decimals: _optionalChain([display, 'optionalAccess', _270 => _270.decimals])
|
|
5559
5609
|
});
|
|
5560
5610
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5561
5611
|
ListRow,
|
|
5562
5612
|
{
|
|
5563
|
-
leadingMedia: _optionalChain([display, 'optionalAccess',
|
|
5613
|
+
leadingMedia: _optionalChain([display, 'optionalAccess', _271 => _271.logo]),
|
|
5564
5614
|
title: `${amount} ${symbol}`,
|
|
5565
5615
|
subtitle: chainName,
|
|
5566
5616
|
onClick: () => selectMatch(match)
|
|
@@ -5700,9 +5750,9 @@ function RecoveryReviewScreen({
|
|
|
5700
5750
|
_react.useEffect.call(void 0, () => {
|
|
5701
5751
|
if (destination.length === 0) return;
|
|
5702
5752
|
if (isSelfDestination) {
|
|
5703
|
-
_optionalChain([onDestinationIsDepositAddressRef, 'access',
|
|
5753
|
+
_optionalChain([onDestinationIsDepositAddressRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
|
|
5704
5754
|
} else if (!destinationValid) {
|
|
5705
|
-
_optionalChain([onDestinationInvalidRef, 'access',
|
|
5755
|
+
_optionalChain([onDestinationInvalidRef, 'access', _274 => _274.current, 'optionalCall', _275 => _275()]);
|
|
5706
5756
|
}
|
|
5707
5757
|
}, [
|
|
5708
5758
|
destination,
|
|
@@ -5874,11 +5924,11 @@ function HistoryRecoveryFlow({
|
|
|
5874
5924
|
} catch (err) {
|
|
5875
5925
|
const recoveryError = err instanceof RecoveryError ? err : void 0;
|
|
5876
5926
|
setError(
|
|
5877
|
-
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5927
|
+
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _276 => _276.message]), () => ( formatUserError(
|
|
5878
5928
|
err instanceof Error ? err.message : "Recovery failed"
|
|
5879
5929
|
)))
|
|
5880
5930
|
);
|
|
5881
|
-
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5931
|
+
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _277 => _277.retryable]), () => ( true));
|
|
5882
5932
|
setRetryable(canRetry);
|
|
5883
5933
|
setPhase("failed");
|
|
5884
5934
|
const reason = claimFailureReasonForError(err);
|
|
@@ -6029,8 +6079,8 @@ function HistoryOverlay({
|
|
|
6029
6079
|
const endAttempt = _react.useCallback.call(void 0,
|
|
6030
6080
|
(source, reason) => {
|
|
6031
6081
|
const claim = claimControllerRef.current;
|
|
6032
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6033
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6082
|
+
_optionalChain([claim, 'optionalAccess', _278 => _278.abandon, 'call', _279 => _279(reason)]);
|
|
6083
|
+
_optionalChain([claim, 'optionalAccess', _280 => _280.close, 'call', _281 => _281(source)]);
|
|
6034
6084
|
claimControllerRef.current = null;
|
|
6035
6085
|
setAttempt(null);
|
|
6036
6086
|
},
|
|
@@ -6088,8 +6138,8 @@ function HistoryOverlay({
|
|
|
6088
6138
|
if (!attempt) return;
|
|
6089
6139
|
return () => {
|
|
6090
6140
|
const claim = claimControllerRef.current;
|
|
6091
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6092
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6141
|
+
_optionalChain([claim, 'optionalAccess', _282 => _282.abandon, 'call', _283 => _283("modal_close")]);
|
|
6142
|
+
_optionalChain([claim, 'optionalAccess', _284 => _284.close, 'call', _285 => _285("host_controlled")]);
|
|
6093
6143
|
};
|
|
6094
6144
|
}, [attempt]);
|
|
6095
6145
|
const claimSessionProperties = _react.useMemo.call(void 0,
|
|
@@ -6115,7 +6165,7 @@ function HistoryOverlay({
|
|
|
6115
6165
|
HistoryRecoveryFlow,
|
|
6116
6166
|
{
|
|
6117
6167
|
deposit: recovering,
|
|
6118
|
-
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess',
|
|
6168
|
+
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess', _286 => _286.entrySource]), () => ( "history_row")),
|
|
6119
6169
|
backendUrl,
|
|
6120
6170
|
signRecovery,
|
|
6121
6171
|
debug,
|
|
@@ -6271,7 +6321,7 @@ function useHistoryPanel({
|
|
|
6271
6321
|
}, [isOpen, badgeState2.nextExpiryAt]);
|
|
6272
6322
|
const openPanel = _react.useCallback.call(void 0, () => {
|
|
6273
6323
|
setIsPanelOpen(true);
|
|
6274
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6324
|
+
_optionalChain([analytics, 'optionalAccess', _287 => _287.visitOpened, 'call', _288 => _288(badge)]);
|
|
6275
6325
|
if (!loadedRef.current || staleRef.current) {
|
|
6276
6326
|
fetchHistory("initial");
|
|
6277
6327
|
}
|
|
@@ -6279,10 +6329,10 @@ function useHistoryPanel({
|
|
|
6279
6329
|
const closePanel = _react.useCallback.call(void 0, () => {
|
|
6280
6330
|
if (recovering) return;
|
|
6281
6331
|
setIsPanelOpen(false);
|
|
6282
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6332
|
+
_optionalChain([analytics, 'optionalAccess', _289 => _289.visitEnded, 'call', _290 => _290()]);
|
|
6283
6333
|
}, [analytics, recovering]);
|
|
6284
6334
|
const loadMore = _react.useCallback.call(void 0, () => {
|
|
6285
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6335
|
+
_optionalChain([analytics, 'optionalAccess', _291 => _291.loadMore, 'call', _292 => _292(filterVisibleDeposits(deposits).length)]);
|
|
6286
6336
|
fetchHistory("more");
|
|
6287
6337
|
}, [analytics, deposits, fetchHistory]);
|
|
6288
6338
|
const markStale = _react.useCallback.call(void 0, () => {
|
|
@@ -6310,7 +6360,7 @@ function useHistoryPanel({
|
|
|
6310
6360
|
_react.useEffect.call(void 0, () => {
|
|
6311
6361
|
if (isOpen) return;
|
|
6312
6362
|
setIsPanelOpen(false);
|
|
6313
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6363
|
+
_optionalChain([analytics, 'optionalAccess', _293 => _293.visitEnded, 'call', _294 => _294()]);
|
|
6314
6364
|
setDeposits([]);
|
|
6315
6365
|
setHasMore(false);
|
|
6316
6366
|
setError(null);
|
|
@@ -6469,11 +6519,11 @@ var NOTHING_TO_STOP = () => {
|
|
|
6469
6519
|
};
|
|
6470
6520
|
function resolveThemeMode(mode) {
|
|
6471
6521
|
if (mode !== "system") return mode;
|
|
6472
|
-
return _optionalChain([globalThis, 'access',
|
|
6522
|
+
return _optionalChain([globalThis, 'access', _295 => _295.matchMedia, 'optionalCall', _296 => _296(DARK_SCHEME_QUERY), 'access', _297 => _297.matches]) ? "dark" : "light";
|
|
6473
6523
|
}
|
|
6474
6524
|
function followSystemAppearance(mode, onChange) {
|
|
6475
6525
|
if (mode !== "system") return NOTHING_TO_STOP;
|
|
6476
|
-
const query = _optionalChain([globalThis, 'access',
|
|
6526
|
+
const query = _optionalChain([globalThis, 'access', _298 => _298.matchMedia, 'optionalCall', _299 => _299(DARK_SCHEME_QUERY)]);
|
|
6477
6527
|
if (!query) return NOTHING_TO_STOP;
|
|
6478
6528
|
query.addEventListener("change", onChange);
|
|
6479
6529
|
return () => query.removeEventListener("change", onChange);
|
|
@@ -6481,22 +6531,22 @@ function followSystemAppearance(mode, onChange) {
|
|
|
6481
6531
|
function applyTheme(element, theme) {
|
|
6482
6532
|
if (!element) return NOTHING_TO_STOP;
|
|
6483
6533
|
const parent = element.parentElement;
|
|
6484
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
6534
|
+
const targets = _optionalChain([parent, 'optionalAccess', _300 => _300.classList, 'access', _301 => _301.contains, 'call', _302 => _302("rs-modal-content")]) ? [element, parent] : [element];
|
|
6485
6535
|
const paintMode = () => {
|
|
6486
|
-
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess',
|
|
6536
|
+
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess', _303 => _303.mode]));
|
|
6487
6537
|
for (const t of targets) {
|
|
6488
6538
|
if (resolved) t.setAttribute("data-theme", resolved);
|
|
6489
6539
|
else t.removeAttribute("data-theme");
|
|
6490
6540
|
}
|
|
6491
6541
|
};
|
|
6492
6542
|
paintMode();
|
|
6493
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6543
|
+
if (_optionalChain([theme, 'optionalAccess', _304 => _304.fontColor])) {
|
|
6494
6544
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
6495
6545
|
}
|
|
6496
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6546
|
+
if (_optionalChain([theme, 'optionalAccess', _305 => _305.iconColor])) {
|
|
6497
6547
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
6498
6548
|
}
|
|
6499
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6549
|
+
if (_optionalChain([theme, 'optionalAccess', _306 => _306.ctaColor])) {
|
|
6500
6550
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
6501
6551
|
if (derived) {
|
|
6502
6552
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -6521,25 +6571,25 @@ function applyTheme(element, theme) {
|
|
|
6521
6571
|
}
|
|
6522
6572
|
} else {
|
|
6523
6573
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
6524
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6574
|
+
if (_optionalChain([theme, 'optionalAccess', _307 => _307.ctaHoverColor])) {
|
|
6525
6575
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
6526
6576
|
}
|
|
6527
6577
|
}
|
|
6528
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6578
|
+
if (_optionalChain([theme, 'optionalAccess', _308 => _308.borderColor])) {
|
|
6529
6579
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
6530
6580
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
6531
6581
|
}
|
|
6532
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6582
|
+
if (_optionalChain([theme, 'optionalAccess', _309 => _309.backgroundColor])) {
|
|
6533
6583
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
6534
6584
|
}
|
|
6535
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6585
|
+
if (_optionalChain([theme, 'optionalAccess', _310 => _310.radius])) {
|
|
6536
6586
|
const scale = RADIUS_SCALE[theme.radius];
|
|
6537
6587
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
6538
6588
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
6539
6589
|
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
6540
6590
|
setVar(targets, "--rs-radius", scale.md);
|
|
6541
6591
|
}
|
|
6542
|
-
return followSystemAppearance(_optionalChain([theme, 'optionalAccess',
|
|
6592
|
+
return followSystemAppearance(_optionalChain([theme, 'optionalAccess', _311 => _311.mode]), paintMode);
|
|
6543
6593
|
}
|
|
6544
6594
|
|
|
6545
6595
|
// src/core/removed-props.ts
|
|
@@ -6643,20 +6693,20 @@ function sinkFor(source) {
|
|
|
6643
6693
|
if (source.modal === "deposit") {
|
|
6644
6694
|
const at2 = () => source.controllerRef.current;
|
|
6645
6695
|
return {
|
|
6646
|
-
opened: (detail) => _optionalChain([at2, 'call',
|
|
6647
|
-
rowViewed: (detail) => _optionalChain([at2, 'call',
|
|
6648
|
-
loadMore: (detail) => _optionalChain([at2, 'call',
|
|
6649
|
-
fallbackOpened: (detail) => _optionalChain([at2, 'call',
|
|
6650
|
-
recoveryStarted: (detail) => _optionalChain([at2, 'call',
|
|
6696
|
+
opened: (detail) => _optionalChain([at2, 'call', _312 => _312(), 'optionalAccess', _313 => _313.historyOpened, 'call', _314 => _314({ ...detail, step: _nullishCoalesce(_optionalChain([at2, 'call', _315 => _315(), 'optionalAccess', _316 => _316.step]), () => ( null)) })]),
|
|
6697
|
+
rowViewed: (detail) => _optionalChain([at2, 'call', _317 => _317(), 'optionalAccess', _318 => _318.historyRowViewed, 'call', _319 => _319(detail)]),
|
|
6698
|
+
loadMore: (detail) => _optionalChain([at2, 'call', _320 => _320(), 'optionalAccess', _321 => _321.historyLoadMore, 'call', _322 => _322(detail)]),
|
|
6699
|
+
fallbackOpened: (detail) => _optionalChain([at2, 'call', _323 => _323(), 'optionalAccess', _324 => _324.historyFallbackOpened, 'call', _325 => _325(detail)]),
|
|
6700
|
+
recoveryStarted: (detail) => _optionalChain([at2, 'call', _326 => _326(), 'optionalAccess', _327 => _327.historyRecoveryStarted, 'call', _328 => _328(detail)])
|
|
6651
6701
|
};
|
|
6652
6702
|
}
|
|
6653
6703
|
const at = () => source.controllerRef.current;
|
|
6654
6704
|
return {
|
|
6655
|
-
opened: (detail) => _optionalChain([at, 'call',
|
|
6656
|
-
rowViewed: (detail) => _optionalChain([at, 'call',
|
|
6657
|
-
loadMore: (detail) => _optionalChain([at, 'call',
|
|
6658
|
-
fallbackOpened: (detail) => _optionalChain([at, 'call',
|
|
6659
|
-
recoveryStarted: (detail) => _optionalChain([at, 'call',
|
|
6705
|
+
opened: (detail) => _optionalChain([at, 'call', _329 => _329(), 'optionalAccess', _330 => _330.historyOpened, 'call', _331 => _331({ ...detail, step: _nullishCoalesce(_optionalChain([at, 'call', _332 => _332(), 'optionalAccess', _333 => _333.step]), () => ( null)) })]),
|
|
6706
|
+
rowViewed: (detail) => _optionalChain([at, 'call', _334 => _334(), 'optionalAccess', _335 => _335.historyRowViewed, 'call', _336 => _336(detail)]),
|
|
6707
|
+
loadMore: (detail) => _optionalChain([at, 'call', _337 => _337(), 'optionalAccess', _338 => _338.historyLoadMore, 'call', _339 => _339(detail)]),
|
|
6708
|
+
fallbackOpened: (detail) => _optionalChain([at, 'call', _340 => _340(), 'optionalAccess', _341 => _341.historyFallbackOpened, 'call', _342 => _342(detail)]),
|
|
6709
|
+
recoveryStarted: (detail) => _optionalChain([at, 'call', _343 => _343(), 'optionalAccess', _344 => _344.historyRecoveryStarted, 'call', _345 => _345(detail)])
|
|
6660
6710
|
};
|
|
6661
6711
|
}
|
|
6662
6712
|
function badgeState(badge) {
|
|
@@ -6682,7 +6732,7 @@ function createHistoryAnalytics(source) {
|
|
|
6682
6732
|
sink.opened({
|
|
6683
6733
|
history_visit_id: visitId,
|
|
6684
6734
|
badge: badgeState(badge),
|
|
6685
|
-
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
6735
|
+
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess', _346 => _346.count]), () => ( 0))
|
|
6686
6736
|
});
|
|
6687
6737
|
},
|
|
6688
6738
|
visitEnded() {
|
|
@@ -6746,7 +6796,7 @@ function resolveChain(targetChain) {
|
|
|
6746
6796
|
return _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, targetChain);
|
|
6747
6797
|
}
|
|
6748
6798
|
function resolveToken(targetToken) {
|
|
6749
|
-
const raw = _optionalChain([targetToken, 'optionalAccess',
|
|
6799
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _347 => _347.trim, 'call', _348 => _348()]);
|
|
6750
6800
|
if (!raw) return void 0;
|
|
6751
6801
|
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
6752
6802
|
if (BASE58_TOKEN.test(raw)) return raw;
|
|
@@ -6804,8 +6854,8 @@ function Tooltip({ content, children, className }) {
|
|
|
6804
6854
|
function handleOutside(event) {
|
|
6805
6855
|
const target = event.target;
|
|
6806
6856
|
if (!target) return;
|
|
6807
|
-
if (_optionalChain([triggerRef, 'access',
|
|
6808
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
6857
|
+
if (_optionalChain([triggerRef, 'access', _349 => _349.current, 'optionalAccess', _350 => _350.contains, 'call', _351 => _351(target)])) return;
|
|
6858
|
+
if (_optionalChain([bubbleRef, 'access', _352 => _352.current, 'optionalAccess', _353 => _353.contains, 'call', _354 => _354(target)])) return;
|
|
6809
6859
|
setOpen(false);
|
|
6810
6860
|
}
|
|
6811
6861
|
function handleKey(event) {
|
|
@@ -7035,7 +7085,7 @@ function asNumber(value) {
|
|
|
7035
7085
|
const trimmed = value.trim();
|
|
7036
7086
|
if (!trimmed) return void 0;
|
|
7037
7087
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
7038
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
7088
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _355 => _355[1]])) {
|
|
7039
7089
|
const parsed2 = Number(caipMatch[1]);
|
|
7040
7090
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
7041
7091
|
}
|
|
@@ -7054,24 +7104,24 @@ function asAddress(value) {
|
|
|
7054
7104
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
7055
7105
|
}
|
|
7056
7106
|
function getEventTxHash(event) {
|
|
7057
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7107
|
+
if (!_optionalChain([event, 'optionalAccess', _356 => _356.type])) return void 0;
|
|
7058
7108
|
if (event.type === "deposit-received") {
|
|
7059
|
-
return asString(_optionalChain([event, 'access',
|
|
7109
|
+
return asString(_optionalChain([event, 'access', _357 => _357.data, 'optionalAccess', _358 => _358.transactionHash]));
|
|
7060
7110
|
}
|
|
7061
7111
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
7062
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
7063
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
7064
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
7112
|
+
const deposit = isRecord(_optionalChain([event, 'access', _359 => _359.data, 'optionalAccess', _360 => _360.deposit])) ? event.data.deposit : void 0;
|
|
7113
|
+
const source = isRecord(_optionalChain([event, 'access', _361 => _361.data, 'optionalAccess', _362 => _362.source])) ? event.data.source : void 0;
|
|
7114
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _363 => _363.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _364 => _364.transactionHash]))));
|
|
7065
7115
|
}
|
|
7066
7116
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
7067
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
7068
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
7069
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
7117
|
+
const deposit = isRecord(_optionalChain([event, 'access', _365 => _365.data, 'optionalAccess', _366 => _366.deposit])) ? event.data.deposit : void 0;
|
|
7118
|
+
const source = isRecord(_optionalChain([event, 'access', _367 => _367.data, 'optionalAccess', _368 => _368.source])) ? event.data.source : void 0;
|
|
7119
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _369 => _369.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _370 => _370.transactionHash]))));
|
|
7070
7120
|
}
|
|
7071
7121
|
return void 0;
|
|
7072
7122
|
}
|
|
7073
7123
|
function getEventSourceDetails(event) {
|
|
7074
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7124
|
+
if (!_optionalChain([event, 'optionalAccess', _371 => _371.type]) || !isRecord(event.data)) return {};
|
|
7075
7125
|
if (event.type === "deposit-received") {
|
|
7076
7126
|
return {
|
|
7077
7127
|
chainId: asNumber(event.data.chain),
|
|
@@ -7083,9 +7133,9 @@ function getEventSourceDetails(event) {
|
|
|
7083
7133
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
7084
7134
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
7085
7135
|
return {
|
|
7086
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
7087
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
7088
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
7136
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _372 => _372.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _373 => _373.chain])))),
|
|
7137
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _374 => _374.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _375 => _375.amount])))),
|
|
7138
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _376 => _376.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _377 => _377.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _378 => _378.token]))))
|
|
7089
7139
|
};
|
|
7090
7140
|
}
|
|
7091
7141
|
return {};
|
|
@@ -7099,7 +7149,7 @@ function asChain(value) {
|
|
|
7099
7149
|
return asNumber(value);
|
|
7100
7150
|
}
|
|
7101
7151
|
function getEventDestinationDetails(event) {
|
|
7102
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7152
|
+
if (!_optionalChain([event, 'optionalAccess', _379 => _379.type]) || !isRecord(event.data)) return {};
|
|
7103
7153
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
7104
7154
|
return {};
|
|
7105
7155
|
}
|
|
@@ -7109,14 +7159,14 @@ function getEventDestinationDetails(event) {
|
|
|
7109
7159
|
return {
|
|
7110
7160
|
chainId: asChain(destination.chain),
|
|
7111
7161
|
amount: asAmount(destination.amount),
|
|
7112
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
7162
|
+
token: _optionalChain([token, 'optionalAccess', _380 => _380.trim, 'call', _381 => _381()]) || void 0
|
|
7113
7163
|
};
|
|
7114
7164
|
}
|
|
7115
7165
|
function isDepositEvent(event) {
|
|
7116
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7166
|
+
return _optionalChain([event, 'optionalAccess', _382 => _382.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _383 => _383.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _384 => _384.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _385 => _385.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _386 => _386.type]) === "error";
|
|
7117
7167
|
}
|
|
7118
7168
|
function isFailedEvent(event) {
|
|
7119
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7169
|
+
return _optionalChain([event, 'optionalAccess', _387 => _387.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _388 => _388.type]) === "error";
|
|
7120
7170
|
}
|
|
7121
7171
|
function isHexString(value) {
|
|
7122
7172
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -7128,7 +7178,7 @@ function txRefsMatch(a, b) {
|
|
|
7128
7178
|
return a === b;
|
|
7129
7179
|
}
|
|
7130
7180
|
function formatBridgeFailedMessage(event) {
|
|
7131
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7181
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _389 => _389.data]), () => ( {}));
|
|
7132
7182
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
7133
7183
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
7134
7184
|
function toUserFacingFailure(raw) {
|
|
@@ -7156,7 +7206,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
7156
7206
|
return { message: "Bridge failed" };
|
|
7157
7207
|
}
|
|
7158
7208
|
function failureMessageForEvent(event) {
|
|
7159
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7209
|
+
if (_optionalChain([event, 'optionalAccess', _390 => _390.type]) === "error") {
|
|
7160
7210
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
7161
7211
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
7162
7212
|
}
|
|
@@ -7171,7 +7221,7 @@ function addressFor(token) {
|
|
|
7171
7221
|
return token.chainId === "solana" ? "native" : ZERO_ADDRESS2;
|
|
7172
7222
|
}
|
|
7173
7223
|
function useTokenPrices(tokens) {
|
|
7174
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
7224
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _391 => _391.symbol])));
|
|
7175
7225
|
const refs = defined.map((token) => ({
|
|
7176
7226
|
chain: token.chainId,
|
|
7177
7227
|
address: addressFor(token)
|
|
@@ -7340,12 +7390,12 @@ function isEventForTx(event, txHash) {
|
|
|
7340
7390
|
return txRefsMatch(eventTxHash, txHash);
|
|
7341
7391
|
}
|
|
7342
7392
|
function parseWebhookTimestamp(event) {
|
|
7343
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
7393
|
+
if (typeof _optionalChain([event, 'optionalAccess', _392 => _392.time]) !== "string") return void 0;
|
|
7344
7394
|
const timestamp = Date.parse(event.time);
|
|
7345
7395
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
7346
7396
|
}
|
|
7347
7397
|
function syncPhaseTimings(previous, event) {
|
|
7348
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7398
|
+
if (!_optionalChain([event, 'optionalAccess', _393 => _393.type])) return previous;
|
|
7349
7399
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
7350
7400
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
7351
7401
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -7407,52 +7457,52 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
7407
7457
|
if (state.type === "complete") {
|
|
7408
7458
|
return void 0;
|
|
7409
7459
|
}
|
|
7410
|
-
if (_optionalChain([state, 'access',
|
|
7460
|
+
if (_optionalChain([state, 'access', _394 => _394.lastEvent, 'optionalAccess', _395 => _395.type]) === "bridge-started" || _optionalChain([state, 'access', _396 => _396.lastEvent, 'optionalAccess', _397 => _397.type]) === "bridge-complete")
|
|
7411
7461
|
return "bridging";
|
|
7412
|
-
if (_optionalChain([state, 'access',
|
|
7462
|
+
if (_optionalChain([state, 'access', _398 => _398.lastEvent, 'optionalAccess', _399 => _399.type]) === "deposit-received") return "received";
|
|
7413
7463
|
return "confirming";
|
|
7414
7464
|
}
|
|
7415
7465
|
function getCompletionDestinationAmount(event) {
|
|
7416
|
-
const amount = _optionalChain([event, 'optionalAccess',
|
|
7466
|
+
const amount = _optionalChain([event, 'optionalAccess', _400 => _400.data, 'optionalAccess', _401 => _401.destination, 'optionalAccess', _402 => _402.amount]);
|
|
7417
7467
|
return typeof amount === "string" ? amount : void 0;
|
|
7418
7468
|
}
|
|
7419
7469
|
function getCompletionDestinationTxHash(event) {
|
|
7420
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
7421
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7422
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7470
|
+
const eventData = _optionalChain([event, 'optionalAccess', _403 => _403.data]);
|
|
7471
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _404 => _404.swap, 'optionalAccess', _405 => _405.transactionHash]);
|
|
7472
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _406 => _406.destination, 'optionalAccess', _407 => _407.transactionHash]);
|
|
7423
7473
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
7424
7474
|
}
|
|
7425
7475
|
function getTerminalProcessingOutcome(event) {
|
|
7426
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7476
|
+
if (_optionalChain([event, 'optionalAccess', _408 => _408.type]) === "post-bridge-swap-complete") {
|
|
7427
7477
|
return {
|
|
7428
7478
|
type: "complete",
|
|
7429
7479
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7430
7480
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7431
7481
|
};
|
|
7432
7482
|
}
|
|
7433
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7483
|
+
if (_optionalChain([event, 'optionalAccess', _409 => _409.type]) === "post-bridge-swap-failed") {
|
|
7434
7484
|
return {
|
|
7435
7485
|
type: "failed",
|
|
7436
7486
|
message: formatBridgeFailedMessage(event).message
|
|
7437
7487
|
};
|
|
7438
7488
|
}
|
|
7439
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7489
|
+
if (_optionalChain([event, 'optionalAccess', _410 => _410.type]) === "bridge-complete") {
|
|
7440
7490
|
return {
|
|
7441
7491
|
type: "complete",
|
|
7442
7492
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7443
7493
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7444
7494
|
};
|
|
7445
7495
|
}
|
|
7446
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7496
|
+
if (_optionalChain([event, 'optionalAccess', _411 => _411.type]) === "bridge-failed") {
|
|
7447
7497
|
return {
|
|
7448
7498
|
type: "failed",
|
|
7449
7499
|
message: formatBridgeFailedMessage(event).message
|
|
7450
7500
|
};
|
|
7451
7501
|
}
|
|
7452
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7502
|
+
if (_optionalChain([event, 'optionalAccess', _412 => _412.type]) === "error") {
|
|
7453
7503
|
return {
|
|
7454
7504
|
type: "failed",
|
|
7455
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
7505
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _413 => _413.data, 'optionalAccess', _414 => _414.message]), () => ( "Unknown error"))
|
|
7456
7506
|
};
|
|
7457
7507
|
}
|
|
7458
7508
|
return null;
|
|
@@ -7460,10 +7510,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
7460
7510
|
function getInitialProcessingState(event, txHash) {
|
|
7461
7511
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
7462
7512
|
const terminal = getTerminalProcessingOutcome(event);
|
|
7463
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7513
|
+
if (_optionalChain([terminal, 'optionalAccess', _415 => _415.type]) === "complete") {
|
|
7464
7514
|
return { type: "complete", lastEvent: event };
|
|
7465
7515
|
}
|
|
7466
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7516
|
+
if (_optionalChain([terminal, 'optionalAccess', _416 => _416.type]) === "failed") {
|
|
7467
7517
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
7468
7518
|
}
|
|
7469
7519
|
if (isDepositEvent(event)) {
|
|
@@ -7472,7 +7522,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
7472
7522
|
return null;
|
|
7473
7523
|
}
|
|
7474
7524
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
7475
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7525
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _417 => _417.data, 'optionalAccess', _418 => _418.source, 'optionalAccess', _419 => _419.transactionHash]), () => ( fallbackTxHash));
|
|
7476
7526
|
}
|
|
7477
7527
|
function ProcessingStep({
|
|
7478
7528
|
smartAccount,
|
|
@@ -7552,8 +7602,8 @@ function ProcessingStep({
|
|
|
7552
7602
|
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0,
|
|
7553
7603
|
() => Math.max(0, Math.floor((Date.now() - startTimeRef.current) / 1e3))
|
|
7554
7604
|
);
|
|
7555
|
-
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess',
|
|
7556
|
-
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess',
|
|
7605
|
+
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess', _420 => _420.timing]));
|
|
7606
|
+
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess', _421 => _421.timing]) !== void 0) {
|
|
7557
7607
|
setLatchedTiming(quote.timing);
|
|
7558
7608
|
}
|
|
7559
7609
|
const timingStateRef = _react.useRef.call(void 0, "expected");
|
|
@@ -7584,7 +7634,7 @@ function ProcessingStep({
|
|
|
7584
7634
|
flowLabel
|
|
7585
7635
|
});
|
|
7586
7636
|
const context = processingContextRef.current;
|
|
7587
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7637
|
+
_optionalChain([onDepositCompleteRef, 'access', _422 => _422.current, 'optionalCall', _423 => _423(txHash, void 0, {
|
|
7588
7638
|
amount: context.amount,
|
|
7589
7639
|
sourceChain: context.sourceChain,
|
|
7590
7640
|
sourceToken: context.sourceToken,
|
|
@@ -7617,7 +7667,7 @@ function ProcessingStep({
|
|
|
7617
7667
|
destinationTxHash: outcome.destinationTxHash,
|
|
7618
7668
|
event: event.type
|
|
7619
7669
|
});
|
|
7620
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7670
|
+
_optionalChain([onDepositCompleteRef, 'access', _424 => _424.current, 'optionalCall', _425 => _425(
|
|
7621
7671
|
sourceTxHash2,
|
|
7622
7672
|
outcome.destinationTxHash,
|
|
7623
7673
|
{
|
|
@@ -7638,7 +7688,7 @@ function ProcessingStep({
|
|
|
7638
7688
|
message: outcome.message,
|
|
7639
7689
|
event: event.type
|
|
7640
7690
|
});
|
|
7641
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7691
|
+
_optionalChain([onDepositFailedRef, 'access', _426 => _426.current, 'optionalCall', _427 => _427(txHash, outcome.message)]);
|
|
7642
7692
|
}, [
|
|
7643
7693
|
debug,
|
|
7644
7694
|
onDepositCompleteRef,
|
|
@@ -7649,8 +7699,8 @@ function ProcessingStep({
|
|
|
7649
7699
|
const onSettledChangeRef = _react.useRef.call(void 0, onSettledChange);
|
|
7650
7700
|
onSettledChangeRef.current = onSettledChange;
|
|
7651
7701
|
_react.useEffect.call(void 0, () => {
|
|
7652
|
-
_optionalChain([onSettledChangeRef, 'access',
|
|
7653
|
-
return () => _optionalChain([onSettledChangeRef, 'access',
|
|
7702
|
+
_optionalChain([onSettledChangeRef, 'access', _428 => _428.current, 'optionalCall', _429 => _429(state.type !== "processing")]);
|
|
7703
|
+
return () => _optionalChain([onSettledChangeRef, 'access', _430 => _430.current, 'optionalCall', _431 => _431(false)]);
|
|
7654
7704
|
}, [state.type]);
|
|
7655
7705
|
_react.useEffect.call(void 0, () => {
|
|
7656
7706
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -7676,13 +7726,13 @@ function ProcessingStep({
|
|
|
7676
7726
|
updatePhaseTimings(
|
|
7677
7727
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
7678
7728
|
);
|
|
7679
|
-
}, [_optionalChain([state, 'access',
|
|
7729
|
+
}, [_optionalChain([state, 'access', _432 => _432.lastEvent, 'optionalAccess', _433 => _433.time]), _optionalChain([state, 'access', _434 => _434.lastEvent, 'optionalAccess', _435 => _435.type]), updatePhaseTimings]);
|
|
7680
7730
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
7681
7731
|
_react.useEffect.call(void 0, () => {
|
|
7682
7732
|
let cancelled = false;
|
|
7683
7733
|
let timeoutId;
|
|
7684
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
7685
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7734
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _436 => _436.variant]) === "fiat";
|
|
7735
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _437 => _437.expectedOrderUuid]), () => ( null));
|
|
7686
7736
|
setSwappedFiatContext(null);
|
|
7687
7737
|
if (!isSwappedOrder || !expectedOrderUuid) {
|
|
7688
7738
|
return () => {
|
|
@@ -7725,8 +7775,8 @@ function ProcessingStep({
|
|
|
7725
7775
|
}, [
|
|
7726
7776
|
service,
|
|
7727
7777
|
isSwappedOrder,
|
|
7728
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7729
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7778
|
+
_optionalChain([swappedContext, 'optionalAccess', _438 => _438.variant]),
|
|
7779
|
+
_optionalChain([swappedContext, 'optionalAccess', _439 => _439.expectedOrderUuid])
|
|
7730
7780
|
]);
|
|
7731
7781
|
_react.useEffect.call(void 0, () => {
|
|
7732
7782
|
if (directTransfer) return;
|
|
@@ -7752,18 +7802,18 @@ function ProcessingStep({
|
|
|
7752
7802
|
debugLog(debug, "processing", "poll:event", {
|
|
7753
7803
|
type: lastEvent2.type,
|
|
7754
7804
|
matchesTx: eventMatchesTx,
|
|
7755
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
7805
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _440 => _440.intentId])
|
|
7756
7806
|
});
|
|
7757
7807
|
}
|
|
7758
7808
|
if (!isMounted) return;
|
|
7759
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7809
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _441 => _441.type]) === "bridge-complete") {
|
|
7760
7810
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
7761
7811
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
7762
7812
|
eventForCurrentTx,
|
|
7763
7813
|
txHash
|
|
7764
7814
|
);
|
|
7765
|
-
const destination = _optionalChain([eventForCurrentTx, 'access',
|
|
7766
|
-
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess',
|
|
7815
|
+
const destination = _optionalChain([eventForCurrentTx, 'access', _442 => _442.data, 'optionalAccess', _443 => _443.destination]);
|
|
7816
|
+
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess', _444 => _444.transactionHash]);
|
|
7767
7817
|
debugLog(debug, "processing", "state:complete", {
|
|
7768
7818
|
txHash,
|
|
7769
7819
|
sourceTxHash: sourceTxHash2,
|
|
@@ -7771,7 +7821,7 @@ function ProcessingStep({
|
|
|
7771
7821
|
event: eventForCurrentTx.type
|
|
7772
7822
|
});
|
|
7773
7823
|
const context = processingContextRef.current;
|
|
7774
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7824
|
+
_optionalChain([onDepositCompleteRef, 'access', _445 => _445.current, 'optionalCall', _446 => _446(sourceTxHash2, destinationTxHash2, {
|
|
7775
7825
|
amount: context.amount,
|
|
7776
7826
|
sourceChain: context.sourceChain,
|
|
7777
7827
|
sourceToken: context.sourceToken,
|
|
@@ -7779,11 +7829,11 @@ function ProcessingStep({
|
|
|
7779
7829
|
amountUsd: context.amountUsd,
|
|
7780
7830
|
targetChain: context.targetChain,
|
|
7781
7831
|
targetToken: context.targetToken,
|
|
7782
|
-
destinationAmount: typeof _optionalChain([destination, 'optionalAccess',
|
|
7832
|
+
destinationAmount: typeof _optionalChain([destination, 'optionalAccess', _447 => _447.amount]) === "string" ? destination.amount : void 0
|
|
7783
7833
|
})]);
|
|
7784
7834
|
return;
|
|
7785
7835
|
}
|
|
7786
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7836
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _448 => _448.type]) === "bridge-failed") {
|
|
7787
7837
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
7788
7838
|
setState({
|
|
7789
7839
|
type: "failed",
|
|
@@ -7795,11 +7845,11 @@ function ProcessingStep({
|
|
|
7795
7845
|
message: formatted.message,
|
|
7796
7846
|
code: formatted.code
|
|
7797
7847
|
});
|
|
7798
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7848
|
+
_optionalChain([onDepositFailedRef, 'access', _449 => _449.current, 'optionalCall', _450 => _450(txHash, formatted.message)]);
|
|
7799
7849
|
return;
|
|
7800
7850
|
}
|
|
7801
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7802
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
7851
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _451 => _451.type]) === "error") {
|
|
7852
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _452 => _452.data, 'optionalAccess', _453 => _453.message]), () => ( "Unknown error"));
|
|
7803
7853
|
setState({
|
|
7804
7854
|
type: "failed",
|
|
7805
7855
|
message: errorMessage,
|
|
@@ -7809,7 +7859,7 @@ function ProcessingStep({
|
|
|
7809
7859
|
txHash,
|
|
7810
7860
|
message: errorMessage
|
|
7811
7861
|
});
|
|
7812
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7862
|
+
_optionalChain([onDepositFailedRef, 'access', _454 => _454.current, 'optionalCall', _455 => _455(txHash, errorMessage)]);
|
|
7813
7863
|
return;
|
|
7814
7864
|
}
|
|
7815
7865
|
setState((previous) => ({
|
|
@@ -7867,18 +7917,18 @@ function ProcessingStep({
|
|
|
7867
7917
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
7868
7918
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : flowLabel === "payment" ? "payment" : "deposit";
|
|
7869
7919
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : flowLabel === "payment" ? "Payment" : "Deposit";
|
|
7870
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7920
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _456 => _456.data, 'optionalAccess', _457 => _457.destination, 'optionalAccess', _458 => _458.transactionHash]) || null;
|
|
7871
7921
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
7872
7922
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
7873
7923
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
7874
7924
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
7875
7925
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
7876
7926
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7877
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7927
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _459 => _459.data, 'optionalAccess', _460 => _460.source, 'optionalAccess', _461 => _461.transactionHash]);
|
|
7878
7928
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
7879
7929
|
_react.useEffect.call(void 0, () => {
|
|
7880
7930
|
if (sourceTxHashPending && settledSourceTxHash) {
|
|
7881
|
-
_optionalChain([onSourceTransactionObserved, 'optionalCall',
|
|
7931
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _462 => _462(settledSourceTxHash)]);
|
|
7882
7932
|
}
|
|
7883
7933
|
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
7884
7934
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
@@ -7989,7 +8039,7 @@ function ProcessingStep({
|
|
|
7989
8039
|
timeoutMs: latchedTiming ? resolveServedThresholds(latchedTiming).escalatedMs : FALLBACK_ESCALATED_DELAY_MS,
|
|
7990
8040
|
served: latchedTiming !== void 0
|
|
7991
8041
|
});
|
|
7992
|
-
_optionalChain([onErrorRef, 'access',
|
|
8042
|
+
_optionalChain([onErrorRef, 'access', _463 => _463.current, 'optionalCall', _464 => _464(
|
|
7993
8043
|
"Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.",
|
|
7994
8044
|
"PROCESS_TIMEOUT"
|
|
7995
8045
|
)]);
|
|
@@ -8007,8 +8057,8 @@ function ProcessingStep({
|
|
|
8007
8057
|
const sourceChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, displaySourceChain);
|
|
8008
8058
|
const targetChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, targetChainId);
|
|
8009
8059
|
const timerText = formatTimer(elapsedSeconds);
|
|
8010
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8011
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8060
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _465 => _465.feeSponsored]), () => ( false));
|
|
8061
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _466 => _466.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
8012
8062
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
8013
8063
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
8014
8064
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -8019,20 +8069,20 @@ function ProcessingStep({
|
|
|
8019
8069
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
8020
8070
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, {}), title: stateTitle });
|
|
8021
8071
|
if (isComplete && isSwappedOrder) {
|
|
8022
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
8072
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _467 => _467.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _468 => _468.paymentMethod]))), () => ( null));
|
|
8023
8073
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
8024
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
8074
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _469 => _469.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
8025
8075
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
8026
8076
|
effectivePaymentMethod
|
|
8027
8077
|
) : null;
|
|
8028
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
8029
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8078
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _470 => _470.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
8079
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _471 => _471.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
8030
8080
|
const depositedAmount = receiveDisplay;
|
|
8031
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8081
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _472 => _472.onrampFeeUsd]), () => ( null));
|
|
8032
8082
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
8033
8083
|
const feesTooltip = feeSponsored ? "On-ramp fees are charged by the payment provider. Market and network fees are sponsored for this deposit." : "Fees include on-ramp, market, and network costs for this deposit.";
|
|
8034
8084
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
8035
|
-
_optionalChain([quote, 'optionalAccess',
|
|
8085
|
+
_optionalChain([quote, 'optionalAccess', _473 => _473.fees, 'access', _474 => _474.breakdown]),
|
|
8036
8086
|
sponsoredFeeTooltip
|
|
8037
8087
|
);
|
|
8038
8088
|
const feeRows = [];
|
|
@@ -8120,7 +8170,7 @@ function ProcessingStep({
|
|
|
8120
8170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
8121
8171
|
] }),
|
|
8122
8172
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
8123
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8173
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _475 => _475.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8124
8174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
8125
8175
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8126
8176
|
"$",
|
|
@@ -8132,7 +8182,7 @@ function ProcessingStep({
|
|
|
8132
8182
|
] })
|
|
8133
8183
|
] })
|
|
8134
8184
|
] }),
|
|
8135
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8185
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _476 => _476.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8136
8186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
8137
8187
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8138
8188
|
"$",
|
|
@@ -8199,7 +8249,7 @@ function ProcessingStep({
|
|
|
8199
8249
|
) })
|
|
8200
8250
|
] })
|
|
8201
8251
|
] }) : (() => {
|
|
8202
|
-
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess',
|
|
8252
|
+
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess', _477 => _477.fees]));
|
|
8203
8253
|
if (display !== null) {
|
|
8204
8254
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8205
8255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -8350,7 +8400,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
8350
8400
|
function readDedupedAccountSetupResult(requestKey) {
|
|
8351
8401
|
const now = Date.now();
|
|
8352
8402
|
const existing = setupRequestDedupe.get(requestKey);
|
|
8353
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
8403
|
+
if (_optionalChain([existing, 'optionalAccess', _478 => _478.settled]) && existing.expiresAt > now && existing.result) {
|
|
8354
8404
|
return existing.result;
|
|
8355
8405
|
}
|
|
8356
8406
|
return null;
|
|
@@ -8384,7 +8434,7 @@ async function runAccountSetup(input, deps) {
|
|
|
8384
8434
|
chain: _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
8385
8435
|
token: input.targetToken,
|
|
8386
8436
|
recipient: input.recipient,
|
|
8387
|
-
..._optionalChain([input, 'access',
|
|
8437
|
+
..._optionalChain([input, 'access', _479 => _479.outputTokenRules, 'optionalAccess', _480 => _480.length]) && {
|
|
8388
8438
|
outputTokenRules: input.outputTokenRules
|
|
8389
8439
|
},
|
|
8390
8440
|
...input.rejectUnmapped != null && {
|
|
@@ -8559,4 +8609,7 @@ function mapError(error) {
|
|
|
8559
8609
|
|
|
8560
8610
|
|
|
8561
8611
|
|
|
8562
|
-
|
|
8612
|
+
|
|
8613
|
+
|
|
8614
|
+
|
|
8615
|
+
exports.Modal = Modal; exports.Callout = Callout; exports.CdnIcon = CdnIcon; exports.ListRow = ListRow; exports.PoweredBy = PoweredBy; exports.catalogKeyForChain = catalogKeyForChain; exports.debugLog = debugLog; exports.debugError = debugError; exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.resolveSolanaToken = resolveSolanaToken; exports.isNativeSol = isNativeSol; exports.hostedOrderStateFromSwapped = hostedOrderStateFromSwapped; exports.mergeHostedOrderState = mergeHostedOrderState; exports.hasReached = hasReached; exports.getAssetId = getAssetId; exports.chainIdsByValue = chainIdsByValue; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.quoteFeeRow = quoteFeeRow; exports.SUPPORTED_CONNECT_EXCHANGE_COUNT = SUPPORTED_CONNECT_EXCHANGE_COUNT; exports.resolveAppFeeBps = resolveAppFeeBps; exports.isDepositPolicyRefusal = isDepositPolicyRefusal; exports.PermitDepositSubmitError = PermitDepositSubmitError; exports.createDepositService = createDepositService; exports.depositBoundsViolation = depositBoundsViolation; exports.describePolicyRefusal = describePolicyRefusal; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.useStableRpcUrls = useStableRpcUrls; exports.getPublicClient = getPublicClient; exports.peekRuntimeChains = peekRuntimeChains; exports.primeRuntimeChains = primeRuntimeChains; exports.useChainCatalog = useChainCatalog; exports.useCatalogChain = useCatalogChain; exports.useDepositChainIds = useDepositChainIds; exports.useDestinationChains = useDestinationChains; exports.useTargetTokens = useTargetTokens; exports.useDepositOffer = useDepositOffer; exports.useDepositBounds = useDepositBounds; exports.useRestrictedListExclusion = useRestrictedListExclusion; exports.useIsDepositChain = useIsDepositChain; exports.useChainName = useChainName; exports.useReadClient = useReadClient; exports.useExplorerTxUrl = useExplorerTxUrl; exports.ChainCatalogProvider = ChainCatalogProvider; exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.Button = Button; exports.assetIdFor = assetIdFor; exports.AssetMetadataProvider = AssetMetadataProvider; exports.useAssetStore = useAssetStore; exports.TokenIcon = TokenIcon; exports.resolveCuratedToken = resolveCuratedToken; exports.useTokenDisplays = useTokenDisplays; exports.useTokenDisplay = useTokenDisplay; exports.useIsRecognizedToken = useIsRecognizedToken; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.formatExpectedDuration = formatExpectedDuration; exports.markSubmissionUncertain = markSubmissionUncertain; exports.isSubmissionUncertain = isSubmissionUncertain; exports.formatTokenAmount = formatTokenAmount; exports.isDisplayStablecoinSymbol = isDisplayStablecoinSymbol; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.AnalyticsSession = AnalyticsSession; exports.useDepositAnalyticsEmitter = useDepositAnalyticsEmitter; exports.useWithdrawAnalyticsEmitter = useWithdrawAnalyticsEmitter; exports.SetupError = SetupError; exports.deriveAccountSalt = deriveAccountSalt; exports.computeRequestKey = computeRequestKey; exports.computeCacheKey = computeCacheKey; exports.computeIsCacheable = computeIsCacheable; exports.readDedupedAccountSetupResult = readDedupedAccountSetupResult; exports.runAccountSetupDeduped = runAccountSetupDeduped; exports.HistoryEntryButton = HistoryEntryButton; exports.HistoryOverlay = HistoryOverlay; exports.useHistoryPanel = useHistoryPanel; exports.resolveThemeMode = resolveThemeMode; exports.followSystemAppearance = followSystemAppearance; exports.applyTheme = applyTheme; exports.warnRemovedProps = warnRemovedProps; exports.checkBackendUrl = checkBackendUrl; exports.isHistoryEntryVisible = isHistoryEntryVisible; exports.createHistoryAnalytics = createHistoryAnalytics; exports.analyticsTargetProperties = analyticsTargetProperties;
|