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