@rhinestone/deposit-modal 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-IFN6YLZJ.cjs → DepositModalReown-6CXXGQ7X.cjs} +16 -16
- package/dist/{DepositModalReown-R7UROJPJ.mjs → DepositModalReown-ELDSTIME.mjs} +3 -3
- package/dist/WithdrawModal-QB2U756L.cjs +11 -0
- package/dist/{WithdrawModal-XKSSHVEJ.mjs → WithdrawModal-QRMDR5T4.mjs} +3 -3
- package/dist/{chunk-24N4KMJX.cjs → chunk-2W4BJ5I3.cjs} +71 -71
- package/dist/{chunk-F6ROQ6RJ.mjs → chunk-H66WM5AO.mjs} +7 -4
- package/dist/{chunk-5CM3ZQ5U.cjs → chunk-JCWJ6HW7.cjs} +1 -1
- package/dist/{chunk-H4O22O7Y.cjs → chunk-QGNJFDEO.cjs} +362 -181
- package/dist/{chunk-EA5CE2UZ.mjs → chunk-QMGEK623.mjs} +210 -29
- package/dist/{chunk-3HCCR54R.mjs → chunk-XCBDJPBD.mjs} +1 -1
- package/dist/{chunk-V466XQSG.cjs → chunk-XJMDCBHS.cjs} +444 -441
- package/dist/{chunk-HMB2XQGD.mjs → chunk-ZHX4QROC.mjs} +1 -1
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/styles.css +22 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +4 -4
- package/dist/WithdrawModal-SZEAI473.cjs +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkJCWJ6HW7cjs = require('./chunk-JCWJ6HW7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -650,12 +650,37 @@ function parseQuotePreview(raw) {
|
|
|
650
650
|
);
|
|
651
651
|
if (Math.abs(totalUsd - breakdownTotalUsd) > 1e-6) return null;
|
|
652
652
|
const breakdown = Object.fromEntries(parsedEntries);
|
|
653
|
+
const timing = parseDepositTiming(obj.timing);
|
|
653
654
|
return {
|
|
654
655
|
settlementLayer: obj.settlementLayer,
|
|
655
656
|
expiresAt: obj.expiresAt,
|
|
656
657
|
estimatedFillTimeSeconds: obj.estimatedFillTimeSeconds,
|
|
657
658
|
fees: { total: { usd: totalUsd }, breakdown },
|
|
658
|
-
output
|
|
659
|
+
output,
|
|
660
|
+
...timing ? { timing } : {}
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function parseDepositTiming(raw) {
|
|
664
|
+
if (typeof raw !== "object" || raw === null) return void 0;
|
|
665
|
+
const o = raw;
|
|
666
|
+
const seconds = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
667
|
+
const expectedSeconds = seconds(o.expectedSeconds);
|
|
668
|
+
const softDelaySeconds = seconds(o.softDelaySeconds);
|
|
669
|
+
const escalatedDelaySeconds = seconds(o.escalatedDelaySeconds);
|
|
670
|
+
if (expectedSeconds === void 0 || softDelaySeconds === void 0 || escalatedDelaySeconds === void 0) {
|
|
671
|
+
return void 0;
|
|
672
|
+
}
|
|
673
|
+
return { expectedSeconds, softDelaySeconds, escalatedDelaySeconds };
|
|
674
|
+
}
|
|
675
|
+
function normalizeHistoryTiming(raw) {
|
|
676
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
677
|
+
return raw;
|
|
678
|
+
}
|
|
679
|
+
const { timing: rawTiming, ...row } = raw;
|
|
680
|
+
const timing = parseDepositTiming(rawTiming);
|
|
681
|
+
return {
|
|
682
|
+
...row,
|
|
683
|
+
...timing ? { timing } : {}
|
|
659
684
|
};
|
|
660
685
|
}
|
|
661
686
|
function parseQuoteOutput(raw) {
|
|
@@ -765,7 +790,7 @@ function createDepositService(baseUrl, options) {
|
|
|
765
790
|
try {
|
|
766
791
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
767
792
|
method: "GET",
|
|
768
|
-
headers:
|
|
793
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, )
|
|
769
794
|
});
|
|
770
795
|
if (!response.ok) {
|
|
771
796
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
@@ -792,7 +817,7 @@ function createDepositService(baseUrl, options) {
|
|
|
792
817
|
try {
|
|
793
818
|
const response = await fetch(apiUrl("/chains"), {
|
|
794
819
|
method: "GET",
|
|
795
|
-
headers:
|
|
820
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, )
|
|
796
821
|
});
|
|
797
822
|
if (!response.ok) {
|
|
798
823
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -846,7 +871,7 @@ function createDepositService(baseUrl, options) {
|
|
|
846
871
|
});
|
|
847
872
|
const response = await fetch(url, {
|
|
848
873
|
method: "POST",
|
|
849
|
-
headers:
|
|
874
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
850
875
|
body: JSON.stringify({ account: params })
|
|
851
876
|
});
|
|
852
877
|
if (!response.ok) {
|
|
@@ -881,7 +906,7 @@ function createDepositService(baseUrl, options) {
|
|
|
881
906
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
882
907
|
const response = await fetch(url, {
|
|
883
908
|
method: "GET",
|
|
884
|
-
headers:
|
|
909
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, )
|
|
885
910
|
});
|
|
886
911
|
if (!response.ok) {
|
|
887
912
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -932,7 +957,7 @@ function createDepositService(baseUrl, options) {
|
|
|
932
957
|
});
|
|
933
958
|
const response = await fetch(url, {
|
|
934
959
|
method: "GET",
|
|
935
|
-
headers:
|
|
960
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, )
|
|
936
961
|
});
|
|
937
962
|
if (!response.ok) {
|
|
938
963
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -961,7 +986,7 @@ function createDepositService(baseUrl, options) {
|
|
|
961
986
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
962
987
|
const response = await fetch(url, {
|
|
963
988
|
method: "GET",
|
|
964
|
-
headers:
|
|
989
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, )
|
|
965
990
|
});
|
|
966
991
|
if (!response.ok) {
|
|
967
992
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -997,7 +1022,7 @@ function createDepositService(baseUrl, options) {
|
|
|
997
1022
|
);
|
|
998
1023
|
const response = await fetch(url, {
|
|
999
1024
|
method: "GET",
|
|
1000
|
-
headers:
|
|
1025
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1001
1026
|
cache: "no-store"
|
|
1002
1027
|
});
|
|
1003
1028
|
if (!response.ok) {
|
|
@@ -1025,7 +1050,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1025
1050
|
);
|
|
1026
1051
|
const response = await fetch(url, {
|
|
1027
1052
|
method: "GET",
|
|
1028
|
-
headers:
|
|
1053
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1029
1054
|
cache: "no-store"
|
|
1030
1055
|
});
|
|
1031
1056
|
if (!response.ok) {
|
|
@@ -1049,7 +1074,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1049
1074
|
);
|
|
1050
1075
|
const response = await fetch(url, {
|
|
1051
1076
|
method: "GET",
|
|
1052
|
-
headers:
|
|
1077
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1053
1078
|
cache: "no-store"
|
|
1054
1079
|
});
|
|
1055
1080
|
if (!response.ok) {
|
|
@@ -1071,7 +1096,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1071
1096
|
async getPositions(address) {
|
|
1072
1097
|
const url = apiUrl(`/positions/${address}`);
|
|
1073
1098
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1074
|
-
const response = await fetch(url, { headers:
|
|
1099
|
+
const response = await fetch(url, { headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ) });
|
|
1075
1100
|
if (!response.ok) {
|
|
1076
1101
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1077
1102
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1105,7 +1130,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1105
1130
|
});
|
|
1106
1131
|
const response = await fetch(url, {
|
|
1107
1132
|
method: "POST",
|
|
1108
|
-
headers:
|
|
1133
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1109
1134
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1110
1135
|
});
|
|
1111
1136
|
if (!response.ok) {
|
|
@@ -1141,7 +1166,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1141
1166
|
});
|
|
1142
1167
|
const response = await fetch(url, {
|
|
1143
1168
|
method: "POST",
|
|
1144
|
-
headers:
|
|
1169
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1145
1170
|
body: JSON.stringify({
|
|
1146
1171
|
depositWallet,
|
|
1147
1172
|
owner,
|
|
@@ -1183,7 +1208,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1183
1208
|
});
|
|
1184
1209
|
const response = await fetch(url, {
|
|
1185
1210
|
method: "GET",
|
|
1186
|
-
headers:
|
|
1211
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1187
1212
|
cache: "no-store"
|
|
1188
1213
|
});
|
|
1189
1214
|
if (!response.ok) {
|
|
@@ -1197,7 +1222,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1197
1222
|
);
|
|
1198
1223
|
}
|
|
1199
1224
|
const data = await response.json();
|
|
1200
|
-
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _36 => _36.deposits])) ? data.deposits : [];
|
|
1225
|
+
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _36 => _36.deposits])) ? data.deposits.map(normalizeHistoryTiming) : [];
|
|
1201
1226
|
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _37 => _37.nextCursor]), () => ( _optionalChain([data, 'optionalAccess', _38 => _38.next_cursor]))), () => ( null));
|
|
1202
1227
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
1203
1228
|
recipient: shortRef(params.recipient),
|
|
@@ -1233,7 +1258,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1233
1258
|
});
|
|
1234
1259
|
const response = await fetch(url, {
|
|
1235
1260
|
method: "GET",
|
|
1236
|
-
headers:
|
|
1261
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1237
1262
|
cache: "no-store"
|
|
1238
1263
|
});
|
|
1239
1264
|
if (!response.ok) {
|
|
@@ -1281,7 +1306,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1281
1306
|
try {
|
|
1282
1307
|
const response = await fetch(url, {
|
|
1283
1308
|
method: "POST",
|
|
1284
|
-
headers:
|
|
1309
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1285
1310
|
body: JSON.stringify(body),
|
|
1286
1311
|
cache: "no-store"
|
|
1287
1312
|
});
|
|
@@ -1321,7 +1346,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1321
1346
|
try {
|
|
1322
1347
|
const response = await fetch(url, {
|
|
1323
1348
|
method: "POST",
|
|
1324
|
-
headers:
|
|
1349
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1325
1350
|
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1326
1351
|
cache: "no-store"
|
|
1327
1352
|
});
|
|
@@ -1415,7 +1440,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1415
1440
|
try {
|
|
1416
1441
|
response = await fetch(url, {
|
|
1417
1442
|
method: "POST",
|
|
1418
|
-
headers:
|
|
1443
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1419
1444
|
body: JSON.stringify(params)
|
|
1420
1445
|
});
|
|
1421
1446
|
} catch (error) {
|
|
@@ -1466,7 +1491,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1466
1491
|
try {
|
|
1467
1492
|
const response = await fetch(url, {
|
|
1468
1493
|
method: "GET",
|
|
1469
|
-
headers:
|
|
1494
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1470
1495
|
cache: "no-store"
|
|
1471
1496
|
});
|
|
1472
1497
|
if (!response.ok) {
|
|
@@ -1498,7 +1523,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1498
1523
|
try {
|
|
1499
1524
|
const response = await fetch(url, {
|
|
1500
1525
|
method: "GET",
|
|
1501
|
-
headers:
|
|
1526
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1502
1527
|
cache: "no-store"
|
|
1503
1528
|
});
|
|
1504
1529
|
if (!response.ok) {
|
|
@@ -1523,7 +1548,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1523
1548
|
});
|
|
1524
1549
|
const response = await fetch(url, {
|
|
1525
1550
|
method: "POST",
|
|
1526
|
-
headers:
|
|
1551
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1527
1552
|
body: JSON.stringify(params)
|
|
1528
1553
|
});
|
|
1529
1554
|
if (!response.ok) {
|
|
@@ -1555,7 +1580,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1555
1580
|
});
|
|
1556
1581
|
const response = await fetch(url, {
|
|
1557
1582
|
method: "POST",
|
|
1558
|
-
headers:
|
|
1583
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1559
1584
|
body: JSON.stringify(params)
|
|
1560
1585
|
});
|
|
1561
1586
|
if (!response.ok) {
|
|
@@ -1592,7 +1617,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1592
1617
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1593
1618
|
const response = await fetch(url, {
|
|
1594
1619
|
method: "GET",
|
|
1595
|
-
headers:
|
|
1620
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1596
1621
|
cache: "no-store"
|
|
1597
1622
|
});
|
|
1598
1623
|
if (!response.ok) {
|
|
@@ -1645,7 +1670,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1645
1670
|
try {
|
|
1646
1671
|
const response = await fetch(url, {
|
|
1647
1672
|
method: "GET",
|
|
1648
|
-
headers:
|
|
1673
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1649
1674
|
cache: "no-store"
|
|
1650
1675
|
});
|
|
1651
1676
|
if (!response.ok) {
|
|
@@ -1731,7 +1756,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1731
1756
|
try {
|
|
1732
1757
|
const response = await fetch(url, {
|
|
1733
1758
|
method: "GET",
|
|
1734
|
-
headers:
|
|
1759
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1735
1760
|
cache: "no-store"
|
|
1736
1761
|
});
|
|
1737
1762
|
if (!response.ok) {
|
|
@@ -1758,7 +1783,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1758
1783
|
);
|
|
1759
1784
|
const response = await fetch(url, {
|
|
1760
1785
|
method: "GET",
|
|
1761
|
-
headers:
|
|
1786
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
1762
1787
|
cache: "no-store"
|
|
1763
1788
|
});
|
|
1764
1789
|
if (!response.ok) return null;
|
|
@@ -2539,7 +2564,7 @@ function createIngestTransport(options) {
|
|
|
2539
2564
|
try {
|
|
2540
2565
|
response = await fetchImpl(mintUrl, {
|
|
2541
2566
|
method: "POST",
|
|
2542
|
-
headers:
|
|
2567
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
2543
2568
|
signal: _optionalChain([controller, 'optionalAccess', _113 => _113.signal])
|
|
2544
2569
|
});
|
|
2545
2570
|
} catch (e6) {
|
|
@@ -2800,7 +2825,7 @@ function AnalyticsSession(props) {
|
|
|
2800
2825
|
type: "analytics_ingest_failure",
|
|
2801
2826
|
session_id: sessionIdRef.current,
|
|
2802
2827
|
modal,
|
|
2803
|
-
widget_version:
|
|
2828
|
+
widget_version: _chunkJCWJ6HW7cjs.MODAL_VERSION,
|
|
2804
2829
|
timestamp: nowRef.current().toISOString(),
|
|
2805
2830
|
reason,
|
|
2806
2831
|
...status === void 0 ? {} : { status },
|
|
@@ -2828,7 +2853,7 @@ function AnalyticsSession(props) {
|
|
|
2828
2853
|
proxyOrigin,
|
|
2829
2854
|
sessionId: sessionIdRef.current,
|
|
2830
2855
|
modal,
|
|
2831
|
-
widgetVersion:
|
|
2856
|
+
widgetVersion: _chunkJCWJ6HW7cjs.MODAL_VERSION,
|
|
2832
2857
|
sessionProperties: sessionPropertiesRef.current,
|
|
2833
2858
|
onFailure: (failure) => emitFailure(failure),
|
|
2834
2859
|
fetchImpl: props.fetchImpl,
|
|
@@ -2884,7 +2909,7 @@ function AnalyticsSession(props) {
|
|
|
2884
2909
|
...payload,
|
|
2885
2910
|
session_id: sessionIdRef.current,
|
|
2886
2911
|
modal,
|
|
2887
|
-
widget_version:
|
|
2912
|
+
widget_version: _chunkJCWJ6HW7cjs.MODAL_VERSION,
|
|
2888
2913
|
timestamp: nowRef.current().toISOString(),
|
|
2889
2914
|
session_properties: sessionPropertiesRef.current,
|
|
2890
2915
|
funding_method: fundingMethod
|
|
@@ -2903,7 +2928,7 @@ function AnalyticsSession(props) {
|
|
|
2903
2928
|
...payload,
|
|
2904
2929
|
session_id: sessionIdRef.current,
|
|
2905
2930
|
modal,
|
|
2906
|
-
widget_version:
|
|
2931
|
+
widget_version: _chunkJCWJ6HW7cjs.MODAL_VERSION,
|
|
2907
2932
|
timestamp: nowRef.current().toISOString(),
|
|
2908
2933
|
session_properties: sessionPropertiesRef.current
|
|
2909
2934
|
};
|
|
@@ -2919,7 +2944,7 @@ function AnalyticsSession(props) {
|
|
|
2919
2944
|
...payload,
|
|
2920
2945
|
session_id: sessionIdRef.current,
|
|
2921
2946
|
modal,
|
|
2922
|
-
widget_version:
|
|
2947
|
+
widget_version: _chunkJCWJ6HW7cjs.MODAL_VERSION,
|
|
2923
2948
|
timestamp: nowRef.current().toISOString(),
|
|
2924
2949
|
session_properties: sessionPropertiesRef.current
|
|
2925
2950
|
};
|
|
@@ -3351,8 +3376,84 @@ function TokenIcon({ symbol, className, fallback }) {
|
|
|
3351
3376
|
}
|
|
3352
3377
|
TokenIcon.displayName = "TokenIcon";
|
|
3353
3378
|
|
|
3379
|
+
// src/core/deposit-timing.ts
|
|
3380
|
+
var FALLBACK_SOFT_DELAY_MS = {
|
|
3381
|
+
confirming: 90 * 1e3,
|
|
3382
|
+
received: 90 * 1e3,
|
|
3383
|
+
bridging: 4 * 60 * 1e3
|
|
3384
|
+
};
|
|
3385
|
+
var FALLBACK_ESCALATED_DELAY_MS = 10 * 60 * 1e3;
|
|
3386
|
+
var MIN_SOFT_DELAY_MS = 90 * 1e3;
|
|
3387
|
+
function formatExpectedDuration(seconds) {
|
|
3388
|
+
if (!Number.isFinite(seconds) || seconds <= 0) return "a few seconds";
|
|
3389
|
+
if (seconds < 60) {
|
|
3390
|
+
const whole = Math.round(seconds);
|
|
3391
|
+
return `~${whole} second${whole === 1 ? "" : "s"}`;
|
|
3392
|
+
}
|
|
3393
|
+
return `~${Math.max(1, Math.round(seconds / 60))} min`;
|
|
3394
|
+
}
|
|
3395
|
+
function resolveServedThresholds(timing) {
|
|
3396
|
+
const softMs = Math.max(timing.softDelaySeconds * 1e3, MIN_SOFT_DELAY_MS);
|
|
3397
|
+
return {
|
|
3398
|
+
softMs,
|
|
3399
|
+
escalatedMs: Math.max(timing.escalatedDelaySeconds * 1e3, softMs)
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
function resolveServedTimingState(timing, totalElapsedMs) {
|
|
3403
|
+
const { softMs, escalatedMs } = resolveServedThresholds(timing);
|
|
3404
|
+
if (totalElapsedMs >= escalatedMs) return "escalated";
|
|
3405
|
+
if (totalElapsedMs >= softMs) return "soft";
|
|
3406
|
+
return "expected";
|
|
3407
|
+
}
|
|
3408
|
+
function resolvePendingTimingState({
|
|
3409
|
+
timing,
|
|
3410
|
+
totalElapsedMs,
|
|
3411
|
+
phaseId,
|
|
3412
|
+
phaseElapsedMs
|
|
3413
|
+
}) {
|
|
3414
|
+
if (timing) return resolveServedTimingState(timing, totalElapsedMs);
|
|
3415
|
+
if (totalElapsedMs >= FALLBACK_ESCALATED_DELAY_MS) return "escalated";
|
|
3416
|
+
if (phaseId && phaseElapsedMs >= FALLBACK_SOFT_DELAY_MS[phaseId]) {
|
|
3417
|
+
return "soft";
|
|
3418
|
+
}
|
|
3419
|
+
return "expected";
|
|
3420
|
+
}
|
|
3421
|
+
var STATE_ORDER = {
|
|
3422
|
+
expected: 0,
|
|
3423
|
+
soft: 1,
|
|
3424
|
+
escalated: 2
|
|
3425
|
+
};
|
|
3426
|
+
function advancePendingTimingState(previous, next) {
|
|
3427
|
+
return STATE_ORDER[next] > STATE_ORDER[previous] ? next : previous;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
// src/core/history-timing.ts
|
|
3431
|
+
var TIMED_HISTORY_STATUSES = /* @__PURE__ */ new Set(["pending", "processing", "delayed"]);
|
|
3432
|
+
function resolveHistoryTiming({
|
|
3433
|
+
status,
|
|
3434
|
+
timing,
|
|
3435
|
+
createdAt,
|
|
3436
|
+
nowMs
|
|
3437
|
+
}) {
|
|
3438
|
+
if (!TIMED_HISTORY_STATUSES.has(status) || !timing || !createdAt) {
|
|
3439
|
+
return void 0;
|
|
3440
|
+
}
|
|
3441
|
+
const createdAtMs = Date.parse(createdAt);
|
|
3442
|
+
if (!Number.isFinite(createdAtMs)) return void 0;
|
|
3443
|
+
const elapsedMs = Math.max(0, nowMs - createdAtMs);
|
|
3444
|
+
const state = resolveServedTimingState(timing, elapsedMs);
|
|
3445
|
+
const { softMs, escalatedMs } = resolveServedThresholds(timing);
|
|
3446
|
+
const nextTransitionAtMs = state === "expected" ? createdAtMs + softMs : state === "soft" ? createdAtMs + escalatedMs : void 0;
|
|
3447
|
+
return {
|
|
3448
|
+
state,
|
|
3449
|
+
expectedDuration: formatExpectedDuration(timing.expectedSeconds),
|
|
3450
|
+
...nextTransitionAtMs !== void 0 ? { nextTransitionAtMs } : {}
|
|
3451
|
+
};
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3354
3454
|
// src/components/history/DepositHistoryPanel.tsx
|
|
3355
3455
|
|
|
3456
|
+
var MAX_TIMER_DELAY_MS = 2147e6;
|
|
3356
3457
|
function shortenHash(hash) {
|
|
3357
3458
|
if (hash.length <= 14) return hash;
|
|
3358
3459
|
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
@@ -3472,6 +3573,48 @@ function DepositHistoryPanel({
|
|
|
3472
3573
|
() => filterVisibleDeposits(deposits),
|
|
3473
3574
|
[deposits]
|
|
3474
3575
|
);
|
|
3576
|
+
const [nowMs, setNowMs] = _react.useState.call(void 0, () => Date.now());
|
|
3577
|
+
const timingPresentations = _react.useMemo.call(void 0,
|
|
3578
|
+
() => visibleDeposits.map(
|
|
3579
|
+
(deposit) => resolveHistoryTiming({
|
|
3580
|
+
status: deposit.status,
|
|
3581
|
+
timing: deposit.timing,
|
|
3582
|
+
createdAt: deposit.createdAt,
|
|
3583
|
+
nowMs
|
|
3584
|
+
})
|
|
3585
|
+
),
|
|
3586
|
+
[nowMs, visibleDeposits]
|
|
3587
|
+
);
|
|
3588
|
+
_react.useEffect.call(void 0, () => {
|
|
3589
|
+
setNowMs(Date.now());
|
|
3590
|
+
}, [visibleDeposits]);
|
|
3591
|
+
_react.useEffect.call(void 0, () => {
|
|
3592
|
+
const nextBoundary = timingPresentations.reduce(
|
|
3593
|
+
(earliest, presentation) => {
|
|
3594
|
+
const next = _optionalChain([presentation, 'optionalAccess', _141 => _141.nextTransitionAtMs]);
|
|
3595
|
+
if (next === void 0) return earliest;
|
|
3596
|
+
return earliest === void 0 || next < earliest ? next : earliest;
|
|
3597
|
+
},
|
|
3598
|
+
void 0
|
|
3599
|
+
);
|
|
3600
|
+
if (nextBoundary === void 0) return;
|
|
3601
|
+
let timeout;
|
|
3602
|
+
const updateAtBoundary = () => {
|
|
3603
|
+
const current = Date.now();
|
|
3604
|
+
if (current < nextBoundary) {
|
|
3605
|
+
timeout = setTimeout(
|
|
3606
|
+
updateAtBoundary,
|
|
3607
|
+
Math.min(nextBoundary - current, MAX_TIMER_DELAY_MS)
|
|
3608
|
+
);
|
|
3609
|
+
return;
|
|
3610
|
+
}
|
|
3611
|
+
setNowMs(current);
|
|
3612
|
+
};
|
|
3613
|
+
updateAtBoundary();
|
|
3614
|
+
return () => {
|
|
3615
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
3616
|
+
};
|
|
3617
|
+
}, [timingPresentations]);
|
|
3475
3618
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3476
3619
|
"div",
|
|
3477
3620
|
{
|
|
@@ -3548,6 +3691,7 @@ function DepositHistoryPanel({
|
|
|
3548
3691
|
HistoryCard,
|
|
3549
3692
|
{
|
|
3550
3693
|
deposit,
|
|
3694
|
+
timing: timingPresentations[i],
|
|
3551
3695
|
position: i,
|
|
3552
3696
|
recipient,
|
|
3553
3697
|
onRecover,
|
|
@@ -3575,6 +3719,7 @@ function DepositHistoryPanel({
|
|
|
3575
3719
|
}
|
|
3576
3720
|
function HistoryCard({
|
|
3577
3721
|
deposit,
|
|
3722
|
+
timing,
|
|
3578
3723
|
position,
|
|
3579
3724
|
recipient,
|
|
3580
3725
|
onRecover,
|
|
@@ -3608,7 +3753,7 @@ function HistoryCard({
|
|
|
3608
3753
|
setExpanded(next);
|
|
3609
3754
|
const depositId = _nullishCoalesce(deposit.id, () => ( deposit.txHash));
|
|
3610
3755
|
if (!next || !depositId) return;
|
|
3611
|
-
_optionalChain([onRowView, 'optionalCall',
|
|
3756
|
+
_optionalChain([onRowView, 'optionalCall', _142 => _142({
|
|
3612
3757
|
depositId,
|
|
3613
3758
|
status,
|
|
3614
3759
|
recoverable: eligible !== null,
|
|
@@ -3682,10 +3827,20 @@ function HistoryCard({
|
|
|
3682
3827
|
}
|
|
3683
3828
|
)
|
|
3684
3829
|
] }),
|
|
3830
|
+
timing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3831
|
+
"span",
|
|
3832
|
+
{
|
|
3833
|
+
className: "rs-history-card-timing",
|
|
3834
|
+
"data-state": timing.state,
|
|
3835
|
+
"aria-live": "polite",
|
|
3836
|
+
"aria-atomic": "true",
|
|
3837
|
+
children: timing.state === "expected" ? `Usually arrives in ${timing.expectedDuration}` : timing.state === "soft" ? "Taking longer than usual" : "Taking much longer than usual"
|
|
3838
|
+
}
|
|
3839
|
+
),
|
|
3685
3840
|
recoverable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3686
3841
|
Button,
|
|
3687
3842
|
{
|
|
3688
|
-
onClick: () => _optionalChain([onRecover, 'optionalCall',
|
|
3843
|
+
onClick: () => _optionalChain([onRecover, 'optionalCall', _143 => _143(recoverable)]),
|
|
3689
3844
|
fullWidth: true,
|
|
3690
3845
|
className: "rs-history-card-recover",
|
|
3691
3846
|
children: [
|
|
@@ -3750,7 +3905,7 @@ function ListRow({
|
|
|
3750
3905
|
if (disabled) return;
|
|
3751
3906
|
if (e.key === "Enter" || e.key === " ") {
|
|
3752
3907
|
e.preventDefault();
|
|
3753
|
-
_optionalChain([onClick, 'optionalCall',
|
|
3908
|
+
_optionalChain([onClick, 'optionalCall', _144 => _144(e)]);
|
|
3754
3909
|
}
|
|
3755
3910
|
};
|
|
3756
3911
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3760,7 +3915,7 @@ function ListRow({
|
|
|
3760
3915
|
role: "button",
|
|
3761
3916
|
tabIndex: disabled ? -1 : 0,
|
|
3762
3917
|
"aria-disabled": disabled || void 0,
|
|
3763
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
3918
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _145 => _145(e)]),
|
|
3764
3919
|
onKeyDown: handleKey,
|
|
3765
3920
|
children: inner
|
|
3766
3921
|
}
|
|
@@ -3818,7 +3973,7 @@ var RECOVERY_LOOKUP_MISS_COPY = {
|
|
|
3818
3973
|
};
|
|
3819
3974
|
function classifyRecoveryLookup(rows, options = {}) {
|
|
3820
3975
|
const inScope = options.recipient ? rows.filter(
|
|
3821
|
-
(row) => _optionalChain([row, 'access',
|
|
3976
|
+
(row) => _optionalChain([row, 'access', _146 => _146.recipient, 'optionalAccess', _147 => _147.toLowerCase, 'call', _148 => _148()]) === _optionalChain([options, 'access', _149 => _149.recipient, 'optionalAccess', _150 => _150.toLowerCase, 'call', _151 => _151()])
|
|
3822
3977
|
) : rows;
|
|
3823
3978
|
const eligible = inScope.map((row) => toRecoverableDeposit(row, options)).filter((deposit) => deposit !== null);
|
|
3824
3979
|
return {
|
|
@@ -3846,7 +4001,7 @@ function RecoveryLookupScreen({
|
|
|
3846
4001
|
const valid = isRecoveryTxHash(trimmed);
|
|
3847
4002
|
_react.useEffect.call(void 0, () => {
|
|
3848
4003
|
if (trimmed.length > 0 && !valid) {
|
|
3849
|
-
_optionalChain([onInvalidRef, 'access',
|
|
4004
|
+
_optionalChain([onInvalidRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153()]);
|
|
3850
4005
|
}
|
|
3851
4006
|
}, [trimmed, valid, onInvalidRef]);
|
|
3852
4007
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -3931,15 +4086,15 @@ function resolveTokenDisplay(token, chain, fallback) {
|
|
|
3931
4086
|
const decimals = _chunkOY5N3E6Lcjs.findTokenDecimals.call(void 0, token, chain);
|
|
3932
4087
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
3933
4088
|
return {
|
|
3934
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3935
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
4089
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _154 => _154.symbol]), () => ( symbol)),
|
|
4090
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _155 => _155.decimals])))
|
|
3936
4091
|
};
|
|
3937
4092
|
}
|
|
3938
4093
|
}
|
|
3939
4094
|
}
|
|
3940
4095
|
return {
|
|
3941
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3942
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
4096
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _156 => _156.symbol]), () => ( "Token")),
|
|
4097
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _157 => _157.decimals])
|
|
3943
4098
|
};
|
|
3944
4099
|
}
|
|
3945
4100
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -4193,7 +4348,7 @@ async function submitSignedRecovery(params) {
|
|
|
4193
4348
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
4194
4349
|
// every other backend call. Without it this path would be invisible in the
|
|
4195
4350
|
// per-client version telemetry the processor records.
|
|
4196
|
-
headers:
|
|
4351
|
+
headers: _chunkJCWJ6HW7cjs.serviceHeaders.call(void 0, ),
|
|
4197
4352
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
4198
4353
|
// precision well before that range.
|
|
4199
4354
|
body: JSON.stringify({ depositId, destination, signature })
|
|
@@ -4789,7 +4944,7 @@ function RecoveryReviewScreen({
|
|
|
4789
4944
|
const onDestinationInvalidRef = useLatestRef(onDestinationInvalid);
|
|
4790
4945
|
_react.useEffect.call(void 0, () => {
|
|
4791
4946
|
if (destination.length > 0 && !destinationValid) {
|
|
4792
|
-
_optionalChain([onDestinationInvalidRef, 'access',
|
|
4947
|
+
_optionalChain([onDestinationInvalidRef, 'access', _158 => _158.current, 'optionalCall', _159 => _159()]);
|
|
4793
4948
|
}
|
|
4794
4949
|
}, [destination, destinationValid, onDestinationInvalidRef]);
|
|
4795
4950
|
const txUrl = txHash ? explorerTxUrl(chainId, txHash) : null;
|
|
@@ -4947,11 +5102,11 @@ function HistoryRecoveryFlow({
|
|
|
4947
5102
|
} catch (err) {
|
|
4948
5103
|
const recoveryError = err instanceof RecoveryError ? err : void 0;
|
|
4949
5104
|
setError(
|
|
4950
|
-
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5105
|
+
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _160 => _160.message]), () => ( formatUserError(
|
|
4951
5106
|
err instanceof Error ? err.message : "Recovery failed"
|
|
4952
5107
|
)))
|
|
4953
5108
|
);
|
|
4954
|
-
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5109
|
+
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _161 => _161.retryable]), () => ( true));
|
|
4955
5110
|
setRetryable(canRetry);
|
|
4956
5111
|
setPhase("failed");
|
|
4957
5112
|
const reason = claimFailureReasonForError(err);
|
|
@@ -5092,8 +5247,8 @@ function HistoryOverlay({
|
|
|
5092
5247
|
const endAttempt = _react.useCallback.call(void 0,
|
|
5093
5248
|
(source, reason) => {
|
|
5094
5249
|
const claim = claimControllerRef.current;
|
|
5095
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5096
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5250
|
+
_optionalChain([claim, 'optionalAccess', _162 => _162.abandon, 'call', _163 => _163(reason)]);
|
|
5251
|
+
_optionalChain([claim, 'optionalAccess', _164 => _164.close, 'call', _165 => _165(source)]);
|
|
5097
5252
|
claimControllerRef.current = null;
|
|
5098
5253
|
setAttempt(null);
|
|
5099
5254
|
},
|
|
@@ -5151,8 +5306,8 @@ function HistoryOverlay({
|
|
|
5151
5306
|
if (!attempt) return;
|
|
5152
5307
|
return () => {
|
|
5153
5308
|
const claim = claimControllerRef.current;
|
|
5154
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5155
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5309
|
+
_optionalChain([claim, 'optionalAccess', _166 => _166.abandon, 'call', _167 => _167("modal_close")]);
|
|
5310
|
+
_optionalChain([claim, 'optionalAccess', _168 => _168.close, 'call', _169 => _169("host_controlled")]);
|
|
5156
5311
|
};
|
|
5157
5312
|
}, [attempt]);
|
|
5158
5313
|
const claimSessionProperties = _react.useMemo.call(void 0,
|
|
@@ -5178,7 +5333,7 @@ function HistoryOverlay({
|
|
|
5178
5333
|
HistoryRecoveryFlow,
|
|
5179
5334
|
{
|
|
5180
5335
|
deposit: recovering,
|
|
5181
|
-
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess',
|
|
5336
|
+
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess', _170 => _170.entrySource]), () => ( "history_row")),
|
|
5182
5337
|
backendUrl,
|
|
5183
5338
|
signRecovery,
|
|
5184
5339
|
debug,
|
|
@@ -5318,7 +5473,7 @@ function useHistoryPanel({
|
|
|
5318
5473
|
);
|
|
5319
5474
|
const openPanel = _react.useCallback.call(void 0, () => {
|
|
5320
5475
|
setIsPanelOpen(true);
|
|
5321
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5476
|
+
_optionalChain([analytics, 'optionalAccess', _171 => _171.visitOpened, 'call', _172 => _172(badge)]);
|
|
5322
5477
|
if (!loadedRef.current || staleRef.current) {
|
|
5323
5478
|
fetchHistory("initial");
|
|
5324
5479
|
}
|
|
@@ -5326,10 +5481,10 @@ function useHistoryPanel({
|
|
|
5326
5481
|
const closePanel = _react.useCallback.call(void 0, () => {
|
|
5327
5482
|
if (recovering) return;
|
|
5328
5483
|
setIsPanelOpen(false);
|
|
5329
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5484
|
+
_optionalChain([analytics, 'optionalAccess', _173 => _173.visitEnded, 'call', _174 => _174()]);
|
|
5330
5485
|
}, [analytics, recovering]);
|
|
5331
5486
|
const loadMore = _react.useCallback.call(void 0, () => {
|
|
5332
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5487
|
+
_optionalChain([analytics, 'optionalAccess', _175 => _175.loadMore, 'call', _176 => _176(filterVisibleDeposits(deposits).length)]);
|
|
5333
5488
|
fetchHistory("more");
|
|
5334
5489
|
}, [analytics, deposits, fetchHistory]);
|
|
5335
5490
|
const markStale = _react.useCallback.call(void 0, () => {
|
|
@@ -5357,7 +5512,7 @@ function useHistoryPanel({
|
|
|
5357
5512
|
_react.useEffect.call(void 0, () => {
|
|
5358
5513
|
if (isOpen) return;
|
|
5359
5514
|
setIsPanelOpen(false);
|
|
5360
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5515
|
+
_optionalChain([analytics, 'optionalAccess', _177 => _177.visitEnded, 'call', _178 => _178()]);
|
|
5361
5516
|
setDeposits([]);
|
|
5362
5517
|
setHasMore(false);
|
|
5363
5518
|
setError(null);
|
|
@@ -5516,11 +5671,11 @@ var NOTHING_TO_STOP = () => {
|
|
|
5516
5671
|
};
|
|
5517
5672
|
function resolveThemeMode(mode) {
|
|
5518
5673
|
if (mode !== "system") return mode;
|
|
5519
|
-
return _optionalChain([globalThis, 'access',
|
|
5674
|
+
return _optionalChain([globalThis, 'access', _179 => _179.matchMedia, 'optionalCall', _180 => _180(DARK_SCHEME_QUERY), 'access', _181 => _181.matches]) ? "dark" : "light";
|
|
5520
5675
|
}
|
|
5521
5676
|
function followSystemAppearance(mode, onChange) {
|
|
5522
5677
|
if (mode !== "system") return NOTHING_TO_STOP;
|
|
5523
|
-
const query = _optionalChain([globalThis, 'access',
|
|
5678
|
+
const query = _optionalChain([globalThis, 'access', _182 => _182.matchMedia, 'optionalCall', _183 => _183(DARK_SCHEME_QUERY)]);
|
|
5524
5679
|
if (!query) return NOTHING_TO_STOP;
|
|
5525
5680
|
query.addEventListener("change", onChange);
|
|
5526
5681
|
return () => query.removeEventListener("change", onChange);
|
|
@@ -5528,22 +5683,22 @@ function followSystemAppearance(mode, onChange) {
|
|
|
5528
5683
|
function applyTheme(element, theme) {
|
|
5529
5684
|
if (!element) return NOTHING_TO_STOP;
|
|
5530
5685
|
const parent = element.parentElement;
|
|
5531
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
5686
|
+
const targets = _optionalChain([parent, 'optionalAccess', _184 => _184.classList, 'access', _185 => _185.contains, 'call', _186 => _186("rs-modal-content")]) ? [element, parent] : [element];
|
|
5532
5687
|
const paintMode = () => {
|
|
5533
|
-
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess',
|
|
5688
|
+
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess', _187 => _187.mode]));
|
|
5534
5689
|
for (const t of targets) {
|
|
5535
5690
|
if (resolved) t.setAttribute("data-theme", resolved);
|
|
5536
5691
|
else t.removeAttribute("data-theme");
|
|
5537
5692
|
}
|
|
5538
5693
|
};
|
|
5539
5694
|
paintMode();
|
|
5540
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5695
|
+
if (_optionalChain([theme, 'optionalAccess', _188 => _188.fontColor])) {
|
|
5541
5696
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
5542
5697
|
}
|
|
5543
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5698
|
+
if (_optionalChain([theme, 'optionalAccess', _189 => _189.iconColor])) {
|
|
5544
5699
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
5545
5700
|
}
|
|
5546
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5701
|
+
if (_optionalChain([theme, 'optionalAccess', _190 => _190.ctaColor])) {
|
|
5547
5702
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
5548
5703
|
if (derived) {
|
|
5549
5704
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -5568,25 +5723,25 @@ function applyTheme(element, theme) {
|
|
|
5568
5723
|
}
|
|
5569
5724
|
} else {
|
|
5570
5725
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
5571
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5726
|
+
if (_optionalChain([theme, 'optionalAccess', _191 => _191.ctaHoverColor])) {
|
|
5572
5727
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
5573
5728
|
}
|
|
5574
5729
|
}
|
|
5575
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5730
|
+
if (_optionalChain([theme, 'optionalAccess', _192 => _192.borderColor])) {
|
|
5576
5731
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
5577
5732
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
5578
5733
|
}
|
|
5579
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5734
|
+
if (_optionalChain([theme, 'optionalAccess', _193 => _193.backgroundColor])) {
|
|
5580
5735
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
5581
5736
|
}
|
|
5582
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5737
|
+
if (_optionalChain([theme, 'optionalAccess', _194 => _194.radius])) {
|
|
5583
5738
|
const scale = RADIUS_SCALE[theme.radius];
|
|
5584
5739
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
5585
5740
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
5586
5741
|
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
5587
5742
|
setVar(targets, "--rs-radius", scale.md);
|
|
5588
5743
|
}
|
|
5589
|
-
return followSystemAppearance(_optionalChain([theme, 'optionalAccess',
|
|
5744
|
+
return followSystemAppearance(_optionalChain([theme, 'optionalAccess', _195 => _195.mode]), paintMode);
|
|
5590
5745
|
}
|
|
5591
5746
|
|
|
5592
5747
|
// src/core/removed-props.ts
|
|
@@ -5675,20 +5830,20 @@ function sinkFor(source) {
|
|
|
5675
5830
|
if (source.modal === "deposit") {
|
|
5676
5831
|
const at2 = () => source.controllerRef.current;
|
|
5677
5832
|
return {
|
|
5678
|
-
opened: (detail) => _optionalChain([at2, 'call',
|
|
5679
|
-
rowViewed: (detail) => _optionalChain([at2, 'call',
|
|
5680
|
-
loadMore: (detail) => _optionalChain([at2, 'call',
|
|
5681
|
-
fallbackOpened: (detail) => _optionalChain([at2, 'call',
|
|
5682
|
-
recoveryStarted: (detail) => _optionalChain([at2, 'call',
|
|
5833
|
+
opened: (detail) => _optionalChain([at2, 'call', _196 => _196(), 'optionalAccess', _197 => _197.historyOpened, 'call', _198 => _198({ ...detail, step: _nullishCoalesce(_optionalChain([at2, 'call', _199 => _199(), 'optionalAccess', _200 => _200.step]), () => ( null)) })]),
|
|
5834
|
+
rowViewed: (detail) => _optionalChain([at2, 'call', _201 => _201(), 'optionalAccess', _202 => _202.historyRowViewed, 'call', _203 => _203(detail)]),
|
|
5835
|
+
loadMore: (detail) => _optionalChain([at2, 'call', _204 => _204(), 'optionalAccess', _205 => _205.historyLoadMore, 'call', _206 => _206(detail)]),
|
|
5836
|
+
fallbackOpened: (detail) => _optionalChain([at2, 'call', _207 => _207(), 'optionalAccess', _208 => _208.historyFallbackOpened, 'call', _209 => _209(detail)]),
|
|
5837
|
+
recoveryStarted: (detail) => _optionalChain([at2, 'call', _210 => _210(), 'optionalAccess', _211 => _211.historyRecoveryStarted, 'call', _212 => _212(detail)])
|
|
5683
5838
|
};
|
|
5684
5839
|
}
|
|
5685
5840
|
const at = () => source.controllerRef.current;
|
|
5686
5841
|
return {
|
|
5687
|
-
opened: (detail) => _optionalChain([at, 'call',
|
|
5688
|
-
rowViewed: (detail) => _optionalChain([at, 'call',
|
|
5689
|
-
loadMore: (detail) => _optionalChain([at, 'call',
|
|
5690
|
-
fallbackOpened: (detail) => _optionalChain([at, 'call',
|
|
5691
|
-
recoveryStarted: (detail) => _optionalChain([at, 'call',
|
|
5842
|
+
opened: (detail) => _optionalChain([at, 'call', _213 => _213(), 'optionalAccess', _214 => _214.historyOpened, 'call', _215 => _215({ ...detail, step: _nullishCoalesce(_optionalChain([at, 'call', _216 => _216(), 'optionalAccess', _217 => _217.step]), () => ( null)) })]),
|
|
5843
|
+
rowViewed: (detail) => _optionalChain([at, 'call', _218 => _218(), 'optionalAccess', _219 => _219.historyRowViewed, 'call', _220 => _220(detail)]),
|
|
5844
|
+
loadMore: (detail) => _optionalChain([at, 'call', _221 => _221(), 'optionalAccess', _222 => _222.historyLoadMore, 'call', _223 => _223(detail)]),
|
|
5845
|
+
fallbackOpened: (detail) => _optionalChain([at, 'call', _224 => _224(), 'optionalAccess', _225 => _225.historyFallbackOpened, 'call', _226 => _226(detail)]),
|
|
5846
|
+
recoveryStarted: (detail) => _optionalChain([at, 'call', _227 => _227(), 'optionalAccess', _228 => _228.historyRecoveryStarted, 'call', _229 => _229(detail)])
|
|
5692
5847
|
};
|
|
5693
5848
|
}
|
|
5694
5849
|
function badgeState(badge) {
|
|
@@ -5714,7 +5869,7 @@ function createHistoryAnalytics(source) {
|
|
|
5714
5869
|
sink.opened({
|
|
5715
5870
|
history_visit_id: visitId,
|
|
5716
5871
|
badge: badgeState(badge),
|
|
5717
|
-
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
5872
|
+
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess', _230 => _230.count]), () => ( 0))
|
|
5718
5873
|
});
|
|
5719
5874
|
},
|
|
5720
5875
|
visitEnded() {
|
|
@@ -5778,7 +5933,7 @@ function resolveChain(targetChain) {
|
|
|
5778
5933
|
return _chunkOY5N3E6Lcjs.targetChainToCaip2.call(void 0, targetChain);
|
|
5779
5934
|
}
|
|
5780
5935
|
function resolveToken(targetToken) {
|
|
5781
|
-
const raw = _optionalChain([targetToken, 'optionalAccess',
|
|
5936
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()]);
|
|
5782
5937
|
if (!raw) return void 0;
|
|
5783
5938
|
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
5784
5939
|
if (BASE58_TOKEN.test(raw)) return raw;
|
|
@@ -5836,8 +5991,8 @@ function Tooltip({ content, children, className }) {
|
|
|
5836
5991
|
function handleOutside(event) {
|
|
5837
5992
|
const target = event.target;
|
|
5838
5993
|
if (!target) return;
|
|
5839
|
-
if (_optionalChain([triggerRef, 'access',
|
|
5840
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
5994
|
+
if (_optionalChain([triggerRef, 'access', _233 => _233.current, 'optionalAccess', _234 => _234.contains, 'call', _235 => _235(target)])) return;
|
|
5995
|
+
if (_optionalChain([bubbleRef, 'access', _236 => _236.current, 'optionalAccess', _237 => _237.contains, 'call', _238 => _238(target)])) return;
|
|
5841
5996
|
setOpen(false);
|
|
5842
5997
|
}
|
|
5843
5998
|
function handleKey(event) {
|
|
@@ -6066,7 +6221,7 @@ function asNumber(value) {
|
|
|
6066
6221
|
const trimmed = value.trim();
|
|
6067
6222
|
if (!trimmed) return void 0;
|
|
6068
6223
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
6069
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
6224
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _239 => _239[1]])) {
|
|
6070
6225
|
const parsed2 = Number(caipMatch[1]);
|
|
6071
6226
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
6072
6227
|
}
|
|
@@ -6085,24 +6240,24 @@ function asAddress(value) {
|
|
|
6085
6240
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
6086
6241
|
}
|
|
6087
6242
|
function getEventTxHash(event) {
|
|
6088
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6243
|
+
if (!_optionalChain([event, 'optionalAccess', _240 => _240.type])) return void 0;
|
|
6089
6244
|
if (event.type === "deposit-received") {
|
|
6090
|
-
return asString(_optionalChain([event, 'access',
|
|
6245
|
+
return asString(_optionalChain([event, 'access', _241 => _241.data, 'optionalAccess', _242 => _242.transactionHash]));
|
|
6091
6246
|
}
|
|
6092
6247
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
6093
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
6094
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
6095
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
6248
|
+
const deposit = isRecord(_optionalChain([event, 'access', _243 => _243.data, 'optionalAccess', _244 => _244.deposit])) ? event.data.deposit : void 0;
|
|
6249
|
+
const source = isRecord(_optionalChain([event, 'access', _245 => _245.data, 'optionalAccess', _246 => _246.source])) ? event.data.source : void 0;
|
|
6250
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _247 => _247.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _248 => _248.transactionHash]))));
|
|
6096
6251
|
}
|
|
6097
6252
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
6098
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
6099
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
6100
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
6253
|
+
const deposit = isRecord(_optionalChain([event, 'access', _249 => _249.data, 'optionalAccess', _250 => _250.deposit])) ? event.data.deposit : void 0;
|
|
6254
|
+
const source = isRecord(_optionalChain([event, 'access', _251 => _251.data, 'optionalAccess', _252 => _252.source])) ? event.data.source : void 0;
|
|
6255
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _253 => _253.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _254 => _254.transactionHash]))));
|
|
6101
6256
|
}
|
|
6102
6257
|
return void 0;
|
|
6103
6258
|
}
|
|
6104
6259
|
function getEventSourceDetails(event) {
|
|
6105
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6260
|
+
if (!_optionalChain([event, 'optionalAccess', _255 => _255.type]) || !isRecord(event.data)) return {};
|
|
6106
6261
|
if (event.type === "deposit-received") {
|
|
6107
6262
|
return {
|
|
6108
6263
|
chainId: asNumber(event.data.chain),
|
|
@@ -6114,9 +6269,9 @@ function getEventSourceDetails(event) {
|
|
|
6114
6269
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
6115
6270
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
6116
6271
|
return {
|
|
6117
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
6118
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
6119
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
6272
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _256 => _256.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _257 => _257.chain])))),
|
|
6273
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _258 => _258.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _259 => _259.amount])))),
|
|
6274
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _260 => _260.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _261 => _261.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _262 => _262.token]))))
|
|
6120
6275
|
};
|
|
6121
6276
|
}
|
|
6122
6277
|
return {};
|
|
@@ -6130,7 +6285,7 @@ function asChain(value) {
|
|
|
6130
6285
|
return asNumber(value);
|
|
6131
6286
|
}
|
|
6132
6287
|
function getEventDestinationDetails(event) {
|
|
6133
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6288
|
+
if (!_optionalChain([event, 'optionalAccess', _263 => _263.type]) || !isRecord(event.data)) return {};
|
|
6134
6289
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
6135
6290
|
return {};
|
|
6136
6291
|
}
|
|
@@ -6140,14 +6295,14 @@ function getEventDestinationDetails(event) {
|
|
|
6140
6295
|
return {
|
|
6141
6296
|
chainId: asChain(destination.chain),
|
|
6142
6297
|
amount: asAmount(destination.amount),
|
|
6143
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
6298
|
+
token: _optionalChain([token, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]) || void 0
|
|
6144
6299
|
};
|
|
6145
6300
|
}
|
|
6146
6301
|
function isDepositEvent(event) {
|
|
6147
|
-
return _optionalChain([event, 'optionalAccess',
|
|
6302
|
+
return _optionalChain([event, 'optionalAccess', _266 => _266.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _267 => _267.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _268 => _268.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _269 => _269.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _270 => _270.type]) === "error";
|
|
6148
6303
|
}
|
|
6149
6304
|
function isFailedEvent(event) {
|
|
6150
|
-
return _optionalChain([event, 'optionalAccess',
|
|
6305
|
+
return _optionalChain([event, 'optionalAccess', _271 => _271.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _272 => _272.type]) === "error";
|
|
6151
6306
|
}
|
|
6152
6307
|
function isHexString(value) {
|
|
6153
6308
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -6159,7 +6314,7 @@ function txRefsMatch(a, b) {
|
|
|
6159
6314
|
return a === b;
|
|
6160
6315
|
}
|
|
6161
6316
|
function formatBridgeFailedMessage(event) {
|
|
6162
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
6317
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _273 => _273.data]), () => ( {}));
|
|
6163
6318
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
6164
6319
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
6165
6320
|
function toUserFacingFailure(raw) {
|
|
@@ -6187,7 +6342,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
6187
6342
|
return { message: "Bridge failed" };
|
|
6188
6343
|
}
|
|
6189
6344
|
function failureMessageForEvent(event) {
|
|
6190
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6345
|
+
if (_optionalChain([event, 'optionalAccess', _274 => _274.type]) === "error") {
|
|
6191
6346
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
6192
6347
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
6193
6348
|
}
|
|
@@ -6226,7 +6381,7 @@ async function fetchTokenPriceUsd(service, token) {
|
|
|
6226
6381
|
}
|
|
6227
6382
|
function useTokenPrices(service, tokens) {
|
|
6228
6383
|
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
6229
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
6384
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _275 => _275.symbol])));
|
|
6230
6385
|
const entries = [
|
|
6231
6386
|
...new Map(
|
|
6232
6387
|
defined.flatMap((token) => {
|
|
@@ -6325,12 +6480,6 @@ var MAX_POLL_INTERVAL = 3e4;
|
|
|
6325
6480
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
6326
6481
|
var SWAPPED_RECEIPT_STATUS_RETRY_INTERVAL_MS = 1e3;
|
|
6327
6482
|
var SWAPPED_FIAT_STATUS_MAX_ATTEMPTS = 12;
|
|
6328
|
-
var ESCALATED_DELAY_MS = 10 * 60 * 1e3;
|
|
6329
|
-
var SOFT_DELAY_MS = {
|
|
6330
|
-
confirming: 90 * 1e3,
|
|
6331
|
-
received: 90 * 1e3,
|
|
6332
|
-
bridging: 4 * 60 * 1e3
|
|
6333
|
-
};
|
|
6334
6483
|
var PHASE_TIMINGS_PREFIX = "rhinestone:phase-timings";
|
|
6335
6484
|
var PAYMENT_METHOD_LABELS = {
|
|
6336
6485
|
creditcard: "Card",
|
|
@@ -6415,12 +6564,12 @@ function isEventForTx(event, txHash) {
|
|
|
6415
6564
|
return txRefsMatch(eventTxHash, txHash);
|
|
6416
6565
|
}
|
|
6417
6566
|
function parseWebhookTimestamp(event) {
|
|
6418
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
6567
|
+
if (typeof _optionalChain([event, 'optionalAccess', _276 => _276.time]) !== "string") return void 0;
|
|
6419
6568
|
const timestamp = Date.parse(event.time);
|
|
6420
6569
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
6421
6570
|
}
|
|
6422
6571
|
function syncPhaseTimings(previous, event) {
|
|
6423
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6572
|
+
if (!_optionalChain([event, 'optionalAccess', _277 => _277.type])) return previous;
|
|
6424
6573
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
6425
6574
|
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;
|
|
6426
6575
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -6482,46 +6631,46 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
6482
6631
|
if (state.type === "complete") {
|
|
6483
6632
|
return void 0;
|
|
6484
6633
|
}
|
|
6485
|
-
if (_optionalChain([state, 'access',
|
|
6634
|
+
if (_optionalChain([state, 'access', _278 => _278.lastEvent, 'optionalAccess', _279 => _279.type]) === "bridge-started" || _optionalChain([state, 'access', _280 => _280.lastEvent, 'optionalAccess', _281 => _281.type]) === "bridge-complete")
|
|
6486
6635
|
return "bridging";
|
|
6487
|
-
if (_optionalChain([state, 'access',
|
|
6636
|
+
if (_optionalChain([state, 'access', _282 => _282.lastEvent, 'optionalAccess', _283 => _283.type]) === "deposit-received") return "received";
|
|
6488
6637
|
return "confirming";
|
|
6489
6638
|
}
|
|
6490
6639
|
function getCompletionDestinationTxHash(event) {
|
|
6491
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
6492
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
6493
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
6640
|
+
const eventData = _optionalChain([event, 'optionalAccess', _284 => _284.data]);
|
|
6641
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _285 => _285.swap, 'optionalAccess', _286 => _286.transactionHash]);
|
|
6642
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _287 => _287.destination, 'optionalAccess', _288 => _288.transactionHash]);
|
|
6494
6643
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
6495
6644
|
}
|
|
6496
6645
|
function getTerminalProcessingOutcome(event) {
|
|
6497
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6646
|
+
if (_optionalChain([event, 'optionalAccess', _289 => _289.type]) === "post-bridge-swap-complete") {
|
|
6498
6647
|
return {
|
|
6499
6648
|
type: "complete",
|
|
6500
6649
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
6501
6650
|
};
|
|
6502
6651
|
}
|
|
6503
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6652
|
+
if (_optionalChain([event, 'optionalAccess', _290 => _290.type]) === "post-bridge-swap-failed") {
|
|
6504
6653
|
return {
|
|
6505
6654
|
type: "failed",
|
|
6506
6655
|
message: formatBridgeFailedMessage(event).message
|
|
6507
6656
|
};
|
|
6508
6657
|
}
|
|
6509
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6658
|
+
if (_optionalChain([event, 'optionalAccess', _291 => _291.type]) === "bridge-complete") {
|
|
6510
6659
|
return {
|
|
6511
6660
|
type: "complete",
|
|
6512
6661
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
6513
6662
|
};
|
|
6514
6663
|
}
|
|
6515
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6664
|
+
if (_optionalChain([event, 'optionalAccess', _292 => _292.type]) === "bridge-failed") {
|
|
6516
6665
|
return {
|
|
6517
6666
|
type: "failed",
|
|
6518
6667
|
message: formatBridgeFailedMessage(event).message
|
|
6519
6668
|
};
|
|
6520
6669
|
}
|
|
6521
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6670
|
+
if (_optionalChain([event, 'optionalAccess', _293 => _293.type]) === "error") {
|
|
6522
6671
|
return {
|
|
6523
6672
|
type: "failed",
|
|
6524
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
6673
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _294 => _294.data, 'optionalAccess', _295 => _295.message]), () => ( "Unknown error"))
|
|
6525
6674
|
};
|
|
6526
6675
|
}
|
|
6527
6676
|
return null;
|
|
@@ -6529,10 +6678,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
6529
6678
|
function getInitialProcessingState(event, txHash) {
|
|
6530
6679
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
6531
6680
|
const terminal = getTerminalProcessingOutcome(event);
|
|
6532
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
6681
|
+
if (_optionalChain([terminal, 'optionalAccess', _296 => _296.type]) === "complete") {
|
|
6533
6682
|
return { type: "complete", lastEvent: event };
|
|
6534
6683
|
}
|
|
6535
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
6684
|
+
if (_optionalChain([terminal, 'optionalAccess', _297 => _297.type]) === "failed") {
|
|
6536
6685
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
6537
6686
|
}
|
|
6538
6687
|
if (isDepositEvent(event)) {
|
|
@@ -6541,7 +6690,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
6541
6690
|
return null;
|
|
6542
6691
|
}
|
|
6543
6692
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
6544
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
6693
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _298 => _298.data, 'optionalAccess', _299 => _299.source, 'optionalAccess', _300 => _300.transactionHash]), () => ( fallbackTxHash));
|
|
6545
6694
|
}
|
|
6546
6695
|
function ProcessingStep({
|
|
6547
6696
|
smartAccount,
|
|
@@ -6610,7 +6759,6 @@ function ProcessingStep({
|
|
|
6610
6759
|
}
|
|
6611
6760
|
return { type: "processing" };
|
|
6612
6761
|
});
|
|
6613
|
-
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0, 0);
|
|
6614
6762
|
const [phaseTimings, setPhaseTimings] = _react.useState.call(void 0, () => {
|
|
6615
6763
|
const saved = loadPhaseTimings(txHash);
|
|
6616
6764
|
if (saved) {
|
|
@@ -6619,7 +6767,15 @@ function ProcessingStep({
|
|
|
6619
6767
|
}
|
|
6620
6768
|
return { startedAt: startTimeRef.current };
|
|
6621
6769
|
});
|
|
6622
|
-
const [
|
|
6770
|
+
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0,
|
|
6771
|
+
() => Math.max(0, Math.floor((Date.now() - startTimeRef.current) / 1e3))
|
|
6772
|
+
);
|
|
6773
|
+
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess', _301 => _301.timing]));
|
|
6774
|
+
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess', _302 => _302.timing]) !== void 0) {
|
|
6775
|
+
setLatchedTiming(quote.timing);
|
|
6776
|
+
}
|
|
6777
|
+
const timingStateRef = _react.useRef.call(void 0, "expected");
|
|
6778
|
+
const servedTimingLatchRef = _react.useRef.call(void 0, false);
|
|
6623
6779
|
const updatePhaseTimings = _react.useCallback.call(void 0,
|
|
6624
6780
|
(updater) => {
|
|
6625
6781
|
setPhaseTimings((previous) => {
|
|
@@ -6646,7 +6802,7 @@ function ProcessingStep({
|
|
|
6646
6802
|
flowLabel
|
|
6647
6803
|
});
|
|
6648
6804
|
const context = processingContextRef.current;
|
|
6649
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
6805
|
+
_optionalChain([onDepositCompleteRef, 'access', _303 => _303.current, 'optionalCall', _304 => _304(txHash, void 0, {
|
|
6650
6806
|
amount: context.amount,
|
|
6651
6807
|
sourceChain: context.sourceChain,
|
|
6652
6808
|
sourceToken: context.sourceToken,
|
|
@@ -6679,7 +6835,7 @@ function ProcessingStep({
|
|
|
6679
6835
|
destinationTxHash: outcome.destinationTxHash,
|
|
6680
6836
|
event: event.type
|
|
6681
6837
|
});
|
|
6682
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
6838
|
+
_optionalChain([onDepositCompleteRef, 'access', _305 => _305.current, 'optionalCall', _306 => _306(
|
|
6683
6839
|
sourceTxHash2,
|
|
6684
6840
|
outcome.destinationTxHash,
|
|
6685
6841
|
{
|
|
@@ -6699,7 +6855,7 @@ function ProcessingStep({
|
|
|
6699
6855
|
message: outcome.message,
|
|
6700
6856
|
event: event.type
|
|
6701
6857
|
});
|
|
6702
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
6858
|
+
_optionalChain([onDepositFailedRef, 'access', _307 => _307.current, 'optionalCall', _308 => _308(txHash, outcome.message)]);
|
|
6703
6859
|
}, [
|
|
6704
6860
|
debug,
|
|
6705
6861
|
onDepositCompleteRef,
|
|
@@ -6710,8 +6866,8 @@ function ProcessingStep({
|
|
|
6710
6866
|
const onSettledChangeRef = _react.useRef.call(void 0, onSettledChange);
|
|
6711
6867
|
onSettledChangeRef.current = onSettledChange;
|
|
6712
6868
|
_react.useEffect.call(void 0, () => {
|
|
6713
|
-
_optionalChain([onSettledChangeRef, 'access',
|
|
6714
|
-
return () => _optionalChain([onSettledChangeRef, 'access',
|
|
6869
|
+
_optionalChain([onSettledChangeRef, 'access', _309 => _309.current, 'optionalCall', _310 => _310(state.type !== "processing")]);
|
|
6870
|
+
return () => _optionalChain([onSettledChangeRef, 'access', _311 => _311.current, 'optionalCall', _312 => _312(false)]);
|
|
6715
6871
|
}, [state.type]);
|
|
6716
6872
|
_react.useEffect.call(void 0, () => {
|
|
6717
6873
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -6737,13 +6893,13 @@ function ProcessingStep({
|
|
|
6737
6893
|
updatePhaseTimings(
|
|
6738
6894
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
6739
6895
|
);
|
|
6740
|
-
}, [_optionalChain([state, 'access',
|
|
6896
|
+
}, [_optionalChain([state, 'access', _313 => _313.lastEvent, 'optionalAccess', _314 => _314.time]), _optionalChain([state, 'access', _315 => _315.lastEvent, 'optionalAccess', _316 => _316.type]), updatePhaseTimings]);
|
|
6741
6897
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
6742
6898
|
_react.useEffect.call(void 0, () => {
|
|
6743
6899
|
let cancelled = false;
|
|
6744
6900
|
let timeoutId;
|
|
6745
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
6746
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
6901
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _317 => _317.variant]) === "fiat";
|
|
6902
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _318 => _318.expectedOrderUuid]), () => ( null));
|
|
6747
6903
|
setSwappedFiatContext(null);
|
|
6748
6904
|
if (isFiatSwappedOrder && !expectedOrderUuid) {
|
|
6749
6905
|
return () => {
|
|
@@ -6793,8 +6949,8 @@ function ProcessingStep({
|
|
|
6793
6949
|
smartAccount,
|
|
6794
6950
|
txHash,
|
|
6795
6951
|
isSwappedOrder,
|
|
6796
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
6797
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
6952
|
+
_optionalChain([swappedContext, 'optionalAccess', _319 => _319.variant]),
|
|
6953
|
+
_optionalChain([swappedContext, 'optionalAccess', _320 => _320.expectedOrderUuid])
|
|
6798
6954
|
]);
|
|
6799
6955
|
_react.useEffect.call(void 0, () => {
|
|
6800
6956
|
if (directTransfer) return;
|
|
@@ -6820,17 +6976,17 @@ function ProcessingStep({
|
|
|
6820
6976
|
debugLog(debug, "processing", "poll:event", {
|
|
6821
6977
|
type: lastEvent2.type,
|
|
6822
6978
|
matchesTx: eventMatchesTx,
|
|
6823
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
6979
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _321 => _321.intentId])
|
|
6824
6980
|
});
|
|
6825
6981
|
}
|
|
6826
6982
|
if (!isMounted) return;
|
|
6827
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
6983
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _322 => _322.type]) === "bridge-complete") {
|
|
6828
6984
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
6829
6985
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
6830
6986
|
eventForCurrentTx,
|
|
6831
6987
|
txHash
|
|
6832
6988
|
);
|
|
6833
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
6989
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _323 => _323.data, 'optionalAccess', _324 => _324.destination, 'optionalAccess', _325 => _325.transactionHash]);
|
|
6834
6990
|
debugLog(debug, "processing", "state:complete", {
|
|
6835
6991
|
txHash,
|
|
6836
6992
|
sourceTxHash: sourceTxHash2,
|
|
@@ -6838,7 +6994,7 @@ function ProcessingStep({
|
|
|
6838
6994
|
event: eventForCurrentTx.type
|
|
6839
6995
|
});
|
|
6840
6996
|
const context = processingContextRef.current;
|
|
6841
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
6997
|
+
_optionalChain([onDepositCompleteRef, 'access', _326 => _326.current, 'optionalCall', _327 => _327(sourceTxHash2, destinationTxHash2, {
|
|
6842
6998
|
amount: context.amount,
|
|
6843
6999
|
sourceChain: context.sourceChain,
|
|
6844
7000
|
sourceToken: context.sourceToken,
|
|
@@ -6849,7 +7005,7 @@ function ProcessingStep({
|
|
|
6849
7005
|
})]);
|
|
6850
7006
|
return;
|
|
6851
7007
|
}
|
|
6852
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7008
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _328 => _328.type]) === "bridge-failed") {
|
|
6853
7009
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
6854
7010
|
setState({
|
|
6855
7011
|
type: "failed",
|
|
@@ -6861,11 +7017,11 @@ function ProcessingStep({
|
|
|
6861
7017
|
message: formatted.message,
|
|
6862
7018
|
code: formatted.code
|
|
6863
7019
|
});
|
|
6864
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7020
|
+
_optionalChain([onDepositFailedRef, 'access', _329 => _329.current, 'optionalCall', _330 => _330(txHash, formatted.message)]);
|
|
6865
7021
|
return;
|
|
6866
7022
|
}
|
|
6867
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
6868
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
7023
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _331 => _331.type]) === "error") {
|
|
7024
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _332 => _332.data, 'optionalAccess', _333 => _333.message]), () => ( "Unknown error"));
|
|
6869
7025
|
setState({
|
|
6870
7026
|
type: "failed",
|
|
6871
7027
|
message: errorMessage,
|
|
@@ -6875,7 +7031,7 @@ function ProcessingStep({
|
|
|
6875
7031
|
txHash,
|
|
6876
7032
|
message: errorMessage
|
|
6877
7033
|
});
|
|
6878
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7034
|
+
_optionalChain([onDepositFailedRef, 'access', _334 => _334.current, 'optionalCall', _335 => _335(txHash, errorMessage)]);
|
|
6879
7035
|
return;
|
|
6880
7036
|
}
|
|
6881
7037
|
setState((previous) => ({
|
|
@@ -6925,21 +7081,6 @@ function ProcessingStep({
|
|
|
6925
7081
|
state.type,
|
|
6926
7082
|
txHash
|
|
6927
7083
|
]);
|
|
6928
|
-
_react.useEffect.call(void 0, () => {
|
|
6929
|
-
if (directTransfer || state.type !== "processing") return;
|
|
6930
|
-
const timeoutId = setTimeout(() => {
|
|
6931
|
-
if (escalatedDelayRef.current) return;
|
|
6932
|
-
escalatedDelayRef.current = true;
|
|
6933
|
-
setHasEscalatedDelay(true);
|
|
6934
|
-
const message = "Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.";
|
|
6935
|
-
debugLog(debug, "processing", "state:delay-escalated", {
|
|
6936
|
-
txHash,
|
|
6937
|
-
timeoutMs: ESCALATED_DELAY_MS
|
|
6938
|
-
});
|
|
6939
|
-
_optionalChain([onErrorRef, 'access', _333 => _333.current, 'optionalCall', _334 => _334(message, "PROCESS_TIMEOUT")]);
|
|
6940
|
-
}, ESCALATED_DELAY_MS);
|
|
6941
|
-
return () => clearTimeout(timeoutId);
|
|
6942
|
-
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
6943
7084
|
const isComplete = state.type === "complete";
|
|
6944
7085
|
const isFailed = state.type === "failed";
|
|
6945
7086
|
const isProcessing = state.type === "processing";
|
|
@@ -6948,18 +7089,18 @@ function ProcessingStep({
|
|
|
6948
7089
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
6949
7090
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
6950
7091
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
6951
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7092
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _336 => _336.data, 'optionalAccess', _337 => _337.destination, 'optionalAccess', _338 => _338.transactionHash]) || null;
|
|
6952
7093
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
6953
7094
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
6954
7095
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
6955
7096
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
6956
7097
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
6957
7098
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
6958
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7099
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _339 => _339.data, 'optionalAccess', _340 => _340.source, 'optionalAccess', _341 => _341.transactionHash]);
|
|
6959
7100
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
6960
7101
|
_react.useEffect.call(void 0, () => {
|
|
6961
7102
|
if (sourceTxHashPending && settledSourceTxHash) {
|
|
6962
|
-
_optionalChain([onSourceTransactionObserved, 'optionalCall',
|
|
7103
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _342 => _342(settledSourceTxHash)]);
|
|
6963
7104
|
}
|
|
6964
7105
|
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
6965
7106
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
@@ -7039,16 +7180,50 @@ function ProcessingStep({
|
|
|
7039
7180
|
const currentPhaseId = getCurrentPhaseId(state, phaseTimings);
|
|
7040
7181
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
7041
7182
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7183
|
+
if (latchedTiming !== void 0 && !servedTimingLatchRef.current) {
|
|
7184
|
+
servedTimingLatchRef.current = true;
|
|
7185
|
+
timingStateRef.current = "expected";
|
|
7186
|
+
}
|
|
7187
|
+
const timingState = isProcessing ? advancePendingTimingState(
|
|
7188
|
+
timingStateRef.current,
|
|
7189
|
+
resolvePendingTimingState({
|
|
7190
|
+
timing: latchedTiming,
|
|
7191
|
+
totalElapsedMs: elapsedSeconds * 1e3,
|
|
7192
|
+
phaseId: currentPhaseId,
|
|
7193
|
+
phaseElapsedMs: activePhaseElapsedMs
|
|
7194
|
+
})
|
|
7195
|
+
) : timingStateRef.current;
|
|
7196
|
+
timingStateRef.current = timingState;
|
|
7197
|
+
const expectedDuration = latchedTiming && timingState === "expected" ? formatExpectedDuration(latchedTiming.expectedSeconds) : void 0;
|
|
7198
|
+
_react.useEffect.call(void 0, () => {
|
|
7199
|
+
if (directTransfer || !isProcessing || timingState !== "escalated") return;
|
|
7200
|
+
if (escalatedDelayRef.current) return;
|
|
7201
|
+
escalatedDelayRef.current = true;
|
|
7202
|
+
debugLog(debug, "processing", "state:delay-escalated", {
|
|
7203
|
+
txHash,
|
|
7204
|
+
timeoutMs: latchedTiming ? resolveServedThresholds(latchedTiming).escalatedMs : FALLBACK_ESCALATED_DELAY_MS,
|
|
7205
|
+
served: latchedTiming !== void 0
|
|
7206
|
+
});
|
|
7207
|
+
_optionalChain([onErrorRef, 'access', _343 => _343.current, 'optionalCall', _344 => _344(
|
|
7208
|
+
"Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.",
|
|
7209
|
+
"PROCESS_TIMEOUT"
|
|
7210
|
+
)]);
|
|
7211
|
+
}, [
|
|
7212
|
+
debug,
|
|
7213
|
+
directTransfer,
|
|
7214
|
+
isProcessing,
|
|
7215
|
+
latchedTiming,
|
|
7216
|
+
onErrorRef,
|
|
7217
|
+
timingState,
|
|
7218
|
+
txHash
|
|
7219
|
+
]);
|
|
7045
7220
|
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
7046
7221
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
7047
7222
|
const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, displaySourceChain);
|
|
7048
7223
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
7049
7224
|
const timerText = formatTimer(elapsedSeconds);
|
|
7050
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7051
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7225
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _345 => _345.feeSponsored]), () => ( false));
|
|
7226
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _346 => _346.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
7052
7227
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
7053
7228
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
7054
7229
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -7059,20 +7234,20 @@ function ProcessingStep({
|
|
|
7059
7234
|
/* @__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 }) })
|
|
7060
7235
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
7061
7236
|
if (isComplete && isSwappedOrder) {
|
|
7062
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7237
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _347 => _347.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _348 => _348.paymentMethod]))), () => ( null));
|
|
7063
7238
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
7064
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
7239
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _349 => _349.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
7065
7240
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
7066
7241
|
effectivePaymentMethod
|
|
7067
7242
|
) : null;
|
|
7068
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
7069
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7243
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _350 => _350.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
7244
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _351 => _351.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
7070
7245
|
const depositedAmount = receiveDisplay;
|
|
7071
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7246
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _352 => _352.onrampFeeUsd]), () => ( null));
|
|
7072
7247
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
7073
7248
|
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.";
|
|
7074
7249
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
7075
|
-
_optionalChain([quote, 'optionalAccess',
|
|
7250
|
+
_optionalChain([quote, 'optionalAccess', _353 => _353.fees, 'access', _354 => _354.breakdown]),
|
|
7076
7251
|
sponsoredFeeTooltip
|
|
7077
7252
|
);
|
|
7078
7253
|
const feeRows = [];
|
|
@@ -7159,7 +7334,7 @@ function ProcessingStep({
|
|
|
7159
7334
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
7160
7335
|
] }),
|
|
7161
7336
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
7162
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7337
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _355 => _355.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7163
7338
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
7164
7339
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
7165
7340
|
"$",
|
|
@@ -7171,7 +7346,7 @@ function ProcessingStep({
|
|
|
7171
7346
|
] })
|
|
7172
7347
|
] })
|
|
7173
7348
|
] }),
|
|
7174
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7349
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _356 => _356.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7175
7350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
7176
7351
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
7177
7352
|
"$",
|
|
@@ -7238,7 +7413,7 @@ function ProcessingStep({
|
|
|
7238
7413
|
) })
|
|
7239
7414
|
] })
|
|
7240
7415
|
] }) : (() => {
|
|
7241
|
-
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess',
|
|
7416
|
+
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess', _357 => _357.fees]));
|
|
7242
7417
|
if (display !== null) {
|
|
7243
7418
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7244
7419
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -7270,6 +7445,11 @@ function ProcessingStep({
|
|
|
7270
7445
|
})()
|
|
7271
7446
|
] }),
|
|
7272
7447
|
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Callout, { variant: "error", children: failureMessage }),
|
|
7448
|
+
isProcessing && expectedDuration !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-pending-expectation", children: [
|
|
7449
|
+
"Usually arrives in ",
|
|
7450
|
+
expectedDuration
|
|
7451
|
+
] }),
|
|
7452
|
+
isProcessing && latchedTiming !== void 0 && timingState !== "expected" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Callout, { variant: "warning", children: timingState === "soft" ? "Taking longer than usual. Your funds are safe and this will complete automatically." : "This is taking much longer than usual. Your funds are safe and processing continues automatically." }),
|
|
7273
7453
|
isProcessing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7274
7454
|
Button,
|
|
7275
7455
|
{
|
|
@@ -7382,7 +7562,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
7382
7562
|
function readDedupedAccountSetupResult(requestKey) {
|
|
7383
7563
|
const now = Date.now();
|
|
7384
7564
|
const existing = setupRequestDedupe.get(requestKey);
|
|
7385
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
7565
|
+
if (_optionalChain([existing, 'optionalAccess', _358 => _358.settled]) && existing.expiresAt > now && existing.result) {
|
|
7386
7566
|
return existing.result;
|
|
7387
7567
|
}
|
|
7388
7568
|
return null;
|
|
@@ -7416,7 +7596,7 @@ async function runAccountSetup(input, deps) {
|
|
|
7416
7596
|
chain: _chunkOY5N3E6Lcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
7417
7597
|
token: input.targetToken,
|
|
7418
7598
|
recipient: input.recipient,
|
|
7419
|
-
..._optionalChain([input, 'access',
|
|
7599
|
+
..._optionalChain([input, 'access', _359 => _359.outputTokenRules, 'optionalAccess', _360 => _360.length]) && {
|
|
7420
7600
|
outputTokenRules: input.outputTokenRules
|
|
7421
7601
|
},
|
|
7422
7602
|
...input.rejectUnmapped != null && {
|
|
@@ -7596,4 +7776,5 @@ function mapError(error) {
|
|
|
7596
7776
|
|
|
7597
7777
|
|
|
7598
7778
|
|
|
7599
|
-
|
|
7779
|
+
|
|
7780
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.CardIcon = CardIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.MigrateAssetsIcon = MigrateAssetsIcon; exports.AppleIcon = AppleIcon; exports.BodyHeader = BodyHeader; exports.CdnIcon = CdnIcon; exports.ListRow = ListRow; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.catalogKeyForChain = catalogKeyForChain; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.chainIdsByValue = chainIdsByValue; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.quoteFeeRow = quoteFeeRow; exports.SwappedConnectFeeChangedError = SwappedConnectFeeChangedError; exports.SUPPORTED_CONNECT_EXCHANGE_COUNT = SUPPORTED_CONNECT_EXCHANGE_COUNT; exports.resolveAppFeeBps = resolveAppFeeBps; exports.PermitDepositSubmitError = PermitDepositSubmitError; exports.createDepositService = createDepositService; 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.useIsDepositChain = useIsDepositChain; exports.useChainName = useChainName; exports.useReadClient = useReadClient; exports.useExplorerTxUrl = useExplorerTxUrl; exports.ChainCatalogProvider = ChainCatalogProvider; exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.Callout = Callout; exports.TokenIcon = TokenIcon; 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.isRecognizedToken = isRecognizedToken; 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.fetchTokenPriceUsd = fetchTokenPriceUsd; 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;
|