@rhinestone/deposit-modal 0.20.0 → 0.21.0
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/README.md +45 -17
- package/dist/{BankOnrampStep-JG32OCM2.mjs → BankOnrampStep-JTU7WS5R.mjs} +22 -12
- package/dist/{BankOnrampStep-NPGXAA7U.cjs → BankOnrampStep-QCPISCAQ.cjs} +34 -24
- package/dist/{DepositModalReown-3FGTPER6.mjs → DepositModalReown-FJBSF4VL.mjs} +5 -3
- package/dist/{DepositModalReown-ALVWADG7.cjs → DepositModalReown-QJ6O2FWY.cjs} +18 -16
- package/dist/{WithdrawModal-LL4Z5WZP.mjs → WithdrawModal-CB7RNEPI.mjs} +3 -3
- package/dist/WithdrawModal-E2BTWJV7.cjs +12 -0
- package/dist/{chunk-B2LZQIGB.mjs → chunk-2D3J53PX.mjs} +1 -1
- package/dist/{chunk-CXRH5MKO.cjs → chunk-4O2UGFFT.cjs} +385 -297
- package/dist/{chunk-HP7S7AD6.mjs → chunk-7CHQA2OZ.mjs} +1 -1
- package/dist/chunk-ADEWTBSN.cjs +19 -0
- package/dist/{chunk-FMUSY563.cjs → chunk-AV3SA7TW.cjs} +3 -3
- package/dist/{chunk-247GJH57.mjs → chunk-B2LUWNFX.mjs} +583 -533
- package/dist/{chunk-Z4RBTNKX.cjs → chunk-CAIRS4LK.cjs} +732 -682
- package/dist/{chunk-OPT5EW6L.cjs → chunk-CG3JKPUF.cjs} +2 -2
- package/dist/{chunk-5QUWEFD4.mjs → chunk-CXEQFRX4.mjs} +1 -1
- package/dist/chunk-PP4QE32S.mjs +19 -0
- package/dist/{chunk-XBJCZYBX.mjs → chunk-PZIKRYMO.mjs} +1 -1
- package/dist/{chunk-BTEG2VNZ.cjs → chunk-U7NYYT4Q.cjs} +58 -58
- package/dist/{chunk-32ERBFMO.mjs → chunk-UNXUOV3F.mjs} +131 -43
- package/dist/{chunk-EKFXUF5A.cjs → chunk-VQAV6ESI.cjs} +1 -1
- package/dist/{chunk-6CTJFR3T.mjs → chunk-WK2ELRL3.mjs} +5 -16
- package/dist/{chunk-PYRXOP2Y.cjs → chunk-X425VJFY.cjs} +10 -21
- 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 +6 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -3
- package/dist/embed.cjs +16 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +6 -4
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -4
- package/dist/onramp.cjs +5 -4
- package/dist/onramp.mjs +4 -3
- package/dist/server.cjs +12 -8
- package/dist/server.mjs +11 -7
- package/dist/{types-CixUBhrM.d.cts → types-BrxDZNEr.d.cts} +23 -11
- package/dist/{types-BxSrazbq.d.ts → types-DCUB4DY8.d.ts} +23 -11
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/WithdrawModal-5YWFJSYY.cjs +0 -12
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
|
|
20
21
|
|
|
21
22
|
|
|
@@ -45,7 +46,7 @@ var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
|
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
var
|
|
49
|
+
var _chunkVQAV6ESIcjs = require('./chunk-VQAV6ESI.cjs');
|
|
49
50
|
|
|
50
51
|
// src/components/ui/Modal.tsx
|
|
51
52
|
|
|
@@ -423,6 +424,54 @@ function catalogExplorerTxUrl(chain, txHash) {
|
|
|
423
424
|
return `${chain.explorer.url}${chain.explorer.txPath}${txHash}`;
|
|
424
425
|
}
|
|
425
426
|
|
|
427
|
+
// src/core/hosted-order.ts
|
|
428
|
+
var RANK = {
|
|
429
|
+
awaiting_payment: 0,
|
|
430
|
+
paying: 1,
|
|
431
|
+
paid: 2,
|
|
432
|
+
sent: 3
|
|
433
|
+
};
|
|
434
|
+
function hostedOrderState(order) {
|
|
435
|
+
const { receipt, conversion, delivery } = order.stages;
|
|
436
|
+
const deliveryTxHash = "txHash" in delivery ? delivery.txHash : null;
|
|
437
|
+
const outcome = order.status === "refunded" ? "refunded" : order.status === "failed" && !deliveryTxHash ? receipt.status === "failed" && receipt.reason === "cancelled" ? "cancelled" : "failed" : null;
|
|
438
|
+
const progress = deliveryTxHash ? "sent" : receipt.status === "completed" || conversion.status !== "not_started" ? "paid" : receipt.status === "processing" || receipt.status === "on_hold" ? "paying" : "awaiting_payment";
|
|
439
|
+
return { progress, outcome, deliveryTxHash };
|
|
440
|
+
}
|
|
441
|
+
function hostedOrderStateFromSwapped(status, txHash) {
|
|
442
|
+
const deliveryTxHash = _nullishCoalesce(txHash, () => ( null));
|
|
443
|
+
switch (status) {
|
|
444
|
+
case "payment_pending":
|
|
445
|
+
return { progress: "awaiting_payment", outcome: null, deliveryTxHash };
|
|
446
|
+
case "wallet_order_registered":
|
|
447
|
+
case "wallet_order_confirmed":
|
|
448
|
+
return { progress: "paying", outcome: null, deliveryTxHash };
|
|
449
|
+
case "order_completed":
|
|
450
|
+
return {
|
|
451
|
+
progress: deliveryTxHash ? "sent" : "paid",
|
|
452
|
+
outcome: null,
|
|
453
|
+
deliveryTxHash
|
|
454
|
+
};
|
|
455
|
+
case "order_broadcasted":
|
|
456
|
+
return { progress: "sent", outcome: null, deliveryTxHash };
|
|
457
|
+
case "order_cancelled":
|
|
458
|
+
return { progress: "awaiting_payment", outcome: "cancelled", deliveryTxHash };
|
|
459
|
+
default:
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function mergeHostedOrderState(previous, next) {
|
|
464
|
+
if (!previous) return next;
|
|
465
|
+
return {
|
|
466
|
+
progress: RANK[next.progress] >= RANK[previous.progress] ? next.progress : previous.progress,
|
|
467
|
+
outcome: _nullishCoalesce(next.outcome, () => ( previous.outcome)),
|
|
468
|
+
deliveryTxHash: _nullishCoalesce(next.deliveryTxHash, () => ( previous.deliveryTxHash))
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function hasReached(state, progress) {
|
|
472
|
+
return state ? RANK[state.progress] >= RANK[progress] : false;
|
|
473
|
+
}
|
|
474
|
+
|
|
426
475
|
// src/core/deposit-asset-helpers.ts
|
|
427
476
|
function getAssetId(asset) {
|
|
428
477
|
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
@@ -795,7 +844,7 @@ function createDepositService(baseUrl, options) {
|
|
|
795
844
|
method === "GET" ? assetsGetUrl(ids, fields) : apiUrl("/assets"),
|
|
796
845
|
{
|
|
797
846
|
method,
|
|
798
|
-
headers:
|
|
847
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
799
848
|
body: method === "QUERY" ? JSON.stringify({ ids, fields }) : void 0,
|
|
800
849
|
cache: "no-store",
|
|
801
850
|
signal
|
|
@@ -889,7 +938,7 @@ function createDepositService(baseUrl, options) {
|
|
|
889
938
|
try {
|
|
890
939
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
891
940
|
method: "GET",
|
|
892
|
-
headers:
|
|
941
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, )
|
|
893
942
|
});
|
|
894
943
|
if (!response.ok) {
|
|
895
944
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -916,7 +965,7 @@ function createDepositService(baseUrl, options) {
|
|
|
916
965
|
try {
|
|
917
966
|
const response = await fetch(apiUrl("/chains"), {
|
|
918
967
|
method: "GET",
|
|
919
|
-
headers:
|
|
968
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, )
|
|
920
969
|
});
|
|
921
970
|
if (!response.ok) {
|
|
922
971
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -962,7 +1011,7 @@ function createDepositService(baseUrl, options) {
|
|
|
962
1011
|
const label = kind === "fiat" ? "Swapped widget URL" : "Swapped Connect URL";
|
|
963
1012
|
const response = await fetch(apiUrl("/onramp/orders"), {
|
|
964
1013
|
method: "POST",
|
|
965
|
-
headers:
|
|
1014
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
966
1015
|
body: JSON.stringify({
|
|
967
1016
|
provider: "swapped",
|
|
968
1017
|
kind,
|
|
@@ -1003,7 +1052,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1003
1052
|
});
|
|
1004
1053
|
const response = await fetch(url, {
|
|
1005
1054
|
method: "POST",
|
|
1006
|
-
headers:
|
|
1055
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1007
1056
|
body: JSON.stringify({ account: params })
|
|
1008
1057
|
});
|
|
1009
1058
|
if (!response.ok) {
|
|
@@ -1038,7 +1087,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1038
1087
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1039
1088
|
const response = await fetch(url, {
|
|
1040
1089
|
method: "GET",
|
|
1041
|
-
headers:
|
|
1090
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, )
|
|
1042
1091
|
});
|
|
1043
1092
|
if (!response.ok) {
|
|
1044
1093
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1089,7 +1138,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1089
1138
|
});
|
|
1090
1139
|
const response = await fetch(url, {
|
|
1091
1140
|
method: "GET",
|
|
1092
|
-
headers:
|
|
1141
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, )
|
|
1093
1142
|
});
|
|
1094
1143
|
if (!response.ok) {
|
|
1095
1144
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1118,7 +1167,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1118
1167
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1119
1168
|
const response = await fetch(url, {
|
|
1120
1169
|
method: "GET",
|
|
1121
|
-
headers:
|
|
1170
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, )
|
|
1122
1171
|
});
|
|
1123
1172
|
if (!response.ok) {
|
|
1124
1173
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1154,7 +1203,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1154
1203
|
);
|
|
1155
1204
|
const response = await fetch(url, {
|
|
1156
1205
|
method: "GET",
|
|
1157
|
-
headers:
|
|
1206
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1158
1207
|
cache: "no-store"
|
|
1159
1208
|
});
|
|
1160
1209
|
if (!response.ok) {
|
|
@@ -1182,7 +1231,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1182
1231
|
);
|
|
1183
1232
|
const response = await fetch(url, {
|
|
1184
1233
|
method: "GET",
|
|
1185
|
-
headers:
|
|
1234
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1186
1235
|
cache: "no-store"
|
|
1187
1236
|
});
|
|
1188
1237
|
if (!response.ok) {
|
|
@@ -1206,7 +1255,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1206
1255
|
);
|
|
1207
1256
|
const response = await fetch(url, {
|
|
1208
1257
|
method: "GET",
|
|
1209
|
-
headers:
|
|
1258
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1210
1259
|
cache: "no-store"
|
|
1211
1260
|
});
|
|
1212
1261
|
if (!response.ok) {
|
|
@@ -1228,7 +1277,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1228
1277
|
async getPositions(address) {
|
|
1229
1278
|
const url = apiUrl(`/positions/${address}`);
|
|
1230
1279
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1231
|
-
const response = await fetch(url, { headers:
|
|
1280
|
+
const response = await fetch(url, { headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ) });
|
|
1232
1281
|
if (!response.ok) {
|
|
1233
1282
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1234
1283
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1262,7 +1311,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1262
1311
|
});
|
|
1263
1312
|
const response = await fetch(url, {
|
|
1264
1313
|
method: "POST",
|
|
1265
|
-
headers:
|
|
1314
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1266
1315
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1267
1316
|
});
|
|
1268
1317
|
if (!response.ok) {
|
|
@@ -1298,7 +1347,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1298
1347
|
});
|
|
1299
1348
|
const response = await fetch(url, {
|
|
1300
1349
|
method: "POST",
|
|
1301
|
-
headers:
|
|
1350
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1302
1351
|
body: JSON.stringify({
|
|
1303
1352
|
depositWallet,
|
|
1304
1353
|
owner,
|
|
@@ -1340,7 +1389,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1340
1389
|
});
|
|
1341
1390
|
const response = await fetch(url, {
|
|
1342
1391
|
method: "GET",
|
|
1343
|
-
headers:
|
|
1392
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1344
1393
|
cache: "no-store"
|
|
1345
1394
|
});
|
|
1346
1395
|
if (!response.ok) {
|
|
@@ -1390,7 +1439,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1390
1439
|
});
|
|
1391
1440
|
const response = await fetch(url, {
|
|
1392
1441
|
method: "GET",
|
|
1393
|
-
headers:
|
|
1442
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1394
1443
|
cache: "no-store"
|
|
1395
1444
|
});
|
|
1396
1445
|
if (!response.ok) {
|
|
@@ -1444,7 +1493,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1444
1493
|
try {
|
|
1445
1494
|
const response = await fetch(url, {
|
|
1446
1495
|
method: "POST",
|
|
1447
|
-
headers:
|
|
1496
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1448
1497
|
body: JSON.stringify(body),
|
|
1449
1498
|
cache: "no-store",
|
|
1450
1499
|
signal
|
|
@@ -1494,7 +1543,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1494
1543
|
try {
|
|
1495
1544
|
const response = await fetch(url, {
|
|
1496
1545
|
method: "POST",
|
|
1497
|
-
headers:
|
|
1546
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1498
1547
|
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1499
1548
|
cache: "no-store",
|
|
1500
1549
|
signal
|
|
@@ -1597,7 +1646,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1597
1646
|
try {
|
|
1598
1647
|
response = await fetch(url, {
|
|
1599
1648
|
method: "POST",
|
|
1600
|
-
headers:
|
|
1649
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1601
1650
|
body: JSON.stringify(params)
|
|
1602
1651
|
});
|
|
1603
1652
|
} catch (error) {
|
|
@@ -1681,7 +1730,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1681
1730
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1682
1731
|
const response = await fetch(url, {
|
|
1683
1732
|
method: "GET",
|
|
1684
|
-
headers:
|
|
1733
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1685
1734
|
cache: "no-store"
|
|
1686
1735
|
});
|
|
1687
1736
|
if (!response.ok) {
|
|
@@ -1717,6 +1766,32 @@ function createDepositService(baseUrl, options) {
|
|
|
1717
1766
|
}
|
|
1718
1767
|
return { exchanges: exchanges.filter(isSupportedConnectExchange) };
|
|
1719
1768
|
},
|
|
1769
|
+
async getOnrampProviders() {
|
|
1770
|
+
try {
|
|
1771
|
+
const response = await fetch(apiUrl("/onramp/providers"), {
|
|
1772
|
+
method: "GET",
|
|
1773
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1774
|
+
cache: "no-store"
|
|
1775
|
+
});
|
|
1776
|
+
if (!response.ok) return null;
|
|
1777
|
+
const body = await response.json();
|
|
1778
|
+
if (!Array.isArray(body.providers)) return null;
|
|
1779
|
+
return body.providers.flatMap((raw) => {
|
|
1780
|
+
const p = raw;
|
|
1781
|
+
return (p.provider === "swapped" || p.provider === "noah") && (p.flow === "hosted" || p.flow === "funding_account") && Array.isArray(p.kinds) ? [
|
|
1782
|
+
{
|
|
1783
|
+
provider: p.provider,
|
|
1784
|
+
flow: p.flow,
|
|
1785
|
+
kinds: p.kinds.filter(
|
|
1786
|
+
(k) => k === "fiat" || k === "exchange"
|
|
1787
|
+
)
|
|
1788
|
+
}
|
|
1789
|
+
] : [];
|
|
1790
|
+
});
|
|
1791
|
+
} catch (e5) {
|
|
1792
|
+
return null;
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1720
1795
|
async getSwappedPaymentMethods() {
|
|
1721
1796
|
const empty = {
|
|
1722
1797
|
country: null,
|
|
@@ -1728,7 +1803,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1728
1803
|
try {
|
|
1729
1804
|
const response = await fetch(url, {
|
|
1730
1805
|
method: "GET",
|
|
1731
|
-
headers:
|
|
1806
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1732
1807
|
cache: "no-store"
|
|
1733
1808
|
});
|
|
1734
1809
|
if (!response.ok) {
|
|
@@ -1816,7 +1891,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1816
1891
|
try {
|
|
1817
1892
|
const response = await fetch(url, {
|
|
1818
1893
|
method: "GET",
|
|
1819
|
-
headers:
|
|
1894
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1820
1895
|
cache: "no-store"
|
|
1821
1896
|
});
|
|
1822
1897
|
if (!response.ok) {
|
|
@@ -1841,34 +1916,24 @@ function createDepositService(baseUrl, options) {
|
|
|
1841
1916
|
const url = apiUrl(`/onramp/orders/${encodeURIComponent(orderId)}`);
|
|
1842
1917
|
const response = await fetch(url, {
|
|
1843
1918
|
method: "GET",
|
|
1844
|
-
headers:
|
|
1919
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
1845
1920
|
cache: "no-store"
|
|
1846
1921
|
});
|
|
1847
1922
|
if (!response.ok) return null;
|
|
1848
1923
|
let body;
|
|
1849
1924
|
try {
|
|
1850
1925
|
body = await response.json();
|
|
1851
|
-
} catch (
|
|
1926
|
+
} catch (e6) {
|
|
1852
1927
|
return null;
|
|
1853
1928
|
}
|
|
1854
1929
|
return swappedOrderFromView(orderId, body);
|
|
1855
1930
|
}
|
|
1856
1931
|
};
|
|
1857
1932
|
}
|
|
1858
|
-
var SWAPPED_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1859
|
-
"payment_pending",
|
|
1860
|
-
"order_completed",
|
|
1861
|
-
"order_broadcasted",
|
|
1862
|
-
"order_cancelled"
|
|
1863
|
-
]);
|
|
1864
1933
|
function swappedOrderFromView(orderId, raw) {
|
|
1865
1934
|
if (!raw || typeof raw !== "object") return null;
|
|
1866
1935
|
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
|
-
}
|
|
1936
|
+
if (view.provider !== "swapped" || !isOrderShape(view)) return null;
|
|
1872
1937
|
const number = (v) => {
|
|
1873
1938
|
const n = typeof v === "string" && v.trim() ? Number(v) : v;
|
|
1874
1939
|
return typeof n === "number" && Number.isFinite(n) ? n : null;
|
|
@@ -1882,17 +1947,29 @@ function swappedOrderFromView(orderId, raw) {
|
|
|
1882
1947
|
const usdNet = number(_optionalChain([view, 'access', _50 => _50.fiat, 'optionalAccess', _51 => _51.usd, 'optionalAccess', _52 => _52.net]));
|
|
1883
1948
|
return {
|
|
1884
1949
|
orderId,
|
|
1885
|
-
|
|
1950
|
+
...hostedOrderState(view),
|
|
1886
1951
|
orderCrypto: text(_optionalChain([view, 'access', _53 => _53.crypto, 'optionalAccess', _54 => _54.asset])),
|
|
1887
1952
|
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
1953
|
receivedAt: text(view.updatedAt),
|
|
1890
1954
|
paidAmountUsd: _nullishCoalesce(usdTotal, () => ( usdNet)),
|
|
1891
|
-
paidAmountEur: _nullishCoalesce(number(_optionalChain([view, 'access',
|
|
1955
|
+
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
1956
|
onrampFeeUsd: usdTotal !== null && usdNet !== null && usdTotal > usdNet ? Number((usdTotal - usdNet).toFixed(2)) : null,
|
|
1893
|
-
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access',
|
|
1957
|
+
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access', _63 => _63.rail, 'optionalAccess', _64 => _64.method]), () => ( _optionalChain([view, 'access', _65 => _65.rail, 'optionalAccess', _66 => _66.connection]))))
|
|
1894
1958
|
};
|
|
1895
1959
|
}
|
|
1960
|
+
var ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1961
|
+
"pending",
|
|
1962
|
+
"processing",
|
|
1963
|
+
"completed",
|
|
1964
|
+
"failed",
|
|
1965
|
+
"refunded"
|
|
1966
|
+
]);
|
|
1967
|
+
function isOrderShape(view) {
|
|
1968
|
+
const stages = view.stages;
|
|
1969
|
+
return ORDER_STATUSES.has(view.status) && ["receipt", "conversion", "delivery"].every(
|
|
1970
|
+
(name) => typeof _optionalChain([stages, 'optionalAccess', _67 => _67[name], 'optionalAccess', _68 => _68.status]) === "string"
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1896
1973
|
function parseAssetItem(raw, fields) {
|
|
1897
1974
|
if (!raw || typeof raw !== "object") return void 0;
|
|
1898
1975
|
const record = raw;
|
|
@@ -1920,16 +1997,16 @@ function parseAssetItem(raw, fields) {
|
|
|
1920
1997
|
}
|
|
1921
1998
|
function normalizeDirectPortfolio(data) {
|
|
1922
1999
|
const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
|
|
1923
|
-
_optionalChain([data, 'optionalAccess',
|
|
2000
|
+
_optionalChain([data, 'optionalAccess', _69 => _69.data]),
|
|
1924
2001
|
"tokens"
|
|
1925
2002
|
))), () => ( []));
|
|
1926
|
-
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess',
|
|
2003
|
+
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _70 => _70.data]), "totalUsd"))), () => ( 0));
|
|
1927
2004
|
const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
|
|
1928
2005
|
return { tokens, totalUsd };
|
|
1929
2006
|
}
|
|
1930
2007
|
function extractOrchestratorPortfolio(data) {
|
|
1931
2008
|
const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
|
|
1932
|
-
_optionalChain([data, 'optionalAccess',
|
|
2009
|
+
_optionalChain([data, 'optionalAccess', _71 => _71.data]),
|
|
1933
2010
|
"portfolio"
|
|
1934
2011
|
)));
|
|
1935
2012
|
if (!portfolio || !Array.isArray(portfolio)) return null;
|
|
@@ -1940,7 +2017,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1940
2017
|
for (const tokenData of data.portfolio || []) {
|
|
1941
2018
|
const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
|
|
1942
2019
|
for (const chainBalance of chainBalances) {
|
|
1943
|
-
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access',
|
|
2020
|
+
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _72 => _72.balance, 'optionalAccess', _73 => _73.unlocked]), () => ( "0"));
|
|
1944
2021
|
const normalizedName = tokenData.tokenName.trim();
|
|
1945
2022
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1946
2023
|
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( runtimeEvmAddress(chainBalance.chainId, normalizedName)));
|
|
@@ -1977,18 +2054,18 @@ function normalizeDirectToken(token) {
|
|
|
1977
2054
|
if (chainId === null) return null;
|
|
1978
2055
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1979
2056
|
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',
|
|
2057
|
+
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
2058
|
if (!balanceValue) return null;
|
|
1982
2059
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1983
2060
|
token.token,
|
|
1984
2061
|
"address"
|
|
1985
|
-
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call',
|
|
2062
|
+
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call', _86 => _86(void 0, symbol), 'optionalAccess', _87 => _87.address]) : typeof chainId === "number" ? runtimeEvmAddress(chainId, symbol) : void 0)));
|
|
1986
2063
|
if (!address) return null;
|
|
1987
2064
|
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
2065
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1989
2066
|
const hyperCore = chainId === "hypercore" ? hyperCoreSourceToken(address, symbol) : void 0;
|
|
1990
|
-
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
1991
|
-
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
2067
|
+
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _88 => _88.symbol]), () => ( symbol));
|
|
2068
|
+
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _89 => _89.decimals]), () => ( backendDecimals)), () => ( 18));
|
|
1992
2069
|
return {
|
|
1993
2070
|
chainId,
|
|
1994
2071
|
address,
|
|
@@ -2010,7 +2087,7 @@ function hyperCoreSourceToken(address, symbol) {
|
|
|
2010
2087
|
}
|
|
2011
2088
|
function extractTokenAddress(tokenData, chainId) {
|
|
2012
2089
|
const token = tokenData;
|
|
2013
|
-
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access',
|
|
2090
|
+
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
2091
|
}
|
|
2015
2092
|
function extractArray(data, key) {
|
|
2016
2093
|
if (!data || typeof data !== "object") return null;
|
|
@@ -2040,7 +2117,7 @@ function extractNumericString(data, key) {
|
|
|
2040
2117
|
// src/core/rpc.ts
|
|
2041
2118
|
|
|
2042
2119
|
function rpcUrlFor(rpcUrls, chain) {
|
|
2043
|
-
const url = _optionalChain([rpcUrls, 'optionalAccess',
|
|
2120
|
+
const url = _optionalChain([rpcUrls, 'optionalAccess', _97 => _97[chain], 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
2044
2121
|
return url ? url : void 0;
|
|
2045
2122
|
}
|
|
2046
2123
|
var RpcUrlsContext = _react.createContext.call(void 0, void 0);
|
|
@@ -2050,7 +2127,7 @@ function useRpcUrls() {
|
|
|
2050
2127
|
}
|
|
2051
2128
|
function rpcUrlsKey(rpcUrls) {
|
|
2052
2129
|
if (!rpcUrls) return "";
|
|
2053
|
-
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess',
|
|
2130
|
+
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
2131
|
}
|
|
2055
2132
|
function useStableRpcUrls(rpcUrls) {
|
|
2056
2133
|
const key = rpcUrlsKey(rpcUrls);
|
|
@@ -2072,15 +2149,15 @@ function useStableRpcUrls(rpcUrls) {
|
|
|
2072
2149
|
|
|
2073
2150
|
function findListed(options, chain, token) {
|
|
2074
2151
|
const normalize2 = (value) => chain === "solana" ? value : value.toLowerCase();
|
|
2075
|
-
return _optionalChain([options, 'access',
|
|
2152
|
+
return _optionalChain([options, 'access', _102 => _102.tokens, 'access', _103 => _103[String(chain)], 'optionalAccess', _104 => _104.find, 'call', _105 => _105(
|
|
2076
2153
|
(listed) => normalize2(listed.address) === normalize2(token)
|
|
2077
2154
|
)]);
|
|
2078
2155
|
}
|
|
2079
2156
|
function isExcludedByRestrictedList(options, chain, token) {
|
|
2080
|
-
return Boolean(_optionalChain([options, 'optionalAccess',
|
|
2157
|
+
return Boolean(_optionalChain([options, 'optionalAccess', _106 => _106.restricted]) && !findListed(options, chain, token));
|
|
2081
2158
|
}
|
|
2082
2159
|
function findDepositBounds(options, chain, token) {
|
|
2083
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2160
|
+
if (!_optionalChain([options, 'optionalAccess', _107 => _107.restricted])) return void 0;
|
|
2084
2161
|
const entry = findListed(options, chain, token);
|
|
2085
2162
|
if (!entry || entry.minAmount === void 0 && entry.maxAmount === void 0) {
|
|
2086
2163
|
return void 0;
|
|
@@ -2093,7 +2170,7 @@ function findDepositBounds(options, chain, token) {
|
|
|
2093
2170
|
};
|
|
2094
2171
|
}
|
|
2095
2172
|
function boundMessage(bounds, bound) {
|
|
2096
|
-
const raw = _optionalChain([bounds, 'optionalAccess',
|
|
2173
|
+
const raw = _optionalChain([bounds, 'optionalAccess', _108 => _108[bound]]);
|
|
2097
2174
|
if (!bounds || raw === void 0) return null;
|
|
2098
2175
|
const amount = new Intl.NumberFormat("en-US", {
|
|
2099
2176
|
maximumFractionDigits: Math.min(bounds.decimals, 20)
|
|
@@ -2192,7 +2269,7 @@ async function loadViemChains() {
|
|
|
2192
2269
|
viemChainsPromise = Promise.resolve().then(() => _interopRequireWildcard(require("viem/chains"))).then((module) => {
|
|
2193
2270
|
const map = /* @__PURE__ */ new Map();
|
|
2194
2271
|
for (const value of Object.values(module)) {
|
|
2195
|
-
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access',
|
|
2272
|
+
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
2273
|
const chain = value;
|
|
2197
2274
|
const existing = map.get(chain.id);
|
|
2198
2275
|
if (existing) existing.push(chain);
|
|
@@ -2206,7 +2283,7 @@ async function loadViemChains() {
|
|
|
2206
2283
|
return viemChainsPromise;
|
|
2207
2284
|
}
|
|
2208
2285
|
function pickViemChain(candidates, chain) {
|
|
2209
|
-
if (!_optionalChain([candidates, 'optionalAccess',
|
|
2286
|
+
if (!_optionalChain([candidates, 'optionalAccess', _113 => _113.length])) return void 0;
|
|
2210
2287
|
if (candidates.length === 1) return candidates[0];
|
|
2211
2288
|
const sameNetworkClass = candidates.filter(
|
|
2212
2289
|
(candidate) => Boolean(candidate.testnet) === chain.testnet
|
|
@@ -2222,10 +2299,10 @@ function pickViemChain(candidates, chain) {
|
|
|
2222
2299
|
}
|
|
2223
2300
|
function resolveRpcUrls(chain, override, viemChains) {
|
|
2224
2301
|
const urls = [];
|
|
2225
|
-
if (_optionalChain([override, 'optionalAccess',
|
|
2302
|
+
if (_optionalChain([override, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()])) urls.push(override.trim());
|
|
2226
2303
|
if (chain.publicRpcUrl) urls.push(chain.publicRpcUrl);
|
|
2227
2304
|
if (chain.chainId !== null && chain.vmType === "evm") {
|
|
2228
|
-
const http2 = _optionalChain([pickViemChain, 'call',
|
|
2305
|
+
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
2306
|
if (http2) urls.push(...http2);
|
|
2230
2307
|
}
|
|
2231
2308
|
return [...new Set(urls)];
|
|
@@ -2234,7 +2311,7 @@ function toViemChain(chain, override, viemChains) {
|
|
|
2234
2311
|
if (chain.vmType !== "evm" || chain.chainId === null) return null;
|
|
2235
2312
|
const rpcUrls = resolveRpcUrls(chain, override, viemChains);
|
|
2236
2313
|
if (rpcUrls.length === 0) return null;
|
|
2237
|
-
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess',
|
|
2314
|
+
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess', _122 => _122.get, 'call', _123 => _123(chain.chainId)]), chain);
|
|
2238
2315
|
if (bundled) {
|
|
2239
2316
|
if (rpcUrls[0] === bundled.rpcUrls.default.http[0]) return bundled;
|
|
2240
2317
|
return _viem.defineChain.call(void 0, {
|
|
@@ -2265,7 +2342,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2265
2342
|
for (const entry of catalog.all) {
|
|
2266
2343
|
const chain = toViemChain(
|
|
2267
2344
|
entry,
|
|
2268
|
-
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess',
|
|
2345
|
+
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess', _124 => _124[entry.chainId]]),
|
|
2269
2346
|
viemChains
|
|
2270
2347
|
);
|
|
2271
2348
|
if (chain) chains.push(chain);
|
|
@@ -2274,7 +2351,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2274
2351
|
}
|
|
2275
2352
|
function needsViemChains(catalog, overrides) {
|
|
2276
2353
|
return catalog.all.some(
|
|
2277
|
-
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess',
|
|
2354
|
+
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess', _125 => _125[chain.chainId], 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()])
|
|
2278
2355
|
);
|
|
2279
2356
|
}
|
|
2280
2357
|
|
|
@@ -2354,9 +2431,9 @@ function publishRuntimeChainMeta(catalog) {
|
|
|
2354
2431
|
iconUrl: _nullishCoalesce(chain.iconUrl, () => ( void 0)),
|
|
2355
2432
|
nativeSymbol: chain.nativeToken.symbol,
|
|
2356
2433
|
nativeDecimals: chain.nativeToken.decimals,
|
|
2357
|
-
explorerUrl: _optionalChain([chain, 'access',
|
|
2358
|
-
explorerTxPath: _optionalChain([chain, 'access',
|
|
2359
|
-
explorerAddressPath: _optionalChain([chain, 'access',
|
|
2434
|
+
explorerUrl: _optionalChain([chain, 'access', _128 => _128.explorer, 'optionalAccess', _129 => _129.url]),
|
|
2435
|
+
explorerTxPath: _optionalChain([chain, 'access', _130 => _130.explorer, 'optionalAccess', _131 => _131.txPath]),
|
|
2436
|
+
explorerAddressPath: _optionalChain([chain, 'access', _132 => _132.explorer, 'optionalAccess', _133 => _133.addressPath])
|
|
2360
2437
|
}));
|
|
2361
2438
|
})
|
|
2362
2439
|
);
|
|
@@ -2429,7 +2506,7 @@ function useTargetTokens() {
|
|
|
2429
2506
|
const { catalog, shortlist } = useChainCatalog();
|
|
2430
2507
|
return _react.useMemo.call(void 0, () => {
|
|
2431
2508
|
return (chainId) => {
|
|
2432
|
-
const fromShortlist = _optionalChain([shortlist, 'optionalAccess',
|
|
2509
|
+
const fromShortlist = _optionalChain([shortlist, 'optionalAccess', _134 => _134[String(chainId)]]);
|
|
2433
2510
|
if (fromShortlist) {
|
|
2434
2511
|
return fromShortlist.map((token) => ({
|
|
2435
2512
|
symbol: token.symbol,
|
|
@@ -2437,8 +2514,8 @@ function useTargetTokens() {
|
|
|
2437
2514
|
decimals: token.decimals
|
|
2438
2515
|
}));
|
|
2439
2516
|
}
|
|
2440
|
-
const entry = _optionalChain([catalog, 'optionalAccess',
|
|
2441
|
-
return Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
2517
|
+
const entry = _optionalChain([catalog, 'optionalAccess', _135 => _135.byChainId, 'access', _136 => _136.get, 'call', _137 => _137(chainId)]);
|
|
2518
|
+
return Array.isArray(_optionalChain([entry, 'optionalAccess', _138 => _138.supportedTokens])) ? entry.supportedTokens.map((token) => ({
|
|
2442
2519
|
symbol: token.symbol,
|
|
2443
2520
|
address: token.address,
|
|
2444
2521
|
decimals: token.decimals
|
|
@@ -2448,12 +2525,12 @@ function useTargetTokens() {
|
|
|
2448
2525
|
}
|
|
2449
2526
|
function createDepositOffer(state, retry) {
|
|
2450
2527
|
const options = state.status === "ready" ? state.options : null;
|
|
2451
|
-
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2452
|
-
const listed = (chain) => _optionalChain([options, 'optionalAccess',
|
|
2528
|
+
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.restricted]), () => ( false));
|
|
2529
|
+
const listed = (chain) => _optionalChain([options, 'optionalAccess', _140 => _140.tokens, 'access', _141 => _141[String(chain)]]);
|
|
2453
2530
|
const isChainOffered = (chain) => {
|
|
2454
2531
|
if (!options) return false;
|
|
2455
2532
|
const entry = listed(chain);
|
|
2456
|
-
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2533
|
+
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess', _142 => _142.length]), () => ( 0))) > 0 : _optionalChain([entry, 'optionalAccess', _143 => _143.length]) !== 0;
|
|
2457
2534
|
};
|
|
2458
2535
|
return {
|
|
2459
2536
|
status: state.status,
|
|
@@ -2503,7 +2580,7 @@ function useChainName() {
|
|
|
2503
2580
|
if (!catalog) return _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId);
|
|
2504
2581
|
const key = catalogKeyForChain(chainId);
|
|
2505
2582
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2506
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2583
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _144 => _144.name]), () => ( _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId)));
|
|
2507
2584
|
};
|
|
2508
2585
|
}, [catalog]);
|
|
2509
2586
|
}
|
|
@@ -2527,7 +2604,7 @@ function useExplorerTxUrl() {
|
|
|
2527
2604
|
return (chainId, txHash) => {
|
|
2528
2605
|
if (chainId === "hypercore") return _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2529
2606
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2530
|
-
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess',
|
|
2607
|
+
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
2608
|
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2532
2609
|
};
|
|
2533
2610
|
}, [catalog]);
|
|
@@ -2590,7 +2667,7 @@ function ChainCatalogProvider({
|
|
|
2590
2667
|
service.getTopTokens().then(
|
|
2591
2668
|
(result) => {
|
|
2592
2669
|
if (!active) return;
|
|
2593
|
-
if (!_optionalChain([result, 'optionalAccess',
|
|
2670
|
+
if (!_optionalChain([result, 'optionalAccess', _151 => _151.ok])) {
|
|
2594
2671
|
setDepositOptions({ status: "error" });
|
|
2595
2672
|
return;
|
|
2596
2673
|
}
|
|
@@ -2747,7 +2824,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2747
2824
|
async function lookup2(ids, fields) {
|
|
2748
2825
|
try {
|
|
2749
2826
|
return await service.lookupAssets(ids, fields);
|
|
2750
|
-
} catch (
|
|
2827
|
+
} catch (e7) {
|
|
2751
2828
|
return { ok: false, routeMissing: false };
|
|
2752
2829
|
}
|
|
2753
2830
|
}
|
|
@@ -2762,22 +2839,22 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2762
2839
|
if (result.routeMissing) routeMissing = true;
|
|
2763
2840
|
meta.set(id, {
|
|
2764
2841
|
...previous,
|
|
2765
|
-
status: _optionalChain([previous, 'optionalAccess',
|
|
2842
|
+
status: _optionalChain([previous, 'optionalAccess', _152 => _152.status]) === "ready" ? "ready" : "failed",
|
|
2766
2843
|
retryAt: at + ASSET_RETRY_MS
|
|
2767
2844
|
});
|
|
2768
2845
|
continue;
|
|
2769
2846
|
}
|
|
2770
2847
|
const item = result.items[id];
|
|
2771
|
-
const code = _optionalChain([item, 'optionalAccess',
|
|
2848
|
+
const code = _optionalChain([item, 'optionalAccess', _153 => _153.error, 'optionalAccess', _154 => _154.code]);
|
|
2772
2849
|
if (!item || code && TERMINAL_ITEM_ERRORS.has(code)) {
|
|
2773
2850
|
meta.set(id, { status: "missing" });
|
|
2774
2851
|
continue;
|
|
2775
2852
|
}
|
|
2776
2853
|
meta.set(id, {
|
|
2777
2854
|
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',
|
|
2855
|
+
symbol: _nullishCoalesce(item.symbol, () => ( _optionalChain([previous, 'optionalAccess', _155 => _155.symbol]))),
|
|
2856
|
+
decimals: _nullishCoalesce(item.decimals, () => ( _optionalChain([previous, 'optionalAccess', _156 => _156.decimals]))),
|
|
2857
|
+
logo: _nullishCoalesce(item.logo, () => ( _optionalChain([previous, 'optionalAccess', _157 => _157.logo]))),
|
|
2781
2858
|
retryAt: code ? at + ASSET_RETRY_MS : void 0
|
|
2782
2859
|
});
|
|
2783
2860
|
}
|
|
@@ -2790,7 +2867,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2790
2867
|
for (const id of ids) {
|
|
2791
2868
|
priceInFlight.delete(id);
|
|
2792
2869
|
prices.set(id, {
|
|
2793
|
-
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access',
|
|
2870
|
+
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access', _158 => _158.items, 'access', _159 => _159[id], 'optionalAccess', _160 => _160.priceUsd]), () => ( null)) : null,
|
|
2794
2871
|
at
|
|
2795
2872
|
});
|
|
2796
2873
|
}
|
|
@@ -2844,7 +2921,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2844
2921
|
requestMeta,
|
|
2845
2922
|
requestPrices,
|
|
2846
2923
|
peekMeta,
|
|
2847
|
-
peekPrice: (id) => _optionalChain([prices, 'access',
|
|
2924
|
+
peekPrice: (id) => _optionalChain([prices, 'access', _161 => _161.get, 'call', _162 => _162(id), 'optionalAccess', _163 => _163.usd]),
|
|
2848
2925
|
async resolveMeta(refs) {
|
|
2849
2926
|
const ids = idsFor(refs);
|
|
2850
2927
|
requestMeta(refs);
|
|
@@ -2860,7 +2937,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2860
2937
|
if (!id) return null;
|
|
2861
2938
|
requestPrices([ref]);
|
|
2862
2939
|
await settled(() => !priceInFlight.has(id) && !priceQueue.has(id));
|
|
2863
|
-
return _nullishCoalesce(_optionalChain([prices, 'access',
|
|
2940
|
+
return _nullishCoalesce(_optionalChain([prices, 'access', _164 => _164.get, 'call', _165 => _165(id), 'optionalAccess', _166 => _166.usd]), () => ( null));
|
|
2864
2941
|
}
|
|
2865
2942
|
};
|
|
2866
2943
|
}
|
|
@@ -2991,7 +3068,7 @@ function createIngestTransport(options) {
|
|
|
2991
3068
|
function report(reason, status) {
|
|
2992
3069
|
try {
|
|
2993
3070
|
onFailure({ reason, status, droppedEvents: dropped });
|
|
2994
|
-
} catch (
|
|
3071
|
+
} catch (e8) {
|
|
2995
3072
|
}
|
|
2996
3073
|
}
|
|
2997
3074
|
function drop(batch, reason, status) {
|
|
@@ -3045,10 +3122,10 @@ function createIngestTransport(options) {
|
|
|
3045
3122
|
}
|
|
3046
3123
|
function interruptForUnload() {
|
|
3047
3124
|
for (const wake of [...sleepers]) wake();
|
|
3048
|
-
_optionalChain([mintAbort, 'optionalAccess',
|
|
3125
|
+
_optionalChain([mintAbort, 'optionalAccess', _167 => _167.abort, 'call', _168 => _168()]);
|
|
3049
3126
|
}
|
|
3050
3127
|
function retryDelay(response, attempt) {
|
|
3051
|
-
const seconds = Number(_optionalChain([response, 'access',
|
|
3128
|
+
const seconds = Number(_optionalChain([response, 'access', _169 => _169.headers, 'optionalAccess', _170 => _170.get, 'optionalCall', _171 => _171("Retry-After")]));
|
|
3052
3129
|
if (Number.isFinite(seconds) && seconds > 0) {
|
|
3053
3130
|
return Math.min(seconds * 1e3, MAX_BACKOFF_MS);
|
|
3054
3131
|
}
|
|
@@ -3063,10 +3140,10 @@ function createIngestTransport(options) {
|
|
|
3063
3140
|
try {
|
|
3064
3141
|
response = await fetchImpl(mintUrl, {
|
|
3065
3142
|
method: "POST",
|
|
3066
|
-
headers:
|
|
3067
|
-
signal: _optionalChain([controller, 'optionalAccess',
|
|
3143
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
3144
|
+
signal: _optionalChain([controller, 'optionalAccess', _172 => _172.signal])
|
|
3068
3145
|
});
|
|
3069
|
-
} catch (
|
|
3146
|
+
} catch (e9) {
|
|
3070
3147
|
if (urgency !== DISMISSAL) {
|
|
3071
3148
|
mintFailures += 1;
|
|
3072
3149
|
mintBackoffUntil = now() + backoff(mintFailures);
|
|
@@ -3094,7 +3171,7 @@ function createIngestTransport(options) {
|
|
|
3094
3171
|
token = { value, expiresAt };
|
|
3095
3172
|
mintFailures = 0;
|
|
3096
3173
|
mintBackoffUntil = 0;
|
|
3097
|
-
} catch (
|
|
3174
|
+
} catch (e10) {
|
|
3098
3175
|
mintUnavailable = true;
|
|
3099
3176
|
report("token_unavailable", response.status);
|
|
3100
3177
|
}
|
|
@@ -3134,7 +3211,7 @@ function createIngestTransport(options) {
|
|
|
3134
3211
|
body: bodyOf(batch),
|
|
3135
3212
|
keepalive: true
|
|
3136
3213
|
});
|
|
3137
|
-
} catch (
|
|
3214
|
+
} catch (e11) {
|
|
3138
3215
|
if (terminal || attempt >= MAX_ATTEMPTS) {
|
|
3139
3216
|
return drop(batch, "network");
|
|
3140
3217
|
}
|
|
@@ -3239,7 +3316,7 @@ function createIngestTransport(options) {
|
|
|
3239
3316
|
}
|
|
3240
3317
|
},
|
|
3241
3318
|
flush(flushOptions) {
|
|
3242
|
-
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess',
|
|
3319
|
+
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess', _173 => _173.terminal]), () => ( false));
|
|
3243
3320
|
if (disposed && !dismissal) return;
|
|
3244
3321
|
clearFlushTimer();
|
|
3245
3322
|
void run(dismissal ? DISMISSAL : IDLE);
|
|
@@ -3254,11 +3331,11 @@ function createIngestTransport(options) {
|
|
|
3254
3331
|
};
|
|
3255
3332
|
}
|
|
3256
3333
|
function randomUuid() {
|
|
3257
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
3334
|
+
if (typeof _optionalChain([globalThis, 'access', _174 => _174.crypto, 'optionalAccess', _175 => _175.randomUUID]) === "function") {
|
|
3258
3335
|
return globalThis.crypto.randomUUID();
|
|
3259
3336
|
}
|
|
3260
3337
|
const bytes = new Uint8Array(16);
|
|
3261
|
-
_optionalChain([globalThis, 'access',
|
|
3338
|
+
_optionalChain([globalThis, 'access', _176 => _176.crypto, 'optionalAccess', _177 => _177.getRandomValues, 'optionalCall', _178 => _178(bytes)]);
|
|
3262
3339
|
if (!bytes.some(Boolean)) {
|
|
3263
3340
|
for (let index = 0; index < bytes.length; index += 1) {
|
|
3264
3341
|
bytes[index] = Math.floor(Math.random() * 256);
|
|
@@ -3272,9 +3349,9 @@ function randomUuid() {
|
|
|
3272
3349
|
function resolveProxyOrigin(backendUrl) {
|
|
3273
3350
|
if (!backendUrl.trim()) return null;
|
|
3274
3351
|
try {
|
|
3275
|
-
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access',
|
|
3352
|
+
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access', _179 => _179.location, 'optionalAccess', _180 => _180.href]));
|
|
3276
3353
|
return origin.startsWith("http") ? origin : null;
|
|
3277
|
-
} catch (
|
|
3354
|
+
} catch (e12) {
|
|
3278
3355
|
return null;
|
|
3279
3356
|
}
|
|
3280
3357
|
}
|
|
@@ -3324,13 +3401,13 @@ function AnalyticsSession(props) {
|
|
|
3324
3401
|
type: "analytics_ingest_failure",
|
|
3325
3402
|
session_id: sessionIdRef.current,
|
|
3326
3403
|
modal,
|
|
3327
|
-
widget_version:
|
|
3404
|
+
widget_version: _chunkVQAV6ESIcjs.MODAL_VERSION,
|
|
3328
3405
|
timestamp: nowRef.current().toISOString(),
|
|
3329
3406
|
reason,
|
|
3330
3407
|
...status === void 0 ? {} : { status },
|
|
3331
3408
|
dropped_events: droppedEvents
|
|
3332
3409
|
};
|
|
3333
|
-
_optionalChain([onEventRef, 'access',
|
|
3410
|
+
_optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182(event)]);
|
|
3334
3411
|
},
|
|
3335
3412
|
[modal]
|
|
3336
3413
|
);
|
|
@@ -3352,7 +3429,7 @@ function AnalyticsSession(props) {
|
|
|
3352
3429
|
proxyOrigin,
|
|
3353
3430
|
sessionId: sessionIdRef.current,
|
|
3354
3431
|
modal,
|
|
3355
|
-
widgetVersion:
|
|
3432
|
+
widgetVersion: _chunkVQAV6ESIcjs.MODAL_VERSION,
|
|
3356
3433
|
sessionProperties: sessionPropertiesRef.current,
|
|
3357
3434
|
onFailure: (failure) => emitFailure(failure),
|
|
3358
3435
|
fetchImpl: props.fetchImpl,
|
|
@@ -3369,10 +3446,10 @@ function AnalyticsSession(props) {
|
|
|
3369
3446
|
const enqueue = _react.useCallback.call(void 0,
|
|
3370
3447
|
(event) => {
|
|
3371
3448
|
try {
|
|
3372
|
-
_optionalChain([ingestRef, 'access',
|
|
3449
|
+
_optionalChain([ingestRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.transport, 'optionalAccess', _185 => _185.enqueue, 'call', _186 => _186(
|
|
3373
3450
|
event
|
|
3374
3451
|
)]);
|
|
3375
|
-
} catch (
|
|
3452
|
+
} catch (e13) {
|
|
3376
3453
|
}
|
|
3377
3454
|
},
|
|
3378
3455
|
[]
|
|
@@ -3408,12 +3485,12 @@ function AnalyticsSession(props) {
|
|
|
3408
3485
|
...payload,
|
|
3409
3486
|
session_id: sessionIdRef.current,
|
|
3410
3487
|
modal,
|
|
3411
|
-
widget_version:
|
|
3488
|
+
widget_version: _chunkVQAV6ESIcjs.MODAL_VERSION,
|
|
3412
3489
|
timestamp: nowRef.current().toISOString(),
|
|
3413
3490
|
session_properties: sessionPropertiesRef.current,
|
|
3414
3491
|
funding_method: fundingMethod
|
|
3415
3492
|
};
|
|
3416
|
-
_optionalChain([onEventRef, 'access',
|
|
3493
|
+
_optionalChain([onEventRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188(
|
|
3417
3494
|
event
|
|
3418
3495
|
)]);
|
|
3419
3496
|
enqueue(event);
|
|
@@ -3427,11 +3504,11 @@ function AnalyticsSession(props) {
|
|
|
3427
3504
|
...payload,
|
|
3428
3505
|
session_id: sessionIdRef.current,
|
|
3429
3506
|
modal,
|
|
3430
|
-
widget_version:
|
|
3507
|
+
widget_version: _chunkVQAV6ESIcjs.MODAL_VERSION,
|
|
3431
3508
|
timestamp: nowRef.current().toISOString(),
|
|
3432
3509
|
session_properties: sessionPropertiesRef.current
|
|
3433
3510
|
};
|
|
3434
|
-
_optionalChain([onEventRef, 'access',
|
|
3511
|
+
_optionalChain([onEventRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190(event)]);
|
|
3435
3512
|
enqueue(event);
|
|
3436
3513
|
},
|
|
3437
3514
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3443,11 +3520,11 @@ function AnalyticsSession(props) {
|
|
|
3443
3520
|
...payload,
|
|
3444
3521
|
session_id: sessionIdRef.current,
|
|
3445
3522
|
modal,
|
|
3446
|
-
widget_version:
|
|
3523
|
+
widget_version: _chunkVQAV6ESIcjs.MODAL_VERSION,
|
|
3447
3524
|
timestamp: nowRef.current().toISOString(),
|
|
3448
3525
|
session_properties: sessionPropertiesRef.current
|
|
3449
3526
|
};
|
|
3450
|
-
_optionalChain([onEventRef, 'access',
|
|
3527
|
+
_optionalChain([onEventRef, 'access', _191 => _191.current, 'optionalCall', _192 => _192(event)]);
|
|
3451
3528
|
enqueue(event);
|
|
3452
3529
|
},
|
|
3453
3530
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3506,7 +3583,7 @@ function toRecoverableDeposit(row, options = {}) {
|
|
|
3506
3583
|
};
|
|
3507
3584
|
}
|
|
3508
3585
|
function isDepositSelfDestination(row, destination) {
|
|
3509
|
-
const depositAddress = _optionalChain([row, 'access',
|
|
3586
|
+
const depositAddress = _optionalChain([row, 'access', _193 => _193.depositAddress, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]);
|
|
3510
3587
|
const candidate = destination.trim();
|
|
3511
3588
|
if (!depositAddress || !candidate) return false;
|
|
3512
3589
|
return depositAddress.toLowerCase() === candidate.toLowerCase();
|
|
@@ -3559,7 +3636,7 @@ var STATUS_LABEL = {
|
|
|
3559
3636
|
};
|
|
3560
3637
|
function filterVisibleDeposits(deposits) {
|
|
3561
3638
|
const sourceHashes = new Set(
|
|
3562
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
3639
|
+
deposits.map((d) => _optionalChain([d, 'access', _196 => _196.sourceTxHash, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198()])).filter((h) => Boolean(h))
|
|
3563
3640
|
);
|
|
3564
3641
|
return deposits.filter(
|
|
3565
3642
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -3628,7 +3705,7 @@ function HistoryEntryButton({
|
|
|
3628
3705
|
(badge || unread) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
3706
|
"span",
|
|
3630
3707
|
{
|
|
3631
|
-
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
3708
|
+
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess', _199 => _199.state]), () => ( "progress"))}`,
|
|
3632
3709
|
"aria-hidden": "true"
|
|
3633
3710
|
}
|
|
3634
3711
|
)
|
|
@@ -3678,7 +3755,7 @@ function CdnIcon({
|
|
|
3678
3755
|
}
|
|
3679
3756
|
const isLoading = loadedSrc !== src;
|
|
3680
3757
|
const settleIfAlreadyComplete = (el) => {
|
|
3681
|
-
if (_optionalChain([el, 'optionalAccess',
|
|
3758
|
+
if (_optionalChain([el, 'optionalAccess', _200 => _200.complete])) setLoadedSrc(src);
|
|
3682
3759
|
};
|
|
3683
3760
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3684
3761
|
"img",
|
|
@@ -3849,7 +3926,7 @@ function PoweredBy() {
|
|
|
3849
3926
|
}
|
|
3850
3927
|
PoweredBy.displayName = "PoweredBy";
|
|
3851
3928
|
|
|
3852
|
-
// src/components/history/
|
|
3929
|
+
// src/components/history/OrderCard.tsx
|
|
3853
3930
|
|
|
3854
3931
|
|
|
3855
3932
|
// src/components/history/HistoryTransactionLink.tsx
|
|
@@ -3915,8 +3992,8 @@ function toPaymentView(order) {
|
|
|
3915
3992
|
const progress = toPaymentProgress(order);
|
|
3916
3993
|
return {
|
|
3917
3994
|
id: order.id,
|
|
3918
|
-
amount: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3919
|
-
currency: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3995
|
+
amount: _nullishCoalesce(_optionalChain([order, 'access', _201 => _201.fiat, 'access', _202 => _202.charged, 'optionalAccess', _203 => _203.total]), () => ( "")),
|
|
3996
|
+
currency: _nullishCoalesce(_optionalChain([order, 'access', _204 => _204.fiat, 'access', _205 => _205.charged, 'optionalAccess', _206 => _206.currency]), () => ( "")),
|
|
3920
3997
|
progress,
|
|
3921
3998
|
terminal: TERMINAL.has(progress)
|
|
3922
3999
|
};
|
|
@@ -3956,18 +4033,18 @@ var BANK_ONRAMP_COPY = {
|
|
|
3956
4033
|
}
|
|
3957
4034
|
};
|
|
3958
4035
|
|
|
3959
|
-
// src/components/history/
|
|
4036
|
+
// src/components/history/OrderCard.tsx
|
|
3960
4037
|
|
|
3961
4038
|
function bankSupportHref(value) {
|
|
3962
4039
|
if (!value) return void 0;
|
|
3963
4040
|
try {
|
|
3964
4041
|
const url = new URL(value);
|
|
3965
4042
|
return ["https:", "mailto:"].includes(url.protocol) ? url.href : void 0;
|
|
3966
|
-
} catch (
|
|
4043
|
+
} catch (e14) {
|
|
3967
4044
|
return void 0;
|
|
3968
4045
|
}
|
|
3969
4046
|
}
|
|
3970
|
-
function
|
|
4047
|
+
function OrderCard({
|
|
3971
4048
|
order,
|
|
3972
4049
|
supportUrl,
|
|
3973
4050
|
children,
|
|
@@ -3979,7 +4056,12 @@ function BankOrderCard({
|
|
|
3979
4056
|
const subFee = [order.stages.conversion, order.stages.delivery].some(
|
|
3980
4057
|
(stage) => stage.status === "failed" && stage.reason === "sub_fee"
|
|
3981
4058
|
);
|
|
3982
|
-
const
|
|
4059
|
+
const exchange = order.rail.kind === "exchange";
|
|
4060
|
+
const bank = order.provider === "noah" || order.rail.kind === "fiat" && order.rail.method === "bank-transfer";
|
|
4061
|
+
const title = exchange ? "Exchange transfer" : bank ? "Bank transfer" : "Card payment";
|
|
4062
|
+
const Icon = exchange ? _chunkG264OM23cjs.CoinsIcon : bank ? _chunkG264OM23cjs.BankIcon : _chunkG264OM23cjs.CardIcon;
|
|
4063
|
+
const noun = bank ? "bank transfer" : "payment";
|
|
4064
|
+
const support = order.provider === "noah" ? bankSupportHref(supportUrl) : void 0;
|
|
3983
4065
|
const { delivery } = order.stages;
|
|
3984
4066
|
const deliveryTxHash = "txHash" in delivery ? delivery.txHash : void 0;
|
|
3985
4067
|
const needsHelp = ["failed", "returned", "on_hold"].includes(view.progress);
|
|
@@ -4011,7 +4093,7 @@ function BankOrderCard({
|
|
|
4011
4093
|
month: "short",
|
|
4012
4094
|
year: "numeric"
|
|
4013
4095
|
});
|
|
4014
|
-
const description = subFee ? "The transfer was consumed by the provider\u2019s fees. No crypto was delivered." : label === "Failed" && deposit ? "Crypto arrived, but settlement to your destination could not be completed." : label === "Completed" ?
|
|
4096
|
+
const description = subFee ? "The transfer was consumed by the provider\u2019s fees. No crypto was delivered." : label === "Failed" && deposit ? "Crypto arrived, but settlement to your destination could not be completed." : label === "Completed" ? `Your ${noun} has completed and the crypto reached its destination.` : label === "Settled" ? `Your ${noun} has settled into crypto. Final delivery is being confirmed.` : label === "Settling" ? `Your ${noun} is being settled into crypto.` : label === "Detected" ? `Your ${noun} was detected and is awaiting settlement.` : order.provider === "noah" || label === "Under review" ? BANK_ONRAMP_COPY[view.progress].subtitle : label === "Returned" ? "The payment was refunded." : "The payment could not be completed. No crypto was delivered.";
|
|
4015
4097
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4016
4098
|
"div",
|
|
4017
4099
|
{
|
|
@@ -4026,9 +4108,9 @@ function BankOrderCard({
|
|
|
4026
4108
|
"aria-expanded": expanded,
|
|
4027
4109
|
"aria-controls": panelId,
|
|
4028
4110
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
4029
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-icons", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4111
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-icons", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, {}) }) }),
|
|
4030
4112
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
4031
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children:
|
|
4113
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: title }),
|
|
4032
4114
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "time", { className: "rs-history-card-date", dateTime: order.createdAt, children: date })
|
|
4033
4115
|
] }),
|
|
4034
4116
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-side", children: [
|
|
@@ -4051,12 +4133,12 @@ function BankOrderCard({
|
|
|
4051
4133
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
4134
|
HistoryTransactionLink,
|
|
4053
4135
|
{
|
|
4054
|
-
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4055
|
-
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4136
|
+
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _207 => _207.chain]), () => ( order.deliveryChain)),
|
|
4137
|
+
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _208 => _208.txHash]), () => ( deliveryTxHash)),
|
|
4056
4138
|
label: "Crypto deposit"
|
|
4057
4139
|
}
|
|
4058
4140
|
),
|
|
4059
|
-
_optionalChain([deposit, 'optionalAccess',
|
|
4141
|
+
_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
4142
|
(needsHelp || status === "failed") && support && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4061
4143
|
"a",
|
|
4062
4144
|
{
|
|
@@ -4084,7 +4166,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4084
4166
|
const entry = useAssetMetadata([token])[_nullishCoalesce(id, () => ( ""))];
|
|
4085
4167
|
const classes = `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd();
|
|
4086
4168
|
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',
|
|
4169
|
+
if (_optionalChain([entry, 'optionalAccess', _213 => _213.status]) === "pending") {
|
|
4088
4170
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4089
4171
|
"span",
|
|
4090
4172
|
{
|
|
@@ -4097,7 +4179,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4097
4179
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4098
4180
|
CdnIcon,
|
|
4099
4181
|
{
|
|
4100
|
-
src: _optionalChain([entry, 'optionalAccess',
|
|
4182
|
+
src: _optionalChain([entry, 'optionalAccess', _214 => _214.status]) === "ready" ? entry.logo : void 0,
|
|
4101
4183
|
className: classes,
|
|
4102
4184
|
fallback: badge
|
|
4103
4185
|
}
|
|
@@ -4204,23 +4286,23 @@ function resolveCuratedToken(token, chain) {
|
|
|
4204
4286
|
return void 0;
|
|
4205
4287
|
}
|
|
4206
4288
|
function resolveTokenDisplay(token, chain, asset, fallback) {
|
|
4207
|
-
const pending = _optionalChain([asset, 'optionalAccess',
|
|
4289
|
+
const pending = _optionalChain([asset, 'optionalAccess', _215 => _215.status]) === "pending";
|
|
4208
4290
|
const curated = token !== void 0 && chain !== void 0 ? resolveCuratedToken(token, chain) : void 0;
|
|
4209
|
-
const fromAsset = _optionalChain([asset, 'optionalAccess',
|
|
4291
|
+
const fromAsset = _optionalChain([asset, 'optionalAccess', _216 => _216.status]) === "ready" ? asset : void 0;
|
|
4210
4292
|
const hyperCore = chain !== void 0 && isHyperCore(chain);
|
|
4211
4293
|
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',
|
|
4294
|
+
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])));
|
|
4295
|
+
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
4296
|
return {
|
|
4215
|
-
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
4297
|
+
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess', _224 => _224.symbol]))), () => ( "Token")),
|
|
4216
4298
|
decimals,
|
|
4217
|
-
logo: _optionalChain([fromAsset, 'optionalAccess',
|
|
4299
|
+
logo: _optionalChain([fromAsset, 'optionalAccess', _225 => _225.logo]),
|
|
4218
4300
|
curated: curatedSymbol !== void 0,
|
|
4219
4301
|
pending
|
|
4220
4302
|
};
|
|
4221
4303
|
}
|
|
4222
4304
|
function toAssetRef(ref) {
|
|
4223
|
-
return _optionalChain([ref, 'optionalAccess',
|
|
4305
|
+
return _optionalChain([ref, 'optionalAccess', _226 => _226.chain]) !== void 0 && ref.address ? { chain: ref.chain, address: ref.address } : void 0;
|
|
4224
4306
|
}
|
|
4225
4307
|
function useTokenDisplays(refs) {
|
|
4226
4308
|
const { catalog } = useChainCatalog();
|
|
@@ -4231,16 +4313,16 @@ function useTokenDisplays(refs) {
|
|
|
4231
4313
|
);
|
|
4232
4314
|
const assets = useAssetMetadata(refs.map(toAssetRef));
|
|
4233
4315
|
const key = refs.map(
|
|
4234
|
-
(ref) => `${String(_optionalChain([ref, 'optionalAccess',
|
|
4316
|
+
(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
4317
|
).join("|");
|
|
4236
4318
|
return _react.useMemo.call(void 0,
|
|
4237
4319
|
() => refs.map((ref) => {
|
|
4238
|
-
const id = assetIdFor(_optionalChain([ref, 'optionalAccess',
|
|
4320
|
+
const id = assetIdFor(_optionalChain([ref, 'optionalAccess', _233 => _233.chain]), _optionalChain([ref, 'optionalAccess', _234 => _234.address]));
|
|
4239
4321
|
return resolveTokenDisplay(
|
|
4240
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4241
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4322
|
+
_optionalChain([ref, 'optionalAccess', _235 => _235.address]),
|
|
4323
|
+
_optionalChain([ref, 'optionalAccess', _236 => _236.chain]),
|
|
4242
4324
|
id ? assets[id] : void 0,
|
|
4243
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4325
|
+
_optionalChain([ref, 'optionalAccess', _237 => _237.fallback])
|
|
4244
4326
|
);
|
|
4245
4327
|
}),
|
|
4246
4328
|
// `refs` enters through `key`.
|
|
@@ -4271,7 +4353,7 @@ function formatDate(iso) {
|
|
|
4271
4353
|
month: "short",
|
|
4272
4354
|
year: "numeric"
|
|
4273
4355
|
});
|
|
4274
|
-
} catch (
|
|
4356
|
+
} catch (e15) {
|
|
4275
4357
|
return iso;
|
|
4276
4358
|
}
|
|
4277
4359
|
}
|
|
@@ -4286,12 +4368,12 @@ function formatAmount(rawAmount, decimals) {
|
|
|
4286
4368
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
4287
4369
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
4288
4370
|
return `${whole}.${frac}`;
|
|
4289
|
-
} catch (
|
|
4371
|
+
} catch (e16) {
|
|
4290
4372
|
return rawAmount;
|
|
4291
4373
|
}
|
|
4292
4374
|
}
|
|
4293
4375
|
function DepositHistoryPanel({
|
|
4294
|
-
|
|
4376
|
+
orderHistory,
|
|
4295
4377
|
bankSupportUrl,
|
|
4296
4378
|
deposits,
|
|
4297
4379
|
isLoading,
|
|
@@ -4311,7 +4393,7 @@ function DepositHistoryPanel({
|
|
|
4311
4393
|
}) {
|
|
4312
4394
|
const rootRef = _react.useRef.call(void 0, null);
|
|
4313
4395
|
_react.useEffect.call(void 0, () => {
|
|
4314
|
-
_optionalChain([rootRef, 'access',
|
|
4396
|
+
_optionalChain([rootRef, 'access', _238 => _238.current, 'optionalAccess', _239 => _239.toggleAttribute, 'call', _240 => _240("inert", Boolean(obscured))]);
|
|
4315
4397
|
}, [obscured]);
|
|
4316
4398
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
4317
4399
|
(e) => {
|
|
@@ -4345,7 +4427,7 @@ function DepositHistoryPanel({
|
|
|
4345
4427
|
_react.useEffect.call(void 0, () => {
|
|
4346
4428
|
const nextBoundary = timingPresentations.reduce(
|
|
4347
4429
|
(earliest, presentation) => {
|
|
4348
|
-
const next = _optionalChain([presentation, 'optionalAccess',
|
|
4430
|
+
const next = _optionalChain([presentation, 'optionalAccess', _241 => _241.nextTransitionAtMs]);
|
|
4349
4431
|
if (next === void 0) return earliest;
|
|
4350
4432
|
return earliest === void 0 || next < earliest ? next : earliest;
|
|
4351
4433
|
},
|
|
@@ -4419,7 +4501,7 @@ function DepositHistoryPanel({
|
|
|
4419
4501
|
]
|
|
4420
4502
|
}
|
|
4421
4503
|
),
|
|
4422
|
-
(isLoading || _optionalChain([
|
|
4504
|
+
(isLoading || _optionalChain([orderHistory, 'optionalAccess', _242 => _242.loading])) && deposits.length === 0 && !_optionalChain([orderHistory, 'optionalAccess', _243 => _243.orders, 'access', _244 => _244.length]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4423
4505
|
/* @__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
4506
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4425
4507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
@@ -4433,18 +4515,18 @@ function DepositHistoryPanel({
|
|
|
4433
4515
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
4434
4516
|
] })
|
|
4435
4517
|
] }),
|
|
4436
|
-
_optionalChain([
|
|
4437
|
-
!isLoading && !error && !_optionalChain([
|
|
4518
|
+
_optionalChain([orderHistory, 'optionalAccess', _245 => _245.error]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { role: "status", children: orderHistory.error }),
|
|
4519
|
+
!isLoading && !error && !_optionalChain([orderHistory, 'optionalAccess', _246 => _246.loading]) && !_optionalChain([orderHistory, 'optionalAccess', _247 => _247.error]) && !_optionalChain([orderHistory, 'optionalAccess', _248 => _248.orders, 'access', _249 => _249.length]) && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4438
4520
|
/* @__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
4521
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4440
4522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
4441
4523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
4442
4524
|
] })
|
|
4443
4525
|
] }),
|
|
4444
|
-
(visibleDeposits.length > 0 || Boolean(_optionalChain([
|
|
4526
|
+
(visibleDeposits.length > 0 || Boolean(_optionalChain([orderHistory, 'optionalAccess', _250 => _250.orders, 'access', _251 => _251.length]))) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
4445
4527
|
[
|
|
4446
4528
|
...visibleDeposits.filter(
|
|
4447
|
-
(deposit) => !_optionalChain([
|
|
4529
|
+
(deposit) => !_optionalChain([orderHistory, 'optionalAccess', _252 => _252.orders, 'access', _253 => _253.some, 'call', _254 => _254(
|
|
4448
4530
|
(order) => order.stages.delivery.status === "completed" && order.stages.delivery.depositId === deposit.id
|
|
4449
4531
|
)])
|
|
4450
4532
|
).map((deposit, i) => ({
|
|
@@ -4463,15 +4545,15 @@ function DepositHistoryPanel({
|
|
|
4463
4545
|
deposit.txHash || i
|
|
4464
4546
|
)
|
|
4465
4547
|
})),
|
|
4466
|
-
...(_nullishCoalesce(_optionalChain([
|
|
4548
|
+
...(_nullishCoalesce(_optionalChain([orderHistory, 'optionalAccess', _255 => _255.orders]), () => ( []))).map((order) => {
|
|
4467
4549
|
const delivery = order.stages.delivery;
|
|
4468
4550
|
const linked = delivery.status === "completed" ? visibleDeposits.find(
|
|
4469
4551
|
(deposit) => deposit.id === delivery.depositId
|
|
4470
4552
|
) : void 0;
|
|
4471
4553
|
return {
|
|
4472
|
-
id: `
|
|
4554
|
+
id: `order:${order.id}`,
|
|
4473
4555
|
createdAt: order.createdAt,
|
|
4474
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4556
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, OrderCard, { order, deposit: linked, supportUrl: bankSupportUrl, children: linked && normalizeStatus(linked.status) === "failed" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4475
4557
|
HistoryCard,
|
|
4476
4558
|
{
|
|
4477
4559
|
deposit: linked,
|
|
@@ -4485,14 +4567,14 @@ function DepositHistoryPanel({
|
|
|
4485
4567
|
};
|
|
4486
4568
|
})
|
|
4487
4569
|
].sort((a, b) => b.createdAt.localeCompare(a.createdAt)).map((entry) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: entry.content }, entry.id)),
|
|
4488
|
-
_optionalChain([
|
|
4570
|
+
_optionalChain([orderHistory, 'optionalAccess', _256 => _256.hasMore]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4489
4571
|
"button",
|
|
4490
4572
|
{
|
|
4491
4573
|
type: "button",
|
|
4492
4574
|
className: "rs-history-load-more",
|
|
4493
|
-
disabled:
|
|
4494
|
-
onClick:
|
|
4495
|
-
children: "Load older
|
|
4575
|
+
disabled: orderHistory.loading,
|
|
4576
|
+
onClick: orderHistory.loadMore,
|
|
4577
|
+
children: "Load older payments"
|
|
4496
4578
|
}
|
|
4497
4579
|
),
|
|
4498
4580
|
hasMore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4549,7 +4631,7 @@ function HistoryCard({
|
|
|
4549
4631
|
setExpanded(next);
|
|
4550
4632
|
const depositId = _nullishCoalesce(deposit.id, () => ( deposit.txHash));
|
|
4551
4633
|
if (!next || !depositId) return;
|
|
4552
|
-
_optionalChain([onRowView, 'optionalCall',
|
|
4634
|
+
_optionalChain([onRowView, 'optionalCall', _257 => _257({
|
|
4553
4635
|
depositId,
|
|
4554
4636
|
status,
|
|
4555
4637
|
recoverable: eligible !== null,
|
|
@@ -4622,7 +4704,7 @@ function HistoryCard({
|
|
|
4622
4704
|
recoverable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4623
4705
|
Button,
|
|
4624
4706
|
{
|
|
4625
|
-
onClick: () => _optionalChain([onRecover, 'optionalCall',
|
|
4707
|
+
onClick: () => _optionalChain([onRecover, 'optionalCall', _258 => _258(recoverable)]),
|
|
4626
4708
|
fullWidth: true,
|
|
4627
4709
|
className: "rs-history-card-recover",
|
|
4628
4710
|
children: [
|
|
@@ -4687,7 +4769,7 @@ function ListRow({
|
|
|
4687
4769
|
if (disabled) return;
|
|
4688
4770
|
if (e.key === "Enter" || e.key === " ") {
|
|
4689
4771
|
e.preventDefault();
|
|
4690
|
-
_optionalChain([onClick, 'optionalCall',
|
|
4772
|
+
_optionalChain([onClick, 'optionalCall', _259 => _259(e)]);
|
|
4691
4773
|
}
|
|
4692
4774
|
};
|
|
4693
4775
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4697,7 +4779,7 @@ function ListRow({
|
|
|
4697
4779
|
role: "button",
|
|
4698
4780
|
tabIndex: disabled ? -1 : 0,
|
|
4699
4781
|
"aria-disabled": disabled || void 0,
|
|
4700
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
4782
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _260 => _260(e)]),
|
|
4701
4783
|
onKeyDown: handleKey,
|
|
4702
4784
|
children: inner
|
|
4703
4785
|
}
|
|
@@ -4755,7 +4837,7 @@ var RECOVERY_LOOKUP_MISS_COPY = {
|
|
|
4755
4837
|
};
|
|
4756
4838
|
function classifyRecoveryLookup(rows, options = {}) {
|
|
4757
4839
|
const inScope = options.recipient ? rows.filter(
|
|
4758
|
-
(row) => _optionalChain([row, 'access',
|
|
4840
|
+
(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
4841
|
) : rows;
|
|
4760
4842
|
const eligible = inScope.map((row) => toRecoverableDeposit(row, options)).filter((deposit) => deposit !== null);
|
|
4761
4843
|
return {
|
|
@@ -4783,7 +4865,7 @@ function RecoveryLookupScreen({
|
|
|
4783
4865
|
const valid = isRecoveryTxHash(trimmed);
|
|
4784
4866
|
_react.useEffect.call(void 0, () => {
|
|
4785
4867
|
if (trimmed.length > 0 && !valid) {
|
|
4786
|
-
_optionalChain([onInvalidRef, 'access',
|
|
4868
|
+
_optionalChain([onInvalidRef, 'access', _267 => _267.current, 'optionalCall', _268 => _268()]);
|
|
4787
4869
|
}
|
|
4788
4870
|
}, [trimmed, valid, onInvalidRef]);
|
|
4789
4871
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -4864,7 +4946,7 @@ function tokenAmountToNumber(rawAmount, decimals) {
|
|
|
4864
4946
|
try {
|
|
4865
4947
|
const value = Number(_viem.formatUnits.call(void 0, BigInt(rawAmount), decimals));
|
|
4866
4948
|
return Number.isFinite(value) ? value : void 0;
|
|
4867
|
-
} catch (
|
|
4949
|
+
} catch (e17) {
|
|
4868
4950
|
return void 0;
|
|
4869
4951
|
}
|
|
4870
4952
|
}
|
|
@@ -4909,7 +4991,7 @@ function formatQuotedReceive(output, fallbackSymbol) {
|
|
|
4909
4991
|
let raw;
|
|
4910
4992
|
try {
|
|
4911
4993
|
raw = BigInt(output.amount);
|
|
4912
|
-
} catch (
|
|
4994
|
+
} catch (e18) {
|
|
4913
4995
|
return void 0;
|
|
4914
4996
|
}
|
|
4915
4997
|
if (raw <= 0n) return void 0;
|
|
@@ -4946,7 +5028,7 @@ function formatRecoveryAmount(amountRaw, decimals, symbol) {
|
|
|
4946
5028
|
function toBigInt(value) {
|
|
4947
5029
|
try {
|
|
4948
5030
|
return BigInt(value || "0");
|
|
4949
|
-
} catch (
|
|
5031
|
+
} catch (e19) {
|
|
4950
5032
|
return 0n;
|
|
4951
5033
|
}
|
|
4952
5034
|
}
|
|
@@ -5080,7 +5162,7 @@ async function submitSignedRecovery(params) {
|
|
|
5080
5162
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
5081
5163
|
// every other backend call. Without it this path would be invisible in the
|
|
5082
5164
|
// per-client version telemetry the processor records.
|
|
5083
|
-
headers:
|
|
5165
|
+
headers: _chunkVQAV6ESIcjs.serviceHeaders.call(void 0, ),
|
|
5084
5166
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
5085
5167
|
// precision well before that range.
|
|
5086
5168
|
body: JSON.stringify({ depositId, destination, signature })
|
|
@@ -5550,17 +5632,17 @@ function HistoryFallbackFlow({
|
|
|
5550
5632
|
),
|
|
5551
5633
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list", children: matches.map((match, i) => {
|
|
5552
5634
|
const display = matchDisplays[i];
|
|
5553
|
-
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess',
|
|
5635
|
+
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess', _269 => _269.symbol]), () => ( "Token"));
|
|
5554
5636
|
const { amount, chainName } = describeRecoveryDeposit({
|
|
5555
5637
|
chainId: match.sourceChainId,
|
|
5556
5638
|
amountRaw: match.amountRaw,
|
|
5557
5639
|
symbol,
|
|
5558
|
-
decimals: _optionalChain([display, 'optionalAccess',
|
|
5640
|
+
decimals: _optionalChain([display, 'optionalAccess', _270 => _270.decimals])
|
|
5559
5641
|
});
|
|
5560
5642
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5561
5643
|
ListRow,
|
|
5562
5644
|
{
|
|
5563
|
-
leadingMedia: _optionalChain([display, 'optionalAccess',
|
|
5645
|
+
leadingMedia: _optionalChain([display, 'optionalAccess', _271 => _271.logo]),
|
|
5564
5646
|
title: `${amount} ${symbol}`,
|
|
5565
5647
|
subtitle: chainName,
|
|
5566
5648
|
onClick: () => selectMatch(match)
|
|
@@ -5700,9 +5782,9 @@ function RecoveryReviewScreen({
|
|
|
5700
5782
|
_react.useEffect.call(void 0, () => {
|
|
5701
5783
|
if (destination.length === 0) return;
|
|
5702
5784
|
if (isSelfDestination) {
|
|
5703
|
-
_optionalChain([onDestinationIsDepositAddressRef, 'access',
|
|
5785
|
+
_optionalChain([onDestinationIsDepositAddressRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
|
|
5704
5786
|
} else if (!destinationValid) {
|
|
5705
|
-
_optionalChain([onDestinationInvalidRef, 'access',
|
|
5787
|
+
_optionalChain([onDestinationInvalidRef, 'access', _274 => _274.current, 'optionalCall', _275 => _275()]);
|
|
5706
5788
|
}
|
|
5707
5789
|
}, [
|
|
5708
5790
|
destination,
|
|
@@ -5874,11 +5956,11 @@ function HistoryRecoveryFlow({
|
|
|
5874
5956
|
} catch (err) {
|
|
5875
5957
|
const recoveryError = err instanceof RecoveryError ? err : void 0;
|
|
5876
5958
|
setError(
|
|
5877
|
-
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5959
|
+
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _276 => _276.message]), () => ( formatUserError(
|
|
5878
5960
|
err instanceof Error ? err.message : "Recovery failed"
|
|
5879
5961
|
)))
|
|
5880
5962
|
);
|
|
5881
|
-
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5963
|
+
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _277 => _277.retryable]), () => ( true));
|
|
5882
5964
|
setRetryable(canRetry);
|
|
5883
5965
|
setPhase("failed");
|
|
5884
5966
|
const reason = claimFailureReasonForError(err);
|
|
@@ -5987,7 +6069,7 @@ HistoryRecoveryFlow.displayName = "HistoryRecoveryFlow";
|
|
|
5987
6069
|
|
|
5988
6070
|
function HistoryOverlay({
|
|
5989
6071
|
controller,
|
|
5990
|
-
|
|
6072
|
+
orderHistory,
|
|
5991
6073
|
bankSupportUrl,
|
|
5992
6074
|
backLabel,
|
|
5993
6075
|
title,
|
|
@@ -6029,8 +6111,8 @@ function HistoryOverlay({
|
|
|
6029
6111
|
const endAttempt = _react.useCallback.call(void 0,
|
|
6030
6112
|
(source, reason) => {
|
|
6031
6113
|
const claim = claimControllerRef.current;
|
|
6032
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6033
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6114
|
+
_optionalChain([claim, 'optionalAccess', _278 => _278.abandon, 'call', _279 => _279(reason)]);
|
|
6115
|
+
_optionalChain([claim, 'optionalAccess', _280 => _280.close, 'call', _281 => _281(source)]);
|
|
6034
6116
|
claimControllerRef.current = null;
|
|
6035
6117
|
setAttempt(null);
|
|
6036
6118
|
},
|
|
@@ -6088,8 +6170,8 @@ function HistoryOverlay({
|
|
|
6088
6170
|
if (!attempt) return;
|
|
6089
6171
|
return () => {
|
|
6090
6172
|
const claim = claimControllerRef.current;
|
|
6091
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6092
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6173
|
+
_optionalChain([claim, 'optionalAccess', _282 => _282.abandon, 'call', _283 => _283("modal_close")]);
|
|
6174
|
+
_optionalChain([claim, 'optionalAccess', _284 => _284.close, 'call', _285 => _285("host_controlled")]);
|
|
6093
6175
|
};
|
|
6094
6176
|
}, [attempt]);
|
|
6095
6177
|
const claimSessionProperties = _react.useMemo.call(void 0,
|
|
@@ -6115,7 +6197,7 @@ function HistoryOverlay({
|
|
|
6115
6197
|
HistoryRecoveryFlow,
|
|
6116
6198
|
{
|
|
6117
6199
|
deposit: recovering,
|
|
6118
|
-
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess',
|
|
6200
|
+
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess', _286 => _286.entrySource]), () => ( "history_row")),
|
|
6119
6201
|
backendUrl,
|
|
6120
6202
|
signRecovery,
|
|
6121
6203
|
debug,
|
|
@@ -6130,7 +6212,7 @@ function HistoryOverlay({
|
|
|
6130
6212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6131
6213
|
DepositHistoryPanel,
|
|
6132
6214
|
{
|
|
6133
|
-
|
|
6215
|
+
orderHistory,
|
|
6134
6216
|
bankSupportUrl,
|
|
6135
6217
|
deposits: controller.deposits,
|
|
6136
6218
|
isLoading: controller.isLoading,
|
|
@@ -6271,7 +6353,7 @@ function useHistoryPanel({
|
|
|
6271
6353
|
}, [isOpen, badgeState2.nextExpiryAt]);
|
|
6272
6354
|
const openPanel = _react.useCallback.call(void 0, () => {
|
|
6273
6355
|
setIsPanelOpen(true);
|
|
6274
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6356
|
+
_optionalChain([analytics, 'optionalAccess', _287 => _287.visitOpened, 'call', _288 => _288(badge)]);
|
|
6275
6357
|
if (!loadedRef.current || staleRef.current) {
|
|
6276
6358
|
fetchHistory("initial");
|
|
6277
6359
|
}
|
|
@@ -6279,10 +6361,10 @@ function useHistoryPanel({
|
|
|
6279
6361
|
const closePanel = _react.useCallback.call(void 0, () => {
|
|
6280
6362
|
if (recovering) return;
|
|
6281
6363
|
setIsPanelOpen(false);
|
|
6282
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6364
|
+
_optionalChain([analytics, 'optionalAccess', _289 => _289.visitEnded, 'call', _290 => _290()]);
|
|
6283
6365
|
}, [analytics, recovering]);
|
|
6284
6366
|
const loadMore = _react.useCallback.call(void 0, () => {
|
|
6285
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6367
|
+
_optionalChain([analytics, 'optionalAccess', _291 => _291.loadMore, 'call', _292 => _292(filterVisibleDeposits(deposits).length)]);
|
|
6286
6368
|
fetchHistory("more");
|
|
6287
6369
|
}, [analytics, deposits, fetchHistory]);
|
|
6288
6370
|
const markStale = _react.useCallback.call(void 0, () => {
|
|
@@ -6310,7 +6392,7 @@ function useHistoryPanel({
|
|
|
6310
6392
|
_react.useEffect.call(void 0, () => {
|
|
6311
6393
|
if (isOpen) return;
|
|
6312
6394
|
setIsPanelOpen(false);
|
|
6313
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6395
|
+
_optionalChain([analytics, 'optionalAccess', _293 => _293.visitEnded, 'call', _294 => _294()]);
|
|
6314
6396
|
setDeposits([]);
|
|
6315
6397
|
setHasMore(false);
|
|
6316
6398
|
setError(null);
|
|
@@ -6469,11 +6551,11 @@ var NOTHING_TO_STOP = () => {
|
|
|
6469
6551
|
};
|
|
6470
6552
|
function resolveThemeMode(mode) {
|
|
6471
6553
|
if (mode !== "system") return mode;
|
|
6472
|
-
return _optionalChain([globalThis, 'access',
|
|
6554
|
+
return _optionalChain([globalThis, 'access', _295 => _295.matchMedia, 'optionalCall', _296 => _296(DARK_SCHEME_QUERY), 'access', _297 => _297.matches]) ? "dark" : "light";
|
|
6473
6555
|
}
|
|
6474
6556
|
function followSystemAppearance(mode, onChange) {
|
|
6475
6557
|
if (mode !== "system") return NOTHING_TO_STOP;
|
|
6476
|
-
const query = _optionalChain([globalThis, 'access',
|
|
6558
|
+
const query = _optionalChain([globalThis, 'access', _298 => _298.matchMedia, 'optionalCall', _299 => _299(DARK_SCHEME_QUERY)]);
|
|
6477
6559
|
if (!query) return NOTHING_TO_STOP;
|
|
6478
6560
|
query.addEventListener("change", onChange);
|
|
6479
6561
|
return () => query.removeEventListener("change", onChange);
|
|
@@ -6481,22 +6563,22 @@ function followSystemAppearance(mode, onChange) {
|
|
|
6481
6563
|
function applyTheme(element, theme) {
|
|
6482
6564
|
if (!element) return NOTHING_TO_STOP;
|
|
6483
6565
|
const parent = element.parentElement;
|
|
6484
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
6566
|
+
const targets = _optionalChain([parent, 'optionalAccess', _300 => _300.classList, 'access', _301 => _301.contains, 'call', _302 => _302("rs-modal-content")]) ? [element, parent] : [element];
|
|
6485
6567
|
const paintMode = () => {
|
|
6486
|
-
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess',
|
|
6568
|
+
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess', _303 => _303.mode]));
|
|
6487
6569
|
for (const t of targets) {
|
|
6488
6570
|
if (resolved) t.setAttribute("data-theme", resolved);
|
|
6489
6571
|
else t.removeAttribute("data-theme");
|
|
6490
6572
|
}
|
|
6491
6573
|
};
|
|
6492
6574
|
paintMode();
|
|
6493
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6575
|
+
if (_optionalChain([theme, 'optionalAccess', _304 => _304.fontColor])) {
|
|
6494
6576
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
6495
6577
|
}
|
|
6496
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6578
|
+
if (_optionalChain([theme, 'optionalAccess', _305 => _305.iconColor])) {
|
|
6497
6579
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
6498
6580
|
}
|
|
6499
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6581
|
+
if (_optionalChain([theme, 'optionalAccess', _306 => _306.ctaColor])) {
|
|
6500
6582
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
6501
6583
|
if (derived) {
|
|
6502
6584
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -6521,25 +6603,25 @@ function applyTheme(element, theme) {
|
|
|
6521
6603
|
}
|
|
6522
6604
|
} else {
|
|
6523
6605
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
6524
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6606
|
+
if (_optionalChain([theme, 'optionalAccess', _307 => _307.ctaHoverColor])) {
|
|
6525
6607
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
6526
6608
|
}
|
|
6527
6609
|
}
|
|
6528
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6610
|
+
if (_optionalChain([theme, 'optionalAccess', _308 => _308.borderColor])) {
|
|
6529
6611
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
6530
6612
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
6531
6613
|
}
|
|
6532
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6614
|
+
if (_optionalChain([theme, 'optionalAccess', _309 => _309.backgroundColor])) {
|
|
6533
6615
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
6534
6616
|
}
|
|
6535
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6617
|
+
if (_optionalChain([theme, 'optionalAccess', _310 => _310.radius])) {
|
|
6536
6618
|
const scale = RADIUS_SCALE[theme.radius];
|
|
6537
6619
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
6538
6620
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
6539
6621
|
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
6540
6622
|
setVar(targets, "--rs-radius", scale.md);
|
|
6541
6623
|
}
|
|
6542
|
-
return followSystemAppearance(_optionalChain([theme, 'optionalAccess',
|
|
6624
|
+
return followSystemAppearance(_optionalChain([theme, 'optionalAccess', _311 => _311.mode]), paintMode);
|
|
6543
6625
|
}
|
|
6544
6626
|
|
|
6545
6627
|
// src/core/removed-props.ts
|
|
@@ -6554,6 +6636,7 @@ var MANAGED_ACCOUNT_REMOVALS = {
|
|
|
6554
6636
|
};
|
|
6555
6637
|
var REMOVED_PROPS = {
|
|
6556
6638
|
DepositModal: {
|
|
6639
|
+
bankOnramp: "renamed to `virtualAccountOnramp`; its session is the `getCustomerSession` prop.",
|
|
6557
6640
|
...MANAGED_ACCOUNT_REMOVALS,
|
|
6558
6641
|
dappImports: "renamed to `assetMigrations`.",
|
|
6559
6642
|
initialDappImport: "renamed to `initialAssetMigration`.",
|
|
@@ -6572,7 +6655,8 @@ var REMOVED_UI_CONFIG_KEYS = {
|
|
|
6572
6655
|
checkLiquidity: "removed \u2014 the modal no longer surfaces a liquidity cap. Route capacity is enforced when the deposit is processed.",
|
|
6573
6656
|
showHistoryButton: "removed \u2014 deposit history is always offered, from the modal's home screen. There is no way to hide it."
|
|
6574
6657
|
};
|
|
6575
|
-
var
|
|
6658
|
+
var REMOVED_VIRTUAL_ACCOUNT_KEYS = {
|
|
6659
|
+
getSession: "use the `getCustomerSession` prop.",
|
|
6576
6660
|
currency: "removed \u2014 the currency follows the residence the customer declares at verification: EUR inside SEPA, USD elsewhere."
|
|
6577
6661
|
};
|
|
6578
6662
|
var warned = /* @__PURE__ */ new Set();
|
|
@@ -6592,14 +6676,14 @@ function warnRemovedProps(component, props) {
|
|
|
6592
6676
|
warnOnce(component, key, table[key]);
|
|
6593
6677
|
}
|
|
6594
6678
|
}
|
|
6595
|
-
const
|
|
6596
|
-
if (
|
|
6597
|
-
for (const key of Object.keys(
|
|
6598
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
6679
|
+
const virtualAccountOnramp = props.virtualAccountOnramp;
|
|
6680
|
+
if (virtualAccountOnramp && typeof virtualAccountOnramp === "object") {
|
|
6681
|
+
for (const key of Object.keys(REMOVED_VIRTUAL_ACCOUNT_KEYS)) {
|
|
6682
|
+
if (Object.prototype.hasOwnProperty.call(virtualAccountOnramp, key)) {
|
|
6599
6683
|
warnOnce(
|
|
6600
6684
|
component,
|
|
6601
|
-
`
|
|
6602
|
-
|
|
6685
|
+
`virtualAccountOnramp.${key}`,
|
|
6686
|
+
REMOVED_VIRTUAL_ACCOUNT_KEYS[key]
|
|
6603
6687
|
);
|
|
6604
6688
|
}
|
|
6605
6689
|
}
|
|
@@ -6643,20 +6727,20 @@ function sinkFor(source) {
|
|
|
6643
6727
|
if (source.modal === "deposit") {
|
|
6644
6728
|
const at2 = () => source.controllerRef.current;
|
|
6645
6729
|
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',
|
|
6730
|
+
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)) })]),
|
|
6731
|
+
rowViewed: (detail) => _optionalChain([at2, 'call', _317 => _317(), 'optionalAccess', _318 => _318.historyRowViewed, 'call', _319 => _319(detail)]),
|
|
6732
|
+
loadMore: (detail) => _optionalChain([at2, 'call', _320 => _320(), 'optionalAccess', _321 => _321.historyLoadMore, 'call', _322 => _322(detail)]),
|
|
6733
|
+
fallbackOpened: (detail) => _optionalChain([at2, 'call', _323 => _323(), 'optionalAccess', _324 => _324.historyFallbackOpened, 'call', _325 => _325(detail)]),
|
|
6734
|
+
recoveryStarted: (detail) => _optionalChain([at2, 'call', _326 => _326(), 'optionalAccess', _327 => _327.historyRecoveryStarted, 'call', _328 => _328(detail)])
|
|
6651
6735
|
};
|
|
6652
6736
|
}
|
|
6653
6737
|
const at = () => source.controllerRef.current;
|
|
6654
6738
|
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',
|
|
6739
|
+
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)) })]),
|
|
6740
|
+
rowViewed: (detail) => _optionalChain([at, 'call', _334 => _334(), 'optionalAccess', _335 => _335.historyRowViewed, 'call', _336 => _336(detail)]),
|
|
6741
|
+
loadMore: (detail) => _optionalChain([at, 'call', _337 => _337(), 'optionalAccess', _338 => _338.historyLoadMore, 'call', _339 => _339(detail)]),
|
|
6742
|
+
fallbackOpened: (detail) => _optionalChain([at, 'call', _340 => _340(), 'optionalAccess', _341 => _341.historyFallbackOpened, 'call', _342 => _342(detail)]),
|
|
6743
|
+
recoveryStarted: (detail) => _optionalChain([at, 'call', _343 => _343(), 'optionalAccess', _344 => _344.historyRecoveryStarted, 'call', _345 => _345(detail)])
|
|
6660
6744
|
};
|
|
6661
6745
|
}
|
|
6662
6746
|
function badgeState(badge) {
|
|
@@ -6682,7 +6766,7 @@ function createHistoryAnalytics(source) {
|
|
|
6682
6766
|
sink.opened({
|
|
6683
6767
|
history_visit_id: visitId,
|
|
6684
6768
|
badge: badgeState(badge),
|
|
6685
|
-
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
6769
|
+
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess', _346 => _346.count]), () => ( 0))
|
|
6686
6770
|
});
|
|
6687
6771
|
},
|
|
6688
6772
|
visitEnded() {
|
|
@@ -6746,7 +6830,7 @@ function resolveChain(targetChain) {
|
|
|
6746
6830
|
return _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, targetChain);
|
|
6747
6831
|
}
|
|
6748
6832
|
function resolveToken(targetToken) {
|
|
6749
|
-
const raw = _optionalChain([targetToken, 'optionalAccess',
|
|
6833
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _347 => _347.trim, 'call', _348 => _348()]);
|
|
6750
6834
|
if (!raw) return void 0;
|
|
6751
6835
|
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
6752
6836
|
if (BASE58_TOKEN.test(raw)) return raw;
|
|
@@ -6804,8 +6888,8 @@ function Tooltip({ content, children, className }) {
|
|
|
6804
6888
|
function handleOutside(event) {
|
|
6805
6889
|
const target = event.target;
|
|
6806
6890
|
if (!target) return;
|
|
6807
|
-
if (_optionalChain([triggerRef, 'access',
|
|
6808
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
6891
|
+
if (_optionalChain([triggerRef, 'access', _349 => _349.current, 'optionalAccess', _350 => _350.contains, 'call', _351 => _351(target)])) return;
|
|
6892
|
+
if (_optionalChain([bubbleRef, 'access', _352 => _352.current, 'optionalAccess', _353 => _353.contains, 'call', _354 => _354(target)])) return;
|
|
6809
6893
|
setOpen(false);
|
|
6810
6894
|
}
|
|
6811
6895
|
function handleKey(event) {
|
|
@@ -7035,7 +7119,7 @@ function asNumber(value) {
|
|
|
7035
7119
|
const trimmed = value.trim();
|
|
7036
7120
|
if (!trimmed) return void 0;
|
|
7037
7121
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
7038
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
7122
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _355 => _355[1]])) {
|
|
7039
7123
|
const parsed2 = Number(caipMatch[1]);
|
|
7040
7124
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
7041
7125
|
}
|
|
@@ -7054,24 +7138,24 @@ function asAddress(value) {
|
|
|
7054
7138
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
7055
7139
|
}
|
|
7056
7140
|
function getEventTxHash(event) {
|
|
7057
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7141
|
+
if (!_optionalChain([event, 'optionalAccess', _356 => _356.type])) return void 0;
|
|
7058
7142
|
if (event.type === "deposit-received") {
|
|
7059
|
-
return asString(_optionalChain([event, 'access',
|
|
7143
|
+
return asString(_optionalChain([event, 'access', _357 => _357.data, 'optionalAccess', _358 => _358.transactionHash]));
|
|
7060
7144
|
}
|
|
7061
7145
|
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',
|
|
7146
|
+
const deposit = isRecord(_optionalChain([event, 'access', _359 => _359.data, 'optionalAccess', _360 => _360.deposit])) ? event.data.deposit : void 0;
|
|
7147
|
+
const source = isRecord(_optionalChain([event, 'access', _361 => _361.data, 'optionalAccess', _362 => _362.source])) ? event.data.source : void 0;
|
|
7148
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _363 => _363.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _364 => _364.transactionHash]))));
|
|
7065
7149
|
}
|
|
7066
7150
|
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',
|
|
7151
|
+
const deposit = isRecord(_optionalChain([event, 'access', _365 => _365.data, 'optionalAccess', _366 => _366.deposit])) ? event.data.deposit : void 0;
|
|
7152
|
+
const source = isRecord(_optionalChain([event, 'access', _367 => _367.data, 'optionalAccess', _368 => _368.source])) ? event.data.source : void 0;
|
|
7153
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _369 => _369.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _370 => _370.transactionHash]))));
|
|
7070
7154
|
}
|
|
7071
7155
|
return void 0;
|
|
7072
7156
|
}
|
|
7073
7157
|
function getEventSourceDetails(event) {
|
|
7074
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7158
|
+
if (!_optionalChain([event, 'optionalAccess', _371 => _371.type]) || !isRecord(event.data)) return {};
|
|
7075
7159
|
if (event.type === "deposit-received") {
|
|
7076
7160
|
return {
|
|
7077
7161
|
chainId: asNumber(event.data.chain),
|
|
@@ -7083,9 +7167,9 @@ function getEventSourceDetails(event) {
|
|
|
7083
7167
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
7084
7168
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
7085
7169
|
return {
|
|
7086
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
7087
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
7088
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
7170
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _372 => _372.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _373 => _373.chain])))),
|
|
7171
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _374 => _374.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _375 => _375.amount])))),
|
|
7172
|
+
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
7173
|
};
|
|
7090
7174
|
}
|
|
7091
7175
|
return {};
|
|
@@ -7099,7 +7183,7 @@ function asChain(value) {
|
|
|
7099
7183
|
return asNumber(value);
|
|
7100
7184
|
}
|
|
7101
7185
|
function getEventDestinationDetails(event) {
|
|
7102
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7186
|
+
if (!_optionalChain([event, 'optionalAccess', _379 => _379.type]) || !isRecord(event.data)) return {};
|
|
7103
7187
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
7104
7188
|
return {};
|
|
7105
7189
|
}
|
|
@@ -7109,14 +7193,14 @@ function getEventDestinationDetails(event) {
|
|
|
7109
7193
|
return {
|
|
7110
7194
|
chainId: asChain(destination.chain),
|
|
7111
7195
|
amount: asAmount(destination.amount),
|
|
7112
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
7196
|
+
token: _optionalChain([token, 'optionalAccess', _380 => _380.trim, 'call', _381 => _381()]) || void 0
|
|
7113
7197
|
};
|
|
7114
7198
|
}
|
|
7115
7199
|
function isDepositEvent(event) {
|
|
7116
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7200
|
+
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
7201
|
}
|
|
7118
7202
|
function isFailedEvent(event) {
|
|
7119
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7203
|
+
return _optionalChain([event, 'optionalAccess', _387 => _387.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _388 => _388.type]) === "error";
|
|
7120
7204
|
}
|
|
7121
7205
|
function isHexString(value) {
|
|
7122
7206
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -7128,7 +7212,7 @@ function txRefsMatch(a, b) {
|
|
|
7128
7212
|
return a === b;
|
|
7129
7213
|
}
|
|
7130
7214
|
function formatBridgeFailedMessage(event) {
|
|
7131
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7215
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _389 => _389.data]), () => ( {}));
|
|
7132
7216
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
7133
7217
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
7134
7218
|
function toUserFacingFailure(raw) {
|
|
@@ -7156,7 +7240,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
7156
7240
|
return { message: "Bridge failed" };
|
|
7157
7241
|
}
|
|
7158
7242
|
function failureMessageForEvent(event) {
|
|
7159
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7243
|
+
if (_optionalChain([event, 'optionalAccess', _390 => _390.type]) === "error") {
|
|
7160
7244
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
7161
7245
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
7162
7246
|
}
|
|
@@ -7171,7 +7255,7 @@ function addressFor(token) {
|
|
|
7171
7255
|
return token.chainId === "solana" ? "native" : ZERO_ADDRESS2;
|
|
7172
7256
|
}
|
|
7173
7257
|
function useTokenPrices(tokens) {
|
|
7174
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
7258
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _391 => _391.symbol])));
|
|
7175
7259
|
const refs = defined.map((token) => ({
|
|
7176
7260
|
chain: token.chainId,
|
|
7177
7261
|
address: addressFor(token)
|
|
@@ -7320,7 +7404,7 @@ function loadPhaseTimings(txHash) {
|
|
|
7320
7404
|
const parsed = JSON.parse(raw);
|
|
7321
7405
|
if (typeof parsed.startedAt !== "number") return null;
|
|
7322
7406
|
return parsed;
|
|
7323
|
-
} catch (
|
|
7407
|
+
} catch (e20) {
|
|
7324
7408
|
return null;
|
|
7325
7409
|
}
|
|
7326
7410
|
}
|
|
@@ -7331,7 +7415,7 @@ function savePhaseTimings(txHash, timings) {
|
|
|
7331
7415
|
`${PHASE_TIMINGS_PREFIX}:${txHash}`,
|
|
7332
7416
|
JSON.stringify(timings)
|
|
7333
7417
|
);
|
|
7334
|
-
} catch (
|
|
7418
|
+
} catch (e21) {
|
|
7335
7419
|
}
|
|
7336
7420
|
}
|
|
7337
7421
|
function isEventForTx(event, txHash) {
|
|
@@ -7340,12 +7424,12 @@ function isEventForTx(event, txHash) {
|
|
|
7340
7424
|
return txRefsMatch(eventTxHash, txHash);
|
|
7341
7425
|
}
|
|
7342
7426
|
function parseWebhookTimestamp(event) {
|
|
7343
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
7427
|
+
if (typeof _optionalChain([event, 'optionalAccess', _392 => _392.time]) !== "string") return void 0;
|
|
7344
7428
|
const timestamp = Date.parse(event.time);
|
|
7345
7429
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
7346
7430
|
}
|
|
7347
7431
|
function syncPhaseTimings(previous, event) {
|
|
7348
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7432
|
+
if (!_optionalChain([event, 'optionalAccess', _393 => _393.type])) return previous;
|
|
7349
7433
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
7350
7434
|
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
7435
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -7407,52 +7491,52 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
7407
7491
|
if (state.type === "complete") {
|
|
7408
7492
|
return void 0;
|
|
7409
7493
|
}
|
|
7410
|
-
if (_optionalChain([state, 'access',
|
|
7494
|
+
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
7495
|
return "bridging";
|
|
7412
|
-
if (_optionalChain([state, 'access',
|
|
7496
|
+
if (_optionalChain([state, 'access', _398 => _398.lastEvent, 'optionalAccess', _399 => _399.type]) === "deposit-received") return "received";
|
|
7413
7497
|
return "confirming";
|
|
7414
7498
|
}
|
|
7415
7499
|
function getCompletionDestinationAmount(event) {
|
|
7416
|
-
const amount = _optionalChain([event, 'optionalAccess',
|
|
7500
|
+
const amount = _optionalChain([event, 'optionalAccess', _400 => _400.data, 'optionalAccess', _401 => _401.destination, 'optionalAccess', _402 => _402.amount]);
|
|
7417
7501
|
return typeof amount === "string" ? amount : void 0;
|
|
7418
7502
|
}
|
|
7419
7503
|
function getCompletionDestinationTxHash(event) {
|
|
7420
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
7421
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7422
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7504
|
+
const eventData = _optionalChain([event, 'optionalAccess', _403 => _403.data]);
|
|
7505
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _404 => _404.swap, 'optionalAccess', _405 => _405.transactionHash]);
|
|
7506
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _406 => _406.destination, 'optionalAccess', _407 => _407.transactionHash]);
|
|
7423
7507
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
7424
7508
|
}
|
|
7425
7509
|
function getTerminalProcessingOutcome(event) {
|
|
7426
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7510
|
+
if (_optionalChain([event, 'optionalAccess', _408 => _408.type]) === "post-bridge-swap-complete") {
|
|
7427
7511
|
return {
|
|
7428
7512
|
type: "complete",
|
|
7429
7513
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7430
7514
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7431
7515
|
};
|
|
7432
7516
|
}
|
|
7433
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7517
|
+
if (_optionalChain([event, 'optionalAccess', _409 => _409.type]) === "post-bridge-swap-failed") {
|
|
7434
7518
|
return {
|
|
7435
7519
|
type: "failed",
|
|
7436
7520
|
message: formatBridgeFailedMessage(event).message
|
|
7437
7521
|
};
|
|
7438
7522
|
}
|
|
7439
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7523
|
+
if (_optionalChain([event, 'optionalAccess', _410 => _410.type]) === "bridge-complete") {
|
|
7440
7524
|
return {
|
|
7441
7525
|
type: "complete",
|
|
7442
7526
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7443
7527
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7444
7528
|
};
|
|
7445
7529
|
}
|
|
7446
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7530
|
+
if (_optionalChain([event, 'optionalAccess', _411 => _411.type]) === "bridge-failed") {
|
|
7447
7531
|
return {
|
|
7448
7532
|
type: "failed",
|
|
7449
7533
|
message: formatBridgeFailedMessage(event).message
|
|
7450
7534
|
};
|
|
7451
7535
|
}
|
|
7452
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7536
|
+
if (_optionalChain([event, 'optionalAccess', _412 => _412.type]) === "error") {
|
|
7453
7537
|
return {
|
|
7454
7538
|
type: "failed",
|
|
7455
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
7539
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _413 => _413.data, 'optionalAccess', _414 => _414.message]), () => ( "Unknown error"))
|
|
7456
7540
|
};
|
|
7457
7541
|
}
|
|
7458
7542
|
return null;
|
|
@@ -7460,10 +7544,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
7460
7544
|
function getInitialProcessingState(event, txHash) {
|
|
7461
7545
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
7462
7546
|
const terminal = getTerminalProcessingOutcome(event);
|
|
7463
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7547
|
+
if (_optionalChain([terminal, 'optionalAccess', _415 => _415.type]) === "complete") {
|
|
7464
7548
|
return { type: "complete", lastEvent: event };
|
|
7465
7549
|
}
|
|
7466
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7550
|
+
if (_optionalChain([terminal, 'optionalAccess', _416 => _416.type]) === "failed") {
|
|
7467
7551
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
7468
7552
|
}
|
|
7469
7553
|
if (isDepositEvent(event)) {
|
|
@@ -7472,7 +7556,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
7472
7556
|
return null;
|
|
7473
7557
|
}
|
|
7474
7558
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
7475
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7559
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _417 => _417.data, 'optionalAccess', _418 => _418.source, 'optionalAccess', _419 => _419.transactionHash]), () => ( fallbackTxHash));
|
|
7476
7560
|
}
|
|
7477
7561
|
function ProcessingStep({
|
|
7478
7562
|
smartAccount,
|
|
@@ -7552,8 +7636,8 @@ function ProcessingStep({
|
|
|
7552
7636
|
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0,
|
|
7553
7637
|
() => Math.max(0, Math.floor((Date.now() - startTimeRef.current) / 1e3))
|
|
7554
7638
|
);
|
|
7555
|
-
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess',
|
|
7556
|
-
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess',
|
|
7639
|
+
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess', _420 => _420.timing]));
|
|
7640
|
+
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess', _421 => _421.timing]) !== void 0) {
|
|
7557
7641
|
setLatchedTiming(quote.timing);
|
|
7558
7642
|
}
|
|
7559
7643
|
const timingStateRef = _react.useRef.call(void 0, "expected");
|
|
@@ -7584,7 +7668,7 @@ function ProcessingStep({
|
|
|
7584
7668
|
flowLabel
|
|
7585
7669
|
});
|
|
7586
7670
|
const context = processingContextRef.current;
|
|
7587
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7671
|
+
_optionalChain([onDepositCompleteRef, 'access', _422 => _422.current, 'optionalCall', _423 => _423(txHash, void 0, {
|
|
7588
7672
|
amount: context.amount,
|
|
7589
7673
|
sourceChain: context.sourceChain,
|
|
7590
7674
|
sourceToken: context.sourceToken,
|
|
@@ -7617,7 +7701,7 @@ function ProcessingStep({
|
|
|
7617
7701
|
destinationTxHash: outcome.destinationTxHash,
|
|
7618
7702
|
event: event.type
|
|
7619
7703
|
});
|
|
7620
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7704
|
+
_optionalChain([onDepositCompleteRef, 'access', _424 => _424.current, 'optionalCall', _425 => _425(
|
|
7621
7705
|
sourceTxHash2,
|
|
7622
7706
|
outcome.destinationTxHash,
|
|
7623
7707
|
{
|
|
@@ -7638,7 +7722,7 @@ function ProcessingStep({
|
|
|
7638
7722
|
message: outcome.message,
|
|
7639
7723
|
event: event.type
|
|
7640
7724
|
});
|
|
7641
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7725
|
+
_optionalChain([onDepositFailedRef, 'access', _426 => _426.current, 'optionalCall', _427 => _427(txHash, outcome.message)]);
|
|
7642
7726
|
}, [
|
|
7643
7727
|
debug,
|
|
7644
7728
|
onDepositCompleteRef,
|
|
@@ -7649,8 +7733,8 @@ function ProcessingStep({
|
|
|
7649
7733
|
const onSettledChangeRef = _react.useRef.call(void 0, onSettledChange);
|
|
7650
7734
|
onSettledChangeRef.current = onSettledChange;
|
|
7651
7735
|
_react.useEffect.call(void 0, () => {
|
|
7652
|
-
_optionalChain([onSettledChangeRef, 'access',
|
|
7653
|
-
return () => _optionalChain([onSettledChangeRef, 'access',
|
|
7736
|
+
_optionalChain([onSettledChangeRef, 'access', _428 => _428.current, 'optionalCall', _429 => _429(state.type !== "processing")]);
|
|
7737
|
+
return () => _optionalChain([onSettledChangeRef, 'access', _430 => _430.current, 'optionalCall', _431 => _431(false)]);
|
|
7654
7738
|
}, [state.type]);
|
|
7655
7739
|
_react.useEffect.call(void 0, () => {
|
|
7656
7740
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -7676,13 +7760,13 @@ function ProcessingStep({
|
|
|
7676
7760
|
updatePhaseTimings(
|
|
7677
7761
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
7678
7762
|
);
|
|
7679
|
-
}, [_optionalChain([state, 'access',
|
|
7763
|
+
}, [_optionalChain([state, 'access', _432 => _432.lastEvent, 'optionalAccess', _433 => _433.time]), _optionalChain([state, 'access', _434 => _434.lastEvent, 'optionalAccess', _435 => _435.type]), updatePhaseTimings]);
|
|
7680
7764
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
7681
7765
|
_react.useEffect.call(void 0, () => {
|
|
7682
7766
|
let cancelled = false;
|
|
7683
7767
|
let timeoutId;
|
|
7684
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
7685
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7768
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _436 => _436.variant]) === "fiat";
|
|
7769
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _437 => _437.expectedOrderUuid]), () => ( null));
|
|
7686
7770
|
setSwappedFiatContext(null);
|
|
7687
7771
|
if (!isSwappedOrder || !expectedOrderUuid) {
|
|
7688
7772
|
return () => {
|
|
@@ -7713,7 +7797,7 @@ function ProcessingStep({
|
|
|
7713
7797
|
if (isFiatSwappedOrder && !hasFiatReceiptPricing(res)) {
|
|
7714
7798
|
scheduleRetry();
|
|
7715
7799
|
}
|
|
7716
|
-
} catch (
|
|
7800
|
+
} catch (e22) {
|
|
7717
7801
|
scheduleRetry();
|
|
7718
7802
|
}
|
|
7719
7803
|
}
|
|
@@ -7725,8 +7809,8 @@ function ProcessingStep({
|
|
|
7725
7809
|
}, [
|
|
7726
7810
|
service,
|
|
7727
7811
|
isSwappedOrder,
|
|
7728
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7729
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7812
|
+
_optionalChain([swappedContext, 'optionalAccess', _438 => _438.variant]),
|
|
7813
|
+
_optionalChain([swappedContext, 'optionalAccess', _439 => _439.expectedOrderUuid])
|
|
7730
7814
|
]);
|
|
7731
7815
|
_react.useEffect.call(void 0, () => {
|
|
7732
7816
|
if (directTransfer) return;
|
|
@@ -7752,18 +7836,18 @@ function ProcessingStep({
|
|
|
7752
7836
|
debugLog(debug, "processing", "poll:event", {
|
|
7753
7837
|
type: lastEvent2.type,
|
|
7754
7838
|
matchesTx: eventMatchesTx,
|
|
7755
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
7839
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _440 => _440.intentId])
|
|
7756
7840
|
});
|
|
7757
7841
|
}
|
|
7758
7842
|
if (!isMounted) return;
|
|
7759
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7843
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _441 => _441.type]) === "bridge-complete") {
|
|
7760
7844
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
7761
7845
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
7762
7846
|
eventForCurrentTx,
|
|
7763
7847
|
txHash
|
|
7764
7848
|
);
|
|
7765
|
-
const destination = _optionalChain([eventForCurrentTx, 'access',
|
|
7766
|
-
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess',
|
|
7849
|
+
const destination = _optionalChain([eventForCurrentTx, 'access', _442 => _442.data, 'optionalAccess', _443 => _443.destination]);
|
|
7850
|
+
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess', _444 => _444.transactionHash]);
|
|
7767
7851
|
debugLog(debug, "processing", "state:complete", {
|
|
7768
7852
|
txHash,
|
|
7769
7853
|
sourceTxHash: sourceTxHash2,
|
|
@@ -7771,7 +7855,7 @@ function ProcessingStep({
|
|
|
7771
7855
|
event: eventForCurrentTx.type
|
|
7772
7856
|
});
|
|
7773
7857
|
const context = processingContextRef.current;
|
|
7774
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7858
|
+
_optionalChain([onDepositCompleteRef, 'access', _445 => _445.current, 'optionalCall', _446 => _446(sourceTxHash2, destinationTxHash2, {
|
|
7775
7859
|
amount: context.amount,
|
|
7776
7860
|
sourceChain: context.sourceChain,
|
|
7777
7861
|
sourceToken: context.sourceToken,
|
|
@@ -7779,11 +7863,11 @@ function ProcessingStep({
|
|
|
7779
7863
|
amountUsd: context.amountUsd,
|
|
7780
7864
|
targetChain: context.targetChain,
|
|
7781
7865
|
targetToken: context.targetToken,
|
|
7782
|
-
destinationAmount: typeof _optionalChain([destination, 'optionalAccess',
|
|
7866
|
+
destinationAmount: typeof _optionalChain([destination, 'optionalAccess', _447 => _447.amount]) === "string" ? destination.amount : void 0
|
|
7783
7867
|
})]);
|
|
7784
7868
|
return;
|
|
7785
7869
|
}
|
|
7786
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7870
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _448 => _448.type]) === "bridge-failed") {
|
|
7787
7871
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
7788
7872
|
setState({
|
|
7789
7873
|
type: "failed",
|
|
@@ -7795,11 +7879,11 @@ function ProcessingStep({
|
|
|
7795
7879
|
message: formatted.message,
|
|
7796
7880
|
code: formatted.code
|
|
7797
7881
|
});
|
|
7798
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7882
|
+
_optionalChain([onDepositFailedRef, 'access', _449 => _449.current, 'optionalCall', _450 => _450(txHash, formatted.message)]);
|
|
7799
7883
|
return;
|
|
7800
7884
|
}
|
|
7801
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7802
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
7885
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _451 => _451.type]) === "error") {
|
|
7886
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _452 => _452.data, 'optionalAccess', _453 => _453.message]), () => ( "Unknown error"));
|
|
7803
7887
|
setState({
|
|
7804
7888
|
type: "failed",
|
|
7805
7889
|
message: errorMessage,
|
|
@@ -7809,7 +7893,7 @@ function ProcessingStep({
|
|
|
7809
7893
|
txHash,
|
|
7810
7894
|
message: errorMessage
|
|
7811
7895
|
});
|
|
7812
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7896
|
+
_optionalChain([onDepositFailedRef, 'access', _454 => _454.current, 'optionalCall', _455 => _455(txHash, errorMessage)]);
|
|
7813
7897
|
return;
|
|
7814
7898
|
}
|
|
7815
7899
|
setState((previous) => ({
|
|
@@ -7867,18 +7951,18 @@ function ProcessingStep({
|
|
|
7867
7951
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
7868
7952
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : flowLabel === "payment" ? "payment" : "deposit";
|
|
7869
7953
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : flowLabel === "payment" ? "Payment" : "Deposit";
|
|
7870
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7954
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _456 => _456.data, 'optionalAccess', _457 => _457.destination, 'optionalAccess', _458 => _458.transactionHash]) || null;
|
|
7871
7955
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
7872
7956
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
7873
7957
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
7874
7958
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
7875
7959
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
7876
7960
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7877
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7961
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _459 => _459.data, 'optionalAccess', _460 => _460.source, 'optionalAccess', _461 => _461.transactionHash]);
|
|
7878
7962
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
7879
7963
|
_react.useEffect.call(void 0, () => {
|
|
7880
7964
|
if (sourceTxHashPending && settledSourceTxHash) {
|
|
7881
|
-
_optionalChain([onSourceTransactionObserved, 'optionalCall',
|
|
7965
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _462 => _462(settledSourceTxHash)]);
|
|
7882
7966
|
}
|
|
7883
7967
|
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
7884
7968
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
@@ -7989,7 +8073,7 @@ function ProcessingStep({
|
|
|
7989
8073
|
timeoutMs: latchedTiming ? resolveServedThresholds(latchedTiming).escalatedMs : FALLBACK_ESCALATED_DELAY_MS,
|
|
7990
8074
|
served: latchedTiming !== void 0
|
|
7991
8075
|
});
|
|
7992
|
-
_optionalChain([onErrorRef, 'access',
|
|
8076
|
+
_optionalChain([onErrorRef, 'access', _463 => _463.current, 'optionalCall', _464 => _464(
|
|
7993
8077
|
"Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.",
|
|
7994
8078
|
"PROCESS_TIMEOUT"
|
|
7995
8079
|
)]);
|
|
@@ -8007,8 +8091,8 @@ function ProcessingStep({
|
|
|
8007
8091
|
const sourceChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, displaySourceChain);
|
|
8008
8092
|
const targetChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, targetChainId);
|
|
8009
8093
|
const timerText = formatTimer(elapsedSeconds);
|
|
8010
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8011
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8094
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _465 => _465.feeSponsored]), () => ( false));
|
|
8095
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _466 => _466.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
8012
8096
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
8013
8097
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
8014
8098
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -8019,20 +8103,20 @@ function ProcessingStep({
|
|
|
8019
8103
|
/* @__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
8104
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, {}), title: stateTitle });
|
|
8021
8105
|
if (isComplete && isSwappedOrder) {
|
|
8022
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
8106
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _467 => _467.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _468 => _468.paymentMethod]))), () => ( null));
|
|
8023
8107
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
8024
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
8108
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _469 => _469.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
8025
8109
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
8026
8110
|
effectivePaymentMethod
|
|
8027
8111
|
) : null;
|
|
8028
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
8029
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8112
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _470 => _470.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
8113
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _471 => _471.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
8030
8114
|
const depositedAmount = receiveDisplay;
|
|
8031
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8115
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _472 => _472.onrampFeeUsd]), () => ( null));
|
|
8032
8116
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
8033
8117
|
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
8118
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
8035
|
-
_optionalChain([quote, 'optionalAccess',
|
|
8119
|
+
_optionalChain([quote, 'optionalAccess', _473 => _473.fees, 'access', _474 => _474.breakdown]),
|
|
8036
8120
|
sponsoredFeeTooltip
|
|
8037
8121
|
);
|
|
8038
8122
|
const feeRows = [];
|
|
@@ -8120,7 +8204,7 @@ function ProcessingStep({
|
|
|
8120
8204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
8121
8205
|
] }),
|
|
8122
8206
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
8123
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8207
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _475 => _475.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8124
8208
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
8125
8209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8126
8210
|
"$",
|
|
@@ -8132,7 +8216,7 @@ function ProcessingStep({
|
|
|
8132
8216
|
] })
|
|
8133
8217
|
] })
|
|
8134
8218
|
] }),
|
|
8135
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8219
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _476 => _476.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8136
8220
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
8137
8221
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8138
8222
|
"$",
|
|
@@ -8199,7 +8283,7 @@ function ProcessingStep({
|
|
|
8199
8283
|
) })
|
|
8200
8284
|
] })
|
|
8201
8285
|
] }) : (() => {
|
|
8202
|
-
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess',
|
|
8286
|
+
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess', _477 => _477.fees]));
|
|
8203
8287
|
if (display !== null) {
|
|
8204
8288
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8205
8289
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -8350,7 +8434,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
8350
8434
|
function readDedupedAccountSetupResult(requestKey) {
|
|
8351
8435
|
const now = Date.now();
|
|
8352
8436
|
const existing = setupRequestDedupe.get(requestKey);
|
|
8353
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
8437
|
+
if (_optionalChain([existing, 'optionalAccess', _478 => _478.settled]) && existing.expiresAt > now && existing.result) {
|
|
8354
8438
|
return existing.result;
|
|
8355
8439
|
}
|
|
8356
8440
|
return null;
|
|
@@ -8384,7 +8468,7 @@ async function runAccountSetup(input, deps) {
|
|
|
8384
8468
|
chain: _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
8385
8469
|
token: input.targetToken,
|
|
8386
8470
|
recipient: input.recipient,
|
|
8387
|
-
..._optionalChain([input, 'access',
|
|
8471
|
+
..._optionalChain([input, 'access', _479 => _479.outputTokenRules, 'optionalAccess', _480 => _480.length]) && {
|
|
8388
8472
|
outputTokenRules: input.outputTokenRules
|
|
8389
8473
|
},
|
|
8390
8474
|
...input.rejectUnmapped != null && {
|
|
@@ -8559,4 +8643,8 @@ function mapError(error) {
|
|
|
8559
8643
|
|
|
8560
8644
|
|
|
8561
8645
|
|
|
8562
|
-
|
|
8646
|
+
|
|
8647
|
+
|
|
8648
|
+
|
|
8649
|
+
|
|
8650
|
+
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.hostedOrderState = hostedOrderState; 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;
|