@rhinestone/deposit-modal 0.1.67 → 0.1.68
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-EYIV6APK.mjs → DepositModalReown-RYCOXWMH.mjs} +1 -1
- package/dist/{DepositModalReown-UPYZN2XA.cjs → DepositModalReown-WXFTSZSK.cjs} +2 -2
- package/dist/{chunk-UDKZWFCM.cjs → chunk-J7ILKS5N.cjs} +319 -101
- package/dist/{chunk-NFE5ZLD3.mjs → chunk-OEB25YZ4.mjs} +611 -393
- package/dist/deposit.cjs +2 -2
- package/dist/deposit.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/reown.cjs +2 -2
- package/dist/reown.mjs +1 -1
- package/dist/styles.css +197 -4
- package/package.json +1 -1
|
@@ -52,16 +52,16 @@ import {
|
|
|
52
52
|
// src/DepositModal.tsx
|
|
53
53
|
import {
|
|
54
54
|
useMemo as useMemo7,
|
|
55
|
-
useEffect as
|
|
56
|
-
useRef as
|
|
57
|
-
useState as
|
|
58
|
-
useCallback as
|
|
55
|
+
useEffect as useEffect11,
|
|
56
|
+
useRef as useRef8,
|
|
57
|
+
useState as useState12,
|
|
58
|
+
useCallback as useCallback7,
|
|
59
59
|
lazy,
|
|
60
60
|
Suspense
|
|
61
61
|
} from "react";
|
|
62
62
|
|
|
63
63
|
// src/DepositFlow.tsx
|
|
64
|
-
import { useState as
|
|
64
|
+
import { useState as useState11, useCallback as useCallback5, useMemo as useMemo6, useEffect as useEffect10, useRef as useRef7 } from "react";
|
|
65
65
|
import { formatUnits as formatUnits5 } from "viem";
|
|
66
66
|
|
|
67
67
|
// src/components/steps/SetupStep.tsx
|
|
@@ -1198,7 +1198,7 @@ function ConfirmStep({
|
|
|
1198
1198
|
}
|
|
1199
1199
|
|
|
1200
1200
|
// src/components/steps/DepositAddressStep.tsx
|
|
1201
|
-
import { useState as
|
|
1201
|
+
import { useState as useState7, useEffect as useEffect7, useCallback as useCallback4, useRef as useRef6, useMemo as useMemo3 } from "react";
|
|
1202
1202
|
|
|
1203
1203
|
// src/components/ui/QRCode.tsx
|
|
1204
1204
|
import { QRCode as QRCodeCanvas } from "react-qrcode-logo";
|
|
@@ -1226,9 +1226,106 @@ function QRCode({ value, size = 200, iconSrc, className }) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
QRCode.displayName = "QRCode";
|
|
1228
1228
|
|
|
1229
|
-
// src/components/ui/
|
|
1230
|
-
import {
|
|
1229
|
+
// src/components/ui/Tooltip.tsx
|
|
1230
|
+
import {
|
|
1231
|
+
useState as useState5,
|
|
1232
|
+
useRef as useRef4,
|
|
1233
|
+
useEffect as useEffect5,
|
|
1234
|
+
useCallback as useCallback2
|
|
1235
|
+
} from "react";
|
|
1236
|
+
import { createPortal } from "react-dom";
|
|
1231
1237
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1238
|
+
function Tooltip({ content, children, className }) {
|
|
1239
|
+
const [open, setOpen] = useState5(false);
|
|
1240
|
+
const [position, setPosition] = useState5(null);
|
|
1241
|
+
const triggerRef = useRef4(null);
|
|
1242
|
+
const bubbleRef = useRef4(null);
|
|
1243
|
+
const updatePosition = useCallback2(() => {
|
|
1244
|
+
const trigger = triggerRef.current;
|
|
1245
|
+
if (!trigger) return;
|
|
1246
|
+
const rect = trigger.getBoundingClientRect();
|
|
1247
|
+
setPosition({
|
|
1248
|
+
top: rect.top,
|
|
1249
|
+
left: rect.left + rect.width / 2
|
|
1250
|
+
});
|
|
1251
|
+
}, []);
|
|
1252
|
+
useEffect5(() => {
|
|
1253
|
+
if (!open) return;
|
|
1254
|
+
updatePosition();
|
|
1255
|
+
function handleOutside(event) {
|
|
1256
|
+
const target = event.target;
|
|
1257
|
+
if (!target) return;
|
|
1258
|
+
if (triggerRef.current?.contains(target)) return;
|
|
1259
|
+
if (bubbleRef.current?.contains(target)) return;
|
|
1260
|
+
setOpen(false);
|
|
1261
|
+
}
|
|
1262
|
+
function handleKey(event) {
|
|
1263
|
+
if (event.key === "Escape") setOpen(false);
|
|
1264
|
+
}
|
|
1265
|
+
document.addEventListener("mousedown", handleOutside);
|
|
1266
|
+
document.addEventListener("touchstart", handleOutside);
|
|
1267
|
+
document.addEventListener("keydown", handleKey);
|
|
1268
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
1269
|
+
window.addEventListener("resize", updatePosition);
|
|
1270
|
+
return () => {
|
|
1271
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
1272
|
+
document.removeEventListener("touchstart", handleOutside);
|
|
1273
|
+
document.removeEventListener("keydown", handleKey);
|
|
1274
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
1275
|
+
window.removeEventListener("resize", updatePosition);
|
|
1276
|
+
};
|
|
1277
|
+
}, [open, updatePosition]);
|
|
1278
|
+
return /* @__PURE__ */ jsxs5(
|
|
1279
|
+
"span",
|
|
1280
|
+
{
|
|
1281
|
+
ref: triggerRef,
|
|
1282
|
+
className: `rs-tooltip ${className ?? ""}`,
|
|
1283
|
+
onMouseEnter: () => setOpen(true),
|
|
1284
|
+
onMouseLeave: () => setOpen(false),
|
|
1285
|
+
children: [
|
|
1286
|
+
/* @__PURE__ */ jsx6(
|
|
1287
|
+
"span",
|
|
1288
|
+
{
|
|
1289
|
+
className: "rs-tooltip-trigger",
|
|
1290
|
+
role: "button",
|
|
1291
|
+
tabIndex: 0,
|
|
1292
|
+
"aria-label": content,
|
|
1293
|
+
onClick: (event) => {
|
|
1294
|
+
event.stopPropagation();
|
|
1295
|
+
event.preventDefault();
|
|
1296
|
+
setOpen((value) => !value);
|
|
1297
|
+
},
|
|
1298
|
+
onKeyDown: (event) => {
|
|
1299
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
1300
|
+
event.preventDefault();
|
|
1301
|
+
setOpen((value) => !value);
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
children
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
open && position && typeof document !== "undefined" && createPortal(
|
|
1308
|
+
/* @__PURE__ */ jsx6(
|
|
1309
|
+
"span",
|
|
1310
|
+
{
|
|
1311
|
+
ref: bubbleRef,
|
|
1312
|
+
className: "rs-tooltip-bubble",
|
|
1313
|
+
role: "tooltip",
|
|
1314
|
+
style: { top: position.top, left: position.left },
|
|
1315
|
+
children: content
|
|
1316
|
+
}
|
|
1317
|
+
),
|
|
1318
|
+
document.body
|
|
1319
|
+
)
|
|
1320
|
+
]
|
|
1321
|
+
}
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
Tooltip.displayName = "Tooltip";
|
|
1325
|
+
|
|
1326
|
+
// src/components/ui/DepositNotification.tsx
|
|
1327
|
+
import { useState as useState6, useEffect as useEffect6, useRef as useRef5, useCallback as useCallback3 } from "react";
|
|
1328
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1232
1329
|
var INITIAL_POLL_INTERVAL = 3e3;
|
|
1233
1330
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1234
1331
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
@@ -1285,7 +1382,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1285
1382
|
}
|
|
1286
1383
|
return "Bridge failed";
|
|
1287
1384
|
}
|
|
1288
|
-
var txLinkIcon = /* @__PURE__ */
|
|
1385
|
+
var txLinkIcon = /* @__PURE__ */ jsx7(
|
|
1289
1386
|
"svg",
|
|
1290
1387
|
{
|
|
1291
1388
|
viewBox: "0 0 24 24",
|
|
@@ -1293,7 +1390,7 @@ var txLinkIcon = /* @__PURE__ */ jsx6(
|
|
|
1293
1390
|
stroke: "currentColor",
|
|
1294
1391
|
strokeWidth: "2.5",
|
|
1295
1392
|
className: "rs-deposit-notification-link-icon",
|
|
1296
|
-
children: /* @__PURE__ */
|
|
1393
|
+
children: /* @__PURE__ */ jsx7(
|
|
1297
1394
|
"path",
|
|
1298
1395
|
{
|
|
1299
1396
|
strokeLinecap: "round",
|
|
@@ -1316,19 +1413,19 @@ function DepositNotification({
|
|
|
1316
1413
|
onDismiss
|
|
1317
1414
|
}) {
|
|
1318
1415
|
const { txHash, sourceChain, amount, token, detectedAt, directTransfer } = deposit;
|
|
1319
|
-
const [status, setStatus] =
|
|
1416
|
+
const [status, setStatus] = useState6(
|
|
1320
1417
|
directTransfer ? "complete" : "processing"
|
|
1321
1418
|
);
|
|
1322
|
-
const [expanded, setExpanded] =
|
|
1323
|
-
const [completedAt, setCompletedAt] =
|
|
1419
|
+
const [expanded, setExpanded] = useState6(false);
|
|
1420
|
+
const [completedAt, setCompletedAt] = useState6(
|
|
1324
1421
|
directTransfer ? detectedAt : null
|
|
1325
1422
|
);
|
|
1326
|
-
const [destinationTxHash, setDestinationTxHash] =
|
|
1423
|
+
const [destinationTxHash, setDestinationTxHash] = useState6(
|
|
1327
1424
|
null
|
|
1328
1425
|
);
|
|
1329
|
-
const pollIntervalRef =
|
|
1330
|
-
const pollTimeoutRef =
|
|
1331
|
-
const completedRef =
|
|
1426
|
+
const pollIntervalRef = useRef5(INITIAL_POLL_INTERVAL);
|
|
1427
|
+
const pollTimeoutRef = useRef5(null);
|
|
1428
|
+
const completedRef = useRef5(directTransfer ?? false);
|
|
1332
1429
|
const depositContextRef = useLatestRef({
|
|
1333
1430
|
amount,
|
|
1334
1431
|
sourceChain,
|
|
@@ -1340,7 +1437,7 @@ function DepositNotification({
|
|
|
1340
1437
|
});
|
|
1341
1438
|
const onCompleteRef = useLatestRef(onComplete);
|
|
1342
1439
|
const onFailedRef = useLatestRef(onFailed);
|
|
1343
|
-
const handleComplete =
|
|
1440
|
+
const handleComplete = useCallback3(
|
|
1344
1441
|
(destTxHash) => {
|
|
1345
1442
|
if (completedRef.current) return;
|
|
1346
1443
|
completedRef.current = true;
|
|
@@ -1358,7 +1455,7 @@ function DepositNotification({
|
|
|
1358
1455
|
},
|
|
1359
1456
|
[depositContextRef, onCompleteRef, txHash]
|
|
1360
1457
|
);
|
|
1361
|
-
const handleFailed =
|
|
1458
|
+
const handleFailed = useCallback3(
|
|
1362
1459
|
(error) => {
|
|
1363
1460
|
if (completedRef.current) return;
|
|
1364
1461
|
completedRef.current = true;
|
|
@@ -1367,7 +1464,7 @@ function DepositNotification({
|
|
|
1367
1464
|
},
|
|
1368
1465
|
[onFailedRef, txHash]
|
|
1369
1466
|
);
|
|
1370
|
-
|
|
1467
|
+
useEffect6(() => {
|
|
1371
1468
|
if (directTransfer) {
|
|
1372
1469
|
handleComplete(void 0);
|
|
1373
1470
|
return;
|
|
@@ -1444,14 +1541,14 @@ function DepositNotification({
|
|
|
1444
1541
|
const destExplorerUrl = destinationTxHash ? getExplorerTxUrl(targetChain, destinationTxHash) : null;
|
|
1445
1542
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1446
1543
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1447
|
-
const statusIcon = status === "complete" ? /* @__PURE__ */
|
|
1544
|
+
const statusIcon = status === "complete" ? /* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ jsx7(
|
|
1448
1545
|
"svg",
|
|
1449
1546
|
{
|
|
1450
1547
|
viewBox: "0 0 24 24",
|
|
1451
1548
|
fill: "none",
|
|
1452
1549
|
stroke: "currentColor",
|
|
1453
1550
|
strokeWidth: "3",
|
|
1454
|
-
children: /* @__PURE__ */
|
|
1551
|
+
children: /* @__PURE__ */ jsx7(
|
|
1455
1552
|
"path",
|
|
1456
1553
|
{
|
|
1457
1554
|
strokeLinecap: "round",
|
|
@@ -1460,14 +1557,14 @@ function DepositNotification({
|
|
|
1460
1557
|
}
|
|
1461
1558
|
)
|
|
1462
1559
|
}
|
|
1463
|
-
) }) : status === "failed" ? /* @__PURE__ */
|
|
1560
|
+
) }) : status === "failed" ? /* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ jsx7(
|
|
1464
1561
|
"svg",
|
|
1465
1562
|
{
|
|
1466
1563
|
viewBox: "0 0 24 24",
|
|
1467
1564
|
fill: "none",
|
|
1468
1565
|
stroke: "currentColor",
|
|
1469
1566
|
strokeWidth: "3",
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1567
|
+
children: /* @__PURE__ */ jsx7(
|
|
1471
1568
|
"path",
|
|
1472
1569
|
{
|
|
1473
1570
|
strokeLinecap: "round",
|
|
@@ -1476,33 +1573,33 @@ function DepositNotification({
|
|
|
1476
1573
|
}
|
|
1477
1574
|
)
|
|
1478
1575
|
}
|
|
1479
|
-
) }) : /* @__PURE__ */
|
|
1480
|
-
return /* @__PURE__ */
|
|
1576
|
+
) }) : /* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ jsx7(Spinner, {}) });
|
|
1577
|
+
return /* @__PURE__ */ jsxs6(
|
|
1481
1578
|
"div",
|
|
1482
1579
|
{
|
|
1483
1580
|
className: `rs-deposit-notification rs-deposit-notification--${status}`,
|
|
1484
1581
|
children: [
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1582
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-header", children: [
|
|
1583
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-icon", children: statusIcon }),
|
|
1584
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-content", children: [
|
|
1585
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-title", children: title }),
|
|
1586
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-notification-subtitle", children: subtitle })
|
|
1490
1587
|
] }),
|
|
1491
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsx7(
|
|
1492
1589
|
"button",
|
|
1493
1590
|
{
|
|
1494
1591
|
type: "button",
|
|
1495
1592
|
className: "rs-deposit-notification-close",
|
|
1496
1593
|
onClick: () => onDismiss(deposit.id),
|
|
1497
1594
|
"aria-label": "Dismiss",
|
|
1498
|
-
children: /* @__PURE__ */
|
|
1595
|
+
children: /* @__PURE__ */ jsx7(
|
|
1499
1596
|
"svg",
|
|
1500
1597
|
{
|
|
1501
1598
|
viewBox: "0 0 24 24",
|
|
1502
1599
|
fill: "none",
|
|
1503
1600
|
stroke: "currentColor",
|
|
1504
1601
|
strokeWidth: "2",
|
|
1505
|
-
children: /* @__PURE__ */
|
|
1602
|
+
children: /* @__PURE__ */ jsx7(
|
|
1506
1603
|
"path",
|
|
1507
1604
|
{
|
|
1508
1605
|
strokeLinecap: "round",
|
|
@@ -1515,10 +1612,10 @@ function DepositNotification({
|
|
|
1515
1612
|
}
|
|
1516
1613
|
)
|
|
1517
1614
|
] }),
|
|
1518
|
-
expanded && /* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1615
|
+
expanded && /* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-details", children: [
|
|
1616
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-row", children: [
|
|
1617
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-label", children: "Deposit tx" }),
|
|
1618
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-value", children: sourceExplorerUrl ? /* @__PURE__ */ jsxs6(
|
|
1522
1619
|
"a",
|
|
1523
1620
|
{
|
|
1524
1621
|
href: sourceExplorerUrl,
|
|
@@ -1532,9 +1629,9 @@ function DepositNotification({
|
|
|
1532
1629
|
}
|
|
1533
1630
|
) : truncateHash(txHash) })
|
|
1534
1631
|
] }),
|
|
1535
|
-
destinationTxHash && /* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1632
|
+
destinationTxHash && /* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-row", children: [
|
|
1633
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-label", children: "Completion tx" }),
|
|
1634
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-value", children: destExplorerUrl ? /* @__PURE__ */ jsxs6(
|
|
1538
1635
|
"a",
|
|
1539
1636
|
{
|
|
1540
1637
|
href: destExplorerUrl,
|
|
@@ -1548,16 +1645,16 @@ function DepositNotification({
|
|
|
1548
1645
|
}
|
|
1549
1646
|
) : truncateHash(destinationTxHash) })
|
|
1550
1647
|
] }),
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-row", children: [
|
|
1649
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-label", children: "Order submitted" }),
|
|
1650
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-value", children: formatTimestamp(detectedAt) })
|
|
1554
1651
|
] }),
|
|
1555
|
-
completedAt && /* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1652
|
+
completedAt && /* @__PURE__ */ jsxs6("div", { className: "rs-deposit-notification-row", children: [
|
|
1653
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-label", children: "Order filled" }),
|
|
1654
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-deposit-notification-value", children: formatTimestamp(completedAt) })
|
|
1558
1655
|
] })
|
|
1559
1656
|
] }),
|
|
1560
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ jsx7(
|
|
1561
1658
|
"button",
|
|
1562
1659
|
{
|
|
1563
1660
|
type: "button",
|
|
@@ -1689,7 +1786,7 @@ async function sendSolanaTransaction(provider, _connection, transaction) {
|
|
|
1689
1786
|
}
|
|
1690
1787
|
|
|
1691
1788
|
// src/components/steps/DepositAddressStep.tsx
|
|
1692
|
-
import { jsx as
|
|
1789
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1693
1790
|
var POLL_INTERVAL_MS = 4e3;
|
|
1694
1791
|
function isRecord(value) {
|
|
1695
1792
|
return typeof value === "object" && value !== null;
|
|
@@ -1773,6 +1870,7 @@ function DepositAddressStep({
|
|
|
1773
1870
|
targetToken,
|
|
1774
1871
|
waitForFinalTx,
|
|
1775
1872
|
hasPostBridgeActions,
|
|
1873
|
+
uiConfig,
|
|
1776
1874
|
onDepositSubmitted,
|
|
1777
1875
|
onDepositComplete,
|
|
1778
1876
|
onDepositFailed,
|
|
@@ -1800,36 +1898,37 @@ function DepositAddressStep({
|
|
|
1800
1898
|
}, [evmChainIds, hasSolana]);
|
|
1801
1899
|
const BASE_CHAIN_ID = 8453;
|
|
1802
1900
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1803
|
-
const [sourceChainId, setSourceChainId] =
|
|
1901
|
+
const [sourceChainId, setSourceChainId] = useState7(defaultChainId);
|
|
1804
1902
|
const isSolana = sourceChainId === "solana";
|
|
1805
1903
|
const tokensForChain = useMemo3(() => {
|
|
1806
1904
|
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(sourceChainId);
|
|
1807
1905
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1808
1906
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1809
1907
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
|
|
1810
|
-
const [sourceTokenSymbol, setSourceTokenSymbol] =
|
|
1811
|
-
|
|
1908
|
+
const [sourceTokenSymbol, setSourceTokenSymbol] = useState7(defaultToken);
|
|
1909
|
+
useEffect7(() => {
|
|
1812
1910
|
if (!tokensForChain.includes(sourceTokenSymbol)) {
|
|
1813
1911
|
const fallback = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
|
|
1814
1912
|
setSourceTokenSymbol(fallback);
|
|
1815
1913
|
}
|
|
1816
1914
|
}, [tokensForChain, sourceTokenSymbol]);
|
|
1817
|
-
const [copied, setCopied] =
|
|
1818
|
-
const [pollingError, setPollingError] =
|
|
1819
|
-
const [chainDropdownOpen, setChainDropdownOpen] =
|
|
1820
|
-
const [tokenDropdownOpen, setTokenDropdownOpen] =
|
|
1821
|
-
const
|
|
1822
|
-
const
|
|
1823
|
-
const
|
|
1824
|
-
const
|
|
1825
|
-
const
|
|
1826
|
-
const
|
|
1827
|
-
const
|
|
1915
|
+
const [copied, setCopied] = useState7(false);
|
|
1916
|
+
const [pollingError, setPollingError] = useState7(null);
|
|
1917
|
+
const [chainDropdownOpen, setChainDropdownOpen] = useState7(false);
|
|
1918
|
+
const [tokenDropdownOpen, setTokenDropdownOpen] = useState7(false);
|
|
1919
|
+
const [priceImpactExpanded, setPriceImpactExpanded] = useState7(false);
|
|
1920
|
+
const chainDropdownRef = useRef6(null);
|
|
1921
|
+
const tokenDropdownRef = useRef6(null);
|
|
1922
|
+
const [notifications, setNotifications] = useState7([]);
|
|
1923
|
+
const isTrackingRef = useRef6(false);
|
|
1924
|
+
const baselineTxHashRef = useRef6(void 0);
|
|
1925
|
+
const notificationIdRef = useRef6(0);
|
|
1926
|
+
const sourceSelectionRef = useRef6({
|
|
1828
1927
|
chainId: defaultChainId,
|
|
1829
1928
|
token: typeof defaultChainId === "number" ? getTokenAddress(defaultToken, defaultChainId) : void 0,
|
|
1830
1929
|
sourceSymbol: defaultToken
|
|
1831
1930
|
});
|
|
1832
|
-
|
|
1931
|
+
useEffect7(() => {
|
|
1833
1932
|
if (isSolana) {
|
|
1834
1933
|
const matched = SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol) ?? SOLANA_TOKENS[0];
|
|
1835
1934
|
sourceSelectionRef.current = {
|
|
@@ -1847,7 +1946,7 @@ function DepositAddressStep({
|
|
|
1847
1946
|
};
|
|
1848
1947
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
1849
1948
|
const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1850
|
-
|
|
1949
|
+
useEffect7(() => {
|
|
1851
1950
|
if (!chainDropdownOpen && !tokenDropdownOpen) return;
|
|
1852
1951
|
function handlePointerDown(event) {
|
|
1853
1952
|
const target = event.target;
|
|
@@ -1865,7 +1964,7 @@ function DepositAddressStep({
|
|
|
1865
1964
|
document.removeEventListener("touchstart", handlePointerDown);
|
|
1866
1965
|
};
|
|
1867
1966
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1868
|
-
const handleCopy =
|
|
1967
|
+
const handleCopy = useCallback4(async () => {
|
|
1869
1968
|
onCopyAddress?.();
|
|
1870
1969
|
try {
|
|
1871
1970
|
await navigator.clipboard.writeText(displayAddress);
|
|
@@ -1884,24 +1983,24 @@ function DepositAddressStep({
|
|
|
1884
1983
|
setTimeout(() => setCopied(false), 2e3);
|
|
1885
1984
|
}
|
|
1886
1985
|
}, [displayAddress, onCopyAddress]);
|
|
1887
|
-
|
|
1986
|
+
useEffect7(() => {
|
|
1888
1987
|
setCopied(false);
|
|
1889
1988
|
setChainDropdownOpen(false);
|
|
1890
1989
|
setTokenDropdownOpen(false);
|
|
1891
1990
|
}, [sourceChainId]);
|
|
1892
|
-
const onDepositSubmittedRef =
|
|
1991
|
+
const onDepositSubmittedRef = useRef6(onDepositSubmitted);
|
|
1893
1992
|
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
1894
|
-
const onDepositCompleteRef =
|
|
1993
|
+
const onDepositCompleteRef = useRef6(onDepositComplete);
|
|
1895
1994
|
onDepositCompleteRef.current = onDepositComplete;
|
|
1896
|
-
const onDepositFailedRef =
|
|
1995
|
+
const onDepositFailedRef = useRef6(onDepositFailed);
|
|
1897
1996
|
onDepositFailedRef.current = onDepositFailed;
|
|
1898
|
-
const onErrorRef =
|
|
1997
|
+
const onErrorRef = useRef6(onError);
|
|
1899
1998
|
onErrorRef.current = onError;
|
|
1900
|
-
const targetChainRef =
|
|
1999
|
+
const targetChainRef = useRef6(targetChain);
|
|
1901
2000
|
targetChainRef.current = targetChain;
|
|
1902
|
-
const targetTokenRef =
|
|
2001
|
+
const targetTokenRef = useRef6(targetToken);
|
|
1903
2002
|
targetTokenRef.current = targetToken;
|
|
1904
|
-
|
|
2003
|
+
useEffect7(() => {
|
|
1905
2004
|
baselineTxHashRef.current = void 0;
|
|
1906
2005
|
isTrackingRef.current = false;
|
|
1907
2006
|
setPollingError(null);
|
|
@@ -1984,30 +2083,30 @@ function DepositAddressStep({
|
|
|
1984
2083
|
clearTimeout(timeoutId);
|
|
1985
2084
|
};
|
|
1986
2085
|
}, [smartAccount, service]);
|
|
1987
|
-
const handleNotificationComplete =
|
|
2086
|
+
const handleNotificationComplete = useCallback4(
|
|
1988
2087
|
(txHash, destinationTxHash, context) => {
|
|
1989
2088
|
isTrackingRef.current = false;
|
|
1990
2089
|
onDepositCompleteRef.current?.(txHash, destinationTxHash, context);
|
|
1991
2090
|
},
|
|
1992
2091
|
[]
|
|
1993
2092
|
);
|
|
1994
|
-
const handleNotificationFailed =
|
|
2093
|
+
const handleNotificationFailed = useCallback4(
|
|
1995
2094
|
(txHash, error) => {
|
|
1996
2095
|
isTrackingRef.current = false;
|
|
1997
2096
|
onDepositFailedRef.current?.(txHash, error);
|
|
1998
2097
|
},
|
|
1999
2098
|
[]
|
|
2000
2099
|
);
|
|
2001
|
-
const handleNotificationDismiss =
|
|
2100
|
+
const handleNotificationDismiss = useCallback4((id) => {
|
|
2002
2101
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2003
2102
|
}, []);
|
|
2004
2103
|
const qrIconSrc = getChainIcon(sourceChainId);
|
|
2005
|
-
return /* @__PURE__ */
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
/* @__PURE__ */
|
|
2104
|
+
return /* @__PURE__ */ jsxs7("div", { className: "rs-step rs-step--with-notifications", children: [
|
|
2105
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-step-body", children: /* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address", children: [
|
|
2106
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-selectors", children: [
|
|
2107
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2108
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2109
|
+
/* @__PURE__ */ jsxs7(
|
|
2011
2110
|
"button",
|
|
2012
2111
|
{
|
|
2013
2112
|
type: "button",
|
|
@@ -2017,7 +2116,7 @@ function DepositAddressStep({
|
|
|
2017
2116
|
setTokenDropdownOpen(false);
|
|
2018
2117
|
},
|
|
2019
2118
|
children: [
|
|
2020
|
-
getChainIcon(sourceChainId) && /* @__PURE__ */
|
|
2119
|
+
getChainIcon(sourceChainId) && /* @__PURE__ */ jsx8(
|
|
2021
2120
|
"img",
|
|
2022
2121
|
{
|
|
2023
2122
|
src: getChainIcon(sourceChainId),
|
|
@@ -2025,8 +2124,8 @@ function DepositAddressStep({
|
|
|
2025
2124
|
className: "rs-deposit-address-dropdown-icon"
|
|
2026
2125
|
}
|
|
2027
2126
|
),
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsx8("span", { children: getChainName(sourceChainId) }),
|
|
2128
|
+
/* @__PURE__ */ jsx8(
|
|
2030
2129
|
"svg",
|
|
2031
2130
|
{
|
|
2032
2131
|
className: "rs-deposit-address-dropdown-chevron",
|
|
@@ -2034,7 +2133,7 @@ function DepositAddressStep({
|
|
|
2034
2133
|
fill: "none",
|
|
2035
2134
|
stroke: "currentColor",
|
|
2036
2135
|
strokeWidth: "2",
|
|
2037
|
-
children: /* @__PURE__ */
|
|
2136
|
+
children: /* @__PURE__ */ jsx8(
|
|
2038
2137
|
"path",
|
|
2039
2138
|
{
|
|
2040
2139
|
strokeLinecap: "round",
|
|
@@ -2047,7 +2146,7 @@ function DepositAddressStep({
|
|
|
2047
2146
|
]
|
|
2048
2147
|
}
|
|
2049
2148
|
),
|
|
2050
|
-
chainDropdownOpen && /* @__PURE__ */
|
|
2149
|
+
chainDropdownOpen && /* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-dropdown-menu", children: chainOptions.map((chainId) => /* @__PURE__ */ jsxs7(
|
|
2051
2150
|
"button",
|
|
2052
2151
|
{
|
|
2053
2152
|
type: "button",
|
|
@@ -2057,7 +2156,7 @@ function DepositAddressStep({
|
|
|
2057
2156
|
setChainDropdownOpen(false);
|
|
2058
2157
|
},
|
|
2059
2158
|
children: [
|
|
2060
|
-
getChainIcon(chainId) && /* @__PURE__ */
|
|
2159
|
+
getChainIcon(chainId) && /* @__PURE__ */ jsx8(
|
|
2061
2160
|
"img",
|
|
2062
2161
|
{
|
|
2063
2162
|
src: getChainIcon(chainId),
|
|
@@ -2065,15 +2164,36 @@ function DepositAddressStep({
|
|
|
2065
2164
|
className: "rs-deposit-address-dropdown-icon"
|
|
2066
2165
|
}
|
|
2067
2166
|
),
|
|
2068
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ jsx8("span", { children: getChainName(chainId) })
|
|
2069
2168
|
]
|
|
2070
2169
|
},
|
|
2071
2170
|
String(chainId)
|
|
2072
2171
|
)) })
|
|
2073
2172
|
] }),
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
|
|
2173
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-dropdown", ref: tokenDropdownRef, children: [
|
|
2174
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
2175
|
+
/* @__PURE__ */ jsx8("span", { children: "Supported token" }),
|
|
2176
|
+
/* @__PURE__ */ jsxs7("span", { className: "rs-deposit-address-min", children: [
|
|
2177
|
+
"Min $",
|
|
2178
|
+
uiConfig?.minDepositUsd ?? 0.1,
|
|
2179
|
+
/* @__PURE__ */ jsx8(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsxs7(
|
|
2180
|
+
"svg",
|
|
2181
|
+
{
|
|
2182
|
+
className: "rs-deposit-address-min-icon",
|
|
2183
|
+
viewBox: "0 0 24 24",
|
|
2184
|
+
fill: "none",
|
|
2185
|
+
stroke: "currentColor",
|
|
2186
|
+
strokeWidth: "2",
|
|
2187
|
+
"aria-hidden": "true",
|
|
2188
|
+
children: [
|
|
2189
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2190
|
+
/* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2191
|
+
]
|
|
2192
|
+
}
|
|
2193
|
+
) })
|
|
2194
|
+
] })
|
|
2195
|
+
] }),
|
|
2196
|
+
/* @__PURE__ */ jsxs7(
|
|
2077
2197
|
"button",
|
|
2078
2198
|
{
|
|
2079
2199
|
type: "button",
|
|
@@ -2083,7 +2203,7 @@ function DepositAddressStep({
|
|
|
2083
2203
|
setChainDropdownOpen(false);
|
|
2084
2204
|
},
|
|
2085
2205
|
children: [
|
|
2086
|
-
getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */
|
|
2206
|
+
getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */ jsx8(
|
|
2087
2207
|
"img",
|
|
2088
2208
|
{
|
|
2089
2209
|
src: getTokenIcon(sourceTokenSymbol),
|
|
@@ -2091,8 +2211,8 @@ function DepositAddressStep({
|
|
|
2091
2211
|
className: "rs-deposit-address-dropdown-icon"
|
|
2092
2212
|
}
|
|
2093
2213
|
),
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsx8("span", { children: sourceTokenSymbol }),
|
|
2215
|
+
/* @__PURE__ */ jsx8(
|
|
2096
2216
|
"svg",
|
|
2097
2217
|
{
|
|
2098
2218
|
className: "rs-deposit-address-dropdown-chevron",
|
|
@@ -2100,7 +2220,7 @@ function DepositAddressStep({
|
|
|
2100
2220
|
fill: "none",
|
|
2101
2221
|
stroke: "currentColor",
|
|
2102
2222
|
strokeWidth: "2",
|
|
2103
|
-
children: /* @__PURE__ */
|
|
2223
|
+
children: /* @__PURE__ */ jsx8(
|
|
2104
2224
|
"path",
|
|
2105
2225
|
{
|
|
2106
2226
|
strokeLinecap: "round",
|
|
@@ -2113,7 +2233,7 @@ function DepositAddressStep({
|
|
|
2113
2233
|
]
|
|
2114
2234
|
}
|
|
2115
2235
|
),
|
|
2116
|
-
tokenDropdownOpen && /* @__PURE__ */
|
|
2236
|
+
tokenDropdownOpen && /* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-dropdown-menu", children: tokensForChain.map((symbol) => /* @__PURE__ */ jsxs7(
|
|
2117
2237
|
"button",
|
|
2118
2238
|
{
|
|
2119
2239
|
type: "button",
|
|
@@ -2123,7 +2243,7 @@ function DepositAddressStep({
|
|
|
2123
2243
|
setTokenDropdownOpen(false);
|
|
2124
2244
|
},
|
|
2125
2245
|
children: [
|
|
2126
|
-
getTokenIcon(symbol) && /* @__PURE__ */
|
|
2246
|
+
getTokenIcon(symbol) && /* @__PURE__ */ jsx8(
|
|
2127
2247
|
"img",
|
|
2128
2248
|
{
|
|
2129
2249
|
src: getTokenIcon(symbol),
|
|
@@ -2131,29 +2251,29 @@ function DepositAddressStep({
|
|
|
2131
2251
|
className: "rs-deposit-address-dropdown-icon"
|
|
2132
2252
|
}
|
|
2133
2253
|
),
|
|
2134
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsx8("span", { children: symbol })
|
|
2135
2255
|
]
|
|
2136
2256
|
},
|
|
2137
2257
|
symbol
|
|
2138
2258
|
)) })
|
|
2139
2259
|
] })
|
|
2140
2260
|
] }),
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2261
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ jsx8(QRCode, { value: displayAddress, size: 150, iconSrc: qrIconSrc }) }),
|
|
2262
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-info", children: [
|
|
2263
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-deposit-address-label", children: [
|
|
2144
2264
|
"Your ",
|
|
2145
2265
|
isSolana ? "Solana" : "EVM",
|
|
2146
2266
|
" deposit address"
|
|
2147
2267
|
] }),
|
|
2148
|
-
/* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-value", children: displayAddress }),
|
|
2269
|
+
/* @__PURE__ */ jsxs7(
|
|
2150
2270
|
"button",
|
|
2151
2271
|
{
|
|
2152
2272
|
type: "button",
|
|
2153
2273
|
className: "rs-deposit-address-copy",
|
|
2154
2274
|
onClick: handleCopy,
|
|
2155
2275
|
children: [
|
|
2156
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ jsx8(
|
|
2157
2277
|
"svg",
|
|
2158
2278
|
{
|
|
2159
2279
|
viewBox: "0 0 24 24",
|
|
@@ -2161,14 +2281,14 @@ function DepositAddressStep({
|
|
|
2161
2281
|
stroke: "currentColor",
|
|
2162
2282
|
strokeWidth: "2",
|
|
2163
2283
|
style: { width: 14, height: 14 },
|
|
2164
|
-
children: copied ? /* @__PURE__ */
|
|
2284
|
+
children: copied ? /* @__PURE__ */ jsx8(
|
|
2165
2285
|
"path",
|
|
2166
2286
|
{
|
|
2167
2287
|
strokeLinecap: "round",
|
|
2168
2288
|
strokeLinejoin: "round",
|
|
2169
2289
|
d: "M5 12l5 5L20 7"
|
|
2170
2290
|
}
|
|
2171
|
-
) : /* @__PURE__ */
|
|
2291
|
+
) : /* @__PURE__ */ jsx8(
|
|
2172
2292
|
"path",
|
|
2173
2293
|
{
|
|
2174
2294
|
strokeLinecap: "round",
|
|
@@ -2183,9 +2303,106 @@ function DepositAddressStep({
|
|
|
2183
2303
|
}
|
|
2184
2304
|
)
|
|
2185
2305
|
] }),
|
|
2186
|
-
|
|
2306
|
+
/* @__PURE__ */ jsxs7(
|
|
2307
|
+
"div",
|
|
2308
|
+
{
|
|
2309
|
+
className: `rs-price-impact ${priceImpactExpanded ? "rs-price-impact--open" : ""}`,
|
|
2310
|
+
children: [
|
|
2311
|
+
/* @__PURE__ */ jsxs7(
|
|
2312
|
+
"button",
|
|
2313
|
+
{
|
|
2314
|
+
type: "button",
|
|
2315
|
+
className: "rs-price-impact-header",
|
|
2316
|
+
onClick: () => setPriceImpactExpanded((v) => !v),
|
|
2317
|
+
"aria-expanded": priceImpactExpanded,
|
|
2318
|
+
children: [
|
|
2319
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2320
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2321
|
+
/* @__PURE__ */ jsx8(
|
|
2322
|
+
"path",
|
|
2323
|
+
{
|
|
2324
|
+
strokeLinecap: "round",
|
|
2325
|
+
strokeLinejoin: "round",
|
|
2326
|
+
d: "M15 9.5a2.5 2.5 0 00-2.5-2h-1A2 2 0 0011 11.5h2a2 2 0 010 4h-1a2.5 2.5 0 01-2.5-2M12 7v1m0 8v1"
|
|
2327
|
+
}
|
|
2328
|
+
)
|
|
2329
|
+
] }) }),
|
|
2330
|
+
/* @__PURE__ */ jsxs7("span", { className: "rs-price-impact-label", children: [
|
|
2331
|
+
"Price impact: ",
|
|
2332
|
+
/* @__PURE__ */ jsx8("strong", { children: "0.00%" })
|
|
2333
|
+
] }),
|
|
2334
|
+
/* @__PURE__ */ jsx8(
|
|
2335
|
+
Tooltip,
|
|
2336
|
+
{
|
|
2337
|
+
className: "rs-price-impact-info",
|
|
2338
|
+
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2339
|
+
children: /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
2340
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2341
|
+
/* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2342
|
+
] })
|
|
2343
|
+
}
|
|
2344
|
+
),
|
|
2345
|
+
/* @__PURE__ */ jsx8(
|
|
2346
|
+
"svg",
|
|
2347
|
+
{
|
|
2348
|
+
className: "rs-price-impact-chevron",
|
|
2349
|
+
viewBox: "0 0 24 24",
|
|
2350
|
+
fill: "none",
|
|
2351
|
+
stroke: "currentColor",
|
|
2352
|
+
strokeWidth: "2",
|
|
2353
|
+
"aria-hidden": "true",
|
|
2354
|
+
children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" })
|
|
2355
|
+
}
|
|
2356
|
+
)
|
|
2357
|
+
]
|
|
2358
|
+
}
|
|
2359
|
+
),
|
|
2360
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ jsxs7("div", { className: "rs-price-impact-panel-inner", children: [
|
|
2361
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-price-impact-row", children: [
|
|
2362
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2363
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2364
|
+
/* @__PURE__ */ jsx8(
|
|
2365
|
+
"path",
|
|
2366
|
+
{
|
|
2367
|
+
strokeLinecap: "round",
|
|
2368
|
+
strokeLinejoin: "round",
|
|
2369
|
+
d: "M8.5 15.5l7-7M9.5 9.5h.01M14.5 14.5h.01"
|
|
2370
|
+
}
|
|
2371
|
+
)
|
|
2372
|
+
] }) }),
|
|
2373
|
+
/* @__PURE__ */ jsxs7("span", { className: "rs-price-impact-label", children: [
|
|
2374
|
+
"Max slippage: ",
|
|
2375
|
+
/* @__PURE__ */ jsx8("strong", { children: "Auto \u2022 0.1%" })
|
|
2376
|
+
] }),
|
|
2377
|
+
/* @__PURE__ */ jsx8(
|
|
2378
|
+
Tooltip,
|
|
2379
|
+
{
|
|
2380
|
+
className: "rs-price-impact-info",
|
|
2381
|
+
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2382
|
+
children: /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
2383
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2384
|
+
/* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2385
|
+
] })
|
|
2386
|
+
}
|
|
2387
|
+
)
|
|
2388
|
+
] }),
|
|
2389
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-price-impact-row", children: [
|
|
2390
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2391
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2392
|
+
/* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 7.5V12l2.5 2" })
|
|
2393
|
+
] }) }),
|
|
2394
|
+
/* @__PURE__ */ jsxs7("span", { className: "rs-price-impact-label", children: [
|
|
2395
|
+
"Processing time: ",
|
|
2396
|
+
/* @__PURE__ */ jsx8("strong", { children: "< 1 min" })
|
|
2397
|
+
] })
|
|
2398
|
+
] })
|
|
2399
|
+
] }) })
|
|
2400
|
+
]
|
|
2401
|
+
}
|
|
2402
|
+
),
|
|
2403
|
+
pollingError && /* @__PURE__ */ jsx8("div", { className: "rs-deposit-address-error", children: pollingError })
|
|
2187
2404
|
] }) }),
|
|
2188
|
-
notifications.length > 0 && /* @__PURE__ */
|
|
2405
|
+
notifications.length > 0 && /* @__PURE__ */ jsx8("div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ jsx8(
|
|
2189
2406
|
DepositNotification,
|
|
2190
2407
|
{
|
|
2191
2408
|
deposit,
|
|
@@ -2201,15 +2418,15 @@ function DepositAddressStep({
|
|
|
2201
2418
|
},
|
|
2202
2419
|
deposit.id
|
|
2203
2420
|
)) }),
|
|
2204
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ jsx8(PoweredBy, {})
|
|
2205
2422
|
] });
|
|
2206
2423
|
}
|
|
2207
2424
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
2208
2425
|
|
|
2209
2426
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
2210
|
-
import { useState as
|
|
2427
|
+
import { useState as useState8, useEffect as useEffect8, useMemo as useMemo4 } from "react";
|
|
2211
2428
|
import { formatUnits as formatUnits3 } from "viem";
|
|
2212
|
-
import { jsx as
|
|
2429
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2213
2430
|
function SolanaTokenSelectStep({
|
|
2214
2431
|
solanaAddress,
|
|
2215
2432
|
service,
|
|
@@ -2217,11 +2434,11 @@ function SolanaTokenSelectStep({
|
|
|
2217
2434
|
onTotalBalanceComputed,
|
|
2218
2435
|
debug
|
|
2219
2436
|
}) {
|
|
2220
|
-
const [tokenBalances, setTokenBalances] =
|
|
2221
|
-
const [selectedSymbol, setSelectedSymbol] =
|
|
2222
|
-
const [loading, setLoading] =
|
|
2223
|
-
const [error, setError] =
|
|
2224
|
-
|
|
2437
|
+
const [tokenBalances, setTokenBalances] = useState8([]);
|
|
2438
|
+
const [selectedSymbol, setSelectedSymbol] = useState8(null);
|
|
2439
|
+
const [loading, setLoading] = useState8(true);
|
|
2440
|
+
const [error, setError] = useState8(null);
|
|
2441
|
+
useEffect8(() => {
|
|
2225
2442
|
let active = true;
|
|
2226
2443
|
async function loadBalances() {
|
|
2227
2444
|
if (!solanaAddress) {
|
|
@@ -2303,22 +2520,22 @@ function SolanaTokenSelectStep({
|
|
|
2303
2520
|
);
|
|
2304
2521
|
const selectedEntry = selectedSymbol ? rows.find((r) => r.token.symbol === selectedSymbol) : null;
|
|
2305
2522
|
if (error) {
|
|
2306
|
-
return /* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsx9("div", { className: "rs-step", children: /* @__PURE__ */ jsx9("div", { className: "rs-step-body", children: /* @__PURE__ */ jsx9("div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ jsx9("span", { className: "rs-alert-text", children: error }) }) }) });
|
|
2307
2524
|
}
|
|
2308
|
-
return /* @__PURE__ */
|
|
2309
|
-
/* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2525
|
+
return /* @__PURE__ */ jsxs8("div", { className: "rs-step", children: [
|
|
2526
|
+
/* @__PURE__ */ jsx9("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ jsx9("div", { className: "rs-step-title", children: "Select source asset" }) }),
|
|
2527
|
+
/* @__PURE__ */ jsxs8(
|
|
2311
2528
|
"div",
|
|
2312
2529
|
{
|
|
2313
2530
|
className: "rs-step-body",
|
|
2314
2531
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2315
2532
|
children: [
|
|
2316
|
-
loading && /* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2533
|
+
loading && /* @__PURE__ */ jsxs8("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2534
|
+
/* @__PURE__ */ jsx9(Spinner, { className: "rs-text-tertiary" }),
|
|
2535
|
+
/* @__PURE__ */ jsx9("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2319
2536
|
] }),
|
|
2320
|
-
!loading && rows.length === 0 && /* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */
|
|
2537
|
+
!loading && rows.length === 0 && /* @__PURE__ */ jsxs8("div", { className: "rs-empty-state", children: [
|
|
2538
|
+
/* @__PURE__ */ jsx9(
|
|
2322
2539
|
"svg",
|
|
2323
2540
|
{
|
|
2324
2541
|
className: "rs-empty-icon",
|
|
@@ -2326,7 +2543,7 @@ function SolanaTokenSelectStep({
|
|
|
2326
2543
|
fill: "none",
|
|
2327
2544
|
stroke: "currentColor",
|
|
2328
2545
|
strokeWidth: "1.5",
|
|
2329
|
-
children: /* @__PURE__ */
|
|
2546
|
+
children: /* @__PURE__ */ jsx9(
|
|
2330
2547
|
"path",
|
|
2331
2548
|
{
|
|
2332
2549
|
strokeLinecap: "round",
|
|
@@ -2336,14 +2553,14 @@ function SolanaTokenSelectStep({
|
|
|
2336
2553
|
)
|
|
2337
2554
|
}
|
|
2338
2555
|
),
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2557
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-empty-address", children: [
|
|
2341
2558
|
solanaAddress.slice(0, 6),
|
|
2342
2559
|
"...",
|
|
2343
2560
|
solanaAddress.slice(-4)
|
|
2344
2561
|
] })
|
|
2345
2562
|
] }),
|
|
2346
|
-
!loading && rows.length > 0 && /* @__PURE__ */
|
|
2563
|
+
!loading && rows.length > 0 && /* @__PURE__ */ jsx9("div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2347
2564
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2348
2565
|
const tokenIcon = getTokenIcon(entry.token.symbol);
|
|
2349
2566
|
const chainIcon = getChainIcon("solana");
|
|
@@ -2355,7 +2572,7 @@ function SolanaTokenSelectStep({
|
|
|
2355
2572
|
} catch {
|
|
2356
2573
|
formattedBalance = "...";
|
|
2357
2574
|
}
|
|
2358
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ jsxs8(
|
|
2359
2576
|
"button",
|
|
2360
2577
|
{
|
|
2361
2578
|
type: "button",
|
|
@@ -2363,9 +2580,9 @@ function SolanaTokenSelectStep({
|
|
|
2363
2580
|
className: `rs-asset-row ${isSelected ? "rs-asset-row--selected" : ""}`,
|
|
2364
2581
|
style: { textAlign: "left" },
|
|
2365
2582
|
children: [
|
|
2366
|
-
/* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
tokenIcon ? /* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-asset-info", children: [
|
|
2584
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-asset-icon-wrapper", children: [
|
|
2585
|
+
tokenIcon ? /* @__PURE__ */ jsx9(
|
|
2369
2586
|
"img",
|
|
2370
2587
|
{
|
|
2371
2588
|
src: tokenIcon,
|
|
@@ -2373,8 +2590,8 @@ function SolanaTokenSelectStep({
|
|
|
2373
2590
|
className: "rs-asset-icon",
|
|
2374
2591
|
style: { background: "transparent" }
|
|
2375
2592
|
}
|
|
2376
|
-
) : /* @__PURE__ */
|
|
2377
|
-
chainIcon && /* @__PURE__ */
|
|
2593
|
+
) : /* @__PURE__ */ jsx9("div", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
|
|
2594
|
+
chainIcon && /* @__PURE__ */ jsx9(
|
|
2378
2595
|
"img",
|
|
2379
2596
|
{
|
|
2380
2597
|
src: chainIcon,
|
|
@@ -2383,19 +2600,19 @@ function SolanaTokenSelectStep({
|
|
|
2383
2600
|
}
|
|
2384
2601
|
)
|
|
2385
2602
|
] }),
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
2604
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-asset-name", children: [
|
|
2388
2605
|
entry.token.symbol,
|
|
2389
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx9("span", { className: "rs-asset-chain", children: " on Solana" })
|
|
2390
2607
|
] }),
|
|
2391
|
-
/* @__PURE__ */
|
|
2608
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-asset-balance-small", children: [
|
|
2392
2609
|
formattedBalance,
|
|
2393
2610
|
" ",
|
|
2394
2611
|
entry.token.symbol
|
|
2395
2612
|
] })
|
|
2396
2613
|
] })
|
|
2397
2614
|
] }),
|
|
2398
|
-
/* @__PURE__ */
|
|
2615
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2399
2616
|
]
|
|
2400
2617
|
},
|
|
2401
2618
|
entry.token.symbol
|
|
@@ -2404,7 +2621,7 @@ function SolanaTokenSelectStep({
|
|
|
2404
2621
|
]
|
|
2405
2622
|
}
|
|
2406
2623
|
),
|
|
2407
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx9(
|
|
2408
2625
|
Button,
|
|
2409
2626
|
{
|
|
2410
2627
|
onClick: () => selectedEntry && onContinue(
|
|
@@ -2417,14 +2634,14 @@ function SolanaTokenSelectStep({
|
|
|
2417
2634
|
children: "Continue"
|
|
2418
2635
|
}
|
|
2419
2636
|
) }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx9(PoweredBy, {})
|
|
2421
2638
|
] });
|
|
2422
2639
|
}
|
|
2423
2640
|
|
|
2424
2641
|
// src/components/steps/SolanaAmountStep.tsx
|
|
2425
|
-
import { useEffect as
|
|
2642
|
+
import { useEffect as useEffect9, useMemo as useMemo5, useState as useState9 } from "react";
|
|
2426
2643
|
import { formatUnits as formatUnits4, parseUnits as parseUnits3 } from "viem";
|
|
2427
|
-
import { jsx as
|
|
2644
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2428
2645
|
var SOL_FEE_RESERVE_LAMPORTS = 1000000n;
|
|
2429
2646
|
function SolanaAmountStep({
|
|
2430
2647
|
token,
|
|
@@ -2435,8 +2652,8 @@ function SolanaAmountStep({
|
|
|
2435
2652
|
onContinue,
|
|
2436
2653
|
debug
|
|
2437
2654
|
}) {
|
|
2438
|
-
const [amount, setAmount] =
|
|
2439
|
-
const [error, setError] =
|
|
2655
|
+
const [amount, setAmount] = useState9("");
|
|
2656
|
+
const [error, setError] = useState9(null);
|
|
2440
2657
|
const isSourceStablecoin = isStablecoinSymbol(token.symbol);
|
|
2441
2658
|
const tokenPriceUsd = useMemo5(() => {
|
|
2442
2659
|
if (isSourceStablecoin) return 1;
|
|
@@ -2452,7 +2669,7 @@ function SolanaAmountStep({
|
|
|
2452
2669
|
}
|
|
2453
2670
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
2454
2671
|
const hasPricing = tokenPriceUsd !== null;
|
|
2455
|
-
|
|
2672
|
+
useEffect9(() => {
|
|
2456
2673
|
if (defaultAmount && !amount) {
|
|
2457
2674
|
const parsed = Number(defaultAmount);
|
|
2458
2675
|
if (Number.isFinite(parsed) && parsed > 0) {
|
|
@@ -2580,11 +2797,11 @@ function SolanaAmountStep({
|
|
|
2580
2797
|
setError(null);
|
|
2581
2798
|
onContinue(token, sourceAmountStr, amount);
|
|
2582
2799
|
};
|
|
2583
|
-
return /* @__PURE__ */
|
|
2584
|
-
/* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ jsxs9("div", { className: "rs-step", children: [
|
|
2801
|
+
/* @__PURE__ */ jsx10("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ jsx10("div", { className: "rs-step-title", children: "Enter amount" }) }),
|
|
2802
|
+
/* @__PURE__ */ jsxs9("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
|
|
2803
|
+
/* @__PURE__ */ jsxs9("div", { className: "rs-amount-display", children: [
|
|
2804
|
+
/* @__PURE__ */ jsx10("div", { className: "rs-amount-input-wrapper", children: /* @__PURE__ */ jsx10(
|
|
2588
2805
|
"input",
|
|
2589
2806
|
{
|
|
2590
2807
|
type: "text",
|
|
@@ -2602,12 +2819,12 @@ function SolanaAmountStep({
|
|
|
2602
2819
|
autoFocus: true
|
|
2603
2820
|
}
|
|
2604
2821
|
) }),
|
|
2605
|
-
!isSourceStablecoin && /* @__PURE__ */
|
|
2822
|
+
!isSourceStablecoin && /* @__PURE__ */ jsx10("div", { className: "rs-amount-available", children: /* @__PURE__ */ jsxs9("span", { className: "rs-amount-available-value", children: [
|
|
2606
2823
|
formattedBalance,
|
|
2607
2824
|
" ",
|
|
2608
2825
|
token.symbol,
|
|
2609
2826
|
" available",
|
|
2610
|
-
formattedBalanceUsd && /* @__PURE__ */
|
|
2827
|
+
formattedBalanceUsd && /* @__PURE__ */ jsxs9("span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
2611
2828
|
" ",
|
|
2612
2829
|
"(",
|
|
2613
2830
|
formattedBalanceUsd,
|
|
@@ -2615,8 +2832,8 @@ function SolanaAmountStep({
|
|
|
2615
2832
|
] })
|
|
2616
2833
|
] }) })
|
|
2617
2834
|
] }),
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
[25, 50, 75].map((pct) => /* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsxs9("div", { className: "rs-amount-presets", children: [
|
|
2836
|
+
[25, 50, 75].map((pct) => /* @__PURE__ */ jsxs9(
|
|
2620
2837
|
"button",
|
|
2621
2838
|
{
|
|
2622
2839
|
type: "button",
|
|
@@ -2629,7 +2846,7 @@ function SolanaAmountStep({
|
|
|
2629
2846
|
},
|
|
2630
2847
|
pct
|
|
2631
2848
|
)),
|
|
2632
|
-
/* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ jsx10(
|
|
2633
2850
|
"button",
|
|
2634
2851
|
{
|
|
2635
2852
|
type: "button",
|
|
@@ -2639,12 +2856,12 @@ function SolanaAmountStep({
|
|
|
2639
2856
|
}
|
|
2640
2857
|
)
|
|
2641
2858
|
] }),
|
|
2642
|
-
uiConfig?.minDepositUsd && /* @__PURE__ */
|
|
2859
|
+
uiConfig?.minDepositUsd && /* @__PURE__ */ jsxs9("div", { className: "rs-amount-minimum", children: [
|
|
2643
2860
|
currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2644
2861
|
" minimum deposit"
|
|
2645
2862
|
] }),
|
|
2646
|
-
error && /* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
2863
|
+
error && /* @__PURE__ */ jsxs9("div", { className: "rs-amount-error", children: [
|
|
2864
|
+
/* @__PURE__ */ jsx10(
|
|
2648
2865
|
"svg",
|
|
2649
2866
|
{
|
|
2650
2867
|
viewBox: "0 0 24 24",
|
|
@@ -2652,7 +2869,7 @@ function SolanaAmountStep({
|
|
|
2652
2869
|
stroke: "currentColor",
|
|
2653
2870
|
strokeWidth: "2",
|
|
2654
2871
|
style: { width: 16, height: 16, flexShrink: 0 },
|
|
2655
|
-
children: /* @__PURE__ */
|
|
2872
|
+
children: /* @__PURE__ */ jsx10(
|
|
2656
2873
|
"path",
|
|
2657
2874
|
{
|
|
2658
2875
|
strokeLinecap: "round",
|
|
@@ -2662,10 +2879,10 @@ function SolanaAmountStep({
|
|
|
2662
2879
|
)
|
|
2663
2880
|
}
|
|
2664
2881
|
),
|
|
2665
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsx10("span", { children: error })
|
|
2666
2883
|
] })
|
|
2667
2884
|
] }),
|
|
2668
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx10("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx10(
|
|
2669
2886
|
Button,
|
|
2670
2887
|
{
|
|
2671
2888
|
onClick: handleContinue,
|
|
@@ -2674,14 +2891,14 @@ function SolanaAmountStep({
|
|
|
2674
2891
|
children: uiConfig?.minDepositUsd && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2675
2892
|
}
|
|
2676
2893
|
) }),
|
|
2677
|
-
/* @__PURE__ */
|
|
2894
|
+
/* @__PURE__ */ jsx10(PoweredBy, {})
|
|
2678
2895
|
] });
|
|
2679
2896
|
}
|
|
2680
2897
|
|
|
2681
2898
|
// src/components/steps/SolanaConfirmStep.tsx
|
|
2682
|
-
import { useState as
|
|
2899
|
+
import { useState as useState10 } from "react";
|
|
2683
2900
|
import { parseUnits as parseUnits4 } from "viem";
|
|
2684
|
-
import { jsx as
|
|
2901
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2685
2902
|
function SolanaConfirmStep({
|
|
2686
2903
|
smartAccount,
|
|
2687
2904
|
solanaAddress,
|
|
@@ -2699,8 +2916,8 @@ function SolanaConfirmStep({
|
|
|
2699
2916
|
onError,
|
|
2700
2917
|
debug
|
|
2701
2918
|
}) {
|
|
2702
|
-
const [isSubmitting, setIsSubmitting] =
|
|
2703
|
-
const [error, setError] =
|
|
2919
|
+
const [isSubmitting, setIsSubmitting] = useState10(false);
|
|
2920
|
+
const [error, setError] = useState10(null);
|
|
2704
2921
|
const targetSymbol = getTokenSymbol(targetToken, targetChain);
|
|
2705
2922
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2706
2923
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -2805,19 +3022,19 @@ function SolanaConfirmStep({
|
|
|
2805
3022
|
setIsSubmitting(false);
|
|
2806
3023
|
}
|
|
2807
3024
|
};
|
|
2808
|
-
return /* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsxs10("div", { className: "rs-step", children: [
|
|
3026
|
+
/* @__PURE__ */ jsx11("div", { style: { padding: "12px 12px 10px" }, children: /* @__PURE__ */ jsx11("div", { className: "rs-step-title", children: "Review order" }) }),
|
|
3027
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
|
|
3028
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card", children: [
|
|
3029
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card-row", children: [
|
|
3030
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-label", children: "Source" }),
|
|
3031
|
+
/* @__PURE__ */ jsxs10(
|
|
2815
3032
|
"span",
|
|
2816
3033
|
{
|
|
2817
3034
|
className: "rs-card-value",
|
|
2818
3035
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2819
3036
|
children: [
|
|
2820
|
-
getChainIcon("solana") && /* @__PURE__ */
|
|
3037
|
+
getChainIcon("solana") && /* @__PURE__ */ jsx11(
|
|
2821
3038
|
"img",
|
|
2822
3039
|
{
|
|
2823
3040
|
src: getChainIcon("solana"),
|
|
@@ -2830,15 +3047,15 @@ function SolanaConfirmStep({
|
|
|
2830
3047
|
}
|
|
2831
3048
|
)
|
|
2832
3049
|
] }),
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
3050
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card-row", children: [
|
|
3051
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-label", children: "Destination" }),
|
|
3052
|
+
/* @__PURE__ */ jsxs10(
|
|
2836
3053
|
"span",
|
|
2837
3054
|
{
|
|
2838
3055
|
className: "rs-card-value",
|
|
2839
3056
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2840
3057
|
children: [
|
|
2841
|
-
getChainIcon(targetChain) && /* @__PURE__ */
|
|
3058
|
+
getChainIcon(targetChain) && /* @__PURE__ */ jsx11(
|
|
2842
3059
|
"img",
|
|
2843
3060
|
{
|
|
2844
3061
|
src: getChainIcon(targetChain),
|
|
@@ -2851,21 +3068,21 @@ function SolanaConfirmStep({
|
|
|
2851
3068
|
}
|
|
2852
3069
|
)
|
|
2853
3070
|
] }),
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card-row", children: [
|
|
3072
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-label", children: "Estimated time" }),
|
|
3073
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-value", children: "< 1 min" })
|
|
2857
3074
|
] })
|
|
2858
3075
|
] }),
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
3076
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card", children: [
|
|
3077
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card-row", children: [
|
|
3078
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-label", children: "You send" }),
|
|
3079
|
+
/* @__PURE__ */ jsxs10(
|
|
2863
3080
|
"span",
|
|
2864
3081
|
{
|
|
2865
3082
|
className: "rs-card-value",
|
|
2866
3083
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2867
3084
|
children: [
|
|
2868
|
-
getTokenIcon(token.symbol) && /* @__PURE__ */
|
|
3085
|
+
getTokenIcon(token.symbol) && /* @__PURE__ */ jsx11(
|
|
2869
3086
|
"img",
|
|
2870
3087
|
{
|
|
2871
3088
|
src: getTokenIcon(token.symbol),
|
|
@@ -2880,15 +3097,15 @@ function SolanaConfirmStep({
|
|
|
2880
3097
|
}
|
|
2881
3098
|
)
|
|
2882
3099
|
] }),
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-card-row", children: [
|
|
3101
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-card-label", children: "You receive" }),
|
|
3102
|
+
/* @__PURE__ */ jsxs10(
|
|
2886
3103
|
"span",
|
|
2887
3104
|
{
|
|
2888
3105
|
className: "rs-card-value",
|
|
2889
3106
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2890
3107
|
children: [
|
|
2891
|
-
getTokenIcon(targetSymbol) && /* @__PURE__ */
|
|
3108
|
+
getTokenIcon(targetSymbol) && /* @__PURE__ */ jsx11(
|
|
2892
3109
|
"img",
|
|
2893
3110
|
{
|
|
2894
3111
|
src: getTokenIcon(targetSymbol),
|
|
@@ -2904,8 +3121,8 @@ function SolanaConfirmStep({
|
|
|
2904
3121
|
)
|
|
2905
3122
|
] })
|
|
2906
3123
|
] }),
|
|
2907
|
-
error && /* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
3124
|
+
error && /* @__PURE__ */ jsxs10("div", { className: "rs-alert rs-alert--error", children: [
|
|
3125
|
+
/* @__PURE__ */ jsx11(
|
|
2909
3126
|
"svg",
|
|
2910
3127
|
{
|
|
2911
3128
|
className: "rs-alert-icon",
|
|
@@ -2913,7 +3130,7 @@ function SolanaConfirmStep({
|
|
|
2913
3130
|
fill: "none",
|
|
2914
3131
|
stroke: "currentColor",
|
|
2915
3132
|
strokeWidth: "2",
|
|
2916
|
-
children: /* @__PURE__ */
|
|
3133
|
+
children: /* @__PURE__ */ jsx11(
|
|
2917
3134
|
"path",
|
|
2918
3135
|
{
|
|
2919
3136
|
strokeLinecap: "round",
|
|
@@ -2923,10 +3140,10 @@ function SolanaConfirmStep({
|
|
|
2923
3140
|
)
|
|
2924
3141
|
}
|
|
2925
3142
|
),
|
|
2926
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsx11("span", { className: "rs-alert-text", children: error })
|
|
2927
3144
|
] })
|
|
2928
3145
|
] }),
|
|
2929
|
-
/* @__PURE__ */
|
|
3146
|
+
/* @__PURE__ */ jsx11("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx11(
|
|
2930
3147
|
Button,
|
|
2931
3148
|
{
|
|
2932
3149
|
onClick: handleConfirm,
|
|
@@ -2936,12 +3153,12 @@ function SolanaConfirmStep({
|
|
|
2936
3153
|
children: "Confirm Order"
|
|
2937
3154
|
}
|
|
2938
3155
|
) }),
|
|
2939
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx11(PoweredBy, {})
|
|
2940
3157
|
] });
|
|
2941
3158
|
}
|
|
2942
3159
|
|
|
2943
3160
|
// src/DepositFlow.tsx
|
|
2944
|
-
import { jsx as
|
|
3161
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2945
3162
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
2946
3163
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2947
3164
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
@@ -3002,33 +3219,33 @@ function DepositFlow({
|
|
|
3002
3219
|
const hasInitialWalletHydrationPending = Boolean(
|
|
3003
3220
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
3004
3221
|
);
|
|
3005
|
-
const [step, setStep] =
|
|
3006
|
-
const [flowMode, setFlowMode] =
|
|
3007
|
-
const [totalBalanceUsd, setTotalBalanceUsd] =
|
|
3008
|
-
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] =
|
|
3009
|
-
const [selectedWalletId, setSelectedWalletId] =
|
|
3010
|
-
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] =
|
|
3011
|
-
const flowModeRef =
|
|
3012
|
-
const portfolioAssetsRef =
|
|
3013
|
-
const stableWalletSignerRef =
|
|
3014
|
-
const stableWalletSelectionKeyRef =
|
|
3222
|
+
const [step, setStep] = useState11({ type: "setup" });
|
|
3223
|
+
const [flowMode, setFlowMode] = useState11(null);
|
|
3224
|
+
const [totalBalanceUsd, setTotalBalanceUsd] = useState11(0);
|
|
3225
|
+
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = useState11(false);
|
|
3226
|
+
const [selectedWalletId, setSelectedWalletId] = useState11(null);
|
|
3227
|
+
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = useState11(() => !hasInitialWalletHydrationPending);
|
|
3228
|
+
const flowModeRef = useRef7(null);
|
|
3229
|
+
const portfolioAssetsRef = useRef7([]);
|
|
3230
|
+
const stableWalletSignerRef = useRef7(null);
|
|
3231
|
+
const stableWalletSelectionKeyRef = useRef7(null);
|
|
3015
3232
|
flowModeRef.current = flowMode;
|
|
3016
|
-
const logFlow =
|
|
3233
|
+
const logFlow = useCallback5(
|
|
3017
3234
|
(message, data) => {
|
|
3018
3235
|
debugLog(debug, "deposit-flow", message, data);
|
|
3019
3236
|
},
|
|
3020
3237
|
[debug]
|
|
3021
3238
|
);
|
|
3022
|
-
const logFlowError =
|
|
3239
|
+
const logFlowError = useCallback5(
|
|
3023
3240
|
(message, error, data) => {
|
|
3024
3241
|
debugError(debug, "deposit-flow", message, error, data);
|
|
3025
3242
|
},
|
|
3026
3243
|
[debug]
|
|
3027
3244
|
);
|
|
3028
|
-
const handleAssetsLoaded =
|
|
3245
|
+
const handleAssetsLoaded = useCallback5((assets) => {
|
|
3029
3246
|
portfolioAssetsRef.current = assets;
|
|
3030
3247
|
}, []);
|
|
3031
|
-
const getTokenPriceUsd =
|
|
3248
|
+
const getTokenPriceUsd = useCallback5((symbol) => {
|
|
3032
3249
|
const sym = symbol.toLowerCase();
|
|
3033
3250
|
for (const asset of portfolioAssetsRef.current) {
|
|
3034
3251
|
if (asset.symbol.toLowerCase() === sym && asset.balanceUsd && asset.balance) {
|
|
@@ -3111,7 +3328,7 @@ function DepositFlow({
|
|
|
3111
3328
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
3112
3329
|
);
|
|
3113
3330
|
const showConnectStep = flowMode === null && !canAutoLock && !isConnectSelectionConfirmed;
|
|
3114
|
-
|
|
3331
|
+
useEffect10(() => {
|
|
3115
3332
|
if (!isWalletHydrationPending) {
|
|
3116
3333
|
setHasQrAutoAdvanceGraceElapsed(true);
|
|
3117
3334
|
return;
|
|
@@ -3202,7 +3419,7 @@ function DepositFlow({
|
|
|
3202
3419
|
reownWallet,
|
|
3203
3420
|
targetChain
|
|
3204
3421
|
]);
|
|
3205
|
-
|
|
3422
|
+
useEffect10(() => {
|
|
3206
3423
|
if (flowMode !== "wallet") {
|
|
3207
3424
|
stableWalletSelectionKeyRef.current = null;
|
|
3208
3425
|
stableWalletSignerRef.current = null;
|
|
@@ -3246,8 +3463,8 @@ function DepositFlow({
|
|
|
3246
3463
|
walletSelectionKey
|
|
3247
3464
|
]);
|
|
3248
3465
|
const sessionKeyAddress = dappAddress ?? signerContext?.ownerAddress ?? null;
|
|
3249
|
-
const lastTargetRef =
|
|
3250
|
-
|
|
3466
|
+
const lastTargetRef = useRef7(null);
|
|
3467
|
+
useEffect10(() => {
|
|
3251
3468
|
const prev = lastTargetRef.current;
|
|
3252
3469
|
if (prev && (prev.chain !== targetChain || prev.token.toLowerCase() !== targetToken.toLowerCase())) {
|
|
3253
3470
|
if (step.type !== "processing") {
|
|
@@ -3256,20 +3473,20 @@ function DepositFlow({
|
|
|
3256
3473
|
}
|
|
3257
3474
|
lastTargetRef.current = { chain: targetChain, token: targetToken };
|
|
3258
3475
|
}, [targetChain, targetToken, step.type]);
|
|
3259
|
-
const handleBackFromAmount =
|
|
3476
|
+
const handleBackFromAmount = useCallback5(() => {
|
|
3260
3477
|
setStep((prev) => {
|
|
3261
3478
|
if (prev.type !== "amount") return prev;
|
|
3262
3479
|
return { type: "select-asset", smartAccount: prev.smartAccount };
|
|
3263
3480
|
});
|
|
3264
3481
|
}, []);
|
|
3265
|
-
const handleBackFromSelectAsset =
|
|
3482
|
+
const handleBackFromSelectAsset = useCallback5(() => {
|
|
3266
3483
|
if (hasWalletOptions || reownWallet) {
|
|
3267
3484
|
hasNavigatedBackRef.current = true;
|
|
3268
3485
|
setFlowMode(null);
|
|
3269
3486
|
setIsConnectSelectionConfirmed(false);
|
|
3270
3487
|
}
|
|
3271
3488
|
}, [hasWalletOptions, reownWallet]);
|
|
3272
|
-
const handleBackFromDepositAddress =
|
|
3489
|
+
const handleBackFromDepositAddress = useCallback5(() => {
|
|
3273
3490
|
setFlowMode(null);
|
|
3274
3491
|
setStep({ type: "setup" });
|
|
3275
3492
|
if (hasWalletOptions || reownWallet) {
|
|
@@ -3277,7 +3494,7 @@ function DepositFlow({
|
|
|
3277
3494
|
setIsConnectSelectionConfirmed(false);
|
|
3278
3495
|
}
|
|
3279
3496
|
}, [hasWalletOptions, reownWallet]);
|
|
3280
|
-
const handleBackFromSolanaTokenSelect =
|
|
3497
|
+
const handleBackFromSolanaTokenSelect = useCallback5(() => {
|
|
3281
3498
|
setFlowMode(null);
|
|
3282
3499
|
setStep({ type: "setup" });
|
|
3283
3500
|
if (hasWalletOptions || reownWallet) {
|
|
@@ -3285,7 +3502,7 @@ function DepositFlow({
|
|
|
3285
3502
|
setIsConnectSelectionConfirmed(false);
|
|
3286
3503
|
}
|
|
3287
3504
|
}, [hasWalletOptions, reownWallet]);
|
|
3288
|
-
const handleBackFromSolanaAmount =
|
|
3505
|
+
const handleBackFromSolanaAmount = useCallback5(() => {
|
|
3289
3506
|
setStep((prev) => {
|
|
3290
3507
|
if (prev.type !== "solana-amount") return prev;
|
|
3291
3508
|
return {
|
|
@@ -3295,7 +3512,7 @@ function DepositFlow({
|
|
|
3295
3512
|
};
|
|
3296
3513
|
});
|
|
3297
3514
|
}, []);
|
|
3298
|
-
const handleBackFromSolanaConfirm =
|
|
3515
|
+
const handleBackFromSolanaConfirm = useCallback5(() => {
|
|
3299
3516
|
setStep((prev) => {
|
|
3300
3517
|
if (prev.type !== "solana-confirm") return prev;
|
|
3301
3518
|
return {
|
|
@@ -3309,7 +3526,7 @@ function DepositFlow({
|
|
|
3309
3526
|
};
|
|
3310
3527
|
});
|
|
3311
3528
|
}, []);
|
|
3312
|
-
const handleBackFromConfirm =
|
|
3529
|
+
const handleBackFromConfirm = useCallback5(() => {
|
|
3313
3530
|
setStep((prev) => {
|
|
3314
3531
|
if (prev.type !== "confirm") return prev;
|
|
3315
3532
|
return {
|
|
@@ -3321,13 +3538,13 @@ function DepositFlow({
|
|
|
3321
3538
|
}, []);
|
|
3322
3539
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "solana-token-select" ? 1 : step.type === "solana-amount" ? 2 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : step.type === "solana-confirm" ? 3 : 4;
|
|
3323
3540
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "solana-token-select" ? handleBackFromSolanaTokenSelect : step.type === "solana-amount" ? handleBackFromSolanaAmount : step.type === "solana-confirm" ? handleBackFromSolanaConfirm : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
3324
|
-
|
|
3541
|
+
useEffect10(() => {
|
|
3325
3542
|
onStepChangeRef.current?.(stepIndex, currentBackHandler);
|
|
3326
3543
|
}, [stepIndex, currentBackHandler, onStepChangeRef]);
|
|
3327
3544
|
const stepSendToken = step.type === "amount" ? step.asset.symbol : null;
|
|
3328
3545
|
const stepOpenEventKey = step.type === "select-asset" ? "select-asset" : step.type === "deposit-address" ? "deposit-address" : step.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
3329
|
-
const lastStepOpenEventKeyRef =
|
|
3330
|
-
|
|
3546
|
+
const lastStepOpenEventKeyRef = useRef7(null);
|
|
3547
|
+
useEffect10(() => {
|
|
3331
3548
|
if (!stepOpenEventKey) {
|
|
3332
3549
|
lastStepOpenEventKeyRef.current = null;
|
|
3333
3550
|
return;
|
|
@@ -3369,7 +3586,7 @@ function DepositFlow({
|
|
|
3369
3586
|
totalBalanceUsd,
|
|
3370
3587
|
onEventRef
|
|
3371
3588
|
]);
|
|
3372
|
-
|
|
3589
|
+
useEffect10(() => {
|
|
3373
3590
|
logFlow("state:changed", {
|
|
3374
3591
|
step: step.type,
|
|
3375
3592
|
flowMode,
|
|
@@ -3385,22 +3602,22 @@ function DepositFlow({
|
|
|
3385
3602
|
targetChain,
|
|
3386
3603
|
targetToken
|
|
3387
3604
|
]);
|
|
3388
|
-
|
|
3605
|
+
useEffect10(() => {
|
|
3389
3606
|
onTotalBalanceChangeRef.current?.(totalBalanceUsd);
|
|
3390
3607
|
}, [totalBalanceUsd, onTotalBalanceChangeRef]);
|
|
3391
3608
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
3392
3609
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
3393
|
-
const handleSelectProvider =
|
|
3610
|
+
const handleSelectProvider = useCallback5(() => {
|
|
3394
3611
|
setFlowMode("wallet");
|
|
3395
3612
|
}, []);
|
|
3396
|
-
const handleSelectSolanaWallet =
|
|
3613
|
+
const handleSelectSolanaWallet = useCallback5(() => {
|
|
3397
3614
|
setFlowMode("solana-wallet");
|
|
3398
3615
|
}, []);
|
|
3399
|
-
const handleSelectTransferCrypto =
|
|
3616
|
+
const handleSelectTransferCrypto = useCallback5(() => {
|
|
3400
3617
|
setFlowMode("deposit-address");
|
|
3401
3618
|
setStep({ type: "setup" });
|
|
3402
3619
|
}, []);
|
|
3403
|
-
const handleNewDeposit =
|
|
3620
|
+
const handleNewDeposit = useCallback5(() => {
|
|
3404
3621
|
onSmartAccountChangeRef.current?.(null);
|
|
3405
3622
|
setFlowMode(null);
|
|
3406
3623
|
setStep({ type: "setup" });
|
|
@@ -3408,7 +3625,7 @@ function DepositFlow({
|
|
|
3408
3625
|
setSelectedWalletId(null);
|
|
3409
3626
|
hasNavigatedBackRef.current = false;
|
|
3410
3627
|
}, [onSmartAccountChangeRef]);
|
|
3411
|
-
const handleSetupComplete =
|
|
3628
|
+
const handleSetupComplete = useCallback5(
|
|
3412
3629
|
(smartAccount, solanaDepositAddress) => {
|
|
3413
3630
|
logFlow("setup:complete", {
|
|
3414
3631
|
smartAccount,
|
|
@@ -3441,7 +3658,7 @@ function DepositFlow({
|
|
|
3441
3658
|
},
|
|
3442
3659
|
[isDepositAddressMode, isSolanaWalletMode, logFlow, onSmartAccountChangeRef]
|
|
3443
3660
|
);
|
|
3444
|
-
const handleDepositAddressSubmitted =
|
|
3661
|
+
const handleDepositAddressSubmitted = useCallback5(
|
|
3445
3662
|
(data) => {
|
|
3446
3663
|
logFlow("deposit-address:detected", {
|
|
3447
3664
|
txHash: data.txHash,
|
|
@@ -3452,7 +3669,7 @@ function DepositFlow({
|
|
|
3452
3669
|
},
|
|
3453
3670
|
[logFlow, onDepositSubmittedRef]
|
|
3454
3671
|
);
|
|
3455
|
-
const handleSolanaTokenContinue =
|
|
3672
|
+
const handleSolanaTokenContinue = useCallback5(
|
|
3456
3673
|
(token, balance, balanceUsd) => {
|
|
3457
3674
|
logFlow("solana:token:continue", { token: token.symbol });
|
|
3458
3675
|
setStep((prev) => {
|
|
@@ -3470,7 +3687,7 @@ function DepositFlow({
|
|
|
3470
3687
|
},
|
|
3471
3688
|
[defaultAmount, logFlow]
|
|
3472
3689
|
);
|
|
3473
|
-
const handleSolanaAmountContinue =
|
|
3690
|
+
const handleSolanaAmountContinue = useCallback5(
|
|
3474
3691
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3475
3692
|
const targetSym = getTokenSymbol(targetToken, targetChain);
|
|
3476
3693
|
const isTargetStable = isStablecoinSymbol(targetSym);
|
|
@@ -3500,7 +3717,7 @@ function DepositFlow({
|
|
|
3500
3717
|
},
|
|
3501
3718
|
[targetToken, targetChain, getTokenPriceUsd, logFlow]
|
|
3502
3719
|
);
|
|
3503
|
-
const handleSolanaConfirmed =
|
|
3720
|
+
const handleSolanaConfirmed = useCallback5(
|
|
3504
3721
|
(txHash, amountUnits) => {
|
|
3505
3722
|
setStep((prev) => {
|
|
3506
3723
|
if (prev.type !== "solana-confirm") return prev;
|
|
@@ -3528,13 +3745,13 @@ function DepositFlow({
|
|
|
3528
3745
|
},
|
|
3529
3746
|
[logFlow, onDepositSubmitted]
|
|
3530
3747
|
);
|
|
3531
|
-
const handleConnected =
|
|
3748
|
+
const handleConnected = useCallback5(
|
|
3532
3749
|
(addr, smartAccount) => {
|
|
3533
3750
|
onConnected?.({ address: addr, smartAccount });
|
|
3534
3751
|
},
|
|
3535
3752
|
[onConnected]
|
|
3536
3753
|
);
|
|
3537
|
-
const handleAssetContinue =
|
|
3754
|
+
const handleAssetContinue = useCallback5(
|
|
3538
3755
|
(asset) => {
|
|
3539
3756
|
onEvent?.({
|
|
3540
3757
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
@@ -3556,7 +3773,7 @@ function DepositFlow({
|
|
|
3556
3773
|
},
|
|
3557
3774
|
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3558
3775
|
);
|
|
3559
|
-
const handleAmountContinue =
|
|
3776
|
+
const handleAmountContinue = useCallback5(
|
|
3560
3777
|
(amount, targetAmount, balance) => {
|
|
3561
3778
|
const targetSym = getTokenSymbol(targetToken, targetChain);
|
|
3562
3779
|
const isTargetStable = isStablecoinSymbol(targetSym);
|
|
@@ -3576,7 +3793,7 @@ function DepositFlow({
|
|
|
3576
3793
|
},
|
|
3577
3794
|
[targetToken, targetChain, getTokenPriceUsd]
|
|
3578
3795
|
);
|
|
3579
|
-
const handleDepositSubmitted =
|
|
3796
|
+
const handleDepositSubmitted = useCallback5(
|
|
3580
3797
|
(txHash, chainId, amount, token) => {
|
|
3581
3798
|
logFlow("evm:submitted", {
|
|
3582
3799
|
txHash,
|
|
@@ -3599,34 +3816,34 @@ function DepositFlow({
|
|
|
3599
3816
|
},
|
|
3600
3817
|
[targetChain, targetToken]
|
|
3601
3818
|
);
|
|
3602
|
-
const handleDepositSubmittedCallback =
|
|
3819
|
+
const handleDepositSubmittedCallback = useCallback5(
|
|
3603
3820
|
(txHash, sourceChain, amount) => {
|
|
3604
3821
|
onDepositSubmittedRef.current?.({ txHash, sourceChain, amount });
|
|
3605
3822
|
},
|
|
3606
3823
|
[onDepositSubmittedRef]
|
|
3607
3824
|
);
|
|
3608
|
-
const handleDepositComplete =
|
|
3825
|
+
const handleDepositComplete = useCallback5(
|
|
3609
3826
|
(txHash, destinationTxHash, context) => {
|
|
3610
3827
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3611
3828
|
onDepositCompleteRef.current?.({ txHash, destinationTxHash, ...context });
|
|
3612
3829
|
},
|
|
3613
3830
|
[logFlow, onDepositCompleteRef]
|
|
3614
3831
|
);
|
|
3615
|
-
const handleDepositFailed =
|
|
3832
|
+
const handleDepositFailed = useCallback5(
|
|
3616
3833
|
(txHash, error) => {
|
|
3617
3834
|
logFlowError("deposit:failed", error, { txHash });
|
|
3618
3835
|
onDepositFailedRef.current?.({ txHash, error });
|
|
3619
3836
|
},
|
|
3620
3837
|
[logFlowError, onDepositFailedRef]
|
|
3621
3838
|
);
|
|
3622
|
-
const handleError =
|
|
3839
|
+
const handleError = useCallback5(
|
|
3623
3840
|
(message, code) => {
|
|
3624
3841
|
logFlowError("flow:error", message, { code });
|
|
3625
3842
|
onErrorRef.current?.({ message, code });
|
|
3626
3843
|
},
|
|
3627
3844
|
[logFlowError, onErrorRef]
|
|
3628
3845
|
);
|
|
3629
|
-
const handleTotalBalanceComputed =
|
|
3846
|
+
const handleTotalBalanceComputed = useCallback5((total) => {
|
|
3630
3847
|
setTotalBalanceUsd(total);
|
|
3631
3848
|
}, []);
|
|
3632
3849
|
const selectedWalletIdEffective = useMemo6(() => {
|
|
@@ -3640,8 +3857,8 @@ function DepositFlow({
|
|
|
3640
3857
|
() => walletOptions.map((option) => option.id).join(","),
|
|
3641
3858
|
[walletOptions]
|
|
3642
3859
|
);
|
|
3643
|
-
const hasNavigatedBackRef =
|
|
3644
|
-
|
|
3860
|
+
const hasNavigatedBackRef = useRef7(false);
|
|
3861
|
+
useEffect10(() => {
|
|
3645
3862
|
if (flowModeRef.current) {
|
|
3646
3863
|
return;
|
|
3647
3864
|
}
|
|
@@ -3652,14 +3869,14 @@ function DepositFlow({
|
|
|
3652
3869
|
setStep({ type: "setup" });
|
|
3653
3870
|
}
|
|
3654
3871
|
}, [walletOptionsKey]);
|
|
3655
|
-
|
|
3872
|
+
useEffect10(() => {
|
|
3656
3873
|
if (!showConnectStep && isConnectSelectionConfirmed && flowMode === "wallet" && !signerContext) {
|
|
3657
3874
|
setSelectedWalletId(null);
|
|
3658
3875
|
setIsConnectSelectionConfirmed(false);
|
|
3659
3876
|
setFlowMode(null);
|
|
3660
3877
|
}
|
|
3661
3878
|
}, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext]);
|
|
3662
|
-
|
|
3879
|
+
useEffect10(() => {
|
|
3663
3880
|
if (enableSolana || flowMode !== "solana-wallet") {
|
|
3664
3881
|
return;
|
|
3665
3882
|
}
|
|
@@ -3670,7 +3887,7 @@ function DepositFlow({
|
|
|
3670
3887
|
setStep({ type: "setup" });
|
|
3671
3888
|
}
|
|
3672
3889
|
}, [enableSolana, flowMode, step.type]);
|
|
3673
|
-
|
|
3890
|
+
useEffect10(() => {
|
|
3674
3891
|
if (hasNavigatedBackRef.current || isConnectSelectionConfirmed || flowMode) {
|
|
3675
3892
|
return;
|
|
3676
3893
|
}
|
|
@@ -3708,7 +3925,7 @@ function DepositFlow({
|
|
|
3708
3925
|
handleSelectTransferCrypto
|
|
3709
3926
|
]);
|
|
3710
3927
|
if (showConnectStep) {
|
|
3711
|
-
return /* @__PURE__ */
|
|
3928
|
+
return /* @__PURE__ */ jsx12("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx12(
|
|
3712
3929
|
ConnectStep,
|
|
3713
3930
|
{
|
|
3714
3931
|
walletOptions,
|
|
@@ -3741,8 +3958,8 @@ function DepositFlow({
|
|
|
3741
3958
|
}
|
|
3742
3959
|
if (isDepositAddressMode) {
|
|
3743
3960
|
if (!dappAddress || !sessionKeyAddress) return null;
|
|
3744
|
-
return /* @__PURE__ */
|
|
3745
|
-
step.type === "setup" && /* @__PURE__ */
|
|
3961
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rs-modal-body", children: [
|
|
3962
|
+
step.type === "setup" && /* @__PURE__ */ jsx12(
|
|
3746
3963
|
SetupStep,
|
|
3747
3964
|
{
|
|
3748
3965
|
address: sessionKeyAddress,
|
|
@@ -3762,7 +3979,7 @@ function DepositFlow({
|
|
|
3762
3979
|
onError: handleError
|
|
3763
3980
|
}
|
|
3764
3981
|
),
|
|
3765
|
-
step.type === "deposit-address" && /* @__PURE__ */
|
|
3982
|
+
step.type === "deposit-address" && /* @__PURE__ */ jsx12(
|
|
3766
3983
|
DepositAddressStep,
|
|
3767
3984
|
{
|
|
3768
3985
|
smartAccount: step.smartAccount,
|
|
@@ -3773,6 +3990,7 @@ function DepositFlow({
|
|
|
3773
3990
|
targetToken,
|
|
3774
3991
|
waitForFinalTx,
|
|
3775
3992
|
hasPostBridgeActions: Boolean(postBridgeActions?.length),
|
|
3993
|
+
uiConfig,
|
|
3776
3994
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
3777
3995
|
onDepositComplete: handleDepositComplete,
|
|
3778
3996
|
onDepositFailed: handleDepositFailed,
|
|
@@ -3797,8 +4015,8 @@ function DepositFlow({
|
|
|
3797
4015
|
if (!sessionKeyAddress) return null;
|
|
3798
4016
|
const solanaAddr = reownWallet?.solanaAddress;
|
|
3799
4017
|
const solanaProvider = reownWallet?.solanaProvider;
|
|
3800
|
-
return /* @__PURE__ */
|
|
3801
|
-
step.type === "setup" && /* @__PURE__ */
|
|
4018
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rs-modal-body", children: [
|
|
4019
|
+
step.type === "setup" && /* @__PURE__ */ jsx12(
|
|
3802
4020
|
SetupStep,
|
|
3803
4021
|
{
|
|
3804
4022
|
address: sessionKeyAddress,
|
|
@@ -3818,7 +4036,7 @@ function DepositFlow({
|
|
|
3818
4036
|
onError: handleError
|
|
3819
4037
|
}
|
|
3820
4038
|
),
|
|
3821
|
-
step.type === "solana-token-select" && solanaAddr && /* @__PURE__ */
|
|
4039
|
+
step.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx12(
|
|
3822
4040
|
SolanaTokenSelectStep,
|
|
3823
4041
|
{
|
|
3824
4042
|
solanaAddress: solanaAddr,
|
|
@@ -3828,7 +4046,7 @@ function DepositFlow({
|
|
|
3828
4046
|
debug
|
|
3829
4047
|
}
|
|
3830
4048
|
),
|
|
3831
|
-
step.type === "solana-amount" && /* @__PURE__ */
|
|
4049
|
+
step.type === "solana-amount" && /* @__PURE__ */ jsx12(
|
|
3832
4050
|
SolanaAmountStep,
|
|
3833
4051
|
{
|
|
3834
4052
|
token: step.token,
|
|
@@ -3840,7 +4058,7 @@ function DepositFlow({
|
|
|
3840
4058
|
debug
|
|
3841
4059
|
}
|
|
3842
4060
|
),
|
|
3843
|
-
step.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */
|
|
4061
|
+
step.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx12(
|
|
3844
4062
|
SolanaConfirmStep,
|
|
3845
4063
|
{
|
|
3846
4064
|
smartAccount: step.smartAccount,
|
|
@@ -3859,16 +4077,16 @@ function DepositFlow({
|
|
|
3859
4077
|
onError: handleError,
|
|
3860
4078
|
debug
|
|
3861
4079
|
}
|
|
3862
|
-
) : step.type === "solana-confirm" ? /* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
/* @__PURE__ */
|
|
4080
|
+
) : step.type === "solana-confirm" ? /* @__PURE__ */ jsxs11("div", { className: "rs-step", children: [
|
|
4081
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-loading-state", children: [
|
|
4082
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx12(
|
|
3865
4083
|
"svg",
|
|
3866
4084
|
{
|
|
3867
4085
|
viewBox: "0 0 24 24",
|
|
3868
4086
|
fill: "none",
|
|
3869
4087
|
stroke: "currentColor",
|
|
3870
4088
|
strokeWidth: "2",
|
|
3871
|
-
children: /* @__PURE__ */
|
|
4089
|
+
children: /* @__PURE__ */ jsx12(
|
|
3872
4090
|
"path",
|
|
3873
4091
|
{
|
|
3874
4092
|
strokeLinecap: "round",
|
|
@@ -3878,22 +4096,22 @@ function DepositFlow({
|
|
|
3878
4096
|
)
|
|
3879
4097
|
}
|
|
3880
4098
|
) }),
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */
|
|
4099
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-loading-text", children: [
|
|
4100
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
|
|
4101
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
|
|
3884
4102
|
] })
|
|
3885
4103
|
] }),
|
|
3886
|
-
/* @__PURE__ */
|
|
4104
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx12(
|
|
3887
4105
|
"button",
|
|
3888
4106
|
{
|
|
3889
4107
|
type: "button",
|
|
3890
4108
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
3891
4109
|
onClick: handleBackFromSolanaConfirm,
|
|
3892
|
-
children: /* @__PURE__ */
|
|
4110
|
+
children: /* @__PURE__ */ jsx12("span", { children: "Go Back" })
|
|
3893
4111
|
}
|
|
3894
4112
|
) })
|
|
3895
4113
|
] }) : null,
|
|
3896
|
-
step.type === "processing" && /* @__PURE__ */
|
|
4114
|
+
step.type === "processing" && /* @__PURE__ */ jsx12(
|
|
3897
4115
|
ProcessingStep,
|
|
3898
4116
|
{
|
|
3899
4117
|
smartAccount: step.smartAccount,
|
|
@@ -3920,7 +4138,7 @@ function DepositFlow({
|
|
|
3920
4138
|
] });
|
|
3921
4139
|
}
|
|
3922
4140
|
if (!signerContext?.walletClient || !signerContext?.publicClient) {
|
|
3923
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsx12("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx12("div", { className: "rs-step", children: /* @__PURE__ */ jsx12("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx12("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx12("div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
3924
4142
|
}
|
|
3925
4143
|
const ownerAddress = signerContext.ownerAddress;
|
|
3926
4144
|
const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? targetChain;
|
|
@@ -3930,8 +4148,8 @@ function DepositFlow({
|
|
|
3930
4148
|
}
|
|
3931
4149
|
return getPublicClient(chainId);
|
|
3932
4150
|
};
|
|
3933
|
-
return /* @__PURE__ */
|
|
3934
|
-
step.type === "setup" && /* @__PURE__ */
|
|
4151
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rs-modal-body", children: [
|
|
4152
|
+
step.type === "setup" && /* @__PURE__ */ jsx12(
|
|
3935
4153
|
SetupStep,
|
|
3936
4154
|
{
|
|
3937
4155
|
walletClient: signerContext.walletClient,
|
|
@@ -3952,7 +4170,7 @@ function DepositFlow({
|
|
|
3952
4170
|
onError: handleError
|
|
3953
4171
|
}
|
|
3954
4172
|
),
|
|
3955
|
-
step.type === "select-asset" && /* @__PURE__ */
|
|
4173
|
+
step.type === "select-asset" && /* @__PURE__ */ jsx12(
|
|
3956
4174
|
AssetSelectStep,
|
|
3957
4175
|
{
|
|
3958
4176
|
address: ownerAddress,
|
|
@@ -3970,7 +4188,7 @@ function DepositFlow({
|
|
|
3970
4188
|
} : void 0
|
|
3971
4189
|
}
|
|
3972
4190
|
),
|
|
3973
|
-
step.type === "amount" && /* @__PURE__ */
|
|
4191
|
+
step.type === "amount" && /* @__PURE__ */ jsx12(
|
|
3974
4192
|
AmountStep,
|
|
3975
4193
|
{
|
|
3976
4194
|
walletClient: signerContext.walletClient,
|
|
@@ -3995,7 +4213,7 @@ function DepositFlow({
|
|
|
3995
4213
|
}
|
|
3996
4214
|
}
|
|
3997
4215
|
),
|
|
3998
|
-
step.type === "confirm" && /* @__PURE__ */
|
|
4216
|
+
step.type === "confirm" && /* @__PURE__ */ jsx12(
|
|
3999
4217
|
ConfirmStep,
|
|
4000
4218
|
{
|
|
4001
4219
|
walletClient: signerContext.walletClient,
|
|
@@ -4015,7 +4233,7 @@ function DepositFlow({
|
|
|
4015
4233
|
onError: handleError
|
|
4016
4234
|
}
|
|
4017
4235
|
),
|
|
4018
|
-
step.type === "processing" && /* @__PURE__ */
|
|
4236
|
+
step.type === "processing" && /* @__PURE__ */ jsx12(
|
|
4019
4237
|
ProcessingStep,
|
|
4020
4238
|
{
|
|
4021
4239
|
smartAccount: step.smartAccount,
|
|
@@ -4043,8 +4261,8 @@ function DepositFlow({
|
|
|
4043
4261
|
}
|
|
4044
4262
|
|
|
4045
4263
|
// src/components/history/DepositHistoryPanel.tsx
|
|
4046
|
-
import { useCallback as
|
|
4047
|
-
import { Fragment as Fragment2, jsx as
|
|
4264
|
+
import { useCallback as useCallback6 } from "react";
|
|
4265
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4048
4266
|
function shortenHash(hash) {
|
|
4049
4267
|
if (hash.length <= 14) return hash;
|
|
4050
4268
|
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
@@ -4149,7 +4367,7 @@ var STATUS_LABEL = {
|
|
|
4149
4367
|
failed: "Failed"
|
|
4150
4368
|
};
|
|
4151
4369
|
function ExternalLinkIcon() {
|
|
4152
|
-
return /* @__PURE__ */
|
|
4370
|
+
return /* @__PURE__ */ jsx13("svg", { className: "rs-history-ext-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 1.5H2.25A.75.75 0 0 0 1.5 2.25v7.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75V7.5m-3-6h3m0 0v3m0-3L6 6" }) });
|
|
4153
4371
|
}
|
|
4154
4372
|
function DepositHistoryPanel({
|
|
4155
4373
|
deposits,
|
|
@@ -4160,7 +4378,7 @@ function DepositHistoryPanel({
|
|
|
4160
4378
|
onLoadMore,
|
|
4161
4379
|
onClose
|
|
4162
4380
|
}) {
|
|
4163
|
-
const handleKeyDown =
|
|
4381
|
+
const handleKeyDown = useCallback6(
|
|
4164
4382
|
(e) => {
|
|
4165
4383
|
if (e.key === "Escape") {
|
|
4166
4384
|
e.stopPropagation();
|
|
@@ -4169,7 +4387,7 @@ function DepositHistoryPanel({
|
|
|
4169
4387
|
},
|
|
4170
4388
|
[onClose]
|
|
4171
4389
|
);
|
|
4172
|
-
return /* @__PURE__ */
|
|
4390
|
+
return /* @__PURE__ */ jsxs12(
|
|
4173
4391
|
"div",
|
|
4174
4392
|
{
|
|
4175
4393
|
className: "rs-history-panel",
|
|
@@ -4177,40 +4395,40 @@ function DepositHistoryPanel({
|
|
|
4177
4395
|
"aria-label": "Deposit history",
|
|
4178
4396
|
onKeyDown: handleKeyDown,
|
|
4179
4397
|
children: [
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4398
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-history-header", children: [
|
|
4399
|
+
/* @__PURE__ */ jsx13(
|
|
4182
4400
|
"button",
|
|
4183
4401
|
{
|
|
4184
4402
|
type: "button",
|
|
4185
4403
|
className: "rs-history-back",
|
|
4186
4404
|
"aria-label": "Close history",
|
|
4187
4405
|
onClick: onClose,
|
|
4188
|
-
children: /* @__PURE__ */
|
|
4406
|
+
children: /* @__PURE__ */ jsx13("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" }) })
|
|
4189
4407
|
}
|
|
4190
4408
|
),
|
|
4191
|
-
/* @__PURE__ */
|
|
4192
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-header-title", children: "History" }),
|
|
4410
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-history-header-spacer" })
|
|
4193
4411
|
] }),
|
|
4194
|
-
/* @__PURE__ */
|
|
4195
|
-
isLoading && deposits.length === 0 && /* @__PURE__ */
|
|
4196
|
-
/* @__PURE__ */
|
|
4197
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-history-body", children: [
|
|
4413
|
+
isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs12("div", { className: "rs-history-state", children: [
|
|
4414
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-history-spinner", children: /* @__PURE__ */ jsx13("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx13("path", { d: "M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83", strokeLinecap: "round" }) }) }),
|
|
4415
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-state-text", children: "Loading history..." })
|
|
4198
4416
|
] }),
|
|
4199
|
-
error && !isLoading && /* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4201
|
-
/* @__PURE__ */
|
|
4202
|
-
/* @__PURE__ */
|
|
4417
|
+
error && !isLoading && /* @__PURE__ */ jsxs12("div", { className: "rs-history-state", children: [
|
|
4418
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-history-state-icon rs-history-state-icon--error", children: /* @__PURE__ */ jsxs12("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
4419
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4420
|
+
/* @__PURE__ */ jsx13("path", { strokeLinecap: "round", d: "M12 8v4m0 4h.01" })
|
|
4203
4421
|
] }) }),
|
|
4204
|
-
/* @__PURE__ */
|
|
4422
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-state-text", children: error })
|
|
4205
4423
|
] }),
|
|
4206
|
-
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
4208
|
-
/* @__PURE__ */
|
|
4209
|
-
/* @__PURE__ */
|
|
4424
|
+
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ jsxs12("div", { className: "rs-history-state", children: [
|
|
4425
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-history-state-icon", children: /* @__PURE__ */ jsx13("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" }) }) }),
|
|
4426
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-state-text", children: "No deposits yet" }),
|
|
4427
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-state-hint", children: "Your deposit history will appear here" })
|
|
4210
4428
|
] }),
|
|
4211
|
-
deposits.length > 0 && /* @__PURE__ */
|
|
4212
|
-
deposits.map((deposit, i) => /* @__PURE__ */
|
|
4213
|
-
hasMore && /* @__PURE__ */
|
|
4429
|
+
deposits.length > 0 && /* @__PURE__ */ jsxs12("div", { className: "rs-history-list", children: [
|
|
4430
|
+
deposits.map((deposit, i) => /* @__PURE__ */ jsx13(HistoryRow, { deposit }, deposit.txHash || i)),
|
|
4431
|
+
hasMore && /* @__PURE__ */ jsx13(
|
|
4214
4432
|
"button",
|
|
4215
4433
|
{
|
|
4216
4434
|
type: "button",
|
|
@@ -4241,38 +4459,38 @@ function HistoryRow({ deposit }) {
|
|
|
4241
4459
|
const timestamp = deposit.createdAt ? formatTimestamp2(deposit.createdAt) : null;
|
|
4242
4460
|
const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
|
|
4243
4461
|
const dstTxUrl = deposit.destinationTxHash ? getTxExplorerUrl(deposit.destinationTxHash, targetChainId) : null;
|
|
4244
|
-
return /* @__PURE__ */
|
|
4245
|
-
/* @__PURE__ */
|
|
4246
|
-
/* @__PURE__ */
|
|
4247
|
-
/* @__PURE__ */
|
|
4248
|
-
sourceChainIcon && /* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsxs12("div", { className: "rs-history-row", children: [
|
|
4463
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-history-row-primary", children: [
|
|
4464
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-history-route", children: [
|
|
4465
|
+
/* @__PURE__ */ jsxs12("span", { className: "rs-history-chain", children: [
|
|
4466
|
+
sourceChainIcon && /* @__PURE__ */ jsx13("img", { src: sourceChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4467
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-chain-name", children: sourceChainName ?? "Unknown" })
|
|
4250
4468
|
] }),
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
targetChainIcon && /* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4469
|
+
/* @__PURE__ */ jsx13("svg", { className: "rs-history-route-arrow", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.5 6h7m0 0L7 3.5M9.5 6 7 8.5" }) }),
|
|
4470
|
+
/* @__PURE__ */ jsxs12("span", { className: "rs-history-chain", children: [
|
|
4471
|
+
targetChainIcon && /* @__PURE__ */ jsx13("img", { src: targetChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4472
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-chain-name", children: targetChainName ?? "Unknown" })
|
|
4255
4473
|
] })
|
|
4256
4474
|
] }),
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
/* @__PURE__ */
|
|
4475
|
+
/* @__PURE__ */ jsxs12("span", { className: `rs-history-status rs-history-status--${status}`, children: [
|
|
4476
|
+
/* @__PURE__ */ jsx13("span", { className: `rs-history-dot rs-history-dot--${status}` }),
|
|
4259
4477
|
STATUS_LABEL[status]
|
|
4260
4478
|
] })
|
|
4261
4479
|
] }),
|
|
4262
|
-
/* @__PURE__ */
|
|
4263
|
-
/* @__PURE__ */
|
|
4480
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-history-row-secondary", children: [
|
|
4481
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-amount", children: formattedAmount ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4264
4482
|
formattedAmount,
|
|
4265
4483
|
" ",
|
|
4266
|
-
/* @__PURE__ */
|
|
4267
|
-
targetSymbol && sourceSymbol !== targetSymbol && /* @__PURE__ */
|
|
4484
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-token", children: sourceSymbol }),
|
|
4485
|
+
targetSymbol && sourceSymbol !== targetSymbol && /* @__PURE__ */ jsxs12("span", { className: "rs-history-token-target", children: [
|
|
4268
4486
|
" \u2192 ",
|
|
4269
4487
|
targetSymbol
|
|
4270
4488
|
] })
|
|
4271
|
-
] }) : /* @__PURE__ */
|
|
4272
|
-
timestamp && /* @__PURE__ */
|
|
4489
|
+
] }) : /* @__PURE__ */ jsx13("span", { className: "rs-history-no-amount", children: "\u2014" }) }),
|
|
4490
|
+
timestamp && /* @__PURE__ */ jsx13("span", { className: "rs-history-time", children: timestamp })
|
|
4273
4491
|
] }),
|
|
4274
|
-
(srcTxUrl || dstTxUrl) && /* @__PURE__ */
|
|
4275
|
-
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */
|
|
4492
|
+
(srcTxUrl || dstTxUrl) && /* @__PURE__ */ jsxs12("div", { className: "rs-history-row-links", children: [
|
|
4493
|
+
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs12(
|
|
4276
4494
|
"a",
|
|
4277
4495
|
{
|
|
4278
4496
|
href: srcTxUrl,
|
|
@@ -4281,12 +4499,12 @@ function HistoryRow({ deposit }) {
|
|
|
4281
4499
|
className: "rs-history-tx-link",
|
|
4282
4500
|
title: deposit.sourceTxHash,
|
|
4283
4501
|
children: [
|
|
4284
|
-
/* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-tx-hash", children: shortenHash(deposit.sourceTxHash) }),
|
|
4503
|
+
/* @__PURE__ */ jsx13(ExternalLinkIcon, {})
|
|
4286
4504
|
]
|
|
4287
4505
|
}
|
|
4288
4506
|
),
|
|
4289
|
-
dstTxUrl && deposit.destinationTxHash && /* @__PURE__ */
|
|
4507
|
+
dstTxUrl && deposit.destinationTxHash && /* @__PURE__ */ jsxs12(
|
|
4290
4508
|
"a",
|
|
4291
4509
|
{
|
|
4292
4510
|
href: dstTxUrl,
|
|
@@ -4295,8 +4513,8 @@ function HistoryRow({ deposit }) {
|
|
|
4295
4513
|
className: "rs-history-tx-link",
|
|
4296
4514
|
title: deposit.destinationTxHash,
|
|
4297
4515
|
children: [
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4516
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-history-tx-hash", children: shortenHash(deposit.destinationTxHash) }),
|
|
4517
|
+
/* @__PURE__ */ jsx13(ExternalLinkIcon, {})
|
|
4300
4518
|
]
|
|
4301
4519
|
}
|
|
4302
4520
|
)
|
|
@@ -4306,9 +4524,9 @@ function HistoryRow({ deposit }) {
|
|
|
4306
4524
|
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
4307
4525
|
|
|
4308
4526
|
// src/DepositModal.tsx
|
|
4309
|
-
import { jsx as
|
|
4527
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4310
4528
|
var ReownDepositInner = lazy(
|
|
4311
|
-
() => import("./DepositModalReown-
|
|
4529
|
+
() => import("./DepositModalReown-RYCOXWMH.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
4312
4530
|
);
|
|
4313
4531
|
function DepositModal(props) {
|
|
4314
4532
|
const needsReown = !!props.reownAppId;
|
|
@@ -4317,7 +4535,7 @@ function DepositModal(props) {
|
|
|
4317
4535
|
"dappWalletClient"
|
|
4318
4536
|
);
|
|
4319
4537
|
if (needsReown) {
|
|
4320
|
-
return /* @__PURE__ */
|
|
4538
|
+
return /* @__PURE__ */ jsx14(Suspense, { fallback: null, children: /* @__PURE__ */ jsx14(
|
|
4321
4539
|
ReownDepositInner,
|
|
4322
4540
|
{
|
|
4323
4541
|
...props,
|
|
@@ -4325,7 +4543,7 @@ function DepositModal(props) {
|
|
|
4325
4543
|
}
|
|
4326
4544
|
) });
|
|
4327
4545
|
}
|
|
4328
|
-
return /* @__PURE__ */
|
|
4546
|
+
return /* @__PURE__ */ jsx14(
|
|
4329
4547
|
DepositModalInner,
|
|
4330
4548
|
{
|
|
4331
4549
|
...props,
|
|
@@ -4378,21 +4596,21 @@ function DepositModalInner({
|
|
|
4378
4596
|
onError,
|
|
4379
4597
|
debug
|
|
4380
4598
|
}) {
|
|
4381
|
-
const modalRef =
|
|
4599
|
+
const modalRef = useRef8(null);
|
|
4382
4600
|
const onReadyRef = useLatestRef(onReady);
|
|
4383
|
-
const [currentStepIndex, setCurrentStepIndex] =
|
|
4384
|
-
const [totalBalanceUsd, setTotalBalanceUsd] =
|
|
4385
|
-
const backHandlerRef =
|
|
4601
|
+
const [currentStepIndex, setCurrentStepIndex] = useState12(0);
|
|
4602
|
+
const [totalBalanceUsd, setTotalBalanceUsd] = useState12(null);
|
|
4603
|
+
const backHandlerRef = useRef8(void 0);
|
|
4386
4604
|
const showHistoryButton = uiConfig?.showHistoryButton ?? false;
|
|
4387
|
-
const [activeSmartAccount, setActiveSmartAccount] =
|
|
4388
|
-
const [historyOpen, setHistoryOpen] =
|
|
4389
|
-
const [historyDeposits, setHistoryDeposits] =
|
|
4390
|
-
const [historyNextCursor, setHistoryNextCursor] =
|
|
4391
|
-
const [historyLoading, setHistoryLoading] =
|
|
4392
|
-
const [historyLoadingMore, setHistoryLoadingMore] =
|
|
4393
|
-
const [historyError, setHistoryError] =
|
|
4394
|
-
const historyStaleRef =
|
|
4395
|
-
const historyLoadedRef =
|
|
4605
|
+
const [activeSmartAccount, setActiveSmartAccount] = useState12(null);
|
|
4606
|
+
const [historyOpen, setHistoryOpen] = useState12(false);
|
|
4607
|
+
const [historyDeposits, setHistoryDeposits] = useState12([]);
|
|
4608
|
+
const [historyNextCursor, setHistoryNextCursor] = useState12(null);
|
|
4609
|
+
const [historyLoading, setHistoryLoading] = useState12(false);
|
|
4610
|
+
const [historyLoadingMore, setHistoryLoadingMore] = useState12(false);
|
|
4611
|
+
const [historyError, setHistoryError] = useState12(null);
|
|
4612
|
+
const historyStaleRef = useRef8(false);
|
|
4613
|
+
const historyLoadedRef = useRef8(false);
|
|
4396
4614
|
const targetChain = getChainId(targetChainProp);
|
|
4397
4615
|
const sourceChain = sourceChainProp ? getChainId(sourceChainProp) : void 0;
|
|
4398
4616
|
const service = useMemo7(
|
|
@@ -4402,38 +4620,38 @@ function DepositModalInner({
|
|
|
4402
4620
|
}),
|
|
4403
4621
|
[backendUrl, debug]
|
|
4404
4622
|
);
|
|
4405
|
-
|
|
4623
|
+
useEffect11(() => {
|
|
4406
4624
|
if (isOpen && modalRef.current) {
|
|
4407
4625
|
applyTheme(modalRef.current, theme);
|
|
4408
4626
|
}
|
|
4409
4627
|
}, [isOpen, theme]);
|
|
4410
|
-
|
|
4628
|
+
useEffect11(() => {
|
|
4411
4629
|
configureSolanaRpcUrl(solanaRpcUrl);
|
|
4412
4630
|
}, [solanaRpcUrl]);
|
|
4413
|
-
|
|
4631
|
+
useEffect11(() => {
|
|
4414
4632
|
if (isOpen) {
|
|
4415
4633
|
onReadyRef.current?.();
|
|
4416
4634
|
}
|
|
4417
4635
|
}, [isOpen, onReadyRef]);
|
|
4418
|
-
|
|
4636
|
+
useEffect11(() => {
|
|
4419
4637
|
if (!isOpen) {
|
|
4420
4638
|
setCurrentStepIndex(0);
|
|
4421
4639
|
}
|
|
4422
4640
|
}, [isOpen]);
|
|
4423
|
-
const handleStepChange =
|
|
4641
|
+
const handleStepChange = useCallback7(
|
|
4424
4642
|
(stepIndex, onBack) => {
|
|
4425
4643
|
setCurrentStepIndex(stepIndex);
|
|
4426
4644
|
backHandlerRef.current = onBack;
|
|
4427
4645
|
},
|
|
4428
4646
|
[]
|
|
4429
4647
|
);
|
|
4430
|
-
const handleTotalBalanceChange =
|
|
4648
|
+
const handleTotalBalanceChange = useCallback7((balance2) => {
|
|
4431
4649
|
setTotalBalanceUsd(balance2);
|
|
4432
4650
|
}, []);
|
|
4433
|
-
const handleBack =
|
|
4651
|
+
const handleBack = useCallback7(() => {
|
|
4434
4652
|
backHandlerRef.current?.();
|
|
4435
4653
|
}, []);
|
|
4436
|
-
const handleSmartAccountChange =
|
|
4654
|
+
const handleSmartAccountChange = useCallback7(
|
|
4437
4655
|
(account) => {
|
|
4438
4656
|
setActiveSmartAccount(account);
|
|
4439
4657
|
if (!account) {
|
|
@@ -4442,7 +4660,7 @@ function DepositModalInner({
|
|
|
4442
4660
|
},
|
|
4443
4661
|
[]
|
|
4444
4662
|
);
|
|
4445
|
-
const fetchHistory =
|
|
4663
|
+
const fetchHistory = useCallback7(
|
|
4446
4664
|
async (cursor) => {
|
|
4447
4665
|
if (!activeSmartAccount) return;
|
|
4448
4666
|
const isInitial = !cursor;
|
|
@@ -4480,21 +4698,21 @@ function DepositModalInner({
|
|
|
4480
4698
|
},
|
|
4481
4699
|
[activeSmartAccount, service]
|
|
4482
4700
|
);
|
|
4483
|
-
const handleHistoryOpen =
|
|
4701
|
+
const handleHistoryOpen = useCallback7(() => {
|
|
4484
4702
|
setHistoryOpen(true);
|
|
4485
4703
|
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
4486
4704
|
fetchHistory();
|
|
4487
4705
|
}
|
|
4488
4706
|
}, [fetchHistory]);
|
|
4489
|
-
const handleHistoryClose =
|
|
4707
|
+
const handleHistoryClose = useCallback7(() => {
|
|
4490
4708
|
setHistoryOpen(false);
|
|
4491
4709
|
}, []);
|
|
4492
|
-
const handleHistoryLoadMore =
|
|
4710
|
+
const handleHistoryLoadMore = useCallback7(() => {
|
|
4493
4711
|
if (historyNextCursor) {
|
|
4494
4712
|
fetchHistory(historyNextCursor);
|
|
4495
4713
|
}
|
|
4496
4714
|
}, [fetchHistory, historyNextCursor]);
|
|
4497
|
-
const markHistoryStale =
|
|
4715
|
+
const markHistoryStale = useCallback7(() => {
|
|
4498
4716
|
historyStaleRef.current = true;
|
|
4499
4717
|
if (historyOpen) {
|
|
4500
4718
|
fetchHistory();
|
|
@@ -4503,28 +4721,28 @@ function DepositModalInner({
|
|
|
4503
4721
|
const onDepositSubmittedRef = useLatestRef(onDepositSubmitted);
|
|
4504
4722
|
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
4505
4723
|
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
4506
|
-
const handleDepositSubmitted =
|
|
4724
|
+
const handleDepositSubmitted = useCallback7(
|
|
4507
4725
|
(data) => {
|
|
4508
4726
|
onDepositSubmittedRef.current?.(data);
|
|
4509
4727
|
if (showHistoryButton) markHistoryStale();
|
|
4510
4728
|
},
|
|
4511
4729
|
[onDepositSubmittedRef, showHistoryButton, markHistoryStale]
|
|
4512
4730
|
);
|
|
4513
|
-
const handleDepositComplete =
|
|
4731
|
+
const handleDepositComplete = useCallback7(
|
|
4514
4732
|
(data) => {
|
|
4515
4733
|
onDepositCompleteRef.current?.(data);
|
|
4516
4734
|
if (showHistoryButton) markHistoryStale();
|
|
4517
4735
|
},
|
|
4518
4736
|
[onDepositCompleteRef, showHistoryButton, markHistoryStale]
|
|
4519
4737
|
);
|
|
4520
|
-
const handleDepositFailed =
|
|
4738
|
+
const handleDepositFailed = useCallback7(
|
|
4521
4739
|
(data) => {
|
|
4522
4740
|
onDepositFailedRef.current?.(data);
|
|
4523
4741
|
if (showHistoryButton) markHistoryStale();
|
|
4524
4742
|
},
|
|
4525
4743
|
[onDepositFailedRef, showHistoryButton, markHistoryStale]
|
|
4526
4744
|
);
|
|
4527
|
-
|
|
4745
|
+
useEffect11(() => {
|
|
4528
4746
|
if (!isOpen) {
|
|
4529
4747
|
setHistoryOpen(false);
|
|
4530
4748
|
setHistoryDeposits([]);
|
|
@@ -4542,7 +4760,7 @@ function DepositModalInner({
|
|
|
4542
4760
|
const logoUrl = branding?.logoUrl ?? "https://github.com/rhinestonewtf.png";
|
|
4543
4761
|
const title = branding?.title ?? "Deposit";
|
|
4544
4762
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
4545
|
-
return /* @__PURE__ */
|
|
4763
|
+
return /* @__PURE__ */ jsx14(
|
|
4546
4764
|
Modal,
|
|
4547
4765
|
{
|
|
4548
4766
|
isOpen,
|
|
@@ -4550,23 +4768,23 @@ function DepositModalInner({
|
|
|
4550
4768
|
className,
|
|
4551
4769
|
inline,
|
|
4552
4770
|
closeOnOverlayClick,
|
|
4553
|
-
children: /* @__PURE__ */
|
|
4554
|
-
/* @__PURE__ */
|
|
4555
|
-
/* @__PURE__ */
|
|
4771
|
+
children: /* @__PURE__ */ jsxs13("div", { ref: modalRef, className: "rs-modal", children: [
|
|
4772
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-modal-header--redesigned", children: [
|
|
4773
|
+
/* @__PURE__ */ jsx14("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ jsx14(
|
|
4556
4774
|
"button",
|
|
4557
4775
|
{
|
|
4558
4776
|
type: "button",
|
|
4559
4777
|
className: "rs-modal-header-back",
|
|
4560
4778
|
"aria-label": "Go back",
|
|
4561
4779
|
onClick: handleBack,
|
|
4562
|
-
children: /* @__PURE__ */
|
|
4780
|
+
children: /* @__PURE__ */ jsx14(
|
|
4563
4781
|
"svg",
|
|
4564
4782
|
{
|
|
4565
4783
|
viewBox: "0 0 24 24",
|
|
4566
4784
|
fill: "none",
|
|
4567
4785
|
stroke: "currentColor",
|
|
4568
4786
|
strokeWidth: "2",
|
|
4569
|
-
children: /* @__PURE__ */
|
|
4787
|
+
children: /* @__PURE__ */ jsx14(
|
|
4570
4788
|
"path",
|
|
4571
4789
|
{
|
|
4572
4790
|
strokeLinecap: "round",
|
|
@@ -4578,9 +4796,9 @@ function DepositModalInner({
|
|
|
4578
4796
|
)
|
|
4579
4797
|
}
|
|
4580
4798
|
) }),
|
|
4581
|
-
/* @__PURE__ */
|
|
4582
|
-
/* @__PURE__ */
|
|
4583
|
-
showLogo && logoUrl && /* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-modal-header-nav-center", children: [
|
|
4800
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-modal-header-title-row", children: [
|
|
4801
|
+
showLogo && logoUrl && /* @__PURE__ */ jsx14(
|
|
4584
4802
|
"img",
|
|
4585
4803
|
{
|
|
4586
4804
|
src: logoUrl,
|
|
@@ -4591,20 +4809,20 @@ function DepositModalInner({
|
|
|
4591
4809
|
}
|
|
4592
4810
|
}
|
|
4593
4811
|
),
|
|
4594
|
-
/* @__PURE__ */
|
|
4595
|
-
showStepper && currentStepIndex >= 2 && /* @__PURE__ */
|
|
4596
|
-
/* @__PURE__ */
|
|
4812
|
+
/* @__PURE__ */ jsx14("span", { className: "rs-modal-header-title", children: title }),
|
|
4813
|
+
showStepper && currentStepIndex >= 2 && /* @__PURE__ */ jsxs13("div", { className: "rs-step-indicator", style: { marginLeft: 8 }, children: [
|
|
4814
|
+
/* @__PURE__ */ jsx14(
|
|
4597
4815
|
"div",
|
|
4598
4816
|
{
|
|
4599
4817
|
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--complete" : "rs-step-indicator-node--active"}`,
|
|
4600
|
-
children: currentStepIndex >= 4 ? /* @__PURE__ */
|
|
4818
|
+
children: currentStepIndex >= 4 ? /* @__PURE__ */ jsx14(
|
|
4601
4819
|
"svg",
|
|
4602
4820
|
{
|
|
4603
4821
|
viewBox: "0 0 24 24",
|
|
4604
4822
|
fill: "none",
|
|
4605
4823
|
stroke: "currentColor",
|
|
4606
4824
|
strokeWidth: "3",
|
|
4607
|
-
children: /* @__PURE__ */
|
|
4825
|
+
children: /* @__PURE__ */ jsx14(
|
|
4608
4826
|
"path",
|
|
4609
4827
|
{
|
|
4610
4828
|
strokeLinecap: "round",
|
|
@@ -4616,13 +4834,13 @@ function DepositModalInner({
|
|
|
4616
4834
|
) : "1"
|
|
4617
4835
|
}
|
|
4618
4836
|
),
|
|
4619
|
-
/* @__PURE__ */
|
|
4837
|
+
/* @__PURE__ */ jsx14(
|
|
4620
4838
|
"div",
|
|
4621
4839
|
{
|
|
4622
4840
|
className: `rs-step-indicator-line ${currentStepIndex >= 4 ? "rs-step-indicator-line--active" : ""}`
|
|
4623
4841
|
}
|
|
4624
4842
|
),
|
|
4625
|
-
/* @__PURE__ */
|
|
4843
|
+
/* @__PURE__ */ jsx14(
|
|
4626
4844
|
"div",
|
|
4627
4845
|
{
|
|
4628
4846
|
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--active" : "rs-step-indicator-node--inactive"}`,
|
|
@@ -4631,16 +4849,16 @@ function DepositModalInner({
|
|
|
4631
4849
|
)
|
|
4632
4850
|
] })
|
|
4633
4851
|
] }),
|
|
4634
|
-
balance && /* @__PURE__ */
|
|
4635
|
-
/* @__PURE__ */
|
|
4852
|
+
balance && /* @__PURE__ */ jsxs13("div", { className: "rs-modal-header-balance", children: [
|
|
4853
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
4636
4854
|
balance.title,
|
|
4637
4855
|
":"
|
|
4638
4856
|
] }),
|
|
4639
|
-
/* @__PURE__ */
|
|
4857
|
+
/* @__PURE__ */ jsx14("span", { className: "rs-modal-header-balance-value", children: balance.amount ?? (totalBalanceUsd !== null ? currencyFormatter.format(totalBalanceUsd) : null) })
|
|
4640
4858
|
] })
|
|
4641
4859
|
] }),
|
|
4642
|
-
/* @__PURE__ */
|
|
4643
|
-
showHistoryButton && /* @__PURE__ */
|
|
4860
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-modal-header-nav-right", children: [
|
|
4861
|
+
showHistoryButton && /* @__PURE__ */ jsx14(
|
|
4644
4862
|
"button",
|
|
4645
4863
|
{
|
|
4646
4864
|
type: "button",
|
|
@@ -4648,14 +4866,14 @@ function DepositModalInner({
|
|
|
4648
4866
|
"aria-label": "Deposit history",
|
|
4649
4867
|
onClick: handleHistoryOpen,
|
|
4650
4868
|
disabled: !activeSmartAccount,
|
|
4651
|
-
children: /* @__PURE__ */
|
|
4869
|
+
children: /* @__PURE__ */ jsx14(
|
|
4652
4870
|
"svg",
|
|
4653
4871
|
{
|
|
4654
4872
|
viewBox: "0 0 24 24",
|
|
4655
4873
|
fill: "none",
|
|
4656
4874
|
stroke: "currentColor",
|
|
4657
4875
|
strokeWidth: "1.75",
|
|
4658
|
-
children: /* @__PURE__ */
|
|
4876
|
+
children: /* @__PURE__ */ jsx14(
|
|
4659
4877
|
"path",
|
|
4660
4878
|
{
|
|
4661
4879
|
strokeLinecap: "round",
|
|
@@ -4667,21 +4885,21 @@ function DepositModalInner({
|
|
|
4667
4885
|
)
|
|
4668
4886
|
}
|
|
4669
4887
|
),
|
|
4670
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ jsx14(
|
|
4671
4889
|
"button",
|
|
4672
4890
|
{
|
|
4673
4891
|
type: "button",
|
|
4674
4892
|
onClick: onClose,
|
|
4675
4893
|
className: "rs-modal-close",
|
|
4676
4894
|
"aria-label": "Close",
|
|
4677
|
-
children: /* @__PURE__ */
|
|
4895
|
+
children: /* @__PURE__ */ jsx14(
|
|
4678
4896
|
"svg",
|
|
4679
4897
|
{
|
|
4680
4898
|
viewBox: "0 0 24 24",
|
|
4681
4899
|
fill: "none",
|
|
4682
4900
|
stroke: "currentColor",
|
|
4683
4901
|
strokeWidth: "2",
|
|
4684
|
-
children: /* @__PURE__ */
|
|
4902
|
+
children: /* @__PURE__ */ jsx14(
|
|
4685
4903
|
"path",
|
|
4686
4904
|
{
|
|
4687
4905
|
strokeLinecap: "round",
|
|
@@ -4695,7 +4913,7 @@ function DepositModalInner({
|
|
|
4695
4913
|
)
|
|
4696
4914
|
] })
|
|
4697
4915
|
] }),
|
|
4698
|
-
/* @__PURE__ */
|
|
4916
|
+
/* @__PURE__ */ jsx14(
|
|
4699
4917
|
DepositFlow,
|
|
4700
4918
|
{
|
|
4701
4919
|
dappWalletClient,
|
|
@@ -4737,7 +4955,7 @@ function DepositModalInner({
|
|
|
4737
4955
|
debug
|
|
4738
4956
|
}
|
|
4739
4957
|
),
|
|
4740
|
-
showHistoryButton && historyOpen && /* @__PURE__ */
|
|
4958
|
+
showHistoryButton && historyOpen && /* @__PURE__ */ jsx14(
|
|
4741
4959
|
DepositHistoryPanel,
|
|
4742
4960
|
{
|
|
4743
4961
|
deposits: historyDeposits,
|