@rhinestone/deposit-modal 0.20.0 → 0.20.1
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 +3 -0
- package/dist/{BankOnrampStep-NPGXAA7U.cjs → BankOnrampStep-3SNUX6V2.cjs} +11 -11
- package/dist/{BankOnrampStep-JG32OCM2.mjs → BankOnrampStep-4D24HVHV.mjs} +4 -4
- package/dist/{DepositModalReown-ALVWADG7.cjs → DepositModalReown-7EHOJTFW.cjs} +16 -16
- package/dist/{DepositModalReown-3FGTPER6.mjs → DepositModalReown-SYQ2SCHC.mjs} +3 -3
- package/dist/WithdrawModal-LLJLEYXZ.cjs +12 -0
- package/dist/{WithdrawModal-LL4Z5WZP.mjs → WithdrawModal-LXDIT4UV.mjs} +3 -3
- package/dist/{chunk-BTEG2VNZ.cjs → chunk-CIVFT5KR.cjs} +58 -58
- package/dist/{chunk-EKFXUF5A.cjs → chunk-D3R3O4CY.cjs} +1 -1
- package/dist/{chunk-6CTJFR3T.mjs → chunk-EJDBIWNH.mjs} +1 -1
- package/dist/{chunk-247GJH57.mjs → chunk-FW7ZMXQS.mjs} +444 -477
- package/dist/{chunk-PYRXOP2Y.cjs → chunk-IPHKBBUV.cjs} +2 -2
- package/dist/{chunk-HP7S7AD6.mjs → chunk-IPKT3FU6.mjs} +1 -1
- package/dist/{chunk-5QUWEFD4.mjs → chunk-JPX4MEHV.mjs} +1 -1
- package/dist/{chunk-CXRH5MKO.cjs → chunk-KXSU24RU.cjs} +354 -275
- package/dist/{chunk-OPT5EW6L.cjs → chunk-LVMNNMOZ.cjs} +2 -2
- package/dist/{chunk-FMUSY563.cjs → chunk-O5OW4S7L.cjs} +3 -3
- package/dist/{chunk-32ERBFMO.mjs → chunk-OZPMRTW3.mjs} +93 -14
- package/dist/{chunk-Z4RBTNKX.cjs → chunk-PVFEZ3UG.cjs} +596 -629
- package/dist/{chunk-XBJCZYBX.mjs → chunk-YQCRXJIL.mjs} +1 -1
- package/dist/{chunk-B2LZQIGB.mjs → chunk-ZOJMB5TZ.mjs} +1 -1
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/onramp.cjs +4 -4
- package/dist/onramp.mjs +3 -3
- package/dist/{types-CixUBhrM.d.cts → types-BEEMfNi2.d.cts} +4 -2
- package/dist/{types-BxSrazbq.d.ts → types-DQDUqzsZ.d.ts} +4 -2
- 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
|
@@ -45,7 +45,7 @@ var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkD3R3O4CYcjs = require('./chunk-D3R3O4CY.cjs');
|
|
49
49
|
|
|
50
50
|
// src/components/ui/Modal.tsx
|
|
51
51
|
|
|
@@ -423,6 +423,54 @@ function catalogExplorerTxUrl(chain, txHash) {
|
|
|
423
423
|
return `${chain.explorer.url}${chain.explorer.txPath}${txHash}`;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
// src/core/hosted-order.ts
|
|
427
|
+
var RANK = {
|
|
428
|
+
awaiting_payment: 0,
|
|
429
|
+
paying: 1,
|
|
430
|
+
paid: 2,
|
|
431
|
+
sent: 3
|
|
432
|
+
};
|
|
433
|
+
function hostedOrderState(order) {
|
|
434
|
+
const { receipt, conversion, delivery } = order.stages;
|
|
435
|
+
const deliveryTxHash = "txHash" in delivery ? delivery.txHash : null;
|
|
436
|
+
const outcome = order.status === "refunded" ? "refunded" : order.status === "failed" && !deliveryTxHash ? receipt.status === "failed" && receipt.reason === "cancelled" ? "cancelled" : "failed" : null;
|
|
437
|
+
const progress = deliveryTxHash ? "sent" : receipt.status === "completed" || conversion.status !== "not_started" ? "paid" : receipt.status === "processing" || receipt.status === "on_hold" ? "paying" : "awaiting_payment";
|
|
438
|
+
return { progress, outcome, deliveryTxHash };
|
|
439
|
+
}
|
|
440
|
+
function hostedOrderStateFromSwapped(status, txHash) {
|
|
441
|
+
const deliveryTxHash = _nullishCoalesce(txHash, () => ( null));
|
|
442
|
+
switch (status) {
|
|
443
|
+
case "payment_pending":
|
|
444
|
+
return { progress: "awaiting_payment", outcome: null, deliveryTxHash };
|
|
445
|
+
case "wallet_order_registered":
|
|
446
|
+
case "wallet_order_confirmed":
|
|
447
|
+
return { progress: "paying", outcome: null, deliveryTxHash };
|
|
448
|
+
case "order_completed":
|
|
449
|
+
return {
|
|
450
|
+
progress: deliveryTxHash ? "sent" : "paid",
|
|
451
|
+
outcome: null,
|
|
452
|
+
deliveryTxHash
|
|
453
|
+
};
|
|
454
|
+
case "order_broadcasted":
|
|
455
|
+
return { progress: "sent", outcome: null, deliveryTxHash };
|
|
456
|
+
case "order_cancelled":
|
|
457
|
+
return { progress: "awaiting_payment", outcome: "cancelled", deliveryTxHash };
|
|
458
|
+
default:
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function mergeHostedOrderState(previous, next) {
|
|
463
|
+
if (!previous) return next;
|
|
464
|
+
return {
|
|
465
|
+
progress: RANK[next.progress] >= RANK[previous.progress] ? next.progress : previous.progress,
|
|
466
|
+
outcome: _nullishCoalesce(next.outcome, () => ( previous.outcome)),
|
|
467
|
+
deliveryTxHash: _nullishCoalesce(next.deliveryTxHash, () => ( previous.deliveryTxHash))
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function hasReached(state, progress) {
|
|
471
|
+
return state ? RANK[state.progress] >= RANK[progress] : false;
|
|
472
|
+
}
|
|
473
|
+
|
|
426
474
|
// src/core/deposit-asset-helpers.ts
|
|
427
475
|
function getAssetId(asset) {
|
|
428
476
|
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
@@ -795,7 +843,7 @@ function createDepositService(baseUrl, options) {
|
|
|
795
843
|
method === "GET" ? assetsGetUrl(ids, fields) : apiUrl("/assets"),
|
|
796
844
|
{
|
|
797
845
|
method,
|
|
798
|
-
headers:
|
|
846
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
799
847
|
body: method === "QUERY" ? JSON.stringify({ ids, fields }) : void 0,
|
|
800
848
|
cache: "no-store",
|
|
801
849
|
signal
|
|
@@ -889,7 +937,7 @@ function createDepositService(baseUrl, options) {
|
|
|
889
937
|
try {
|
|
890
938
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
891
939
|
method: "GET",
|
|
892
|
-
headers:
|
|
940
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, )
|
|
893
941
|
});
|
|
894
942
|
if (!response.ok) {
|
|
895
943
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -916,7 +964,7 @@ function createDepositService(baseUrl, options) {
|
|
|
916
964
|
try {
|
|
917
965
|
const response = await fetch(apiUrl("/chains"), {
|
|
918
966
|
method: "GET",
|
|
919
|
-
headers:
|
|
967
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, )
|
|
920
968
|
});
|
|
921
969
|
if (!response.ok) {
|
|
922
970
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -962,7 +1010,7 @@ function createDepositService(baseUrl, options) {
|
|
|
962
1010
|
const label = kind === "fiat" ? "Swapped widget URL" : "Swapped Connect URL";
|
|
963
1011
|
const response = await fetch(apiUrl("/onramp/orders"), {
|
|
964
1012
|
method: "POST",
|
|
965
|
-
headers:
|
|
1013
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
966
1014
|
body: JSON.stringify({
|
|
967
1015
|
provider: "swapped",
|
|
968
1016
|
kind,
|
|
@@ -1003,7 +1051,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1003
1051
|
});
|
|
1004
1052
|
const response = await fetch(url, {
|
|
1005
1053
|
method: "POST",
|
|
1006
|
-
headers:
|
|
1054
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1007
1055
|
body: JSON.stringify({ account: params })
|
|
1008
1056
|
});
|
|
1009
1057
|
if (!response.ok) {
|
|
@@ -1038,7 +1086,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1038
1086
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
1039
1087
|
const response = await fetch(url, {
|
|
1040
1088
|
method: "GET",
|
|
1041
|
-
headers:
|
|
1089
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, )
|
|
1042
1090
|
});
|
|
1043
1091
|
if (!response.ok) {
|
|
1044
1092
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1089,7 +1137,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1089
1137
|
});
|
|
1090
1138
|
const response = await fetch(url, {
|
|
1091
1139
|
method: "GET",
|
|
1092
|
-
headers:
|
|
1140
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, )
|
|
1093
1141
|
});
|
|
1094
1142
|
if (!response.ok) {
|
|
1095
1143
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1118,7 +1166,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1118
1166
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
1119
1167
|
const response = await fetch(url, {
|
|
1120
1168
|
method: "GET",
|
|
1121
|
-
headers:
|
|
1169
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, )
|
|
1122
1170
|
});
|
|
1123
1171
|
if (!response.ok) {
|
|
1124
1172
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1154,7 +1202,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1154
1202
|
);
|
|
1155
1203
|
const response = await fetch(url, {
|
|
1156
1204
|
method: "GET",
|
|
1157
|
-
headers:
|
|
1205
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1158
1206
|
cache: "no-store"
|
|
1159
1207
|
});
|
|
1160
1208
|
if (!response.ok) {
|
|
@@ -1182,7 +1230,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1182
1230
|
);
|
|
1183
1231
|
const response = await fetch(url, {
|
|
1184
1232
|
method: "GET",
|
|
1185
|
-
headers:
|
|
1233
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1186
1234
|
cache: "no-store"
|
|
1187
1235
|
});
|
|
1188
1236
|
if (!response.ok) {
|
|
@@ -1206,7 +1254,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1206
1254
|
);
|
|
1207
1255
|
const response = await fetch(url, {
|
|
1208
1256
|
method: "GET",
|
|
1209
|
-
headers:
|
|
1257
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1210
1258
|
cache: "no-store"
|
|
1211
1259
|
});
|
|
1212
1260
|
if (!response.ok) {
|
|
@@ -1228,7 +1276,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1228
1276
|
async getPositions(address) {
|
|
1229
1277
|
const url = apiUrl(`/positions/${address}`);
|
|
1230
1278
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1231
|
-
const response = await fetch(url, { headers:
|
|
1279
|
+
const response = await fetch(url, { headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ) });
|
|
1232
1280
|
if (!response.ok) {
|
|
1233
1281
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1234
1282
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1262,7 +1310,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1262
1310
|
});
|
|
1263
1311
|
const response = await fetch(url, {
|
|
1264
1312
|
method: "POST",
|
|
1265
|
-
headers:
|
|
1313
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1266
1314
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1267
1315
|
});
|
|
1268
1316
|
if (!response.ok) {
|
|
@@ -1298,7 +1346,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1298
1346
|
});
|
|
1299
1347
|
const response = await fetch(url, {
|
|
1300
1348
|
method: "POST",
|
|
1301
|
-
headers:
|
|
1349
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1302
1350
|
body: JSON.stringify({
|
|
1303
1351
|
depositWallet,
|
|
1304
1352
|
owner,
|
|
@@ -1340,7 +1388,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1340
1388
|
});
|
|
1341
1389
|
const response = await fetch(url, {
|
|
1342
1390
|
method: "GET",
|
|
1343
|
-
headers:
|
|
1391
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1344
1392
|
cache: "no-store"
|
|
1345
1393
|
});
|
|
1346
1394
|
if (!response.ok) {
|
|
@@ -1390,7 +1438,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1390
1438
|
});
|
|
1391
1439
|
const response = await fetch(url, {
|
|
1392
1440
|
method: "GET",
|
|
1393
|
-
headers:
|
|
1441
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1394
1442
|
cache: "no-store"
|
|
1395
1443
|
});
|
|
1396
1444
|
if (!response.ok) {
|
|
@@ -1444,7 +1492,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1444
1492
|
try {
|
|
1445
1493
|
const response = await fetch(url, {
|
|
1446
1494
|
method: "POST",
|
|
1447
|
-
headers:
|
|
1495
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1448
1496
|
body: JSON.stringify(body),
|
|
1449
1497
|
cache: "no-store",
|
|
1450
1498
|
signal
|
|
@@ -1494,7 +1542,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1494
1542
|
try {
|
|
1495
1543
|
const response = await fetch(url, {
|
|
1496
1544
|
method: "POST",
|
|
1497
|
-
headers:
|
|
1545
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1498
1546
|
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1499
1547
|
cache: "no-store",
|
|
1500
1548
|
signal
|
|
@@ -1597,7 +1645,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1597
1645
|
try {
|
|
1598
1646
|
response = await fetch(url, {
|
|
1599
1647
|
method: "POST",
|
|
1600
|
-
headers:
|
|
1648
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1601
1649
|
body: JSON.stringify(params)
|
|
1602
1650
|
});
|
|
1603
1651
|
} catch (error) {
|
|
@@ -1681,7 +1729,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1681
1729
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1682
1730
|
const response = await fetch(url, {
|
|
1683
1731
|
method: "GET",
|
|
1684
|
-
headers:
|
|
1732
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1685
1733
|
cache: "no-store"
|
|
1686
1734
|
});
|
|
1687
1735
|
if (!response.ok) {
|
|
@@ -1717,6 +1765,32 @@ function createDepositService(baseUrl, options) {
|
|
|
1717
1765
|
}
|
|
1718
1766
|
return { exchanges: exchanges.filter(isSupportedConnectExchange) };
|
|
1719
1767
|
},
|
|
1768
|
+
async getOnrampProviders() {
|
|
1769
|
+
try {
|
|
1770
|
+
const response = await fetch(apiUrl("/onramp/providers"), {
|
|
1771
|
+
method: "GET",
|
|
1772
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1773
|
+
cache: "no-store"
|
|
1774
|
+
});
|
|
1775
|
+
if (!response.ok) return null;
|
|
1776
|
+
const body = await response.json();
|
|
1777
|
+
if (!Array.isArray(body.providers)) return null;
|
|
1778
|
+
return body.providers.flatMap((raw) => {
|
|
1779
|
+
const p = raw;
|
|
1780
|
+
return (p.provider === "swapped" || p.provider === "noah") && (p.flow === "hosted" || p.flow === "funding_account") && Array.isArray(p.kinds) ? [
|
|
1781
|
+
{
|
|
1782
|
+
provider: p.provider,
|
|
1783
|
+
flow: p.flow,
|
|
1784
|
+
kinds: p.kinds.filter(
|
|
1785
|
+
(k) => k === "fiat" || k === "exchange"
|
|
1786
|
+
)
|
|
1787
|
+
}
|
|
1788
|
+
] : [];
|
|
1789
|
+
});
|
|
1790
|
+
} catch (e5) {
|
|
1791
|
+
return null;
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1720
1794
|
async getSwappedPaymentMethods() {
|
|
1721
1795
|
const empty = {
|
|
1722
1796
|
country: null,
|
|
@@ -1728,7 +1802,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1728
1802
|
try {
|
|
1729
1803
|
const response = await fetch(url, {
|
|
1730
1804
|
method: "GET",
|
|
1731
|
-
headers:
|
|
1805
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1732
1806
|
cache: "no-store"
|
|
1733
1807
|
});
|
|
1734
1808
|
if (!response.ok) {
|
|
@@ -1816,7 +1890,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1816
1890
|
try {
|
|
1817
1891
|
const response = await fetch(url, {
|
|
1818
1892
|
method: "GET",
|
|
1819
|
-
headers:
|
|
1893
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1820
1894
|
cache: "no-store"
|
|
1821
1895
|
});
|
|
1822
1896
|
if (!response.ok) {
|
|
@@ -1841,34 +1915,24 @@ function createDepositService(baseUrl, options) {
|
|
|
1841
1915
|
const url = apiUrl(`/onramp/orders/${encodeURIComponent(orderId)}`);
|
|
1842
1916
|
const response = await fetch(url, {
|
|
1843
1917
|
method: "GET",
|
|
1844
|
-
headers:
|
|
1918
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
1845
1919
|
cache: "no-store"
|
|
1846
1920
|
});
|
|
1847
1921
|
if (!response.ok) return null;
|
|
1848
1922
|
let body;
|
|
1849
1923
|
try {
|
|
1850
1924
|
body = await response.json();
|
|
1851
|
-
} catch (
|
|
1925
|
+
} catch (e6) {
|
|
1852
1926
|
return null;
|
|
1853
1927
|
}
|
|
1854
1928
|
return swappedOrderFromView(orderId, body);
|
|
1855
1929
|
}
|
|
1856
1930
|
};
|
|
1857
1931
|
}
|
|
1858
|
-
var SWAPPED_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1859
|
-
"payment_pending",
|
|
1860
|
-
"order_completed",
|
|
1861
|
-
"order_broadcasted",
|
|
1862
|
-
"order_cancelled"
|
|
1863
|
-
]);
|
|
1864
1932
|
function swappedOrderFromView(orderId, raw) {
|
|
1865
1933
|
if (!raw || typeof raw !== "object") return null;
|
|
1866
1934
|
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
|
-
}
|
|
1935
|
+
if (view.provider !== "swapped" || !isOrderShape(view)) return null;
|
|
1872
1936
|
const number = (v) => {
|
|
1873
1937
|
const n = typeof v === "string" && v.trim() ? Number(v) : v;
|
|
1874
1938
|
return typeof n === "number" && Number.isFinite(n) ? n : null;
|
|
@@ -1882,17 +1946,29 @@ function swappedOrderFromView(orderId, raw) {
|
|
|
1882
1946
|
const usdNet = number(_optionalChain([view, 'access', _50 => _50.fiat, 'optionalAccess', _51 => _51.usd, 'optionalAccess', _52 => _52.net]));
|
|
1883
1947
|
return {
|
|
1884
1948
|
orderId,
|
|
1885
|
-
|
|
1949
|
+
...hostedOrderState(view),
|
|
1886
1950
|
orderCrypto: text(_optionalChain([view, 'access', _53 => _53.crypto, 'optionalAccess', _54 => _54.asset])),
|
|
1887
1951
|
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
1952
|
receivedAt: text(view.updatedAt),
|
|
1890
1953
|
paidAmountUsd: _nullishCoalesce(usdTotal, () => ( usdNet)),
|
|
1891
|
-
paidAmountEur: _nullishCoalesce(number(_optionalChain([view, 'access',
|
|
1954
|
+
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
1955
|
onrampFeeUsd: usdTotal !== null && usdNet !== null && usdTotal > usdNet ? Number((usdTotal - usdNet).toFixed(2)) : null,
|
|
1893
|
-
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access',
|
|
1956
|
+
paymentMethod: railName(_nullishCoalesce(_optionalChain([view, 'access', _63 => _63.rail, 'optionalAccess', _64 => _64.method]), () => ( _optionalChain([view, 'access', _65 => _65.rail, 'optionalAccess', _66 => _66.connection]))))
|
|
1894
1957
|
};
|
|
1895
1958
|
}
|
|
1959
|
+
var ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
1960
|
+
"pending",
|
|
1961
|
+
"processing",
|
|
1962
|
+
"completed",
|
|
1963
|
+
"failed",
|
|
1964
|
+
"refunded"
|
|
1965
|
+
]);
|
|
1966
|
+
function isOrderShape(view) {
|
|
1967
|
+
const stages = view.stages;
|
|
1968
|
+
return ORDER_STATUSES.has(view.status) && ["receipt", "conversion", "delivery"].every(
|
|
1969
|
+
(name) => typeof _optionalChain([stages, 'optionalAccess', _67 => _67[name], 'optionalAccess', _68 => _68.status]) === "string"
|
|
1970
|
+
);
|
|
1971
|
+
}
|
|
1896
1972
|
function parseAssetItem(raw, fields) {
|
|
1897
1973
|
if (!raw || typeof raw !== "object") return void 0;
|
|
1898
1974
|
const record = raw;
|
|
@@ -1920,16 +1996,16 @@ function parseAssetItem(raw, fields) {
|
|
|
1920
1996
|
}
|
|
1921
1997
|
function normalizeDirectPortfolio(data) {
|
|
1922
1998
|
const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
|
|
1923
|
-
_optionalChain([data, 'optionalAccess',
|
|
1999
|
+
_optionalChain([data, 'optionalAccess', _69 => _69.data]),
|
|
1924
2000
|
"tokens"
|
|
1925
2001
|
))), () => ( []));
|
|
1926
|
-
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess',
|
|
2002
|
+
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _70 => _70.data]), "totalUsd"))), () => ( 0));
|
|
1927
2003
|
const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
|
|
1928
2004
|
return { tokens, totalUsd };
|
|
1929
2005
|
}
|
|
1930
2006
|
function extractOrchestratorPortfolio(data) {
|
|
1931
2007
|
const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
|
|
1932
|
-
_optionalChain([data, 'optionalAccess',
|
|
2008
|
+
_optionalChain([data, 'optionalAccess', _71 => _71.data]),
|
|
1933
2009
|
"portfolio"
|
|
1934
2010
|
)));
|
|
1935
2011
|
if (!portfolio || !Array.isArray(portfolio)) return null;
|
|
@@ -1940,7 +2016,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1940
2016
|
for (const tokenData of data.portfolio || []) {
|
|
1941
2017
|
const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
|
|
1942
2018
|
for (const chainBalance of chainBalances) {
|
|
1943
|
-
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access',
|
|
2019
|
+
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _72 => _72.balance, 'optionalAccess', _73 => _73.unlocked]), () => ( "0"));
|
|
1944
2020
|
const normalizedName = tokenData.tokenName.trim();
|
|
1945
2021
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1946
2022
|
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( runtimeEvmAddress(chainBalance.chainId, normalizedName)));
|
|
@@ -1977,18 +2053,18 @@ function normalizeDirectToken(token) {
|
|
|
1977
2053
|
if (chainId === null) return null;
|
|
1978
2054
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1979
2055
|
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',
|
|
2056
|
+
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
2057
|
if (!balanceValue) return null;
|
|
1982
2058
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1983
2059
|
token.token,
|
|
1984
2060
|
"address"
|
|
1985
|
-
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call',
|
|
2061
|
+
))), () => ( (chainId === "hypercore" ? _optionalChain([hyperCoreSourceToken, 'call', _86 => _86(void 0, symbol), 'optionalAccess', _87 => _87.address]) : typeof chainId === "number" ? runtimeEvmAddress(chainId, symbol) : void 0)));
|
|
1986
2062
|
if (!address) return null;
|
|
1987
2063
|
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
2064
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1989
2065
|
const hyperCore = chainId === "hypercore" ? hyperCoreSourceToken(address, symbol) : void 0;
|
|
1990
|
-
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
1991
|
-
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess',
|
|
2066
|
+
const resolvedSymbol = _nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _88 => _88.symbol]), () => ( symbol));
|
|
2067
|
+
const resolvedDecimals = _nullishCoalesce(_nullishCoalesce(_optionalChain([hyperCore, 'optionalAccess', _89 => _89.decimals]), () => ( backendDecimals)), () => ( 18));
|
|
1992
2068
|
return {
|
|
1993
2069
|
chainId,
|
|
1994
2070
|
address,
|
|
@@ -2010,7 +2086,7 @@ function hyperCoreSourceToken(address, symbol) {
|
|
|
2010
2086
|
}
|
|
2011
2087
|
function extractTokenAddress(tokenData, chainId) {
|
|
2012
2088
|
const token = tokenData;
|
|
2013
|
-
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access',
|
|
2089
|
+
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
2090
|
}
|
|
2015
2091
|
function extractArray(data, key) {
|
|
2016
2092
|
if (!data || typeof data !== "object") return null;
|
|
@@ -2040,7 +2116,7 @@ function extractNumericString(data, key) {
|
|
|
2040
2116
|
// src/core/rpc.ts
|
|
2041
2117
|
|
|
2042
2118
|
function rpcUrlFor(rpcUrls, chain) {
|
|
2043
|
-
const url = _optionalChain([rpcUrls, 'optionalAccess',
|
|
2119
|
+
const url = _optionalChain([rpcUrls, 'optionalAccess', _97 => _97[chain], 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
2044
2120
|
return url ? url : void 0;
|
|
2045
2121
|
}
|
|
2046
2122
|
var RpcUrlsContext = _react.createContext.call(void 0, void 0);
|
|
@@ -2050,7 +2126,7 @@ function useRpcUrls() {
|
|
|
2050
2126
|
}
|
|
2051
2127
|
function rpcUrlsKey(rpcUrls) {
|
|
2052
2128
|
if (!rpcUrls) return "";
|
|
2053
|
-
return Object.entries(rpcUrls).map(([chain, url]) => [chain, _nullishCoalesce(_optionalChain([url, 'optionalAccess',
|
|
2129
|
+
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
2130
|
}
|
|
2055
2131
|
function useStableRpcUrls(rpcUrls) {
|
|
2056
2132
|
const key = rpcUrlsKey(rpcUrls);
|
|
@@ -2072,15 +2148,15 @@ function useStableRpcUrls(rpcUrls) {
|
|
|
2072
2148
|
|
|
2073
2149
|
function findListed(options, chain, token) {
|
|
2074
2150
|
const normalize2 = (value) => chain === "solana" ? value : value.toLowerCase();
|
|
2075
|
-
return _optionalChain([options, 'access',
|
|
2151
|
+
return _optionalChain([options, 'access', _102 => _102.tokens, 'access', _103 => _103[String(chain)], 'optionalAccess', _104 => _104.find, 'call', _105 => _105(
|
|
2076
2152
|
(listed) => normalize2(listed.address) === normalize2(token)
|
|
2077
2153
|
)]);
|
|
2078
2154
|
}
|
|
2079
2155
|
function isExcludedByRestrictedList(options, chain, token) {
|
|
2080
|
-
return Boolean(_optionalChain([options, 'optionalAccess',
|
|
2156
|
+
return Boolean(_optionalChain([options, 'optionalAccess', _106 => _106.restricted]) && !findListed(options, chain, token));
|
|
2081
2157
|
}
|
|
2082
2158
|
function findDepositBounds(options, chain, token) {
|
|
2083
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2159
|
+
if (!_optionalChain([options, 'optionalAccess', _107 => _107.restricted])) return void 0;
|
|
2084
2160
|
const entry = findListed(options, chain, token);
|
|
2085
2161
|
if (!entry || entry.minAmount === void 0 && entry.maxAmount === void 0) {
|
|
2086
2162
|
return void 0;
|
|
@@ -2093,7 +2169,7 @@ function findDepositBounds(options, chain, token) {
|
|
|
2093
2169
|
};
|
|
2094
2170
|
}
|
|
2095
2171
|
function boundMessage(bounds, bound) {
|
|
2096
|
-
const raw = _optionalChain([bounds, 'optionalAccess',
|
|
2172
|
+
const raw = _optionalChain([bounds, 'optionalAccess', _108 => _108[bound]]);
|
|
2097
2173
|
if (!bounds || raw === void 0) return null;
|
|
2098
2174
|
const amount = new Intl.NumberFormat("en-US", {
|
|
2099
2175
|
maximumFractionDigits: Math.min(bounds.decimals, 20)
|
|
@@ -2192,7 +2268,7 @@ async function loadViemChains() {
|
|
|
2192
2268
|
viemChainsPromise = Promise.resolve().then(() => _interopRequireWildcard(require("viem/chains"))).then((module) => {
|
|
2193
2269
|
const map = /* @__PURE__ */ new Map();
|
|
2194
2270
|
for (const value of Object.values(module)) {
|
|
2195
|
-
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access',
|
|
2271
|
+
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
2272
|
const chain = value;
|
|
2197
2273
|
const existing = map.get(chain.id);
|
|
2198
2274
|
if (existing) existing.push(chain);
|
|
@@ -2206,7 +2282,7 @@ async function loadViemChains() {
|
|
|
2206
2282
|
return viemChainsPromise;
|
|
2207
2283
|
}
|
|
2208
2284
|
function pickViemChain(candidates, chain) {
|
|
2209
|
-
if (!_optionalChain([candidates, 'optionalAccess',
|
|
2285
|
+
if (!_optionalChain([candidates, 'optionalAccess', _113 => _113.length])) return void 0;
|
|
2210
2286
|
if (candidates.length === 1) return candidates[0];
|
|
2211
2287
|
const sameNetworkClass = candidates.filter(
|
|
2212
2288
|
(candidate) => Boolean(candidate.testnet) === chain.testnet
|
|
@@ -2222,10 +2298,10 @@ function pickViemChain(candidates, chain) {
|
|
|
2222
2298
|
}
|
|
2223
2299
|
function resolveRpcUrls(chain, override, viemChains) {
|
|
2224
2300
|
const urls = [];
|
|
2225
|
-
if (_optionalChain([override, 'optionalAccess',
|
|
2301
|
+
if (_optionalChain([override, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()])) urls.push(override.trim());
|
|
2226
2302
|
if (chain.publicRpcUrl) urls.push(chain.publicRpcUrl);
|
|
2227
2303
|
if (chain.chainId !== null && chain.vmType === "evm") {
|
|
2228
|
-
const http2 = _optionalChain([pickViemChain, 'call',
|
|
2304
|
+
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
2305
|
if (http2) urls.push(...http2);
|
|
2230
2306
|
}
|
|
2231
2307
|
return [...new Set(urls)];
|
|
@@ -2234,7 +2310,7 @@ function toViemChain(chain, override, viemChains) {
|
|
|
2234
2310
|
if (chain.vmType !== "evm" || chain.chainId === null) return null;
|
|
2235
2311
|
const rpcUrls = resolveRpcUrls(chain, override, viemChains);
|
|
2236
2312
|
if (rpcUrls.length === 0) return null;
|
|
2237
|
-
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess',
|
|
2313
|
+
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess', _122 => _122.get, 'call', _123 => _123(chain.chainId)]), chain);
|
|
2238
2314
|
if (bundled) {
|
|
2239
2315
|
if (rpcUrls[0] === bundled.rpcUrls.default.http[0]) return bundled;
|
|
2240
2316
|
return _viem.defineChain.call(void 0, {
|
|
@@ -2265,7 +2341,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2265
2341
|
for (const entry of catalog.all) {
|
|
2266
2342
|
const chain = toViemChain(
|
|
2267
2343
|
entry,
|
|
2268
|
-
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess',
|
|
2344
|
+
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess', _124 => _124[entry.chainId]]),
|
|
2269
2345
|
viemChains
|
|
2270
2346
|
);
|
|
2271
2347
|
if (chain) chains.push(chain);
|
|
@@ -2274,7 +2350,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2274
2350
|
}
|
|
2275
2351
|
function needsViemChains(catalog, overrides) {
|
|
2276
2352
|
return catalog.all.some(
|
|
2277
|
-
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess',
|
|
2353
|
+
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess', _125 => _125[chain.chainId], 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()])
|
|
2278
2354
|
);
|
|
2279
2355
|
}
|
|
2280
2356
|
|
|
@@ -2354,9 +2430,9 @@ function publishRuntimeChainMeta(catalog) {
|
|
|
2354
2430
|
iconUrl: _nullishCoalesce(chain.iconUrl, () => ( void 0)),
|
|
2355
2431
|
nativeSymbol: chain.nativeToken.symbol,
|
|
2356
2432
|
nativeDecimals: chain.nativeToken.decimals,
|
|
2357
|
-
explorerUrl: _optionalChain([chain, 'access',
|
|
2358
|
-
explorerTxPath: _optionalChain([chain, 'access',
|
|
2359
|
-
explorerAddressPath: _optionalChain([chain, 'access',
|
|
2433
|
+
explorerUrl: _optionalChain([chain, 'access', _128 => _128.explorer, 'optionalAccess', _129 => _129.url]),
|
|
2434
|
+
explorerTxPath: _optionalChain([chain, 'access', _130 => _130.explorer, 'optionalAccess', _131 => _131.txPath]),
|
|
2435
|
+
explorerAddressPath: _optionalChain([chain, 'access', _132 => _132.explorer, 'optionalAccess', _133 => _133.addressPath])
|
|
2360
2436
|
}));
|
|
2361
2437
|
})
|
|
2362
2438
|
);
|
|
@@ -2429,7 +2505,7 @@ function useTargetTokens() {
|
|
|
2429
2505
|
const { catalog, shortlist } = useChainCatalog();
|
|
2430
2506
|
return _react.useMemo.call(void 0, () => {
|
|
2431
2507
|
return (chainId) => {
|
|
2432
|
-
const fromShortlist = _optionalChain([shortlist, 'optionalAccess',
|
|
2508
|
+
const fromShortlist = _optionalChain([shortlist, 'optionalAccess', _134 => _134[String(chainId)]]);
|
|
2433
2509
|
if (fromShortlist) {
|
|
2434
2510
|
return fromShortlist.map((token) => ({
|
|
2435
2511
|
symbol: token.symbol,
|
|
@@ -2437,8 +2513,8 @@ function useTargetTokens() {
|
|
|
2437
2513
|
decimals: token.decimals
|
|
2438
2514
|
}));
|
|
2439
2515
|
}
|
|
2440
|
-
const entry = _optionalChain([catalog, 'optionalAccess',
|
|
2441
|
-
return Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
2516
|
+
const entry = _optionalChain([catalog, 'optionalAccess', _135 => _135.byChainId, 'access', _136 => _136.get, 'call', _137 => _137(chainId)]);
|
|
2517
|
+
return Array.isArray(_optionalChain([entry, 'optionalAccess', _138 => _138.supportedTokens])) ? entry.supportedTokens.map((token) => ({
|
|
2442
2518
|
symbol: token.symbol,
|
|
2443
2519
|
address: token.address,
|
|
2444
2520
|
decimals: token.decimals
|
|
@@ -2448,12 +2524,12 @@ function useTargetTokens() {
|
|
|
2448
2524
|
}
|
|
2449
2525
|
function createDepositOffer(state, retry) {
|
|
2450
2526
|
const options = state.status === "ready" ? state.options : null;
|
|
2451
|
-
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2452
|
-
const listed = (chain) => _optionalChain([options, 'optionalAccess',
|
|
2527
|
+
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _139 => _139.restricted]), () => ( false));
|
|
2528
|
+
const listed = (chain) => _optionalChain([options, 'optionalAccess', _140 => _140.tokens, 'access', _141 => _141[String(chain)]]);
|
|
2453
2529
|
const isChainOffered = (chain) => {
|
|
2454
2530
|
if (!options) return false;
|
|
2455
2531
|
const entry = listed(chain);
|
|
2456
|
-
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2532
|
+
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess', _142 => _142.length]), () => ( 0))) > 0 : _optionalChain([entry, 'optionalAccess', _143 => _143.length]) !== 0;
|
|
2457
2533
|
};
|
|
2458
2534
|
return {
|
|
2459
2535
|
status: state.status,
|
|
@@ -2503,7 +2579,7 @@ function useChainName() {
|
|
|
2503
2579
|
if (!catalog) return _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId);
|
|
2504
2580
|
const key = catalogKeyForChain(chainId);
|
|
2505
2581
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2506
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2582
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _144 => _144.name]), () => ( _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId)));
|
|
2507
2583
|
};
|
|
2508
2584
|
}, [catalog]);
|
|
2509
2585
|
}
|
|
@@ -2527,7 +2603,7 @@ function useExplorerTxUrl() {
|
|
|
2527
2603
|
return (chainId, txHash) => {
|
|
2528
2604
|
if (chainId === "hypercore") return _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2529
2605
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2530
|
-
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess',
|
|
2606
|
+
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
2607
|
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunkFKJ6EJHHcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2532
2608
|
};
|
|
2533
2609
|
}, [catalog]);
|
|
@@ -2590,7 +2666,7 @@ function ChainCatalogProvider({
|
|
|
2590
2666
|
service.getTopTokens().then(
|
|
2591
2667
|
(result) => {
|
|
2592
2668
|
if (!active) return;
|
|
2593
|
-
if (!_optionalChain([result, 'optionalAccess',
|
|
2669
|
+
if (!_optionalChain([result, 'optionalAccess', _151 => _151.ok])) {
|
|
2594
2670
|
setDepositOptions({ status: "error" });
|
|
2595
2671
|
return;
|
|
2596
2672
|
}
|
|
@@ -2747,7 +2823,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2747
2823
|
async function lookup2(ids, fields) {
|
|
2748
2824
|
try {
|
|
2749
2825
|
return await service.lookupAssets(ids, fields);
|
|
2750
|
-
} catch (
|
|
2826
|
+
} catch (e7) {
|
|
2751
2827
|
return { ok: false, routeMissing: false };
|
|
2752
2828
|
}
|
|
2753
2829
|
}
|
|
@@ -2762,22 +2838,22 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2762
2838
|
if (result.routeMissing) routeMissing = true;
|
|
2763
2839
|
meta.set(id, {
|
|
2764
2840
|
...previous,
|
|
2765
|
-
status: _optionalChain([previous, 'optionalAccess',
|
|
2841
|
+
status: _optionalChain([previous, 'optionalAccess', _152 => _152.status]) === "ready" ? "ready" : "failed",
|
|
2766
2842
|
retryAt: at + ASSET_RETRY_MS
|
|
2767
2843
|
});
|
|
2768
2844
|
continue;
|
|
2769
2845
|
}
|
|
2770
2846
|
const item = result.items[id];
|
|
2771
|
-
const code = _optionalChain([item, 'optionalAccess',
|
|
2847
|
+
const code = _optionalChain([item, 'optionalAccess', _153 => _153.error, 'optionalAccess', _154 => _154.code]);
|
|
2772
2848
|
if (!item || code && TERMINAL_ITEM_ERRORS.has(code)) {
|
|
2773
2849
|
meta.set(id, { status: "missing" });
|
|
2774
2850
|
continue;
|
|
2775
2851
|
}
|
|
2776
2852
|
meta.set(id, {
|
|
2777
2853
|
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',
|
|
2854
|
+
symbol: _nullishCoalesce(item.symbol, () => ( _optionalChain([previous, 'optionalAccess', _155 => _155.symbol]))),
|
|
2855
|
+
decimals: _nullishCoalesce(item.decimals, () => ( _optionalChain([previous, 'optionalAccess', _156 => _156.decimals]))),
|
|
2856
|
+
logo: _nullishCoalesce(item.logo, () => ( _optionalChain([previous, 'optionalAccess', _157 => _157.logo]))),
|
|
2781
2857
|
retryAt: code ? at + ASSET_RETRY_MS : void 0
|
|
2782
2858
|
});
|
|
2783
2859
|
}
|
|
@@ -2790,7 +2866,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2790
2866
|
for (const id of ids) {
|
|
2791
2867
|
priceInFlight.delete(id);
|
|
2792
2868
|
prices.set(id, {
|
|
2793
|
-
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access',
|
|
2869
|
+
usd: result.ok ? _nullishCoalesce(_optionalChain([result, 'access', _158 => _158.items, 'access', _159 => _159[id], 'optionalAccess', _160 => _160.priceUsd]), () => ( null)) : null,
|
|
2794
2870
|
at
|
|
2795
2871
|
});
|
|
2796
2872
|
}
|
|
@@ -2844,7 +2920,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2844
2920
|
requestMeta,
|
|
2845
2921
|
requestPrices,
|
|
2846
2922
|
peekMeta,
|
|
2847
|
-
peekPrice: (id) => _optionalChain([prices, 'access',
|
|
2923
|
+
peekPrice: (id) => _optionalChain([prices, 'access', _161 => _161.get, 'call', _162 => _162(id), 'optionalAccess', _163 => _163.usd]),
|
|
2848
2924
|
async resolveMeta(refs) {
|
|
2849
2925
|
const ids = idsFor(refs);
|
|
2850
2926
|
requestMeta(refs);
|
|
@@ -2860,7 +2936,7 @@ function createAssetStore(service, now = Date.now) {
|
|
|
2860
2936
|
if (!id) return null;
|
|
2861
2937
|
requestPrices([ref]);
|
|
2862
2938
|
await settled(() => !priceInFlight.has(id) && !priceQueue.has(id));
|
|
2863
|
-
return _nullishCoalesce(_optionalChain([prices, 'access',
|
|
2939
|
+
return _nullishCoalesce(_optionalChain([prices, 'access', _164 => _164.get, 'call', _165 => _165(id), 'optionalAccess', _166 => _166.usd]), () => ( null));
|
|
2864
2940
|
}
|
|
2865
2941
|
};
|
|
2866
2942
|
}
|
|
@@ -2991,7 +3067,7 @@ function createIngestTransport(options) {
|
|
|
2991
3067
|
function report(reason, status) {
|
|
2992
3068
|
try {
|
|
2993
3069
|
onFailure({ reason, status, droppedEvents: dropped });
|
|
2994
|
-
} catch (
|
|
3070
|
+
} catch (e8) {
|
|
2995
3071
|
}
|
|
2996
3072
|
}
|
|
2997
3073
|
function drop(batch, reason, status) {
|
|
@@ -3045,10 +3121,10 @@ function createIngestTransport(options) {
|
|
|
3045
3121
|
}
|
|
3046
3122
|
function interruptForUnload() {
|
|
3047
3123
|
for (const wake of [...sleepers]) wake();
|
|
3048
|
-
_optionalChain([mintAbort, 'optionalAccess',
|
|
3124
|
+
_optionalChain([mintAbort, 'optionalAccess', _167 => _167.abort, 'call', _168 => _168()]);
|
|
3049
3125
|
}
|
|
3050
3126
|
function retryDelay(response, attempt) {
|
|
3051
|
-
const seconds = Number(_optionalChain([response, 'access',
|
|
3127
|
+
const seconds = Number(_optionalChain([response, 'access', _169 => _169.headers, 'optionalAccess', _170 => _170.get, 'optionalCall', _171 => _171("Retry-After")]));
|
|
3052
3128
|
if (Number.isFinite(seconds) && seconds > 0) {
|
|
3053
3129
|
return Math.min(seconds * 1e3, MAX_BACKOFF_MS);
|
|
3054
3130
|
}
|
|
@@ -3063,10 +3139,10 @@ function createIngestTransport(options) {
|
|
|
3063
3139
|
try {
|
|
3064
3140
|
response = await fetchImpl(mintUrl, {
|
|
3065
3141
|
method: "POST",
|
|
3066
|
-
headers:
|
|
3067
|
-
signal: _optionalChain([controller, 'optionalAccess',
|
|
3142
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
3143
|
+
signal: _optionalChain([controller, 'optionalAccess', _172 => _172.signal])
|
|
3068
3144
|
});
|
|
3069
|
-
} catch (
|
|
3145
|
+
} catch (e9) {
|
|
3070
3146
|
if (urgency !== DISMISSAL) {
|
|
3071
3147
|
mintFailures += 1;
|
|
3072
3148
|
mintBackoffUntil = now() + backoff(mintFailures);
|
|
@@ -3094,7 +3170,7 @@ function createIngestTransport(options) {
|
|
|
3094
3170
|
token = { value, expiresAt };
|
|
3095
3171
|
mintFailures = 0;
|
|
3096
3172
|
mintBackoffUntil = 0;
|
|
3097
|
-
} catch (
|
|
3173
|
+
} catch (e10) {
|
|
3098
3174
|
mintUnavailable = true;
|
|
3099
3175
|
report("token_unavailable", response.status);
|
|
3100
3176
|
}
|
|
@@ -3134,7 +3210,7 @@ function createIngestTransport(options) {
|
|
|
3134
3210
|
body: bodyOf(batch),
|
|
3135
3211
|
keepalive: true
|
|
3136
3212
|
});
|
|
3137
|
-
} catch (
|
|
3213
|
+
} catch (e11) {
|
|
3138
3214
|
if (terminal || attempt >= MAX_ATTEMPTS) {
|
|
3139
3215
|
return drop(batch, "network");
|
|
3140
3216
|
}
|
|
@@ -3239,7 +3315,7 @@ function createIngestTransport(options) {
|
|
|
3239
3315
|
}
|
|
3240
3316
|
},
|
|
3241
3317
|
flush(flushOptions) {
|
|
3242
|
-
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess',
|
|
3318
|
+
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess', _173 => _173.terminal]), () => ( false));
|
|
3243
3319
|
if (disposed && !dismissal) return;
|
|
3244
3320
|
clearFlushTimer();
|
|
3245
3321
|
void run(dismissal ? DISMISSAL : IDLE);
|
|
@@ -3254,11 +3330,11 @@ function createIngestTransport(options) {
|
|
|
3254
3330
|
};
|
|
3255
3331
|
}
|
|
3256
3332
|
function randomUuid() {
|
|
3257
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
3333
|
+
if (typeof _optionalChain([globalThis, 'access', _174 => _174.crypto, 'optionalAccess', _175 => _175.randomUUID]) === "function") {
|
|
3258
3334
|
return globalThis.crypto.randomUUID();
|
|
3259
3335
|
}
|
|
3260
3336
|
const bytes = new Uint8Array(16);
|
|
3261
|
-
_optionalChain([globalThis, 'access',
|
|
3337
|
+
_optionalChain([globalThis, 'access', _176 => _176.crypto, 'optionalAccess', _177 => _177.getRandomValues, 'optionalCall', _178 => _178(bytes)]);
|
|
3262
3338
|
if (!bytes.some(Boolean)) {
|
|
3263
3339
|
for (let index = 0; index < bytes.length; index += 1) {
|
|
3264
3340
|
bytes[index] = Math.floor(Math.random() * 256);
|
|
@@ -3272,9 +3348,9 @@ function randomUuid() {
|
|
|
3272
3348
|
function resolveProxyOrigin(backendUrl) {
|
|
3273
3349
|
if (!backendUrl.trim()) return null;
|
|
3274
3350
|
try {
|
|
3275
|
-
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access',
|
|
3351
|
+
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access', _179 => _179.location, 'optionalAccess', _180 => _180.href]));
|
|
3276
3352
|
return origin.startsWith("http") ? origin : null;
|
|
3277
|
-
} catch (
|
|
3353
|
+
} catch (e12) {
|
|
3278
3354
|
return null;
|
|
3279
3355
|
}
|
|
3280
3356
|
}
|
|
@@ -3324,13 +3400,13 @@ function AnalyticsSession(props) {
|
|
|
3324
3400
|
type: "analytics_ingest_failure",
|
|
3325
3401
|
session_id: sessionIdRef.current,
|
|
3326
3402
|
modal,
|
|
3327
|
-
widget_version:
|
|
3403
|
+
widget_version: _chunkD3R3O4CYcjs.MODAL_VERSION,
|
|
3328
3404
|
timestamp: nowRef.current().toISOString(),
|
|
3329
3405
|
reason,
|
|
3330
3406
|
...status === void 0 ? {} : { status },
|
|
3331
3407
|
dropped_events: droppedEvents
|
|
3332
3408
|
};
|
|
3333
|
-
_optionalChain([onEventRef, 'access',
|
|
3409
|
+
_optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182(event)]);
|
|
3334
3410
|
},
|
|
3335
3411
|
[modal]
|
|
3336
3412
|
);
|
|
@@ -3352,7 +3428,7 @@ function AnalyticsSession(props) {
|
|
|
3352
3428
|
proxyOrigin,
|
|
3353
3429
|
sessionId: sessionIdRef.current,
|
|
3354
3430
|
modal,
|
|
3355
|
-
widgetVersion:
|
|
3431
|
+
widgetVersion: _chunkD3R3O4CYcjs.MODAL_VERSION,
|
|
3356
3432
|
sessionProperties: sessionPropertiesRef.current,
|
|
3357
3433
|
onFailure: (failure) => emitFailure(failure),
|
|
3358
3434
|
fetchImpl: props.fetchImpl,
|
|
@@ -3369,10 +3445,10 @@ function AnalyticsSession(props) {
|
|
|
3369
3445
|
const enqueue = _react.useCallback.call(void 0,
|
|
3370
3446
|
(event) => {
|
|
3371
3447
|
try {
|
|
3372
|
-
_optionalChain([ingestRef, 'access',
|
|
3448
|
+
_optionalChain([ingestRef, 'access', _183 => _183.current, 'optionalAccess', _184 => _184.transport, 'optionalAccess', _185 => _185.enqueue, 'call', _186 => _186(
|
|
3373
3449
|
event
|
|
3374
3450
|
)]);
|
|
3375
|
-
} catch (
|
|
3451
|
+
} catch (e13) {
|
|
3376
3452
|
}
|
|
3377
3453
|
},
|
|
3378
3454
|
[]
|
|
@@ -3408,12 +3484,12 @@ function AnalyticsSession(props) {
|
|
|
3408
3484
|
...payload,
|
|
3409
3485
|
session_id: sessionIdRef.current,
|
|
3410
3486
|
modal,
|
|
3411
|
-
widget_version:
|
|
3487
|
+
widget_version: _chunkD3R3O4CYcjs.MODAL_VERSION,
|
|
3412
3488
|
timestamp: nowRef.current().toISOString(),
|
|
3413
3489
|
session_properties: sessionPropertiesRef.current,
|
|
3414
3490
|
funding_method: fundingMethod
|
|
3415
3491
|
};
|
|
3416
|
-
_optionalChain([onEventRef, 'access',
|
|
3492
|
+
_optionalChain([onEventRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188(
|
|
3417
3493
|
event
|
|
3418
3494
|
)]);
|
|
3419
3495
|
enqueue(event);
|
|
@@ -3427,11 +3503,11 @@ function AnalyticsSession(props) {
|
|
|
3427
3503
|
...payload,
|
|
3428
3504
|
session_id: sessionIdRef.current,
|
|
3429
3505
|
modal,
|
|
3430
|
-
widget_version:
|
|
3506
|
+
widget_version: _chunkD3R3O4CYcjs.MODAL_VERSION,
|
|
3431
3507
|
timestamp: nowRef.current().toISOString(),
|
|
3432
3508
|
session_properties: sessionPropertiesRef.current
|
|
3433
3509
|
};
|
|
3434
|
-
_optionalChain([onEventRef, 'access',
|
|
3510
|
+
_optionalChain([onEventRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190(event)]);
|
|
3435
3511
|
enqueue(event);
|
|
3436
3512
|
},
|
|
3437
3513
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3443,11 +3519,11 @@ function AnalyticsSession(props) {
|
|
|
3443
3519
|
...payload,
|
|
3444
3520
|
session_id: sessionIdRef.current,
|
|
3445
3521
|
modal,
|
|
3446
|
-
widget_version:
|
|
3522
|
+
widget_version: _chunkD3R3O4CYcjs.MODAL_VERSION,
|
|
3447
3523
|
timestamp: nowRef.current().toISOString(),
|
|
3448
3524
|
session_properties: sessionPropertiesRef.current
|
|
3449
3525
|
};
|
|
3450
|
-
_optionalChain([onEventRef, 'access',
|
|
3526
|
+
_optionalChain([onEventRef, 'access', _191 => _191.current, 'optionalCall', _192 => _192(event)]);
|
|
3451
3527
|
enqueue(event);
|
|
3452
3528
|
},
|
|
3453
3529
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3506,7 +3582,7 @@ function toRecoverableDeposit(row, options = {}) {
|
|
|
3506
3582
|
};
|
|
3507
3583
|
}
|
|
3508
3584
|
function isDepositSelfDestination(row, destination) {
|
|
3509
|
-
const depositAddress = _optionalChain([row, 'access',
|
|
3585
|
+
const depositAddress = _optionalChain([row, 'access', _193 => _193.depositAddress, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()]);
|
|
3510
3586
|
const candidate = destination.trim();
|
|
3511
3587
|
if (!depositAddress || !candidate) return false;
|
|
3512
3588
|
return depositAddress.toLowerCase() === candidate.toLowerCase();
|
|
@@ -3559,7 +3635,7 @@ var STATUS_LABEL = {
|
|
|
3559
3635
|
};
|
|
3560
3636
|
function filterVisibleDeposits(deposits) {
|
|
3561
3637
|
const sourceHashes = new Set(
|
|
3562
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
3638
|
+
deposits.map((d) => _optionalChain([d, 'access', _196 => _196.sourceTxHash, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198()])).filter((h) => Boolean(h))
|
|
3563
3639
|
);
|
|
3564
3640
|
return deposits.filter(
|
|
3565
3641
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -3628,7 +3704,7 @@ function HistoryEntryButton({
|
|
|
3628
3704
|
(badge || unread) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
3705
|
"span",
|
|
3630
3706
|
{
|
|
3631
|
-
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
3707
|
+
className: `rs-history-dot rs-history-dot--${_nullishCoalesce(_optionalChain([badge, 'optionalAccess', _199 => _199.state]), () => ( "progress"))}`,
|
|
3632
3708
|
"aria-hidden": "true"
|
|
3633
3709
|
}
|
|
3634
3710
|
)
|
|
@@ -3678,7 +3754,7 @@ function CdnIcon({
|
|
|
3678
3754
|
}
|
|
3679
3755
|
const isLoading = loadedSrc !== src;
|
|
3680
3756
|
const settleIfAlreadyComplete = (el) => {
|
|
3681
|
-
if (_optionalChain([el, 'optionalAccess',
|
|
3757
|
+
if (_optionalChain([el, 'optionalAccess', _200 => _200.complete])) setLoadedSrc(src);
|
|
3682
3758
|
};
|
|
3683
3759
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3684
3760
|
"img",
|
|
@@ -3915,8 +3991,8 @@ function toPaymentView(order) {
|
|
|
3915
3991
|
const progress = toPaymentProgress(order);
|
|
3916
3992
|
return {
|
|
3917
3993
|
id: order.id,
|
|
3918
|
-
amount: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3919
|
-
currency: _nullishCoalesce(_optionalChain([order, 'access',
|
|
3994
|
+
amount: _nullishCoalesce(_optionalChain([order, 'access', _201 => _201.fiat, 'access', _202 => _202.charged, 'optionalAccess', _203 => _203.total]), () => ( "")),
|
|
3995
|
+
currency: _nullishCoalesce(_optionalChain([order, 'access', _204 => _204.fiat, 'access', _205 => _205.charged, 'optionalAccess', _206 => _206.currency]), () => ( "")),
|
|
3920
3996
|
progress,
|
|
3921
3997
|
terminal: TERMINAL.has(progress)
|
|
3922
3998
|
};
|
|
@@ -3963,7 +4039,7 @@ function bankSupportHref(value) {
|
|
|
3963
4039
|
try {
|
|
3964
4040
|
const url = new URL(value);
|
|
3965
4041
|
return ["https:", "mailto:"].includes(url.protocol) ? url.href : void 0;
|
|
3966
|
-
} catch (
|
|
4042
|
+
} catch (e14) {
|
|
3967
4043
|
return void 0;
|
|
3968
4044
|
}
|
|
3969
4045
|
}
|
|
@@ -4051,12 +4127,12 @@ function BankOrderCard({
|
|
|
4051
4127
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
4128
|
HistoryTransactionLink,
|
|
4053
4129
|
{
|
|
4054
|
-
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4055
|
-
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess',
|
|
4130
|
+
chainId: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _207 => _207.chain]), () => ( order.deliveryChain)),
|
|
4131
|
+
txHash: _nullishCoalesce(_optionalChain([deposit, 'optionalAccess', _208 => _208.txHash]), () => ( deliveryTxHash)),
|
|
4056
4132
|
label: "Crypto deposit"
|
|
4057
4133
|
}
|
|
4058
4134
|
),
|
|
4059
|
-
_optionalChain([deposit, 'optionalAccess',
|
|
4135
|
+
_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
4136
|
(needsHelp || status === "failed") && support && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4061
4137
|
"a",
|
|
4062
4138
|
{
|
|
@@ -4084,7 +4160,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4084
4160
|
const entry = useAssetMetadata([token])[_nullishCoalesce(id, () => ( ""))];
|
|
4085
4161
|
const classes = `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd();
|
|
4086
4162
|
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',
|
|
4163
|
+
if (_optionalChain([entry, 'optionalAccess', _213 => _213.status]) === "pending") {
|
|
4088
4164
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4089
4165
|
"span",
|
|
4090
4166
|
{
|
|
@@ -4097,7 +4173,7 @@ function TokenIcon({ token, symbol, className, fallback }) {
|
|
|
4097
4173
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4098
4174
|
CdnIcon,
|
|
4099
4175
|
{
|
|
4100
|
-
src: _optionalChain([entry, 'optionalAccess',
|
|
4176
|
+
src: _optionalChain([entry, 'optionalAccess', _214 => _214.status]) === "ready" ? entry.logo : void 0,
|
|
4101
4177
|
className: classes,
|
|
4102
4178
|
fallback: badge
|
|
4103
4179
|
}
|
|
@@ -4204,23 +4280,23 @@ function resolveCuratedToken(token, chain) {
|
|
|
4204
4280
|
return void 0;
|
|
4205
4281
|
}
|
|
4206
4282
|
function resolveTokenDisplay(token, chain, asset, fallback) {
|
|
4207
|
-
const pending = _optionalChain([asset, 'optionalAccess',
|
|
4283
|
+
const pending = _optionalChain([asset, 'optionalAccess', _215 => _215.status]) === "pending";
|
|
4208
4284
|
const curated = token !== void 0 && chain !== void 0 ? resolveCuratedToken(token, chain) : void 0;
|
|
4209
|
-
const fromAsset = _optionalChain([asset, 'optionalAccess',
|
|
4285
|
+
const fromAsset = _optionalChain([asset, 'optionalAccess', _216 => _216.status]) === "ready" ? asset : void 0;
|
|
4210
4286
|
const hyperCore = chain !== void 0 && isHyperCore(chain);
|
|
4211
4287
|
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',
|
|
4288
|
+
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])));
|
|
4289
|
+
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
4290
|
return {
|
|
4215
|
-
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
4291
|
+
symbol: _nullishCoalesce(_nullishCoalesce(curatedSymbol, () => ( _optionalChain([fallback, 'optionalAccess', _224 => _224.symbol]))), () => ( "Token")),
|
|
4216
4292
|
decimals,
|
|
4217
|
-
logo: _optionalChain([fromAsset, 'optionalAccess',
|
|
4293
|
+
logo: _optionalChain([fromAsset, 'optionalAccess', _225 => _225.logo]),
|
|
4218
4294
|
curated: curatedSymbol !== void 0,
|
|
4219
4295
|
pending
|
|
4220
4296
|
};
|
|
4221
4297
|
}
|
|
4222
4298
|
function toAssetRef(ref) {
|
|
4223
|
-
return _optionalChain([ref, 'optionalAccess',
|
|
4299
|
+
return _optionalChain([ref, 'optionalAccess', _226 => _226.chain]) !== void 0 && ref.address ? { chain: ref.chain, address: ref.address } : void 0;
|
|
4224
4300
|
}
|
|
4225
4301
|
function useTokenDisplays(refs) {
|
|
4226
4302
|
const { catalog } = useChainCatalog();
|
|
@@ -4231,16 +4307,16 @@ function useTokenDisplays(refs) {
|
|
|
4231
4307
|
);
|
|
4232
4308
|
const assets = useAssetMetadata(refs.map(toAssetRef));
|
|
4233
4309
|
const key = refs.map(
|
|
4234
|
-
(ref) => `${String(_optionalChain([ref, 'optionalAccess',
|
|
4310
|
+
(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
4311
|
).join("|");
|
|
4236
4312
|
return _react.useMemo.call(void 0,
|
|
4237
4313
|
() => refs.map((ref) => {
|
|
4238
|
-
const id = assetIdFor(_optionalChain([ref, 'optionalAccess',
|
|
4314
|
+
const id = assetIdFor(_optionalChain([ref, 'optionalAccess', _233 => _233.chain]), _optionalChain([ref, 'optionalAccess', _234 => _234.address]));
|
|
4239
4315
|
return resolveTokenDisplay(
|
|
4240
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4241
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4316
|
+
_optionalChain([ref, 'optionalAccess', _235 => _235.address]),
|
|
4317
|
+
_optionalChain([ref, 'optionalAccess', _236 => _236.chain]),
|
|
4242
4318
|
id ? assets[id] : void 0,
|
|
4243
|
-
_optionalChain([ref, 'optionalAccess',
|
|
4319
|
+
_optionalChain([ref, 'optionalAccess', _237 => _237.fallback])
|
|
4244
4320
|
);
|
|
4245
4321
|
}),
|
|
4246
4322
|
// `refs` enters through `key`.
|
|
@@ -4271,7 +4347,7 @@ function formatDate(iso) {
|
|
|
4271
4347
|
month: "short",
|
|
4272
4348
|
year: "numeric"
|
|
4273
4349
|
});
|
|
4274
|
-
} catch (
|
|
4350
|
+
} catch (e15) {
|
|
4275
4351
|
return iso;
|
|
4276
4352
|
}
|
|
4277
4353
|
}
|
|
@@ -4286,7 +4362,7 @@ function formatAmount(rawAmount, decimals) {
|
|
|
4286
4362
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
4287
4363
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
4288
4364
|
return `${whole}.${frac}`;
|
|
4289
|
-
} catch (
|
|
4365
|
+
} catch (e16) {
|
|
4290
4366
|
return rawAmount;
|
|
4291
4367
|
}
|
|
4292
4368
|
}
|
|
@@ -4311,7 +4387,7 @@ function DepositHistoryPanel({
|
|
|
4311
4387
|
}) {
|
|
4312
4388
|
const rootRef = _react.useRef.call(void 0, null);
|
|
4313
4389
|
_react.useEffect.call(void 0, () => {
|
|
4314
|
-
_optionalChain([rootRef, 'access',
|
|
4390
|
+
_optionalChain([rootRef, 'access', _238 => _238.current, 'optionalAccess', _239 => _239.toggleAttribute, 'call', _240 => _240("inert", Boolean(obscured))]);
|
|
4315
4391
|
}, [obscured]);
|
|
4316
4392
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
4317
4393
|
(e) => {
|
|
@@ -4345,7 +4421,7 @@ function DepositHistoryPanel({
|
|
|
4345
4421
|
_react.useEffect.call(void 0, () => {
|
|
4346
4422
|
const nextBoundary = timingPresentations.reduce(
|
|
4347
4423
|
(earliest, presentation) => {
|
|
4348
|
-
const next = _optionalChain([presentation, 'optionalAccess',
|
|
4424
|
+
const next = _optionalChain([presentation, 'optionalAccess', _241 => _241.nextTransitionAtMs]);
|
|
4349
4425
|
if (next === void 0) return earliest;
|
|
4350
4426
|
return earliest === void 0 || next < earliest ? next : earliest;
|
|
4351
4427
|
},
|
|
@@ -4419,7 +4495,7 @@ function DepositHistoryPanel({
|
|
|
4419
4495
|
]
|
|
4420
4496
|
}
|
|
4421
4497
|
),
|
|
4422
|
-
(isLoading || _optionalChain([bankHistory, 'optionalAccess',
|
|
4498
|
+
(isLoading || _optionalChain([bankHistory, 'optionalAccess', _242 => _242.loading])) && deposits.length === 0 && !_optionalChain([bankHistory, 'optionalAccess', _243 => _243.orders, 'access', _244 => _244.length]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4423
4499
|
/* @__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
4500
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4425
4501
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
@@ -4433,18 +4509,18 @@ function DepositHistoryPanel({
|
|
|
4433
4509
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
4434
4510
|
] })
|
|
4435
4511
|
] }),
|
|
4436
|
-
_optionalChain([bankHistory, 'optionalAccess',
|
|
4437
|
-
!isLoading && !error && !_optionalChain([bankHistory, 'optionalAccess',
|
|
4512
|
+
_optionalChain([bankHistory, 'optionalAccess', _245 => _245.error]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { role: "status", children: bankHistory.error }),
|
|
4513
|
+
!isLoading && !error && !_optionalChain([bankHistory, 'optionalAccess', _246 => _246.loading]) && !_optionalChain([bankHistory, 'optionalAccess', _247 => _247.error]) && !_optionalChain([bankHistory, 'optionalAccess', _248 => _248.orders, 'access', _249 => _249.length]) && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4438
4514
|
/* @__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
4515
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4440
4516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
4441
4517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
4442
4518
|
] })
|
|
4443
4519
|
] }),
|
|
4444
|
-
(visibleDeposits.length > 0 || Boolean(_optionalChain([bankHistory, 'optionalAccess',
|
|
4520
|
+
(visibleDeposits.length > 0 || Boolean(_optionalChain([bankHistory, 'optionalAccess', _250 => _250.orders, 'access', _251 => _251.length]))) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
4445
4521
|
[
|
|
4446
4522
|
...visibleDeposits.filter(
|
|
4447
|
-
(deposit) => !_optionalChain([bankHistory, 'optionalAccess',
|
|
4523
|
+
(deposit) => !_optionalChain([bankHistory, 'optionalAccess', _252 => _252.orders, 'access', _253 => _253.some, 'call', _254 => _254(
|
|
4448
4524
|
(order) => order.stages.delivery.status === "completed" && order.stages.delivery.depositId === deposit.id
|
|
4449
4525
|
)])
|
|
4450
4526
|
).map((deposit, i) => ({
|
|
@@ -4463,7 +4539,7 @@ function DepositHistoryPanel({
|
|
|
4463
4539
|
deposit.txHash || i
|
|
4464
4540
|
)
|
|
4465
4541
|
})),
|
|
4466
|
-
...(_nullishCoalesce(_optionalChain([bankHistory, 'optionalAccess',
|
|
4542
|
+
...(_nullishCoalesce(_optionalChain([bankHistory, 'optionalAccess', _255 => _255.orders]), () => ( []))).map((order) => {
|
|
4467
4543
|
const delivery = order.stages.delivery;
|
|
4468
4544
|
const linked = delivery.status === "completed" ? visibleDeposits.find(
|
|
4469
4545
|
(deposit) => deposit.id === delivery.depositId
|
|
@@ -4485,7 +4561,7 @@ function DepositHistoryPanel({
|
|
|
4485
4561
|
};
|
|
4486
4562
|
})
|
|
4487
4563
|
].sort((a, b) => b.createdAt.localeCompare(a.createdAt)).map((entry) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: entry.content }, entry.id)),
|
|
4488
|
-
_optionalChain([bankHistory, 'optionalAccess',
|
|
4564
|
+
_optionalChain([bankHistory, 'optionalAccess', _256 => _256.hasMore]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4489
4565
|
"button",
|
|
4490
4566
|
{
|
|
4491
4567
|
type: "button",
|
|
@@ -4549,7 +4625,7 @@ function HistoryCard({
|
|
|
4549
4625
|
setExpanded(next);
|
|
4550
4626
|
const depositId = _nullishCoalesce(deposit.id, () => ( deposit.txHash));
|
|
4551
4627
|
if (!next || !depositId) return;
|
|
4552
|
-
_optionalChain([onRowView, 'optionalCall',
|
|
4628
|
+
_optionalChain([onRowView, 'optionalCall', _257 => _257({
|
|
4553
4629
|
depositId,
|
|
4554
4630
|
status,
|
|
4555
4631
|
recoverable: eligible !== null,
|
|
@@ -4622,7 +4698,7 @@ function HistoryCard({
|
|
|
4622
4698
|
recoverable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4623
4699
|
Button,
|
|
4624
4700
|
{
|
|
4625
|
-
onClick: () => _optionalChain([onRecover, 'optionalCall',
|
|
4701
|
+
onClick: () => _optionalChain([onRecover, 'optionalCall', _258 => _258(recoverable)]),
|
|
4626
4702
|
fullWidth: true,
|
|
4627
4703
|
className: "rs-history-card-recover",
|
|
4628
4704
|
children: [
|
|
@@ -4687,7 +4763,7 @@ function ListRow({
|
|
|
4687
4763
|
if (disabled) return;
|
|
4688
4764
|
if (e.key === "Enter" || e.key === " ") {
|
|
4689
4765
|
e.preventDefault();
|
|
4690
|
-
_optionalChain([onClick, 'optionalCall',
|
|
4766
|
+
_optionalChain([onClick, 'optionalCall', _259 => _259(e)]);
|
|
4691
4767
|
}
|
|
4692
4768
|
};
|
|
4693
4769
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4697,7 +4773,7 @@ function ListRow({
|
|
|
4697
4773
|
role: "button",
|
|
4698
4774
|
tabIndex: disabled ? -1 : 0,
|
|
4699
4775
|
"aria-disabled": disabled || void 0,
|
|
4700
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
4776
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _260 => _260(e)]),
|
|
4701
4777
|
onKeyDown: handleKey,
|
|
4702
4778
|
children: inner
|
|
4703
4779
|
}
|
|
@@ -4755,7 +4831,7 @@ var RECOVERY_LOOKUP_MISS_COPY = {
|
|
|
4755
4831
|
};
|
|
4756
4832
|
function classifyRecoveryLookup(rows, options = {}) {
|
|
4757
4833
|
const inScope = options.recipient ? rows.filter(
|
|
4758
|
-
(row) => _optionalChain([row, 'access',
|
|
4834
|
+
(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
4835
|
) : rows;
|
|
4760
4836
|
const eligible = inScope.map((row) => toRecoverableDeposit(row, options)).filter((deposit) => deposit !== null);
|
|
4761
4837
|
return {
|
|
@@ -4783,7 +4859,7 @@ function RecoveryLookupScreen({
|
|
|
4783
4859
|
const valid = isRecoveryTxHash(trimmed);
|
|
4784
4860
|
_react.useEffect.call(void 0, () => {
|
|
4785
4861
|
if (trimmed.length > 0 && !valid) {
|
|
4786
|
-
_optionalChain([onInvalidRef, 'access',
|
|
4862
|
+
_optionalChain([onInvalidRef, 'access', _267 => _267.current, 'optionalCall', _268 => _268()]);
|
|
4787
4863
|
}
|
|
4788
4864
|
}, [trimmed, valid, onInvalidRef]);
|
|
4789
4865
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -4864,7 +4940,7 @@ function tokenAmountToNumber(rawAmount, decimals) {
|
|
|
4864
4940
|
try {
|
|
4865
4941
|
const value = Number(_viem.formatUnits.call(void 0, BigInt(rawAmount), decimals));
|
|
4866
4942
|
return Number.isFinite(value) ? value : void 0;
|
|
4867
|
-
} catch (
|
|
4943
|
+
} catch (e17) {
|
|
4868
4944
|
return void 0;
|
|
4869
4945
|
}
|
|
4870
4946
|
}
|
|
@@ -4909,7 +4985,7 @@ function formatQuotedReceive(output, fallbackSymbol) {
|
|
|
4909
4985
|
let raw;
|
|
4910
4986
|
try {
|
|
4911
4987
|
raw = BigInt(output.amount);
|
|
4912
|
-
} catch (
|
|
4988
|
+
} catch (e18) {
|
|
4913
4989
|
return void 0;
|
|
4914
4990
|
}
|
|
4915
4991
|
if (raw <= 0n) return void 0;
|
|
@@ -4946,7 +5022,7 @@ function formatRecoveryAmount(amountRaw, decimals, symbol) {
|
|
|
4946
5022
|
function toBigInt(value) {
|
|
4947
5023
|
try {
|
|
4948
5024
|
return BigInt(value || "0");
|
|
4949
|
-
} catch (
|
|
5025
|
+
} catch (e19) {
|
|
4950
5026
|
return 0n;
|
|
4951
5027
|
}
|
|
4952
5028
|
}
|
|
@@ -5080,7 +5156,7 @@ async function submitSignedRecovery(params) {
|
|
|
5080
5156
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
5081
5157
|
// every other backend call. Without it this path would be invisible in the
|
|
5082
5158
|
// per-client version telemetry the processor records.
|
|
5083
|
-
headers:
|
|
5159
|
+
headers: _chunkD3R3O4CYcjs.serviceHeaders.call(void 0, ),
|
|
5084
5160
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
5085
5161
|
// precision well before that range.
|
|
5086
5162
|
body: JSON.stringify({ depositId, destination, signature })
|
|
@@ -5550,17 +5626,17 @@ function HistoryFallbackFlow({
|
|
|
5550
5626
|
),
|
|
5551
5627
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list", children: matches.map((match, i) => {
|
|
5552
5628
|
const display = matchDisplays[i];
|
|
5553
|
-
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess',
|
|
5629
|
+
const symbol = _nullishCoalesce(_optionalChain([display, 'optionalAccess', _269 => _269.symbol]), () => ( "Token"));
|
|
5554
5630
|
const { amount, chainName } = describeRecoveryDeposit({
|
|
5555
5631
|
chainId: match.sourceChainId,
|
|
5556
5632
|
amountRaw: match.amountRaw,
|
|
5557
5633
|
symbol,
|
|
5558
|
-
decimals: _optionalChain([display, 'optionalAccess',
|
|
5634
|
+
decimals: _optionalChain([display, 'optionalAccess', _270 => _270.decimals])
|
|
5559
5635
|
});
|
|
5560
5636
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5561
5637
|
ListRow,
|
|
5562
5638
|
{
|
|
5563
|
-
leadingMedia: _optionalChain([display, 'optionalAccess',
|
|
5639
|
+
leadingMedia: _optionalChain([display, 'optionalAccess', _271 => _271.logo]),
|
|
5564
5640
|
title: `${amount} ${symbol}`,
|
|
5565
5641
|
subtitle: chainName,
|
|
5566
5642
|
onClick: () => selectMatch(match)
|
|
@@ -5700,9 +5776,9 @@ function RecoveryReviewScreen({
|
|
|
5700
5776
|
_react.useEffect.call(void 0, () => {
|
|
5701
5777
|
if (destination.length === 0) return;
|
|
5702
5778
|
if (isSelfDestination) {
|
|
5703
|
-
_optionalChain([onDestinationIsDepositAddressRef, 'access',
|
|
5779
|
+
_optionalChain([onDestinationIsDepositAddressRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273()]);
|
|
5704
5780
|
} else if (!destinationValid) {
|
|
5705
|
-
_optionalChain([onDestinationInvalidRef, 'access',
|
|
5781
|
+
_optionalChain([onDestinationInvalidRef, 'access', _274 => _274.current, 'optionalCall', _275 => _275()]);
|
|
5706
5782
|
}
|
|
5707
5783
|
}, [
|
|
5708
5784
|
destination,
|
|
@@ -5874,11 +5950,11 @@ function HistoryRecoveryFlow({
|
|
|
5874
5950
|
} catch (err) {
|
|
5875
5951
|
const recoveryError = err instanceof RecoveryError ? err : void 0;
|
|
5876
5952
|
setError(
|
|
5877
|
-
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5953
|
+
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _276 => _276.message]), () => ( formatUserError(
|
|
5878
5954
|
err instanceof Error ? err.message : "Recovery failed"
|
|
5879
5955
|
)))
|
|
5880
5956
|
);
|
|
5881
|
-
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5957
|
+
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _277 => _277.retryable]), () => ( true));
|
|
5882
5958
|
setRetryable(canRetry);
|
|
5883
5959
|
setPhase("failed");
|
|
5884
5960
|
const reason = claimFailureReasonForError(err);
|
|
@@ -6029,8 +6105,8 @@ function HistoryOverlay({
|
|
|
6029
6105
|
const endAttempt = _react.useCallback.call(void 0,
|
|
6030
6106
|
(source, reason) => {
|
|
6031
6107
|
const claim = claimControllerRef.current;
|
|
6032
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6033
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6108
|
+
_optionalChain([claim, 'optionalAccess', _278 => _278.abandon, 'call', _279 => _279(reason)]);
|
|
6109
|
+
_optionalChain([claim, 'optionalAccess', _280 => _280.close, 'call', _281 => _281(source)]);
|
|
6034
6110
|
claimControllerRef.current = null;
|
|
6035
6111
|
setAttempt(null);
|
|
6036
6112
|
},
|
|
@@ -6088,8 +6164,8 @@ function HistoryOverlay({
|
|
|
6088
6164
|
if (!attempt) return;
|
|
6089
6165
|
return () => {
|
|
6090
6166
|
const claim = claimControllerRef.current;
|
|
6091
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6092
|
-
_optionalChain([claim, 'optionalAccess',
|
|
6167
|
+
_optionalChain([claim, 'optionalAccess', _282 => _282.abandon, 'call', _283 => _283("modal_close")]);
|
|
6168
|
+
_optionalChain([claim, 'optionalAccess', _284 => _284.close, 'call', _285 => _285("host_controlled")]);
|
|
6093
6169
|
};
|
|
6094
6170
|
}, [attempt]);
|
|
6095
6171
|
const claimSessionProperties = _react.useMemo.call(void 0,
|
|
@@ -6115,7 +6191,7 @@ function HistoryOverlay({
|
|
|
6115
6191
|
HistoryRecoveryFlow,
|
|
6116
6192
|
{
|
|
6117
6193
|
deposit: recovering,
|
|
6118
|
-
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess',
|
|
6194
|
+
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess', _286 => _286.entrySource]), () => ( "history_row")),
|
|
6119
6195
|
backendUrl,
|
|
6120
6196
|
signRecovery,
|
|
6121
6197
|
debug,
|
|
@@ -6271,7 +6347,7 @@ function useHistoryPanel({
|
|
|
6271
6347
|
}, [isOpen, badgeState2.nextExpiryAt]);
|
|
6272
6348
|
const openPanel = _react.useCallback.call(void 0, () => {
|
|
6273
6349
|
setIsPanelOpen(true);
|
|
6274
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6350
|
+
_optionalChain([analytics, 'optionalAccess', _287 => _287.visitOpened, 'call', _288 => _288(badge)]);
|
|
6275
6351
|
if (!loadedRef.current || staleRef.current) {
|
|
6276
6352
|
fetchHistory("initial");
|
|
6277
6353
|
}
|
|
@@ -6279,10 +6355,10 @@ function useHistoryPanel({
|
|
|
6279
6355
|
const closePanel = _react.useCallback.call(void 0, () => {
|
|
6280
6356
|
if (recovering) return;
|
|
6281
6357
|
setIsPanelOpen(false);
|
|
6282
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6358
|
+
_optionalChain([analytics, 'optionalAccess', _289 => _289.visitEnded, 'call', _290 => _290()]);
|
|
6283
6359
|
}, [analytics, recovering]);
|
|
6284
6360
|
const loadMore = _react.useCallback.call(void 0, () => {
|
|
6285
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6361
|
+
_optionalChain([analytics, 'optionalAccess', _291 => _291.loadMore, 'call', _292 => _292(filterVisibleDeposits(deposits).length)]);
|
|
6286
6362
|
fetchHistory("more");
|
|
6287
6363
|
}, [analytics, deposits, fetchHistory]);
|
|
6288
6364
|
const markStale = _react.useCallback.call(void 0, () => {
|
|
@@ -6310,7 +6386,7 @@ function useHistoryPanel({
|
|
|
6310
6386
|
_react.useEffect.call(void 0, () => {
|
|
6311
6387
|
if (isOpen) return;
|
|
6312
6388
|
setIsPanelOpen(false);
|
|
6313
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
6389
|
+
_optionalChain([analytics, 'optionalAccess', _293 => _293.visitEnded, 'call', _294 => _294()]);
|
|
6314
6390
|
setDeposits([]);
|
|
6315
6391
|
setHasMore(false);
|
|
6316
6392
|
setError(null);
|
|
@@ -6469,11 +6545,11 @@ var NOTHING_TO_STOP = () => {
|
|
|
6469
6545
|
};
|
|
6470
6546
|
function resolveThemeMode(mode) {
|
|
6471
6547
|
if (mode !== "system") return mode;
|
|
6472
|
-
return _optionalChain([globalThis, 'access',
|
|
6548
|
+
return _optionalChain([globalThis, 'access', _295 => _295.matchMedia, 'optionalCall', _296 => _296(DARK_SCHEME_QUERY), 'access', _297 => _297.matches]) ? "dark" : "light";
|
|
6473
6549
|
}
|
|
6474
6550
|
function followSystemAppearance(mode, onChange) {
|
|
6475
6551
|
if (mode !== "system") return NOTHING_TO_STOP;
|
|
6476
|
-
const query = _optionalChain([globalThis, 'access',
|
|
6552
|
+
const query = _optionalChain([globalThis, 'access', _298 => _298.matchMedia, 'optionalCall', _299 => _299(DARK_SCHEME_QUERY)]);
|
|
6477
6553
|
if (!query) return NOTHING_TO_STOP;
|
|
6478
6554
|
query.addEventListener("change", onChange);
|
|
6479
6555
|
return () => query.removeEventListener("change", onChange);
|
|
@@ -6481,22 +6557,22 @@ function followSystemAppearance(mode, onChange) {
|
|
|
6481
6557
|
function applyTheme(element, theme) {
|
|
6482
6558
|
if (!element) return NOTHING_TO_STOP;
|
|
6483
6559
|
const parent = element.parentElement;
|
|
6484
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
6560
|
+
const targets = _optionalChain([parent, 'optionalAccess', _300 => _300.classList, 'access', _301 => _301.contains, 'call', _302 => _302("rs-modal-content")]) ? [element, parent] : [element];
|
|
6485
6561
|
const paintMode = () => {
|
|
6486
|
-
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess',
|
|
6562
|
+
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess', _303 => _303.mode]));
|
|
6487
6563
|
for (const t of targets) {
|
|
6488
6564
|
if (resolved) t.setAttribute("data-theme", resolved);
|
|
6489
6565
|
else t.removeAttribute("data-theme");
|
|
6490
6566
|
}
|
|
6491
6567
|
};
|
|
6492
6568
|
paintMode();
|
|
6493
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6569
|
+
if (_optionalChain([theme, 'optionalAccess', _304 => _304.fontColor])) {
|
|
6494
6570
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
6495
6571
|
}
|
|
6496
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6572
|
+
if (_optionalChain([theme, 'optionalAccess', _305 => _305.iconColor])) {
|
|
6497
6573
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
6498
6574
|
}
|
|
6499
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6575
|
+
if (_optionalChain([theme, 'optionalAccess', _306 => _306.ctaColor])) {
|
|
6500
6576
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
6501
6577
|
if (derived) {
|
|
6502
6578
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -6521,25 +6597,25 @@ function applyTheme(element, theme) {
|
|
|
6521
6597
|
}
|
|
6522
6598
|
} else {
|
|
6523
6599
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
6524
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6600
|
+
if (_optionalChain([theme, 'optionalAccess', _307 => _307.ctaHoverColor])) {
|
|
6525
6601
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
6526
6602
|
}
|
|
6527
6603
|
}
|
|
6528
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6604
|
+
if (_optionalChain([theme, 'optionalAccess', _308 => _308.borderColor])) {
|
|
6529
6605
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
6530
6606
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
6531
6607
|
}
|
|
6532
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6608
|
+
if (_optionalChain([theme, 'optionalAccess', _309 => _309.backgroundColor])) {
|
|
6533
6609
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
6534
6610
|
}
|
|
6535
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
6611
|
+
if (_optionalChain([theme, 'optionalAccess', _310 => _310.radius])) {
|
|
6536
6612
|
const scale = RADIUS_SCALE[theme.radius];
|
|
6537
6613
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
6538
6614
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
6539
6615
|
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
6540
6616
|
setVar(targets, "--rs-radius", scale.md);
|
|
6541
6617
|
}
|
|
6542
|
-
return followSystemAppearance(_optionalChain([theme, 'optionalAccess',
|
|
6618
|
+
return followSystemAppearance(_optionalChain([theme, 'optionalAccess', _311 => _311.mode]), paintMode);
|
|
6543
6619
|
}
|
|
6544
6620
|
|
|
6545
6621
|
// src/core/removed-props.ts
|
|
@@ -6643,20 +6719,20 @@ function sinkFor(source) {
|
|
|
6643
6719
|
if (source.modal === "deposit") {
|
|
6644
6720
|
const at2 = () => source.controllerRef.current;
|
|
6645
6721
|
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',
|
|
6722
|
+
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)) })]),
|
|
6723
|
+
rowViewed: (detail) => _optionalChain([at2, 'call', _317 => _317(), 'optionalAccess', _318 => _318.historyRowViewed, 'call', _319 => _319(detail)]),
|
|
6724
|
+
loadMore: (detail) => _optionalChain([at2, 'call', _320 => _320(), 'optionalAccess', _321 => _321.historyLoadMore, 'call', _322 => _322(detail)]),
|
|
6725
|
+
fallbackOpened: (detail) => _optionalChain([at2, 'call', _323 => _323(), 'optionalAccess', _324 => _324.historyFallbackOpened, 'call', _325 => _325(detail)]),
|
|
6726
|
+
recoveryStarted: (detail) => _optionalChain([at2, 'call', _326 => _326(), 'optionalAccess', _327 => _327.historyRecoveryStarted, 'call', _328 => _328(detail)])
|
|
6651
6727
|
};
|
|
6652
6728
|
}
|
|
6653
6729
|
const at = () => source.controllerRef.current;
|
|
6654
6730
|
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',
|
|
6731
|
+
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)) })]),
|
|
6732
|
+
rowViewed: (detail) => _optionalChain([at, 'call', _334 => _334(), 'optionalAccess', _335 => _335.historyRowViewed, 'call', _336 => _336(detail)]),
|
|
6733
|
+
loadMore: (detail) => _optionalChain([at, 'call', _337 => _337(), 'optionalAccess', _338 => _338.historyLoadMore, 'call', _339 => _339(detail)]),
|
|
6734
|
+
fallbackOpened: (detail) => _optionalChain([at, 'call', _340 => _340(), 'optionalAccess', _341 => _341.historyFallbackOpened, 'call', _342 => _342(detail)]),
|
|
6735
|
+
recoveryStarted: (detail) => _optionalChain([at, 'call', _343 => _343(), 'optionalAccess', _344 => _344.historyRecoveryStarted, 'call', _345 => _345(detail)])
|
|
6660
6736
|
};
|
|
6661
6737
|
}
|
|
6662
6738
|
function badgeState(badge) {
|
|
@@ -6682,7 +6758,7 @@ function createHistoryAnalytics(source) {
|
|
|
6682
6758
|
sink.opened({
|
|
6683
6759
|
history_visit_id: visitId,
|
|
6684
6760
|
badge: badgeState(badge),
|
|
6685
|
-
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
6761
|
+
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess', _346 => _346.count]), () => ( 0))
|
|
6686
6762
|
});
|
|
6687
6763
|
},
|
|
6688
6764
|
visitEnded() {
|
|
@@ -6746,7 +6822,7 @@ function resolveChain(targetChain) {
|
|
|
6746
6822
|
return _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, targetChain);
|
|
6747
6823
|
}
|
|
6748
6824
|
function resolveToken(targetToken) {
|
|
6749
|
-
const raw = _optionalChain([targetToken, 'optionalAccess',
|
|
6825
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _347 => _347.trim, 'call', _348 => _348()]);
|
|
6750
6826
|
if (!raw) return void 0;
|
|
6751
6827
|
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
6752
6828
|
if (BASE58_TOKEN.test(raw)) return raw;
|
|
@@ -6804,8 +6880,8 @@ function Tooltip({ content, children, className }) {
|
|
|
6804
6880
|
function handleOutside(event) {
|
|
6805
6881
|
const target = event.target;
|
|
6806
6882
|
if (!target) return;
|
|
6807
|
-
if (_optionalChain([triggerRef, 'access',
|
|
6808
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
6883
|
+
if (_optionalChain([triggerRef, 'access', _349 => _349.current, 'optionalAccess', _350 => _350.contains, 'call', _351 => _351(target)])) return;
|
|
6884
|
+
if (_optionalChain([bubbleRef, 'access', _352 => _352.current, 'optionalAccess', _353 => _353.contains, 'call', _354 => _354(target)])) return;
|
|
6809
6885
|
setOpen(false);
|
|
6810
6886
|
}
|
|
6811
6887
|
function handleKey(event) {
|
|
@@ -7035,7 +7111,7 @@ function asNumber(value) {
|
|
|
7035
7111
|
const trimmed = value.trim();
|
|
7036
7112
|
if (!trimmed) return void 0;
|
|
7037
7113
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
7038
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
7114
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _355 => _355[1]])) {
|
|
7039
7115
|
const parsed2 = Number(caipMatch[1]);
|
|
7040
7116
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
7041
7117
|
}
|
|
@@ -7054,24 +7130,24 @@ function asAddress(value) {
|
|
|
7054
7130
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
7055
7131
|
}
|
|
7056
7132
|
function getEventTxHash(event) {
|
|
7057
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7133
|
+
if (!_optionalChain([event, 'optionalAccess', _356 => _356.type])) return void 0;
|
|
7058
7134
|
if (event.type === "deposit-received") {
|
|
7059
|
-
return asString(_optionalChain([event, 'access',
|
|
7135
|
+
return asString(_optionalChain([event, 'access', _357 => _357.data, 'optionalAccess', _358 => _358.transactionHash]));
|
|
7060
7136
|
}
|
|
7061
7137
|
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',
|
|
7138
|
+
const deposit = isRecord(_optionalChain([event, 'access', _359 => _359.data, 'optionalAccess', _360 => _360.deposit])) ? event.data.deposit : void 0;
|
|
7139
|
+
const source = isRecord(_optionalChain([event, 'access', _361 => _361.data, 'optionalAccess', _362 => _362.source])) ? event.data.source : void 0;
|
|
7140
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _363 => _363.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _364 => _364.transactionHash]))));
|
|
7065
7141
|
}
|
|
7066
7142
|
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',
|
|
7143
|
+
const deposit = isRecord(_optionalChain([event, 'access', _365 => _365.data, 'optionalAccess', _366 => _366.deposit])) ? event.data.deposit : void 0;
|
|
7144
|
+
const source = isRecord(_optionalChain([event, 'access', _367 => _367.data, 'optionalAccess', _368 => _368.source])) ? event.data.source : void 0;
|
|
7145
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _369 => _369.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _370 => _370.transactionHash]))));
|
|
7070
7146
|
}
|
|
7071
7147
|
return void 0;
|
|
7072
7148
|
}
|
|
7073
7149
|
function getEventSourceDetails(event) {
|
|
7074
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7150
|
+
if (!_optionalChain([event, 'optionalAccess', _371 => _371.type]) || !isRecord(event.data)) return {};
|
|
7075
7151
|
if (event.type === "deposit-received") {
|
|
7076
7152
|
return {
|
|
7077
7153
|
chainId: asNumber(event.data.chain),
|
|
@@ -7083,9 +7159,9 @@ function getEventSourceDetails(event) {
|
|
|
7083
7159
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
7084
7160
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
7085
7161
|
return {
|
|
7086
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
7087
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
7088
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
7162
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _372 => _372.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _373 => _373.chain])))),
|
|
7163
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _374 => _374.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _375 => _375.amount])))),
|
|
7164
|
+
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
7165
|
};
|
|
7090
7166
|
}
|
|
7091
7167
|
return {};
|
|
@@ -7099,7 +7175,7 @@ function asChain(value) {
|
|
|
7099
7175
|
return asNumber(value);
|
|
7100
7176
|
}
|
|
7101
7177
|
function getEventDestinationDetails(event) {
|
|
7102
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7178
|
+
if (!_optionalChain([event, 'optionalAccess', _379 => _379.type]) || !isRecord(event.data)) return {};
|
|
7103
7179
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
7104
7180
|
return {};
|
|
7105
7181
|
}
|
|
@@ -7109,14 +7185,14 @@ function getEventDestinationDetails(event) {
|
|
|
7109
7185
|
return {
|
|
7110
7186
|
chainId: asChain(destination.chain),
|
|
7111
7187
|
amount: asAmount(destination.amount),
|
|
7112
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
7188
|
+
token: _optionalChain([token, 'optionalAccess', _380 => _380.trim, 'call', _381 => _381()]) || void 0
|
|
7113
7189
|
};
|
|
7114
7190
|
}
|
|
7115
7191
|
function isDepositEvent(event) {
|
|
7116
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7192
|
+
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
7193
|
}
|
|
7118
7194
|
function isFailedEvent(event) {
|
|
7119
|
-
return _optionalChain([event, 'optionalAccess',
|
|
7195
|
+
return _optionalChain([event, 'optionalAccess', _387 => _387.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _388 => _388.type]) === "error";
|
|
7120
7196
|
}
|
|
7121
7197
|
function isHexString(value) {
|
|
7122
7198
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -7128,7 +7204,7 @@ function txRefsMatch(a, b) {
|
|
|
7128
7204
|
return a === b;
|
|
7129
7205
|
}
|
|
7130
7206
|
function formatBridgeFailedMessage(event) {
|
|
7131
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7207
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _389 => _389.data]), () => ( {}));
|
|
7132
7208
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
7133
7209
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
7134
7210
|
function toUserFacingFailure(raw) {
|
|
@@ -7156,7 +7232,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
7156
7232
|
return { message: "Bridge failed" };
|
|
7157
7233
|
}
|
|
7158
7234
|
function failureMessageForEvent(event) {
|
|
7159
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7235
|
+
if (_optionalChain([event, 'optionalAccess', _390 => _390.type]) === "error") {
|
|
7160
7236
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
7161
7237
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
7162
7238
|
}
|
|
@@ -7171,7 +7247,7 @@ function addressFor(token) {
|
|
|
7171
7247
|
return token.chainId === "solana" ? "native" : ZERO_ADDRESS2;
|
|
7172
7248
|
}
|
|
7173
7249
|
function useTokenPrices(tokens) {
|
|
7174
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
7250
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _391 => _391.symbol])));
|
|
7175
7251
|
const refs = defined.map((token) => ({
|
|
7176
7252
|
chain: token.chainId,
|
|
7177
7253
|
address: addressFor(token)
|
|
@@ -7320,7 +7396,7 @@ function loadPhaseTimings(txHash) {
|
|
|
7320
7396
|
const parsed = JSON.parse(raw);
|
|
7321
7397
|
if (typeof parsed.startedAt !== "number") return null;
|
|
7322
7398
|
return parsed;
|
|
7323
|
-
} catch (
|
|
7399
|
+
} catch (e20) {
|
|
7324
7400
|
return null;
|
|
7325
7401
|
}
|
|
7326
7402
|
}
|
|
@@ -7331,7 +7407,7 @@ function savePhaseTimings(txHash, timings) {
|
|
|
7331
7407
|
`${PHASE_TIMINGS_PREFIX}:${txHash}`,
|
|
7332
7408
|
JSON.stringify(timings)
|
|
7333
7409
|
);
|
|
7334
|
-
} catch (
|
|
7410
|
+
} catch (e21) {
|
|
7335
7411
|
}
|
|
7336
7412
|
}
|
|
7337
7413
|
function isEventForTx(event, txHash) {
|
|
@@ -7340,12 +7416,12 @@ function isEventForTx(event, txHash) {
|
|
|
7340
7416
|
return txRefsMatch(eventTxHash, txHash);
|
|
7341
7417
|
}
|
|
7342
7418
|
function parseWebhookTimestamp(event) {
|
|
7343
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
7419
|
+
if (typeof _optionalChain([event, 'optionalAccess', _392 => _392.time]) !== "string") return void 0;
|
|
7344
7420
|
const timestamp = Date.parse(event.time);
|
|
7345
7421
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
7346
7422
|
}
|
|
7347
7423
|
function syncPhaseTimings(previous, event) {
|
|
7348
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
7424
|
+
if (!_optionalChain([event, 'optionalAccess', _393 => _393.type])) return previous;
|
|
7349
7425
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
7350
7426
|
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
7427
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -7407,52 +7483,52 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
7407
7483
|
if (state.type === "complete") {
|
|
7408
7484
|
return void 0;
|
|
7409
7485
|
}
|
|
7410
|
-
if (_optionalChain([state, 'access',
|
|
7486
|
+
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
7487
|
return "bridging";
|
|
7412
|
-
if (_optionalChain([state, 'access',
|
|
7488
|
+
if (_optionalChain([state, 'access', _398 => _398.lastEvent, 'optionalAccess', _399 => _399.type]) === "deposit-received") return "received";
|
|
7413
7489
|
return "confirming";
|
|
7414
7490
|
}
|
|
7415
7491
|
function getCompletionDestinationAmount(event) {
|
|
7416
|
-
const amount = _optionalChain([event, 'optionalAccess',
|
|
7492
|
+
const amount = _optionalChain([event, 'optionalAccess', _400 => _400.data, 'optionalAccess', _401 => _401.destination, 'optionalAccess', _402 => _402.amount]);
|
|
7417
7493
|
return typeof amount === "string" ? amount : void 0;
|
|
7418
7494
|
}
|
|
7419
7495
|
function getCompletionDestinationTxHash(event) {
|
|
7420
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
7421
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7422
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
7496
|
+
const eventData = _optionalChain([event, 'optionalAccess', _403 => _403.data]);
|
|
7497
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _404 => _404.swap, 'optionalAccess', _405 => _405.transactionHash]);
|
|
7498
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _406 => _406.destination, 'optionalAccess', _407 => _407.transactionHash]);
|
|
7423
7499
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
7424
7500
|
}
|
|
7425
7501
|
function getTerminalProcessingOutcome(event) {
|
|
7426
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7502
|
+
if (_optionalChain([event, 'optionalAccess', _408 => _408.type]) === "post-bridge-swap-complete") {
|
|
7427
7503
|
return {
|
|
7428
7504
|
type: "complete",
|
|
7429
7505
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7430
7506
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7431
7507
|
};
|
|
7432
7508
|
}
|
|
7433
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7509
|
+
if (_optionalChain([event, 'optionalAccess', _409 => _409.type]) === "post-bridge-swap-failed") {
|
|
7434
7510
|
return {
|
|
7435
7511
|
type: "failed",
|
|
7436
7512
|
message: formatBridgeFailedMessage(event).message
|
|
7437
7513
|
};
|
|
7438
7514
|
}
|
|
7439
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7515
|
+
if (_optionalChain([event, 'optionalAccess', _410 => _410.type]) === "bridge-complete") {
|
|
7440
7516
|
return {
|
|
7441
7517
|
type: "complete",
|
|
7442
7518
|
destinationTxHash: getCompletionDestinationTxHash(event),
|
|
7443
7519
|
destinationAmount: getCompletionDestinationAmount(event)
|
|
7444
7520
|
};
|
|
7445
7521
|
}
|
|
7446
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7522
|
+
if (_optionalChain([event, 'optionalAccess', _411 => _411.type]) === "bridge-failed") {
|
|
7447
7523
|
return {
|
|
7448
7524
|
type: "failed",
|
|
7449
7525
|
message: formatBridgeFailedMessage(event).message
|
|
7450
7526
|
};
|
|
7451
7527
|
}
|
|
7452
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
7528
|
+
if (_optionalChain([event, 'optionalAccess', _412 => _412.type]) === "error") {
|
|
7453
7529
|
return {
|
|
7454
7530
|
type: "failed",
|
|
7455
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
7531
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _413 => _413.data, 'optionalAccess', _414 => _414.message]), () => ( "Unknown error"))
|
|
7456
7532
|
};
|
|
7457
7533
|
}
|
|
7458
7534
|
return null;
|
|
@@ -7460,10 +7536,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
7460
7536
|
function getInitialProcessingState(event, txHash) {
|
|
7461
7537
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
7462
7538
|
const terminal = getTerminalProcessingOutcome(event);
|
|
7463
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7539
|
+
if (_optionalChain([terminal, 'optionalAccess', _415 => _415.type]) === "complete") {
|
|
7464
7540
|
return { type: "complete", lastEvent: event };
|
|
7465
7541
|
}
|
|
7466
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
7542
|
+
if (_optionalChain([terminal, 'optionalAccess', _416 => _416.type]) === "failed") {
|
|
7467
7543
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
7468
7544
|
}
|
|
7469
7545
|
if (isDepositEvent(event)) {
|
|
@@ -7472,7 +7548,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
7472
7548
|
return null;
|
|
7473
7549
|
}
|
|
7474
7550
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
7475
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
7551
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _417 => _417.data, 'optionalAccess', _418 => _418.source, 'optionalAccess', _419 => _419.transactionHash]), () => ( fallbackTxHash));
|
|
7476
7552
|
}
|
|
7477
7553
|
function ProcessingStep({
|
|
7478
7554
|
smartAccount,
|
|
@@ -7552,8 +7628,8 @@ function ProcessingStep({
|
|
|
7552
7628
|
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0,
|
|
7553
7629
|
() => Math.max(0, Math.floor((Date.now() - startTimeRef.current) / 1e3))
|
|
7554
7630
|
);
|
|
7555
|
-
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess',
|
|
7556
|
-
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess',
|
|
7631
|
+
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess', _420 => _420.timing]));
|
|
7632
|
+
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess', _421 => _421.timing]) !== void 0) {
|
|
7557
7633
|
setLatchedTiming(quote.timing);
|
|
7558
7634
|
}
|
|
7559
7635
|
const timingStateRef = _react.useRef.call(void 0, "expected");
|
|
@@ -7584,7 +7660,7 @@ function ProcessingStep({
|
|
|
7584
7660
|
flowLabel
|
|
7585
7661
|
});
|
|
7586
7662
|
const context = processingContextRef.current;
|
|
7587
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7663
|
+
_optionalChain([onDepositCompleteRef, 'access', _422 => _422.current, 'optionalCall', _423 => _423(txHash, void 0, {
|
|
7588
7664
|
amount: context.amount,
|
|
7589
7665
|
sourceChain: context.sourceChain,
|
|
7590
7666
|
sourceToken: context.sourceToken,
|
|
@@ -7617,7 +7693,7 @@ function ProcessingStep({
|
|
|
7617
7693
|
destinationTxHash: outcome.destinationTxHash,
|
|
7618
7694
|
event: event.type
|
|
7619
7695
|
});
|
|
7620
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7696
|
+
_optionalChain([onDepositCompleteRef, 'access', _424 => _424.current, 'optionalCall', _425 => _425(
|
|
7621
7697
|
sourceTxHash2,
|
|
7622
7698
|
outcome.destinationTxHash,
|
|
7623
7699
|
{
|
|
@@ -7638,7 +7714,7 @@ function ProcessingStep({
|
|
|
7638
7714
|
message: outcome.message,
|
|
7639
7715
|
event: event.type
|
|
7640
7716
|
});
|
|
7641
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7717
|
+
_optionalChain([onDepositFailedRef, 'access', _426 => _426.current, 'optionalCall', _427 => _427(txHash, outcome.message)]);
|
|
7642
7718
|
}, [
|
|
7643
7719
|
debug,
|
|
7644
7720
|
onDepositCompleteRef,
|
|
@@ -7649,8 +7725,8 @@ function ProcessingStep({
|
|
|
7649
7725
|
const onSettledChangeRef = _react.useRef.call(void 0, onSettledChange);
|
|
7650
7726
|
onSettledChangeRef.current = onSettledChange;
|
|
7651
7727
|
_react.useEffect.call(void 0, () => {
|
|
7652
|
-
_optionalChain([onSettledChangeRef, 'access',
|
|
7653
|
-
return () => _optionalChain([onSettledChangeRef, 'access',
|
|
7728
|
+
_optionalChain([onSettledChangeRef, 'access', _428 => _428.current, 'optionalCall', _429 => _429(state.type !== "processing")]);
|
|
7729
|
+
return () => _optionalChain([onSettledChangeRef, 'access', _430 => _430.current, 'optionalCall', _431 => _431(false)]);
|
|
7654
7730
|
}, [state.type]);
|
|
7655
7731
|
_react.useEffect.call(void 0, () => {
|
|
7656
7732
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -7676,13 +7752,13 @@ function ProcessingStep({
|
|
|
7676
7752
|
updatePhaseTimings(
|
|
7677
7753
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
7678
7754
|
);
|
|
7679
|
-
}, [_optionalChain([state, 'access',
|
|
7755
|
+
}, [_optionalChain([state, 'access', _432 => _432.lastEvent, 'optionalAccess', _433 => _433.time]), _optionalChain([state, 'access', _434 => _434.lastEvent, 'optionalAccess', _435 => _435.type]), updatePhaseTimings]);
|
|
7680
7756
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
7681
7757
|
_react.useEffect.call(void 0, () => {
|
|
7682
7758
|
let cancelled = false;
|
|
7683
7759
|
let timeoutId;
|
|
7684
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
7685
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7760
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _436 => _436.variant]) === "fiat";
|
|
7761
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _437 => _437.expectedOrderUuid]), () => ( null));
|
|
7686
7762
|
setSwappedFiatContext(null);
|
|
7687
7763
|
if (!isSwappedOrder || !expectedOrderUuid) {
|
|
7688
7764
|
return () => {
|
|
@@ -7713,7 +7789,7 @@ function ProcessingStep({
|
|
|
7713
7789
|
if (isFiatSwappedOrder && !hasFiatReceiptPricing(res)) {
|
|
7714
7790
|
scheduleRetry();
|
|
7715
7791
|
}
|
|
7716
|
-
} catch (
|
|
7792
|
+
} catch (e22) {
|
|
7717
7793
|
scheduleRetry();
|
|
7718
7794
|
}
|
|
7719
7795
|
}
|
|
@@ -7725,8 +7801,8 @@ function ProcessingStep({
|
|
|
7725
7801
|
}, [
|
|
7726
7802
|
service,
|
|
7727
7803
|
isSwappedOrder,
|
|
7728
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7729
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7804
|
+
_optionalChain([swappedContext, 'optionalAccess', _438 => _438.variant]),
|
|
7805
|
+
_optionalChain([swappedContext, 'optionalAccess', _439 => _439.expectedOrderUuid])
|
|
7730
7806
|
]);
|
|
7731
7807
|
_react.useEffect.call(void 0, () => {
|
|
7732
7808
|
if (directTransfer) return;
|
|
@@ -7752,18 +7828,18 @@ function ProcessingStep({
|
|
|
7752
7828
|
debugLog(debug, "processing", "poll:event", {
|
|
7753
7829
|
type: lastEvent2.type,
|
|
7754
7830
|
matchesTx: eventMatchesTx,
|
|
7755
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
7831
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _440 => _440.intentId])
|
|
7756
7832
|
});
|
|
7757
7833
|
}
|
|
7758
7834
|
if (!isMounted) return;
|
|
7759
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7835
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _441 => _441.type]) === "bridge-complete") {
|
|
7760
7836
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
7761
7837
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
7762
7838
|
eventForCurrentTx,
|
|
7763
7839
|
txHash
|
|
7764
7840
|
);
|
|
7765
|
-
const destination = _optionalChain([eventForCurrentTx, 'access',
|
|
7766
|
-
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess',
|
|
7841
|
+
const destination = _optionalChain([eventForCurrentTx, 'access', _442 => _442.data, 'optionalAccess', _443 => _443.destination]);
|
|
7842
|
+
const destinationTxHash2 = _optionalChain([destination, 'optionalAccess', _444 => _444.transactionHash]);
|
|
7767
7843
|
debugLog(debug, "processing", "state:complete", {
|
|
7768
7844
|
txHash,
|
|
7769
7845
|
sourceTxHash: sourceTxHash2,
|
|
@@ -7771,7 +7847,7 @@ function ProcessingStep({
|
|
|
7771
7847
|
event: eventForCurrentTx.type
|
|
7772
7848
|
});
|
|
7773
7849
|
const context = processingContextRef.current;
|
|
7774
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7850
|
+
_optionalChain([onDepositCompleteRef, 'access', _445 => _445.current, 'optionalCall', _446 => _446(sourceTxHash2, destinationTxHash2, {
|
|
7775
7851
|
amount: context.amount,
|
|
7776
7852
|
sourceChain: context.sourceChain,
|
|
7777
7853
|
sourceToken: context.sourceToken,
|
|
@@ -7779,11 +7855,11 @@ function ProcessingStep({
|
|
|
7779
7855
|
amountUsd: context.amountUsd,
|
|
7780
7856
|
targetChain: context.targetChain,
|
|
7781
7857
|
targetToken: context.targetToken,
|
|
7782
|
-
destinationAmount: typeof _optionalChain([destination, 'optionalAccess',
|
|
7858
|
+
destinationAmount: typeof _optionalChain([destination, 'optionalAccess', _447 => _447.amount]) === "string" ? destination.amount : void 0
|
|
7783
7859
|
})]);
|
|
7784
7860
|
return;
|
|
7785
7861
|
}
|
|
7786
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7862
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _448 => _448.type]) === "bridge-failed") {
|
|
7787
7863
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
7788
7864
|
setState({
|
|
7789
7865
|
type: "failed",
|
|
@@ -7795,11 +7871,11 @@ function ProcessingStep({
|
|
|
7795
7871
|
message: formatted.message,
|
|
7796
7872
|
code: formatted.code
|
|
7797
7873
|
});
|
|
7798
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7874
|
+
_optionalChain([onDepositFailedRef, 'access', _449 => _449.current, 'optionalCall', _450 => _450(txHash, formatted.message)]);
|
|
7799
7875
|
return;
|
|
7800
7876
|
}
|
|
7801
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7802
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
7877
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _451 => _451.type]) === "error") {
|
|
7878
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _452 => _452.data, 'optionalAccess', _453 => _453.message]), () => ( "Unknown error"));
|
|
7803
7879
|
setState({
|
|
7804
7880
|
type: "failed",
|
|
7805
7881
|
message: errorMessage,
|
|
@@ -7809,7 +7885,7 @@ function ProcessingStep({
|
|
|
7809
7885
|
txHash,
|
|
7810
7886
|
message: errorMessage
|
|
7811
7887
|
});
|
|
7812
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7888
|
+
_optionalChain([onDepositFailedRef, 'access', _454 => _454.current, 'optionalCall', _455 => _455(txHash, errorMessage)]);
|
|
7813
7889
|
return;
|
|
7814
7890
|
}
|
|
7815
7891
|
setState((previous) => ({
|
|
@@ -7867,18 +7943,18 @@ function ProcessingStep({
|
|
|
7867
7943
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
7868
7944
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : flowLabel === "payment" ? "payment" : "deposit";
|
|
7869
7945
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : flowLabel === "payment" ? "Payment" : "Deposit";
|
|
7870
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7946
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _456 => _456.data, 'optionalAccess', _457 => _457.destination, 'optionalAccess', _458 => _458.transactionHash]) || null;
|
|
7871
7947
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
7872
7948
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
7873
7949
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
7874
7950
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
7875
7951
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
7876
7952
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7877
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7953
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _459 => _459.data, 'optionalAccess', _460 => _460.source, 'optionalAccess', _461 => _461.transactionHash]);
|
|
7878
7954
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
7879
7955
|
_react.useEffect.call(void 0, () => {
|
|
7880
7956
|
if (sourceTxHashPending && settledSourceTxHash) {
|
|
7881
|
-
_optionalChain([onSourceTransactionObserved, 'optionalCall',
|
|
7957
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _462 => _462(settledSourceTxHash)]);
|
|
7882
7958
|
}
|
|
7883
7959
|
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
7884
7960
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
@@ -7989,7 +8065,7 @@ function ProcessingStep({
|
|
|
7989
8065
|
timeoutMs: latchedTiming ? resolveServedThresholds(latchedTiming).escalatedMs : FALLBACK_ESCALATED_DELAY_MS,
|
|
7990
8066
|
served: latchedTiming !== void 0
|
|
7991
8067
|
});
|
|
7992
|
-
_optionalChain([onErrorRef, 'access',
|
|
8068
|
+
_optionalChain([onErrorRef, 'access', _463 => _463.current, 'optionalCall', _464 => _464(
|
|
7993
8069
|
"Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.",
|
|
7994
8070
|
"PROCESS_TIMEOUT"
|
|
7995
8071
|
)]);
|
|
@@ -8007,8 +8083,8 @@ function ProcessingStep({
|
|
|
8007
8083
|
const sourceChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, displaySourceChain);
|
|
8008
8084
|
const targetChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, targetChainId);
|
|
8009
8085
|
const timerText = formatTimer(elapsedSeconds);
|
|
8010
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8011
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8086
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _465 => _465.feeSponsored]), () => ( false));
|
|
8087
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _466 => _466.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
8012
8088
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
8013
8089
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
8014
8090
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -8019,20 +8095,20 @@ function ProcessingStep({
|
|
|
8019
8095
|
/* @__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
8096
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, {}), title: stateTitle });
|
|
8021
8097
|
if (isComplete && isSwappedOrder) {
|
|
8022
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
8098
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _467 => _467.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _468 => _468.paymentMethod]))), () => ( null));
|
|
8023
8099
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
8024
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
8100
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _469 => _469.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
8025
8101
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
8026
8102
|
effectivePaymentMethod
|
|
8027
8103
|
) : null;
|
|
8028
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
8029
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8104
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _470 => _470.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
8105
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _471 => _471.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
8030
8106
|
const depositedAmount = receiveDisplay;
|
|
8031
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8107
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _472 => _472.onrampFeeUsd]), () => ( null));
|
|
8032
8108
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
8033
8109
|
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
8110
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
8035
|
-
_optionalChain([quote, 'optionalAccess',
|
|
8111
|
+
_optionalChain([quote, 'optionalAccess', _473 => _473.fees, 'access', _474 => _474.breakdown]),
|
|
8036
8112
|
sponsoredFeeTooltip
|
|
8037
8113
|
);
|
|
8038
8114
|
const feeRows = [];
|
|
@@ -8120,7 +8196,7 @@ function ProcessingStep({
|
|
|
8120
8196
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
8121
8197
|
] }),
|
|
8122
8198
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
8123
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8199
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _475 => _475.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8124
8200
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
8125
8201
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8126
8202
|
"$",
|
|
@@ -8132,7 +8208,7 @@ function ProcessingStep({
|
|
|
8132
8208
|
] })
|
|
8133
8209
|
] })
|
|
8134
8210
|
] }),
|
|
8135
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
8211
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _476 => _476.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8136
8212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
8137
8213
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
8138
8214
|
"$",
|
|
@@ -8199,7 +8275,7 @@ function ProcessingStep({
|
|
|
8199
8275
|
) })
|
|
8200
8276
|
] })
|
|
8201
8277
|
] }) : (() => {
|
|
8202
|
-
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess',
|
|
8278
|
+
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess', _477 => _477.fees]));
|
|
8203
8279
|
if (display !== null) {
|
|
8204
8280
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
8205
8281
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -8350,7 +8426,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
8350
8426
|
function readDedupedAccountSetupResult(requestKey) {
|
|
8351
8427
|
const now = Date.now();
|
|
8352
8428
|
const existing = setupRequestDedupe.get(requestKey);
|
|
8353
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
8429
|
+
if (_optionalChain([existing, 'optionalAccess', _478 => _478.settled]) && existing.expiresAt > now && existing.result) {
|
|
8354
8430
|
return existing.result;
|
|
8355
8431
|
}
|
|
8356
8432
|
return null;
|
|
@@ -8384,7 +8460,7 @@ async function runAccountSetup(input, deps) {
|
|
|
8384
8460
|
chain: _chunkFKJ6EJHHcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
8385
8461
|
token: input.targetToken,
|
|
8386
8462
|
recipient: input.recipient,
|
|
8387
|
-
..._optionalChain([input, 'access',
|
|
8463
|
+
..._optionalChain([input, 'access', _479 => _479.outputTokenRules, 'optionalAccess', _480 => _480.length]) && {
|
|
8388
8464
|
outputTokenRules: input.outputTokenRules
|
|
8389
8465
|
},
|
|
8390
8466
|
...input.rejectUnmapped != null && {
|
|
@@ -8559,4 +8635,7 @@ function mapError(error) {
|
|
|
8559
8635
|
|
|
8560
8636
|
|
|
8561
8637
|
|
|
8562
|
-
|
|
8638
|
+
|
|
8639
|
+
|
|
8640
|
+
|
|
8641
|
+
exports.Modal = Modal; exports.Callout = Callout; exports.CdnIcon = CdnIcon; exports.ListRow = ListRow; exports.PoweredBy = PoweredBy; exports.catalogKeyForChain = catalogKeyForChain; exports.debugLog = debugLog; exports.debugError = debugError; exports.SOLANA_TOKENS = SOLANA_TOKENS; exports.resolveSolanaToken = resolveSolanaToken; exports.isNativeSol = isNativeSol; exports.hostedOrderStateFromSwapped = hostedOrderStateFromSwapped; exports.mergeHostedOrderState = mergeHostedOrderState; exports.hasReached = hasReached; exports.getAssetId = getAssetId; exports.chainIdsByValue = chainIdsByValue; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.quoteFeeRow = quoteFeeRow; exports.SUPPORTED_CONNECT_EXCHANGE_COUNT = SUPPORTED_CONNECT_EXCHANGE_COUNT; exports.resolveAppFeeBps = resolveAppFeeBps; exports.isDepositPolicyRefusal = isDepositPolicyRefusal; exports.PermitDepositSubmitError = PermitDepositSubmitError; exports.createDepositService = createDepositService; exports.depositBoundsViolation = depositBoundsViolation; exports.describePolicyRefusal = describePolicyRefusal; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.useStableRpcUrls = useStableRpcUrls; exports.getPublicClient = getPublicClient; exports.peekRuntimeChains = peekRuntimeChains; exports.primeRuntimeChains = primeRuntimeChains; exports.useChainCatalog = useChainCatalog; exports.useCatalogChain = useCatalogChain; exports.useDepositChainIds = useDepositChainIds; exports.useDestinationChains = useDestinationChains; exports.useTargetTokens = useTargetTokens; exports.useDepositOffer = useDepositOffer; exports.useDepositBounds = useDepositBounds; exports.useRestrictedListExclusion = useRestrictedListExclusion; exports.useIsDepositChain = useIsDepositChain; exports.useChainName = useChainName; exports.useReadClient = useReadClient; exports.useExplorerTxUrl = useExplorerTxUrl; exports.ChainCatalogProvider = ChainCatalogProvider; exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.Button = Button; exports.assetIdFor = assetIdFor; exports.AssetMetadataProvider = AssetMetadataProvider; exports.useAssetStore = useAssetStore; exports.TokenIcon = TokenIcon; exports.resolveCuratedToken = resolveCuratedToken; exports.useTokenDisplays = useTokenDisplays; exports.useTokenDisplay = useTokenDisplay; exports.useIsRecognizedToken = useIsRecognizedToken; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.formatExpectedDuration = formatExpectedDuration; exports.markSubmissionUncertain = markSubmissionUncertain; exports.isSubmissionUncertain = isSubmissionUncertain; exports.formatTokenAmount = formatTokenAmount; exports.isDisplayStablecoinSymbol = isDisplayStablecoinSymbol; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.AnalyticsSession = AnalyticsSession; exports.useDepositAnalyticsEmitter = useDepositAnalyticsEmitter; exports.useWithdrawAnalyticsEmitter = useWithdrawAnalyticsEmitter; exports.SetupError = SetupError; exports.deriveAccountSalt = deriveAccountSalt; exports.computeRequestKey = computeRequestKey; exports.computeCacheKey = computeCacheKey; exports.computeIsCacheable = computeIsCacheable; exports.readDedupedAccountSetupResult = readDedupedAccountSetupResult; exports.runAccountSetupDeduped = runAccountSetupDeduped; exports.HistoryEntryButton = HistoryEntryButton; exports.HistoryOverlay = HistoryOverlay; exports.useHistoryPanel = useHistoryPanel; exports.resolveThemeMode = resolveThemeMode; exports.followSystemAppearance = followSystemAppearance; exports.applyTheme = applyTheme; exports.warnRemovedProps = warnRemovedProps; exports.checkBackendUrl = checkBackendUrl; exports.isHistoryEntryVisible = isHistoryEntryVisible; exports.createHistoryAnalytics = createHistoryAnalytics; exports.analyticsTargetProperties = analyticsTargetProperties;
|