@rhinestone/deposit-modal 0.1.65 → 0.1.67
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-Y4M3RA73.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
- package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
- package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
- package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
- package/dist/{chunk-RKRF7ANK.mjs → chunk-5FDIQNJJ.mjs} +22 -19
- package/dist/{chunk-4CZ7W3RS.cjs → chunk-FLVSQDP4.cjs} +181 -132
- package/dist/{chunk-GAHX5RAT.mjs → chunk-IUW3SJQT.mjs} +103 -54
- package/dist/{chunk-MGV75YLV.cjs → chunk-LTLFJPHO.cjs} +106 -103
- package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
- package/dist/{chunk-IYZGLNY6.mjs → chunk-NFE5ZLD3.mjs} +1171 -374
- package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
- package/dist/{chunk-OWV4KVBM.cjs → chunk-UDKZWFCM.cjs} +1251 -454
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/styles.css +696 -34
- package/dist/{types-BLIqLF0c.d.ts → types-DGQzvl6v.d.ts} +12 -1
- package/dist/{types-7IoN8k-P.d.cts → types-DJ1fzNC7.d.cts} +12 -1
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
|
@@ -19,14 +19,16 @@ import {
|
|
|
19
19
|
getPublicClient,
|
|
20
20
|
isDepositEvent,
|
|
21
21
|
isNativeAsset,
|
|
22
|
+
isSolanaCaip2,
|
|
22
23
|
loadSessionOwnerFromStorage,
|
|
24
|
+
parseEvmChainId,
|
|
23
25
|
portfolioToAssets,
|
|
24
26
|
saveSessionOwnerToStorage,
|
|
25
27
|
toEvmCaip2,
|
|
26
28
|
tokenFormatter,
|
|
27
29
|
txRefsMatch,
|
|
28
30
|
useLatestRef
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-IUW3SJQT.mjs";
|
|
30
32
|
import {
|
|
31
33
|
DEFAULT_BACKEND_URL,
|
|
32
34
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -36,27 +38,31 @@ import {
|
|
|
36
38
|
getChainIcon,
|
|
37
39
|
getChainId,
|
|
38
40
|
getChainName,
|
|
41
|
+
getExplorerTxUrl,
|
|
42
|
+
getExplorerUrl,
|
|
39
43
|
getSupportedChainIds,
|
|
40
44
|
getTargetTokenSymbolsForChain,
|
|
41
45
|
getTokenAddress,
|
|
46
|
+
getTokenDecimalsByAddress,
|
|
42
47
|
getTokenIcon,
|
|
43
48
|
getTokenSymbol,
|
|
44
49
|
isStablecoinSymbol
|
|
45
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-SDZKKUCJ.mjs";
|
|
46
51
|
|
|
47
52
|
// src/DepositModal.tsx
|
|
48
53
|
import {
|
|
49
|
-
useMemo as
|
|
54
|
+
useMemo as useMemo7,
|
|
50
55
|
useEffect as useEffect10,
|
|
51
|
-
useRef as
|
|
56
|
+
useRef as useRef7,
|
|
52
57
|
useState as useState11,
|
|
53
|
-
useCallback as
|
|
58
|
+
useCallback as useCallback6,
|
|
54
59
|
lazy,
|
|
55
60
|
Suspense
|
|
56
61
|
} from "react";
|
|
57
62
|
|
|
58
63
|
// src/DepositFlow.tsx
|
|
59
|
-
import { useState as useState10, useCallback as
|
|
64
|
+
import { useState as useState10, useCallback as useCallback4, useMemo as useMemo6, useEffect as useEffect9, useRef as useRef6 } from "react";
|
|
65
|
+
import { formatUnits as formatUnits5 } from "viem";
|
|
60
66
|
|
|
61
67
|
// src/components/steps/SetupStep.tsx
|
|
62
68
|
import { useState, useEffect, useRef, useCallback } from "react";
|
|
@@ -85,6 +91,8 @@ function SetupStep({
|
|
|
85
91
|
sessionChainIds,
|
|
86
92
|
recipient,
|
|
87
93
|
postBridgeActions,
|
|
94
|
+
outputTokenRules,
|
|
95
|
+
rejectUnmapped,
|
|
88
96
|
forceRegister,
|
|
89
97
|
enableSolana = true,
|
|
90
98
|
service,
|
|
@@ -154,7 +162,9 @@ function SetupStep({
|
|
|
154
162
|
chain: toEvmCaip2(targetChain),
|
|
155
163
|
token: targetToken,
|
|
156
164
|
...recipient && { recipient },
|
|
157
|
-
...postBridgeActions?.length && { postBridgeActions }
|
|
165
|
+
...postBridgeActions?.length && { postBridgeActions },
|
|
166
|
+
...outputTokenRules?.length && { outputTokenRules },
|
|
167
|
+
...rejectUnmapped != null && { rejectUnmapped }
|
|
158
168
|
}
|
|
159
169
|
});
|
|
160
170
|
setState({ type: "ready", smartAccount });
|
|
@@ -270,7 +280,8 @@ function AssetSelectStep({
|
|
|
270
280
|
service,
|
|
271
281
|
onContinue,
|
|
272
282
|
onTotalBalanceComputed,
|
|
273
|
-
onAssetsLoaded
|
|
283
|
+
onAssetsLoaded,
|
|
284
|
+
onDisconnect
|
|
274
285
|
}) {
|
|
275
286
|
const [assets, setAssets] = useState2([]);
|
|
276
287
|
const [selectedAssetId, setSelectedAssetId] = useState2(null);
|
|
@@ -418,7 +429,16 @@ function AssetSelectStep({
|
|
|
418
429
|
address.slice(0, 6),
|
|
419
430
|
"...",
|
|
420
431
|
address.slice(-4)
|
|
421
|
-
] })
|
|
432
|
+
] }),
|
|
433
|
+
onDisconnect && /* @__PURE__ */ jsx2(
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
className: "rs-empty-disconnect",
|
|
438
|
+
onClick: onDisconnect,
|
|
439
|
+
children: "Disconnect wallet"
|
|
440
|
+
}
|
|
441
|
+
)
|
|
422
442
|
] }),
|
|
423
443
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ jsx2("div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
424
444
|
const isSelected = selectedAssetId === asset.id;
|
|
@@ -1178,96 +1198,378 @@ function ConfirmStep({
|
|
|
1178
1198
|
}
|
|
1179
1199
|
|
|
1180
1200
|
// src/components/steps/DepositAddressStep.tsx
|
|
1181
|
-
import { useState as useState6, useEffect as useEffect6, useCallback as
|
|
1201
|
+
import { useState as useState6, useEffect as useEffect6, useCallback as useCallback3, useRef as useRef5, useMemo as useMemo3 } from "react";
|
|
1182
1202
|
|
|
1183
1203
|
// src/components/ui/QRCode.tsx
|
|
1184
|
-
import {
|
|
1185
|
-
import {
|
|
1204
|
+
import { QRCode as QRCodeCanvas } from "react-qrcode-logo";
|
|
1205
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1186
1206
|
function QRCode({ value, size = 200, iconSrc, className }) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1207
|
+
return /* @__PURE__ */ jsx5("div", { className, role: "img", "aria-label": "QR Code", children: /* @__PURE__ */ jsx5(
|
|
1208
|
+
QRCodeCanvas,
|
|
1209
|
+
{
|
|
1210
|
+
value,
|
|
1211
|
+
size,
|
|
1212
|
+
qrStyle: "dots",
|
|
1213
|
+
eyeRadius: [10, 10, 10],
|
|
1214
|
+
ecLevel: "H",
|
|
1215
|
+
logoImage: iconSrc,
|
|
1216
|
+
logoWidth: size * 0.22,
|
|
1217
|
+
logoHeight: size * 0.22,
|
|
1218
|
+
logoPaddingStyle: "circle",
|
|
1219
|
+
logoPadding: 5,
|
|
1220
|
+
removeQrCodeBehindLogo: true,
|
|
1221
|
+
quietZone: 10,
|
|
1222
|
+
bgColor: "#ffffff",
|
|
1223
|
+
fgColor: "#000000"
|
|
1224
|
+
}
|
|
1225
|
+
) });
|
|
1226
|
+
}
|
|
1227
|
+
QRCode.displayName = "QRCode";
|
|
1228
|
+
|
|
1229
|
+
// src/components/ui/DepositNotification.tsx
|
|
1230
|
+
import { useState as useState5, useEffect as useEffect5, useRef as useRef4, useCallback as useCallback2 } from "react";
|
|
1231
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1232
|
+
var INITIAL_POLL_INTERVAL = 3e3;
|
|
1233
|
+
var MAX_POLL_INTERVAL = 3e4;
|
|
1234
|
+
var BACKOFF_MULTIPLIER = 1.5;
|
|
1235
|
+
function isEventForTx(event, txHash) {
|
|
1236
|
+
const eventTxHash = getEventTxHash(event);
|
|
1237
|
+
if (!eventTxHash) return false;
|
|
1238
|
+
return txRefsMatch(eventTxHash, txHash);
|
|
1239
|
+
}
|
|
1240
|
+
function truncateHash(hash) {
|
|
1241
|
+
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
1242
|
+
}
|
|
1243
|
+
function formatTimestamp(ms) {
|
|
1244
|
+
const date = new Date(ms);
|
|
1245
|
+
const months = [
|
|
1246
|
+
"Jan",
|
|
1247
|
+
"Feb",
|
|
1248
|
+
"Mar",
|
|
1249
|
+
"Apr",
|
|
1250
|
+
"May",
|
|
1251
|
+
"Jun",
|
|
1252
|
+
"Jul",
|
|
1253
|
+
"Aug",
|
|
1254
|
+
"Sep",
|
|
1255
|
+
"Oct",
|
|
1256
|
+
"Nov",
|
|
1257
|
+
"Dec"
|
|
1258
|
+
];
|
|
1259
|
+
const month = months[date.getMonth()];
|
|
1260
|
+
const day = date.getDate();
|
|
1261
|
+
const suffix = day % 10 === 1 && day !== 11 ? "st" : day % 10 === 2 && day !== 12 ? "nd" : day % 10 === 3 && day !== 13 ? "rd" : "th";
|
|
1262
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
1263
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
1264
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
1265
|
+
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1266
|
+
}
|
|
1267
|
+
function formatBridgeFailedMessage(event) {
|
|
1268
|
+
const eventData = event?.data ?? {};
|
|
1269
|
+
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1270
|
+
if (backendMessage.length > 0) {
|
|
1271
|
+
const lower = backendMessage.toLowerCase();
|
|
1272
|
+
if (lower.includes("insufficient funds")) {
|
|
1273
|
+
return "Deposit was received, but processing could not continue due to insufficient funds.";
|
|
1274
|
+
}
|
|
1275
|
+
if (lower.includes("no valid quote available")) {
|
|
1276
|
+
return "No bridge route is currently available for this transfer.";
|
|
1277
|
+
}
|
|
1278
|
+
if (lower.includes("simulation failed")) {
|
|
1279
|
+
return "Transfer processing failed during simulation.";
|
|
1280
|
+
}
|
|
1281
|
+
if (backendMessage.length > 220) {
|
|
1282
|
+
return "Transfer processing failed.";
|
|
1283
|
+
}
|
|
1284
|
+
return backendMessage;
|
|
1285
|
+
}
|
|
1286
|
+
return "Bridge failed";
|
|
1287
|
+
}
|
|
1288
|
+
var txLinkIcon = /* @__PURE__ */ jsx6(
|
|
1289
|
+
"svg",
|
|
1290
|
+
{
|
|
1291
|
+
viewBox: "0 0 24 24",
|
|
1292
|
+
fill: "none",
|
|
1293
|
+
stroke: "currentColor",
|
|
1294
|
+
strokeWidth: "2.5",
|
|
1295
|
+
className: "rs-deposit-notification-link-icon",
|
|
1296
|
+
children: /* @__PURE__ */ jsx6(
|
|
1297
|
+
"path",
|
|
1298
|
+
{
|
|
1299
|
+
strokeLinecap: "round",
|
|
1300
|
+
strokeLinejoin: "round",
|
|
1301
|
+
d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
|
|
1193
1302
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1303
|
+
)
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
function DepositNotification({
|
|
1307
|
+
deposit,
|
|
1308
|
+
smartAccount,
|
|
1309
|
+
targetChain,
|
|
1310
|
+
targetToken,
|
|
1311
|
+
waitForFinalTx,
|
|
1312
|
+
hasPostBridgeActions,
|
|
1313
|
+
service,
|
|
1314
|
+
onComplete,
|
|
1315
|
+
onFailed,
|
|
1316
|
+
onDismiss
|
|
1317
|
+
}) {
|
|
1318
|
+
const { txHash, sourceChain, amount, token, detectedAt, directTransfer } = deposit;
|
|
1319
|
+
const [status, setStatus] = useState5(
|
|
1320
|
+
directTransfer ? "complete" : "processing"
|
|
1321
|
+
);
|
|
1322
|
+
const [expanded, setExpanded] = useState5(false);
|
|
1323
|
+
const [completedAt, setCompletedAt] = useState5(
|
|
1324
|
+
directTransfer ? detectedAt : null
|
|
1325
|
+
);
|
|
1326
|
+
const [destinationTxHash, setDestinationTxHash] = useState5(
|
|
1327
|
+
null
|
|
1328
|
+
);
|
|
1329
|
+
const pollIntervalRef = useRef4(INITIAL_POLL_INTERVAL);
|
|
1330
|
+
const pollTimeoutRef = useRef4(null);
|
|
1331
|
+
const completedRef = useRef4(directTransfer ?? false);
|
|
1332
|
+
const depositContextRef = useLatestRef({
|
|
1333
|
+
amount,
|
|
1334
|
+
sourceChain,
|
|
1335
|
+
sourceToken: token,
|
|
1336
|
+
targetChain,
|
|
1337
|
+
targetToken,
|
|
1338
|
+
waitForFinalTx,
|
|
1339
|
+
hasPostBridgeActions
|
|
1340
|
+
});
|
|
1341
|
+
const onCompleteRef = useLatestRef(onComplete);
|
|
1342
|
+
const onFailedRef = useLatestRef(onFailed);
|
|
1343
|
+
const handleComplete = useCallback2(
|
|
1344
|
+
(destTxHash) => {
|
|
1345
|
+
if (completedRef.current) return;
|
|
1346
|
+
completedRef.current = true;
|
|
1347
|
+
setDestinationTxHash(destTxHash ?? null);
|
|
1348
|
+
setCompletedAt(Date.now());
|
|
1349
|
+
setStatus("complete");
|
|
1350
|
+
const context = depositContextRef.current;
|
|
1351
|
+
onCompleteRef.current?.(txHash, destTxHash, {
|
|
1352
|
+
amount: context.amount,
|
|
1353
|
+
sourceChain: context.sourceChain,
|
|
1354
|
+
sourceToken: context.sourceToken,
|
|
1355
|
+
targetChain: context.targetChain,
|
|
1356
|
+
targetToken: context.targetToken
|
|
1357
|
+
});
|
|
1358
|
+
},
|
|
1359
|
+
[depositContextRef, onCompleteRef, txHash]
|
|
1360
|
+
);
|
|
1361
|
+
const handleFailed = useCallback2(
|
|
1362
|
+
(error) => {
|
|
1363
|
+
if (completedRef.current) return;
|
|
1364
|
+
completedRef.current = true;
|
|
1365
|
+
setStatus("failed");
|
|
1366
|
+
onFailedRef.current?.(txHash, error);
|
|
1367
|
+
},
|
|
1368
|
+
[onFailedRef, txHash]
|
|
1369
|
+
);
|
|
1370
|
+
useEffect5(() => {
|
|
1371
|
+
if (directTransfer) {
|
|
1372
|
+
handleComplete(void 0);
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
if (status !== "processing") return;
|
|
1376
|
+
let isMounted = true;
|
|
1377
|
+
async function pollStatus() {
|
|
1378
|
+
try {
|
|
1379
|
+
const data = await service.fetchStatus(smartAccount, txHash);
|
|
1380
|
+
if (!isMounted) return;
|
|
1381
|
+
const lastEvent = data.lastEvent;
|
|
1382
|
+
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1383
|
+
const awaitingPostBridgeSwap = depositContextRef.current.waitForFinalTx && depositContextRef.current.hasPostBridgeActions;
|
|
1384
|
+
if (eventForTx?.type === "post-bridge-swap-complete") {
|
|
1385
|
+
const swapTxHash = eventForTx.data?.swap?.transactionHash;
|
|
1386
|
+
handleComplete(swapTxHash);
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
if (eventForTx?.type === "post-bridge-swap-failed") {
|
|
1390
|
+
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
if (eventForTx?.type === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1394
|
+
const destTx = eventForTx.data?.destination?.transactionHash;
|
|
1395
|
+
handleComplete(destTx);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
if (!waitForFinalTx && eventForTx?.type === "bridge-started") {
|
|
1399
|
+
handleComplete(void 0);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (eventForTx?.type === "bridge-failed") {
|
|
1403
|
+
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
if (eventForTx?.type === "error") {
|
|
1407
|
+
const errorMessage = eventForTx.data?.message ?? "Unknown error";
|
|
1408
|
+
handleFailed(errorMessage);
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
scheduleNextPoll();
|
|
1412
|
+
} catch {
|
|
1413
|
+
scheduleNextPoll();
|
|
1197
1414
|
}
|
|
1198
|
-
}
|
|
1415
|
+
}
|
|
1416
|
+
function scheduleNextPoll() {
|
|
1417
|
+
if (!isMounted) return;
|
|
1418
|
+
pollTimeoutRef.current = setTimeout(() => {
|
|
1419
|
+
pollIntervalRef.current = Math.min(
|
|
1420
|
+
pollIntervalRef.current * BACKOFF_MULTIPLIER,
|
|
1421
|
+
MAX_POLL_INTERVAL
|
|
1422
|
+
);
|
|
1423
|
+
pollStatus();
|
|
1424
|
+
}, pollIntervalRef.current);
|
|
1425
|
+
}
|
|
1426
|
+
pollStatus();
|
|
1199
1427
|
return () => {
|
|
1200
|
-
|
|
1428
|
+
isMounted = false;
|
|
1429
|
+
if (pollTimeoutRef.current) {
|
|
1430
|
+
clearTimeout(pollTimeoutRef.current);
|
|
1431
|
+
}
|
|
1201
1432
|
};
|
|
1202
|
-
}, [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1433
|
+
}, [
|
|
1434
|
+
directTransfer,
|
|
1435
|
+
depositContextRef,
|
|
1436
|
+
handleComplete,
|
|
1437
|
+
handleFailed,
|
|
1438
|
+
service,
|
|
1439
|
+
smartAccount,
|
|
1440
|
+
status,
|
|
1441
|
+
txHash
|
|
1442
|
+
]);
|
|
1443
|
+
const sourceExplorerUrl = getExplorerTxUrl(sourceChain, txHash);
|
|
1444
|
+
const destExplorerUrl = destinationTxHash ? getExplorerTxUrl(targetChain, destinationTxHash) : null;
|
|
1445
|
+
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1446
|
+
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__ */ jsx6("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ jsx6(
|
|
1448
|
+
"svg",
|
|
1449
|
+
{
|
|
1450
|
+
viewBox: "0 0 24 24",
|
|
1451
|
+
fill: "none",
|
|
1452
|
+
stroke: "currentColor",
|
|
1453
|
+
strokeWidth: "3",
|
|
1454
|
+
children: /* @__PURE__ */ jsx6(
|
|
1455
|
+
"path",
|
|
1456
|
+
{
|
|
1457
|
+
strokeLinecap: "round",
|
|
1458
|
+
strokeLinejoin: "round",
|
|
1459
|
+
d: "M5 12l5 5L20 7"
|
|
1460
|
+
}
|
|
1461
|
+
)
|
|
1206
1462
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
continue;
|
|
1463
|
+
) }) : status === "failed" ? /* @__PURE__ */ jsx6("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ jsx6(
|
|
1464
|
+
"svg",
|
|
1465
|
+
{
|
|
1466
|
+
viewBox: "0 0 24 24",
|
|
1467
|
+
fill: "none",
|
|
1468
|
+
stroke: "currentColor",
|
|
1469
|
+
strokeWidth: "3",
|
|
1470
|
+
children: /* @__PURE__ */ jsx6(
|
|
1471
|
+
"path",
|
|
1472
|
+
{
|
|
1473
|
+
strokeLinecap: "round",
|
|
1474
|
+
strokeLinejoin: "round",
|
|
1475
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1221
1476
|
}
|
|
1222
|
-
|
|
1223
|
-
const y = row * cellSize;
|
|
1224
|
-
paths.push(`M${x},${y}h${cellSize}v${cellSize}h${-cellSize}z`);
|
|
1225
|
-
}
|
|
1477
|
+
)
|
|
1226
1478
|
}
|
|
1227
|
-
|
|
1228
|
-
}, [createQrCode, value, size, iconSrc]);
|
|
1229
|
-
const iconSize = size * 0.22;
|
|
1230
|
-
const iconOffset = (size - iconSize) / 2;
|
|
1479
|
+
) }) : /* @__PURE__ */ jsx6("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ jsx6(Spinner, {}) });
|
|
1231
1480
|
return /* @__PURE__ */ jsxs5(
|
|
1232
|
-
"
|
|
1481
|
+
"div",
|
|
1233
1482
|
{
|
|
1234
|
-
|
|
1235
|
-
width: size,
|
|
1236
|
-
height: size,
|
|
1237
|
-
className,
|
|
1238
|
-
role: "img",
|
|
1239
|
-
"aria-label": "QR Code",
|
|
1483
|
+
className: `rs-deposit-notification rs-deposit-notification--${status}`,
|
|
1240
1484
|
children: [
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
"
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
width: iconSize + 8,
|
|
1250
|
-
height: iconSize + 8,
|
|
1251
|
-
fill: "white",
|
|
1252
|
-
rx: 8
|
|
1253
|
-
}
|
|
1254
|
-
),
|
|
1255
|
-
/* @__PURE__ */ jsx5(
|
|
1256
|
-
"image",
|
|
1485
|
+
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-header", children: [
|
|
1486
|
+
/* @__PURE__ */ jsx6("div", { className: "rs-deposit-notification-icon", children: statusIcon }),
|
|
1487
|
+
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-content", children: [
|
|
1488
|
+
/* @__PURE__ */ jsx6("div", { className: "rs-deposit-notification-title", children: title }),
|
|
1489
|
+
/* @__PURE__ */ jsx6("div", { className: "rs-deposit-notification-subtitle", children: subtitle })
|
|
1490
|
+
] }),
|
|
1491
|
+
/* @__PURE__ */ jsx6(
|
|
1492
|
+
"button",
|
|
1257
1493
|
{
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1494
|
+
type: "button",
|
|
1495
|
+
className: "rs-deposit-notification-close",
|
|
1496
|
+
onClick: () => onDismiss(deposit.id),
|
|
1497
|
+
"aria-label": "Dismiss",
|
|
1498
|
+
children: /* @__PURE__ */ jsx6(
|
|
1499
|
+
"svg",
|
|
1500
|
+
{
|
|
1501
|
+
viewBox: "0 0 24 24",
|
|
1502
|
+
fill: "none",
|
|
1503
|
+
stroke: "currentColor",
|
|
1504
|
+
strokeWidth: "2",
|
|
1505
|
+
children: /* @__PURE__ */ jsx6(
|
|
1506
|
+
"path",
|
|
1507
|
+
{
|
|
1508
|
+
strokeLinecap: "round",
|
|
1509
|
+
strokeLinejoin: "round",
|
|
1510
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1511
|
+
}
|
|
1512
|
+
)
|
|
1513
|
+
}
|
|
1514
|
+
)
|
|
1263
1515
|
}
|
|
1264
1516
|
)
|
|
1265
|
-
] })
|
|
1517
|
+
] }),
|
|
1518
|
+
expanded && /* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-details", children: [
|
|
1519
|
+
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-row", children: [
|
|
1520
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-label", children: "Deposit tx" }),
|
|
1521
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-value", children: sourceExplorerUrl ? /* @__PURE__ */ jsxs5(
|
|
1522
|
+
"a",
|
|
1523
|
+
{
|
|
1524
|
+
href: sourceExplorerUrl,
|
|
1525
|
+
target: "_blank",
|
|
1526
|
+
rel: "noopener noreferrer",
|
|
1527
|
+
className: "rs-deposit-notification-link",
|
|
1528
|
+
children: [
|
|
1529
|
+
truncateHash(txHash),
|
|
1530
|
+
txLinkIcon
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
) : truncateHash(txHash) })
|
|
1534
|
+
] }),
|
|
1535
|
+
destinationTxHash && /* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-row", children: [
|
|
1536
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-label", children: "Completion tx" }),
|
|
1537
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-value", children: destExplorerUrl ? /* @__PURE__ */ jsxs5(
|
|
1538
|
+
"a",
|
|
1539
|
+
{
|
|
1540
|
+
href: destExplorerUrl,
|
|
1541
|
+
target: "_blank",
|
|
1542
|
+
rel: "noopener noreferrer",
|
|
1543
|
+
className: "rs-deposit-notification-link",
|
|
1544
|
+
children: [
|
|
1545
|
+
truncateHash(destinationTxHash),
|
|
1546
|
+
txLinkIcon
|
|
1547
|
+
]
|
|
1548
|
+
}
|
|
1549
|
+
) : truncateHash(destinationTxHash) })
|
|
1550
|
+
] }),
|
|
1551
|
+
/* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-row", children: [
|
|
1552
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-label", children: "Order submitted" }),
|
|
1553
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-value", children: formatTimestamp(detectedAt) })
|
|
1554
|
+
] }),
|
|
1555
|
+
completedAt && /* @__PURE__ */ jsxs5("div", { className: "rs-deposit-notification-row", children: [
|
|
1556
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-label", children: "Order filled" }),
|
|
1557
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-deposit-notification-value", children: formatTimestamp(completedAt) })
|
|
1558
|
+
] })
|
|
1559
|
+
] }),
|
|
1560
|
+
/* @__PURE__ */ jsx6(
|
|
1561
|
+
"button",
|
|
1562
|
+
{
|
|
1563
|
+
type: "button",
|
|
1564
|
+
className: "rs-deposit-notification-toggle",
|
|
1565
|
+
onClick: () => setExpanded(!expanded),
|
|
1566
|
+
children: expanded ? "See less" : "See more"
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1266
1569
|
]
|
|
1267
1570
|
}
|
|
1268
1571
|
);
|
|
1269
1572
|
}
|
|
1270
|
-
QRCode.displayName = "QRCode";
|
|
1271
1573
|
|
|
1272
1574
|
// src/core/solana.ts
|
|
1273
1575
|
import {
|
|
@@ -1387,7 +1689,7 @@ async function sendSolanaTransaction(provider, _connection, transaction) {
|
|
|
1387
1689
|
}
|
|
1388
1690
|
|
|
1389
1691
|
// src/components/steps/DepositAddressStep.tsx
|
|
1390
|
-
import { jsx as
|
|
1692
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1391
1693
|
var POLL_INTERVAL_MS = 4e3;
|
|
1392
1694
|
function isRecord(value) {
|
|
1393
1695
|
return typeof value === "object" && value !== null;
|
|
@@ -1459,37 +1761,48 @@ function getDepositEventDetails(event) {
|
|
|
1459
1761
|
}
|
|
1460
1762
|
return {};
|
|
1461
1763
|
}
|
|
1764
|
+
function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
1765
|
+
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
1766
|
+
}
|
|
1462
1767
|
function DepositAddressStep({
|
|
1463
1768
|
smartAccount,
|
|
1464
1769
|
solanaDepositAddress,
|
|
1465
1770
|
service,
|
|
1466
1771
|
allowedRoutes,
|
|
1467
|
-
|
|
1772
|
+
targetChain,
|
|
1773
|
+
targetToken,
|
|
1774
|
+
waitForFinalTx,
|
|
1775
|
+
hasPostBridgeActions,
|
|
1776
|
+
onDepositSubmitted,
|
|
1777
|
+
onDepositComplete,
|
|
1778
|
+
onDepositFailed,
|
|
1468
1779
|
onCopyAddress,
|
|
1469
1780
|
onError
|
|
1470
1781
|
}) {
|
|
1471
1782
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1472
|
-
const allowedChainSet =
|
|
1783
|
+
const allowedChainSet = useMemo3(
|
|
1473
1784
|
() => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
|
|
1474
1785
|
[allowedRoutes?.sourceChains]
|
|
1475
1786
|
);
|
|
1476
|
-
const allowedTokenSet =
|
|
1787
|
+
const allowedTokenSet = useMemo3(
|
|
1477
1788
|
() => allowedRoutes?.sourceTokens ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1478
1789
|
[allowedRoutes?.sourceTokens]
|
|
1479
1790
|
);
|
|
1480
|
-
const evmChainIds =
|
|
1791
|
+
const evmChainIds = useMemo3(() => {
|
|
1481
1792
|
const all = getSupportedChainIds();
|
|
1482
1793
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1483
1794
|
}, [allowedChainSet]);
|
|
1484
|
-
const chainOptions =
|
|
1485
|
-
()
|
|
1486
|
-
[evmChainIds
|
|
1487
|
-
|
|
1795
|
+
const chainOptions = useMemo3(() => {
|
|
1796
|
+
if (!hasSolana) return evmChainIds;
|
|
1797
|
+
const options = [...evmChainIds];
|
|
1798
|
+
options.splice(1, 0, "solana");
|
|
1799
|
+
return options;
|
|
1800
|
+
}, [evmChainIds, hasSolana]);
|
|
1488
1801
|
const BASE_CHAIN_ID = 8453;
|
|
1489
1802
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1490
1803
|
const [sourceChainId, setSourceChainId] = useState6(defaultChainId);
|
|
1491
1804
|
const isSolana = sourceChainId === "solana";
|
|
1492
|
-
const tokensForChain =
|
|
1805
|
+
const tokensForChain = useMemo3(() => {
|
|
1493
1806
|
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(sourceChainId);
|
|
1494
1807
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1495
1808
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
@@ -1505,10 +1818,13 @@ function DepositAddressStep({
|
|
|
1505
1818
|
const [pollingError, setPollingError] = useState6(null);
|
|
1506
1819
|
const [chainDropdownOpen, setChainDropdownOpen] = useState6(false);
|
|
1507
1820
|
const [tokenDropdownOpen, setTokenDropdownOpen] = useState6(false);
|
|
1508
|
-
const chainDropdownRef =
|
|
1509
|
-
const tokenDropdownRef =
|
|
1510
|
-
const
|
|
1511
|
-
const
|
|
1821
|
+
const chainDropdownRef = useRef5(null);
|
|
1822
|
+
const tokenDropdownRef = useRef5(null);
|
|
1823
|
+
const [notifications, setNotifications] = useState6([]);
|
|
1824
|
+
const isTrackingRef = useRef5(false);
|
|
1825
|
+
const baselineTxHashRef = useRef5(void 0);
|
|
1826
|
+
const notificationIdRef = useRef5(0);
|
|
1827
|
+
const sourceSelectionRef = useRef5({
|
|
1512
1828
|
chainId: defaultChainId,
|
|
1513
1829
|
token: typeof defaultChainId === "number" ? getTokenAddress(defaultToken, defaultChainId) : void 0,
|
|
1514
1830
|
sourceSymbol: defaultToken
|
|
@@ -1549,7 +1865,7 @@ function DepositAddressStep({
|
|
|
1549
1865
|
document.removeEventListener("touchstart", handlePointerDown);
|
|
1550
1866
|
};
|
|
1551
1867
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1552
|
-
const handleCopy =
|
|
1868
|
+
const handleCopy = useCallback3(async () => {
|
|
1553
1869
|
onCopyAddress?.();
|
|
1554
1870
|
try {
|
|
1555
1871
|
await navigator.clipboard.writeText(displayAddress);
|
|
@@ -1573,22 +1889,46 @@ function DepositAddressStep({
|
|
|
1573
1889
|
setChainDropdownOpen(false);
|
|
1574
1890
|
setTokenDropdownOpen(false);
|
|
1575
1891
|
}, [sourceChainId]);
|
|
1892
|
+
const onDepositSubmittedRef = useRef5(onDepositSubmitted);
|
|
1893
|
+
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
1894
|
+
const onDepositCompleteRef = useRef5(onDepositComplete);
|
|
1895
|
+
onDepositCompleteRef.current = onDepositComplete;
|
|
1896
|
+
const onDepositFailedRef = useRef5(onDepositFailed);
|
|
1897
|
+
onDepositFailedRef.current = onDepositFailed;
|
|
1898
|
+
const onErrorRef = useRef5(onError);
|
|
1899
|
+
onErrorRef.current = onError;
|
|
1900
|
+
const targetChainRef = useRef5(targetChain);
|
|
1901
|
+
targetChainRef.current = targetChain;
|
|
1902
|
+
const targetTokenRef = useRef5(targetToken);
|
|
1903
|
+
targetTokenRef.current = targetToken;
|
|
1576
1904
|
useEffect6(() => {
|
|
1577
|
-
|
|
1905
|
+
baselineTxHashRef.current = void 0;
|
|
1906
|
+
isTrackingRef.current = false;
|
|
1578
1907
|
setPollingError(null);
|
|
1579
1908
|
let timeoutId;
|
|
1580
1909
|
let cancelled = false;
|
|
1581
|
-
let baselineTxHash = void 0;
|
|
1582
1910
|
async function poll() {
|
|
1583
|
-
if (cancelled
|
|
1911
|
+
if (cancelled) return;
|
|
1912
|
+
if (isTrackingRef.current) {
|
|
1913
|
+
if (!cancelled) {
|
|
1914
|
+
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1915
|
+
}
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1584
1918
|
try {
|
|
1585
1919
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1586
|
-
if (cancelled
|
|
1920
|
+
if (cancelled) return;
|
|
1921
|
+
if (isTrackingRef.current) {
|
|
1922
|
+
if (!cancelled) {
|
|
1923
|
+
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1924
|
+
}
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1587
1927
|
const event = status.lastEvent;
|
|
1588
1928
|
const eventTxHash = isDepositEvent(event) ? getEventTxHash(event) ?? null : null;
|
|
1589
|
-
if (
|
|
1590
|
-
|
|
1591
|
-
} else if (eventTxHash && (!
|
|
1929
|
+
if (baselineTxHashRef.current === void 0) {
|
|
1930
|
+
baselineTxHashRef.current = eventTxHash;
|
|
1931
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !txRefsMatch(eventTxHash, baselineTxHashRef.current))) {
|
|
1592
1932
|
const details = getDepositEventDetails(event);
|
|
1593
1933
|
const fallback = sourceSelectionRef.current;
|
|
1594
1934
|
const chainId = details.chainId ?? fallback.chainId;
|
|
@@ -1597,16 +1937,33 @@ function DepositAddressStep({
|
|
|
1597
1937
|
const sourceSymbol = details.sourceSymbol ?? fallback.sourceSymbol;
|
|
1598
1938
|
const sourceDecimals = details.sourceDecimals ?? fallback.sourceDecimals;
|
|
1599
1939
|
if (token) {
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1940
|
+
baselineTxHashRef.current = eventTxHash;
|
|
1941
|
+
isTrackingRef.current = true;
|
|
1942
|
+
const isEvmToken = /^0x[a-fA-F0-9]{40}$/.test(token);
|
|
1943
|
+
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(
|
|
1603
1944
|
chainId,
|
|
1945
|
+
token,
|
|
1946
|
+
targetChainRef.current,
|
|
1947
|
+
targetTokenRef.current
|
|
1948
|
+
);
|
|
1949
|
+
const id = String(++notificationIdRef.current);
|
|
1950
|
+
const notification = {
|
|
1951
|
+
id,
|
|
1952
|
+
txHash: eventTxHash,
|
|
1953
|
+
sourceChain: chainId,
|
|
1604
1954
|
amount,
|
|
1605
1955
|
token,
|
|
1606
1956
|
sourceSymbol,
|
|
1607
|
-
sourceDecimals
|
|
1608
|
-
|
|
1609
|
-
|
|
1957
|
+
sourceDecimals,
|
|
1958
|
+
detectedAt: Date.now(),
|
|
1959
|
+
directTransfer
|
|
1960
|
+
};
|
|
1961
|
+
setNotifications((prev) => [notification, ...prev]);
|
|
1962
|
+
onDepositSubmittedRef.current?.({
|
|
1963
|
+
txHash: eventTxHash,
|
|
1964
|
+
sourceChain: chainId,
|
|
1965
|
+
amount
|
|
1966
|
+
});
|
|
1610
1967
|
}
|
|
1611
1968
|
}
|
|
1612
1969
|
setPollingError(null);
|
|
@@ -1614,10 +1971,10 @@ function DepositAddressStep({
|
|
|
1614
1971
|
if (!cancelled) {
|
|
1615
1972
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1616
1973
|
setPollingError(msg);
|
|
1617
|
-
|
|
1974
|
+
onErrorRef.current?.(msg, "STATUS_POLL_ERROR");
|
|
1618
1975
|
}
|
|
1619
1976
|
}
|
|
1620
|
-
if (!cancelled
|
|
1977
|
+
if (!cancelled) {
|
|
1621
1978
|
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1622
1979
|
}
|
|
1623
1980
|
}
|
|
@@ -1626,13 +1983,30 @@ function DepositAddressStep({
|
|
|
1626
1983
|
cancelled = true;
|
|
1627
1984
|
clearTimeout(timeoutId);
|
|
1628
1985
|
};
|
|
1629
|
-
}, [smartAccount, service
|
|
1986
|
+
}, [smartAccount, service]);
|
|
1987
|
+
const handleNotificationComplete = useCallback3(
|
|
1988
|
+
(txHash, destinationTxHash, context) => {
|
|
1989
|
+
isTrackingRef.current = false;
|
|
1990
|
+
onDepositCompleteRef.current?.(txHash, destinationTxHash, context);
|
|
1991
|
+
},
|
|
1992
|
+
[]
|
|
1993
|
+
);
|
|
1994
|
+
const handleNotificationFailed = useCallback3(
|
|
1995
|
+
(txHash, error) => {
|
|
1996
|
+
isTrackingRef.current = false;
|
|
1997
|
+
onDepositFailedRef.current?.(txHash, error);
|
|
1998
|
+
},
|
|
1999
|
+
[]
|
|
2000
|
+
);
|
|
2001
|
+
const handleNotificationDismiss = useCallback3((id) => {
|
|
2002
|
+
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2003
|
+
}, []);
|
|
1630
2004
|
const qrIconSrc = getChainIcon(sourceChainId);
|
|
1631
|
-
return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
|
|
1632
|
-
/* @__PURE__ */
|
|
2005
|
+
return /* @__PURE__ */ jsxs6("div", { className: "rs-step rs-step--with-notifications", children: [
|
|
2006
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-step-body", children: /* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address", children: [
|
|
1633
2007
|
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address-selectors", children: [
|
|
1634
2008
|
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1635
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
1636
2010
|
/* @__PURE__ */ jsxs6(
|
|
1637
2011
|
"button",
|
|
1638
2012
|
{
|
|
@@ -1643,7 +2017,7 @@ function DepositAddressStep({
|
|
|
1643
2017
|
setTokenDropdownOpen(false);
|
|
1644
2018
|
},
|
|
1645
2019
|
children: [
|
|
1646
|
-
getChainIcon(sourceChainId) && /* @__PURE__ */
|
|
2020
|
+
getChainIcon(sourceChainId) && /* @__PURE__ */ jsx7(
|
|
1647
2021
|
"img",
|
|
1648
2022
|
{
|
|
1649
2023
|
src: getChainIcon(sourceChainId),
|
|
@@ -1651,8 +2025,8 @@ function DepositAddressStep({
|
|
|
1651
2025
|
className: "rs-deposit-address-dropdown-icon"
|
|
1652
2026
|
}
|
|
1653
2027
|
),
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ jsx7("span", { children: getChainName(sourceChainId) }),
|
|
2029
|
+
/* @__PURE__ */ jsx7(
|
|
1656
2030
|
"svg",
|
|
1657
2031
|
{
|
|
1658
2032
|
className: "rs-deposit-address-dropdown-chevron",
|
|
@@ -1660,7 +2034,7 @@ function DepositAddressStep({
|
|
|
1660
2034
|
fill: "none",
|
|
1661
2035
|
stroke: "currentColor",
|
|
1662
2036
|
strokeWidth: "2",
|
|
1663
|
-
children: /* @__PURE__ */
|
|
2037
|
+
children: /* @__PURE__ */ jsx7(
|
|
1664
2038
|
"path",
|
|
1665
2039
|
{
|
|
1666
2040
|
strokeLinecap: "round",
|
|
@@ -1673,7 +2047,7 @@ function DepositAddressStep({
|
|
|
1673
2047
|
]
|
|
1674
2048
|
}
|
|
1675
2049
|
),
|
|
1676
|
-
chainDropdownOpen && /* @__PURE__ */
|
|
2050
|
+
chainDropdownOpen && /* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-dropdown-menu", children: chainOptions.map((chainId) => /* @__PURE__ */ jsxs6(
|
|
1677
2051
|
"button",
|
|
1678
2052
|
{
|
|
1679
2053
|
type: "button",
|
|
@@ -1683,7 +2057,7 @@ function DepositAddressStep({
|
|
|
1683
2057
|
setChainDropdownOpen(false);
|
|
1684
2058
|
},
|
|
1685
2059
|
children: [
|
|
1686
|
-
getChainIcon(chainId) && /* @__PURE__ */
|
|
2060
|
+
getChainIcon(chainId) && /* @__PURE__ */ jsx7(
|
|
1687
2061
|
"img",
|
|
1688
2062
|
{
|
|
1689
2063
|
src: getChainIcon(chainId),
|
|
@@ -1691,14 +2065,14 @@ function DepositAddressStep({
|
|
|
1691
2065
|
className: "rs-deposit-address-dropdown-icon"
|
|
1692
2066
|
}
|
|
1693
2067
|
),
|
|
1694
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ jsx7("span", { children: getChainName(chainId) })
|
|
1695
2069
|
]
|
|
1696
2070
|
},
|
|
1697
2071
|
String(chainId)
|
|
1698
2072
|
)) })
|
|
1699
2073
|
] }),
|
|
1700
2074
|
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address-dropdown", ref: tokenDropdownRef, children: [
|
|
1701
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-dropdown-label", children: "Supported token" }),
|
|
1702
2076
|
/* @__PURE__ */ jsxs6(
|
|
1703
2077
|
"button",
|
|
1704
2078
|
{
|
|
@@ -1709,7 +2083,7 @@ function DepositAddressStep({
|
|
|
1709
2083
|
setChainDropdownOpen(false);
|
|
1710
2084
|
},
|
|
1711
2085
|
children: [
|
|
1712
|
-
getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */
|
|
2086
|
+
getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */ jsx7(
|
|
1713
2087
|
"img",
|
|
1714
2088
|
{
|
|
1715
2089
|
src: getTokenIcon(sourceTokenSymbol),
|
|
@@ -1717,8 +2091,8 @@ function DepositAddressStep({
|
|
|
1717
2091
|
className: "rs-deposit-address-dropdown-icon"
|
|
1718
2092
|
}
|
|
1719
2093
|
),
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ jsx7("span", { children: sourceTokenSymbol }),
|
|
2095
|
+
/* @__PURE__ */ jsx7(
|
|
1722
2096
|
"svg",
|
|
1723
2097
|
{
|
|
1724
2098
|
className: "rs-deposit-address-dropdown-chevron",
|
|
@@ -1726,7 +2100,7 @@ function DepositAddressStep({
|
|
|
1726
2100
|
fill: "none",
|
|
1727
2101
|
stroke: "currentColor",
|
|
1728
2102
|
strokeWidth: "2",
|
|
1729
|
-
children: /* @__PURE__ */
|
|
2103
|
+
children: /* @__PURE__ */ jsx7(
|
|
1730
2104
|
"path",
|
|
1731
2105
|
{
|
|
1732
2106
|
strokeLinecap: "round",
|
|
@@ -1739,7 +2113,7 @@ function DepositAddressStep({
|
|
|
1739
2113
|
]
|
|
1740
2114
|
}
|
|
1741
2115
|
),
|
|
1742
|
-
tokenDropdownOpen && /* @__PURE__ */
|
|
2116
|
+
tokenDropdownOpen && /* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-dropdown-menu", children: tokensForChain.map((symbol) => /* @__PURE__ */ jsxs6(
|
|
1743
2117
|
"button",
|
|
1744
2118
|
{
|
|
1745
2119
|
type: "button",
|
|
@@ -1749,7 +2123,7 @@ function DepositAddressStep({
|
|
|
1749
2123
|
setTokenDropdownOpen(false);
|
|
1750
2124
|
},
|
|
1751
2125
|
children: [
|
|
1752
|
-
getTokenIcon(symbol) && /* @__PURE__ */
|
|
2126
|
+
getTokenIcon(symbol) && /* @__PURE__ */ jsx7(
|
|
1753
2127
|
"img",
|
|
1754
2128
|
{
|
|
1755
2129
|
src: getTokenIcon(symbol),
|
|
@@ -1757,21 +2131,21 @@ function DepositAddressStep({
|
|
|
1757
2131
|
className: "rs-deposit-address-dropdown-icon"
|
|
1758
2132
|
}
|
|
1759
2133
|
),
|
|
1760
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ jsx7("span", { children: symbol })
|
|
1761
2135
|
]
|
|
1762
2136
|
},
|
|
1763
2137
|
symbol
|
|
1764
2138
|
)) })
|
|
1765
2139
|
] })
|
|
1766
2140
|
] }),
|
|
1767
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ jsx7(QRCode, { value: displayAddress, size: 150, iconSrc: qrIconSrc }) }),
|
|
1768
2142
|
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address-info", children: [
|
|
1769
2143
|
/* @__PURE__ */ jsxs6("div", { className: "rs-deposit-address-label", children: [
|
|
1770
2144
|
"Your ",
|
|
1771
2145
|
isSolana ? "Solana" : "EVM",
|
|
1772
2146
|
" deposit address"
|
|
1773
2147
|
] }),
|
|
1774
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-value", children: displayAddress }),
|
|
1775
2149
|
/* @__PURE__ */ jsxs6(
|
|
1776
2150
|
"button",
|
|
1777
2151
|
{
|
|
@@ -1779,7 +2153,7 @@ function DepositAddressStep({
|
|
|
1779
2153
|
className: "rs-deposit-address-copy",
|
|
1780
2154
|
onClick: handleCopy,
|
|
1781
2155
|
children: [
|
|
1782
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ jsx7(
|
|
1783
2157
|
"svg",
|
|
1784
2158
|
{
|
|
1785
2159
|
viewBox: "0 0 24 24",
|
|
@@ -1787,14 +2161,14 @@ function DepositAddressStep({
|
|
|
1787
2161
|
stroke: "currentColor",
|
|
1788
2162
|
strokeWidth: "2",
|
|
1789
2163
|
style: { width: 14, height: 14 },
|
|
1790
|
-
children: copied ? /* @__PURE__ */
|
|
2164
|
+
children: copied ? /* @__PURE__ */ jsx7(
|
|
1791
2165
|
"path",
|
|
1792
2166
|
{
|
|
1793
2167
|
strokeLinecap: "round",
|
|
1794
2168
|
strokeLinejoin: "round",
|
|
1795
2169
|
d: "M5 12l5 5L20 7"
|
|
1796
2170
|
}
|
|
1797
|
-
) : /* @__PURE__ */
|
|
2171
|
+
) : /* @__PURE__ */ jsx7(
|
|
1798
2172
|
"path",
|
|
1799
2173
|
{
|
|
1800
2174
|
strokeLinecap: "round",
|
|
@@ -1809,17 +2183,33 @@ function DepositAddressStep({
|
|
|
1809
2183
|
}
|
|
1810
2184
|
)
|
|
1811
2185
|
] }),
|
|
1812
|
-
pollingError && /* @__PURE__ */
|
|
2186
|
+
pollingError && /* @__PURE__ */ jsx7("div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1813
2187
|
] }) }),
|
|
1814
|
-
/* @__PURE__ */
|
|
2188
|
+
notifications.length > 0 && /* @__PURE__ */ jsx7("div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ jsx7(
|
|
2189
|
+
DepositNotification,
|
|
2190
|
+
{
|
|
2191
|
+
deposit,
|
|
2192
|
+
smartAccount,
|
|
2193
|
+
targetChain,
|
|
2194
|
+
targetToken,
|
|
2195
|
+
waitForFinalTx,
|
|
2196
|
+
hasPostBridgeActions,
|
|
2197
|
+
service,
|
|
2198
|
+
onComplete: handleNotificationComplete,
|
|
2199
|
+
onFailed: handleNotificationFailed,
|
|
2200
|
+
onDismiss: handleNotificationDismiss
|
|
2201
|
+
},
|
|
2202
|
+
deposit.id
|
|
2203
|
+
)) }),
|
|
2204
|
+
/* @__PURE__ */ jsx7(PoweredBy, {})
|
|
1815
2205
|
] });
|
|
1816
2206
|
}
|
|
1817
2207
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
1818
2208
|
|
|
1819
2209
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
1820
|
-
import { useState as useState7, useEffect as useEffect7, useMemo as
|
|
2210
|
+
import { useState as useState7, useEffect as useEffect7, useMemo as useMemo4 } from "react";
|
|
1821
2211
|
import { formatUnits as formatUnits3 } from "viem";
|
|
1822
|
-
import { jsx as
|
|
2212
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1823
2213
|
function SolanaTokenSelectStep({
|
|
1824
2214
|
solanaAddress,
|
|
1825
2215
|
service,
|
|
@@ -1902,7 +2292,7 @@ function SolanaTokenSelectStep({
|
|
|
1902
2292
|
active = false;
|
|
1903
2293
|
};
|
|
1904
2294
|
}, [debug, solanaAddress, service, onTotalBalanceComputed]);
|
|
1905
|
-
const rows =
|
|
2295
|
+
const rows = useMemo4(
|
|
1906
2296
|
() => [...tokenBalances].sort((a, b) => {
|
|
1907
2297
|
if (a.balanceUsd !== b.balanceUsd) return b.balanceUsd - a.balanceUsd;
|
|
1908
2298
|
if (b.balance > a.balance) return 1;
|
|
@@ -1913,10 +2303,10 @@ function SolanaTokenSelectStep({
|
|
|
1913
2303
|
);
|
|
1914
2304
|
const selectedEntry = selectedSymbol ? rows.find((r) => r.token.symbol === selectedSymbol) : null;
|
|
1915
2305
|
if (error) {
|
|
1916
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ jsx8("div", { className: "rs-step", children: /* @__PURE__ */ jsx8("div", { className: "rs-step-body", children: /* @__PURE__ */ jsx8("div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ jsx8("span", { className: "rs-alert-text", children: error }) }) }) });
|
|
1917
2307
|
}
|
|
1918
2308
|
return /* @__PURE__ */ jsxs7("div", { className: "rs-step", children: [
|
|
1919
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsx8("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ jsx8("div", { className: "rs-step-title", children: "Select source asset" }) }),
|
|
1920
2310
|
/* @__PURE__ */ jsxs7(
|
|
1921
2311
|
"div",
|
|
1922
2312
|
{
|
|
@@ -1924,11 +2314,11 @@ function SolanaTokenSelectStep({
|
|
|
1924
2314
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1925
2315
|
children: [
|
|
1926
2316
|
loading && /* @__PURE__ */ jsxs7("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ jsx8(Spinner, { className: "rs-text-tertiary" }),
|
|
2318
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1929
2319
|
] }),
|
|
1930
2320
|
!loading && rows.length === 0 && /* @__PURE__ */ jsxs7("div", { className: "rs-empty-state", children: [
|
|
1931
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ jsx8(
|
|
1932
2322
|
"svg",
|
|
1933
2323
|
{
|
|
1934
2324
|
className: "rs-empty-icon",
|
|
@@ -1936,7 +2326,7 @@ function SolanaTokenSelectStep({
|
|
|
1936
2326
|
fill: "none",
|
|
1937
2327
|
stroke: "currentColor",
|
|
1938
2328
|
strokeWidth: "1.5",
|
|
1939
|
-
children: /* @__PURE__ */
|
|
2329
|
+
children: /* @__PURE__ */ jsx8(
|
|
1940
2330
|
"path",
|
|
1941
2331
|
{
|
|
1942
2332
|
strokeLinecap: "round",
|
|
@@ -1946,14 +2336,14 @@ function SolanaTokenSelectStep({
|
|
|
1946
2336
|
)
|
|
1947
2337
|
}
|
|
1948
2338
|
),
|
|
1949
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
1950
2340
|
/* @__PURE__ */ jsxs7("div", { className: "rs-empty-address", children: [
|
|
1951
2341
|
solanaAddress.slice(0, 6),
|
|
1952
2342
|
"...",
|
|
1953
2343
|
solanaAddress.slice(-4)
|
|
1954
2344
|
] })
|
|
1955
2345
|
] }),
|
|
1956
|
-
!loading && rows.length > 0 && /* @__PURE__ */
|
|
2346
|
+
!loading && rows.length > 0 && /* @__PURE__ */ jsx8("div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
1957
2347
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
1958
2348
|
const tokenIcon = getTokenIcon(entry.token.symbol);
|
|
1959
2349
|
const chainIcon = getChainIcon("solana");
|
|
@@ -1975,7 +2365,7 @@ function SolanaTokenSelectStep({
|
|
|
1975
2365
|
children: [
|
|
1976
2366
|
/* @__PURE__ */ jsxs7("div", { className: "rs-asset-info", children: [
|
|
1977
2367
|
/* @__PURE__ */ jsxs7("div", { className: "rs-asset-icon-wrapper", children: [
|
|
1978
|
-
tokenIcon ? /* @__PURE__ */
|
|
2368
|
+
tokenIcon ? /* @__PURE__ */ jsx8(
|
|
1979
2369
|
"img",
|
|
1980
2370
|
{
|
|
1981
2371
|
src: tokenIcon,
|
|
@@ -1983,8 +2373,8 @@ function SolanaTokenSelectStep({
|
|
|
1983
2373
|
className: "rs-asset-icon",
|
|
1984
2374
|
style: { background: "transparent" }
|
|
1985
2375
|
}
|
|
1986
|
-
) : /* @__PURE__ */
|
|
1987
|
-
chainIcon && /* @__PURE__ */
|
|
2376
|
+
) : /* @__PURE__ */ jsx8("div", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
|
|
2377
|
+
chainIcon && /* @__PURE__ */ jsx8(
|
|
1988
2378
|
"img",
|
|
1989
2379
|
{
|
|
1990
2380
|
src: chainIcon,
|
|
@@ -1996,7 +2386,7 @@ function SolanaTokenSelectStep({
|
|
|
1996
2386
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1997
2387
|
/* @__PURE__ */ jsxs7("div", { className: "rs-asset-name", children: [
|
|
1998
2388
|
entry.token.symbol,
|
|
1999
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-asset-chain", children: " on Solana" })
|
|
2000
2390
|
] }),
|
|
2001
2391
|
/* @__PURE__ */ jsxs7("div", { className: "rs-asset-balance-small", children: [
|
|
2002
2392
|
formattedBalance,
|
|
@@ -2005,7 +2395,7 @@ function SolanaTokenSelectStep({
|
|
|
2005
2395
|
] })
|
|
2006
2396
|
] })
|
|
2007
2397
|
] }),
|
|
2008
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2009
2399
|
]
|
|
2010
2400
|
},
|
|
2011
2401
|
entry.token.symbol
|
|
@@ -2014,7 +2404,7 @@ function SolanaTokenSelectStep({
|
|
|
2014
2404
|
]
|
|
2015
2405
|
}
|
|
2016
2406
|
),
|
|
2017
|
-
/* @__PURE__ */
|
|
2407
|
+
/* @__PURE__ */ jsx8("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx8(
|
|
2018
2408
|
Button,
|
|
2019
2409
|
{
|
|
2020
2410
|
onClick: () => selectedEntry && onContinue(
|
|
@@ -2027,14 +2417,14 @@ function SolanaTokenSelectStep({
|
|
|
2027
2417
|
children: "Continue"
|
|
2028
2418
|
}
|
|
2029
2419
|
) }),
|
|
2030
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ jsx8(PoweredBy, {})
|
|
2031
2421
|
] });
|
|
2032
2422
|
}
|
|
2033
2423
|
|
|
2034
2424
|
// src/components/steps/SolanaAmountStep.tsx
|
|
2035
|
-
import { useEffect as useEffect8, useMemo as
|
|
2425
|
+
import { useEffect as useEffect8, useMemo as useMemo5, useState as useState8 } from "react";
|
|
2036
2426
|
import { formatUnits as formatUnits4, parseUnits as parseUnits3 } from "viem";
|
|
2037
|
-
import { jsx as
|
|
2427
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2038
2428
|
var SOL_FEE_RESERVE_LAMPORTS = 1000000n;
|
|
2039
2429
|
function SolanaAmountStep({
|
|
2040
2430
|
token,
|
|
@@ -2048,7 +2438,7 @@ function SolanaAmountStep({
|
|
|
2048
2438
|
const [amount, setAmount] = useState8("");
|
|
2049
2439
|
const [error, setError] = useState8(null);
|
|
2050
2440
|
const isSourceStablecoin = isStablecoinSymbol(token.symbol);
|
|
2051
|
-
const tokenPriceUsd =
|
|
2441
|
+
const tokenPriceUsd = useMemo5(() => {
|
|
2052
2442
|
if (isSourceStablecoin) return 1;
|
|
2053
2443
|
try {
|
|
2054
2444
|
const balanceUnits = Number(formatUnits4(balance, token.decimals));
|
|
@@ -2070,7 +2460,7 @@ function SolanaAmountStep({
|
|
|
2070
2460
|
}
|
|
2071
2461
|
}
|
|
2072
2462
|
}, [defaultAmount, amount]);
|
|
2073
|
-
const formattedBalance =
|
|
2463
|
+
const formattedBalance = useMemo5(() => {
|
|
2074
2464
|
try {
|
|
2075
2465
|
const raw = formatUnits4(balance, token.decimals);
|
|
2076
2466
|
const numeric = Number(raw);
|
|
@@ -2080,7 +2470,7 @@ function SolanaAmountStep({
|
|
|
2080
2470
|
return "...";
|
|
2081
2471
|
}
|
|
2082
2472
|
}, [balance, token.decimals]);
|
|
2083
|
-
const computedBalanceUsd =
|
|
2473
|
+
const computedBalanceUsd = useMemo5(() => {
|
|
2084
2474
|
try {
|
|
2085
2475
|
const balanceUnits = Number(formatUnits4(balance, token.decimals));
|
|
2086
2476
|
if (!Number.isFinite(balanceUnits) || balanceUnits < 0) return null;
|
|
@@ -2091,15 +2481,15 @@ function SolanaAmountStep({
|
|
|
2091
2481
|
return null;
|
|
2092
2482
|
}
|
|
2093
2483
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2094
|
-
const formattedBalanceUsd =
|
|
2484
|
+
const formattedBalanceUsd = useMemo5(() => {
|
|
2095
2485
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2096
2486
|
return currencyFormatter.format(computedBalanceUsd);
|
|
2097
2487
|
}, [computedBalanceUsd]);
|
|
2098
|
-
const spendableBalance =
|
|
2488
|
+
const spendableBalance = useMemo5(() => {
|
|
2099
2489
|
if (!isNativeSol(token)) return balance;
|
|
2100
2490
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
2101
2491
|
}, [balance, token]);
|
|
2102
|
-
const spendableBalanceUsd =
|
|
2492
|
+
const spendableBalanceUsd = useMemo5(() => {
|
|
2103
2493
|
try {
|
|
2104
2494
|
const spendableUnits = Number(formatUnits4(spendableBalance, token.decimals));
|
|
2105
2495
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
@@ -2191,10 +2581,10 @@ function SolanaAmountStep({
|
|
|
2191
2581
|
onContinue(token, sourceAmountStr, amount);
|
|
2192
2582
|
};
|
|
2193
2583
|
return /* @__PURE__ */ jsxs8("div", { className: "rs-step", children: [
|
|
2194
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ jsx9("div", { style: { padding: "12px 12px 4px" }, children: /* @__PURE__ */ jsx9("div", { className: "rs-step-title", children: "Enter amount" }) }),
|
|
2195
2585
|
/* @__PURE__ */ jsxs8("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
|
|
2196
2586
|
/* @__PURE__ */ jsxs8("div", { className: "rs-amount-display", children: [
|
|
2197
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-amount-input-wrapper", children: /* @__PURE__ */ jsx9(
|
|
2198
2588
|
"input",
|
|
2199
2589
|
{
|
|
2200
2590
|
type: "text",
|
|
@@ -2212,7 +2602,7 @@ function SolanaAmountStep({
|
|
|
2212
2602
|
autoFocus: true
|
|
2213
2603
|
}
|
|
2214
2604
|
) }),
|
|
2215
|
-
!isSourceStablecoin && /* @__PURE__ */
|
|
2605
|
+
!isSourceStablecoin && /* @__PURE__ */ jsx9("div", { className: "rs-amount-available", children: /* @__PURE__ */ jsxs8("span", { className: "rs-amount-available-value", children: [
|
|
2216
2606
|
formattedBalance,
|
|
2217
2607
|
" ",
|
|
2218
2608
|
token.symbol,
|
|
@@ -2239,7 +2629,7 @@ function SolanaAmountStep({
|
|
|
2239
2629
|
},
|
|
2240
2630
|
pct
|
|
2241
2631
|
)),
|
|
2242
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsx9(
|
|
2243
2633
|
"button",
|
|
2244
2634
|
{
|
|
2245
2635
|
type: "button",
|
|
@@ -2254,7 +2644,7 @@ function SolanaAmountStep({
|
|
|
2254
2644
|
" minimum deposit"
|
|
2255
2645
|
] }),
|
|
2256
2646
|
error && /* @__PURE__ */ jsxs8("div", { className: "rs-amount-error", children: [
|
|
2257
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsx9(
|
|
2258
2648
|
"svg",
|
|
2259
2649
|
{
|
|
2260
2650
|
viewBox: "0 0 24 24",
|
|
@@ -2262,7 +2652,7 @@ function SolanaAmountStep({
|
|
|
2262
2652
|
stroke: "currentColor",
|
|
2263
2653
|
strokeWidth: "2",
|
|
2264
2654
|
style: { width: 16, height: 16, flexShrink: 0 },
|
|
2265
|
-
children: /* @__PURE__ */
|
|
2655
|
+
children: /* @__PURE__ */ jsx9(
|
|
2266
2656
|
"path",
|
|
2267
2657
|
{
|
|
2268
2658
|
strokeLinecap: "round",
|
|
@@ -2272,10 +2662,10 @@ function SolanaAmountStep({
|
|
|
2272
2662
|
)
|
|
2273
2663
|
}
|
|
2274
2664
|
),
|
|
2275
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ jsx9("span", { children: error })
|
|
2276
2666
|
] })
|
|
2277
2667
|
] }),
|
|
2278
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx9(
|
|
2279
2669
|
Button,
|
|
2280
2670
|
{
|
|
2281
2671
|
onClick: handleContinue,
|
|
@@ -2284,14 +2674,14 @@ function SolanaAmountStep({
|
|
|
2284
2674
|
children: uiConfig?.minDepositUsd && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2285
2675
|
}
|
|
2286
2676
|
) }),
|
|
2287
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ jsx9(PoweredBy, {})
|
|
2288
2678
|
] });
|
|
2289
2679
|
}
|
|
2290
2680
|
|
|
2291
2681
|
// src/components/steps/SolanaConfirmStep.tsx
|
|
2292
2682
|
import { useState as useState9 } from "react";
|
|
2293
2683
|
import { parseUnits as parseUnits4 } from "viem";
|
|
2294
|
-
import { jsx as
|
|
2684
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2295
2685
|
function SolanaConfirmStep({
|
|
2296
2686
|
smartAccount,
|
|
2297
2687
|
solanaAddress,
|
|
@@ -2416,18 +2806,18 @@ function SolanaConfirmStep({
|
|
|
2416
2806
|
}
|
|
2417
2807
|
};
|
|
2418
2808
|
return /* @__PURE__ */ jsxs9("div", { className: "rs-step", children: [
|
|
2419
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ jsx10("div", { style: { padding: "12px 12px 10px" }, children: /* @__PURE__ */ jsx10("div", { className: "rs-step-title", children: "Review order" }) }),
|
|
2420
2810
|
/* @__PURE__ */ jsxs9("div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
|
|
2421
2811
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card", children: [
|
|
2422
2812
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card-row", children: [
|
|
2423
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-label", children: "Source" }),
|
|
2424
2814
|
/* @__PURE__ */ jsxs9(
|
|
2425
2815
|
"span",
|
|
2426
2816
|
{
|
|
2427
2817
|
className: "rs-card-value",
|
|
2428
2818
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2429
2819
|
children: [
|
|
2430
|
-
getChainIcon("solana") && /* @__PURE__ */
|
|
2820
|
+
getChainIcon("solana") && /* @__PURE__ */ jsx10(
|
|
2431
2821
|
"img",
|
|
2432
2822
|
{
|
|
2433
2823
|
src: getChainIcon("solana"),
|
|
@@ -2441,14 +2831,14 @@ function SolanaConfirmStep({
|
|
|
2441
2831
|
)
|
|
2442
2832
|
] }),
|
|
2443
2833
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card-row", children: [
|
|
2444
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-label", children: "Destination" }),
|
|
2445
2835
|
/* @__PURE__ */ jsxs9(
|
|
2446
2836
|
"span",
|
|
2447
2837
|
{
|
|
2448
2838
|
className: "rs-card-value",
|
|
2449
2839
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2450
2840
|
children: [
|
|
2451
|
-
getChainIcon(targetChain) && /* @__PURE__ */
|
|
2841
|
+
getChainIcon(targetChain) && /* @__PURE__ */ jsx10(
|
|
2452
2842
|
"img",
|
|
2453
2843
|
{
|
|
2454
2844
|
src: getChainIcon(targetChain),
|
|
@@ -2462,20 +2852,20 @@ function SolanaConfirmStep({
|
|
|
2462
2852
|
)
|
|
2463
2853
|
] }),
|
|
2464
2854
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card-row", children: [
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-label", children: "Estimated time" }),
|
|
2856
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-value", children: "< 1 min" })
|
|
2467
2857
|
] })
|
|
2468
2858
|
] }),
|
|
2469
2859
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card", children: [
|
|
2470
2860
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card-row", children: [
|
|
2471
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-label", children: "You send" }),
|
|
2472
2862
|
/* @__PURE__ */ jsxs9(
|
|
2473
2863
|
"span",
|
|
2474
2864
|
{
|
|
2475
2865
|
className: "rs-card-value",
|
|
2476
2866
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2477
2867
|
children: [
|
|
2478
|
-
getTokenIcon(token.symbol) && /* @__PURE__ */
|
|
2868
|
+
getTokenIcon(token.symbol) && /* @__PURE__ */ jsx10(
|
|
2479
2869
|
"img",
|
|
2480
2870
|
{
|
|
2481
2871
|
src: getTokenIcon(token.symbol),
|
|
@@ -2491,14 +2881,14 @@ function SolanaConfirmStep({
|
|
|
2491
2881
|
)
|
|
2492
2882
|
] }),
|
|
2493
2883
|
/* @__PURE__ */ jsxs9("div", { className: "rs-card-row", children: [
|
|
2494
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-card-label", children: "You receive" }),
|
|
2495
2885
|
/* @__PURE__ */ jsxs9(
|
|
2496
2886
|
"span",
|
|
2497
2887
|
{
|
|
2498
2888
|
className: "rs-card-value",
|
|
2499
2889
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2500
2890
|
children: [
|
|
2501
|
-
getTokenIcon(targetSymbol) && /* @__PURE__ */
|
|
2891
|
+
getTokenIcon(targetSymbol) && /* @__PURE__ */ jsx10(
|
|
2502
2892
|
"img",
|
|
2503
2893
|
{
|
|
2504
2894
|
src: getTokenIcon(targetSymbol),
|
|
@@ -2515,7 +2905,7 @@ function SolanaConfirmStep({
|
|
|
2515
2905
|
] })
|
|
2516
2906
|
] }),
|
|
2517
2907
|
error && /* @__PURE__ */ jsxs9("div", { className: "rs-alert rs-alert--error", children: [
|
|
2518
|
-
/* @__PURE__ */
|
|
2908
|
+
/* @__PURE__ */ jsx10(
|
|
2519
2909
|
"svg",
|
|
2520
2910
|
{
|
|
2521
2911
|
className: "rs-alert-icon",
|
|
@@ -2523,7 +2913,7 @@ function SolanaConfirmStep({
|
|
|
2523
2913
|
fill: "none",
|
|
2524
2914
|
stroke: "currentColor",
|
|
2525
2915
|
strokeWidth: "2",
|
|
2526
|
-
children: /* @__PURE__ */
|
|
2916
|
+
children: /* @__PURE__ */ jsx10(
|
|
2527
2917
|
"path",
|
|
2528
2918
|
{
|
|
2529
2919
|
strokeLinecap: "round",
|
|
@@ -2533,10 +2923,10 @@ function SolanaConfirmStep({
|
|
|
2533
2923
|
)
|
|
2534
2924
|
}
|
|
2535
2925
|
),
|
|
2536
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ jsx10("span", { className: "rs-alert-text", children: error })
|
|
2537
2927
|
] })
|
|
2538
2928
|
] }),
|
|
2539
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsx10("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx10(
|
|
2540
2930
|
Button,
|
|
2541
2931
|
{
|
|
2542
2932
|
onClick: handleConfirm,
|
|
@@ -2546,14 +2936,14 @@ function SolanaConfirmStep({
|
|
|
2546
2936
|
children: "Confirm Order"
|
|
2547
2937
|
}
|
|
2548
2938
|
) }),
|
|
2549
|
-
/* @__PURE__ */
|
|
2939
|
+
/* @__PURE__ */ jsx10(PoweredBy, {})
|
|
2550
2940
|
] });
|
|
2551
2941
|
}
|
|
2552
2942
|
|
|
2553
2943
|
// src/DepositFlow.tsx
|
|
2554
|
-
import { jsx as
|
|
2944
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2555
2945
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
2556
|
-
function
|
|
2946
|
+
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2557
2947
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2558
2948
|
}
|
|
2559
2949
|
function getAddressKey(address) {
|
|
@@ -2572,6 +2962,8 @@ function DepositFlow({
|
|
|
2572
2962
|
amount: defaultAmount,
|
|
2573
2963
|
recipient,
|
|
2574
2964
|
postBridgeActions,
|
|
2965
|
+
outputTokenRules,
|
|
2966
|
+
rejectUnmapped,
|
|
2575
2967
|
signerAddress = DEFAULT_SIGNER_ADDRESS,
|
|
2576
2968
|
sessionChainIds,
|
|
2577
2969
|
forceRegister = false,
|
|
@@ -2586,6 +2978,7 @@ function DepositFlow({
|
|
|
2586
2978
|
allowedRoutes,
|
|
2587
2979
|
onStepChange,
|
|
2588
2980
|
onTotalBalanceChange,
|
|
2981
|
+
onSmartAccountChange,
|
|
2589
2982
|
onClose,
|
|
2590
2983
|
onConnected,
|
|
2591
2984
|
onDepositSubmitted,
|
|
@@ -2597,7 +2990,12 @@ function DepositFlow({
|
|
|
2597
2990
|
}) {
|
|
2598
2991
|
const onStepChangeRef = useLatestRef(onStepChange);
|
|
2599
2992
|
const onTotalBalanceChangeRef = useLatestRef(onTotalBalanceChange);
|
|
2993
|
+
const onSmartAccountChangeRef = useLatestRef(onSmartAccountChange);
|
|
2600
2994
|
const onEventRef = useLatestRef(onEvent);
|
|
2995
|
+
const onDepositSubmittedRef = useLatestRef(onDepositSubmitted);
|
|
2996
|
+
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
2997
|
+
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
2998
|
+
const onErrorRef = useLatestRef(onError);
|
|
2601
2999
|
const hasInitialReownSession = Boolean(
|
|
2602
3000
|
enableSolana ? reownWallet?.isConnected || reownWallet?.address : reownWallet?.address
|
|
2603
3001
|
);
|
|
@@ -2610,32 +3008,34 @@ function DepositFlow({
|
|
|
2610
3008
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = useState10(false);
|
|
2611
3009
|
const [selectedWalletId, setSelectedWalletId] = useState10(null);
|
|
2612
3010
|
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = useState10(() => !hasInitialWalletHydrationPending);
|
|
2613
|
-
const flowModeRef =
|
|
2614
|
-
const portfolioAssetsRef =
|
|
2615
|
-
const stableWalletSignerRef =
|
|
2616
|
-
const stableWalletSelectionKeyRef =
|
|
3011
|
+
const flowModeRef = useRef6(null);
|
|
3012
|
+
const portfolioAssetsRef = useRef6([]);
|
|
3013
|
+
const stableWalletSignerRef = useRef6(null);
|
|
3014
|
+
const stableWalletSelectionKeyRef = useRef6(null);
|
|
2617
3015
|
flowModeRef.current = flowMode;
|
|
2618
|
-
const logFlow =
|
|
3016
|
+
const logFlow = useCallback4(
|
|
2619
3017
|
(message, data) => {
|
|
2620
3018
|
debugLog(debug, "deposit-flow", message, data);
|
|
2621
3019
|
},
|
|
2622
3020
|
[debug]
|
|
2623
3021
|
);
|
|
2624
|
-
const logFlowError =
|
|
3022
|
+
const logFlowError = useCallback4(
|
|
2625
3023
|
(message, error, data) => {
|
|
2626
3024
|
debugError(debug, "deposit-flow", message, error, data);
|
|
2627
3025
|
},
|
|
2628
3026
|
[debug]
|
|
2629
3027
|
);
|
|
2630
|
-
const handleAssetsLoaded =
|
|
3028
|
+
const handleAssetsLoaded = useCallback4((assets) => {
|
|
2631
3029
|
portfolioAssetsRef.current = assets;
|
|
2632
3030
|
}, []);
|
|
2633
|
-
const getTokenPriceUsd =
|
|
3031
|
+
const getTokenPriceUsd = useCallback4((symbol) => {
|
|
2634
3032
|
const sym = symbol.toLowerCase();
|
|
2635
3033
|
for (const asset of portfolioAssetsRef.current) {
|
|
2636
3034
|
if (asset.symbol.toLowerCase() === sym && asset.balanceUsd && asset.balance) {
|
|
2637
3035
|
try {
|
|
2638
|
-
const balanceUnits = Number(
|
|
3036
|
+
const balanceUnits = Number(
|
|
3037
|
+
formatUnits5(BigInt(asset.balance), asset.decimals)
|
|
3038
|
+
);
|
|
2639
3039
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
2640
3040
|
} catch {
|
|
2641
3041
|
}
|
|
@@ -2643,14 +3043,14 @@ function DepositFlow({
|
|
|
2643
3043
|
}
|
|
2644
3044
|
return null;
|
|
2645
3045
|
}, []);
|
|
2646
|
-
const dappSwitchChain =
|
|
3046
|
+
const dappSwitchChain = useMemo6(() => {
|
|
2647
3047
|
if (!dappWalletClient?.switchChain) return void 0;
|
|
2648
3048
|
return async (chainId) => {
|
|
2649
3049
|
await dappWalletClient.switchChain?.({ id: chainId });
|
|
2650
3050
|
};
|
|
2651
3051
|
}, [dappWalletClient]);
|
|
2652
3052
|
const connectedWalletAddress = dappWalletClient?.account?.address ?? null;
|
|
2653
|
-
const walletOptions =
|
|
3053
|
+
const walletOptions = useMemo6(() => {
|
|
2654
3054
|
const options = [];
|
|
2655
3055
|
const seen = /* @__PURE__ */ new Set();
|
|
2656
3056
|
if (connectedWalletAddress && dappAddress) {
|
|
@@ -2722,7 +3122,7 @@ function DepositFlow({
|
|
|
2722
3122
|
}, QR_AUTO_ADVANCE_HYDRATION_GRACE_MS);
|
|
2723
3123
|
return () => window.clearTimeout(timeout);
|
|
2724
3124
|
}, [isWalletHydrationPending]);
|
|
2725
|
-
const walletSelectionKey =
|
|
3125
|
+
const walletSelectionKey = useMemo6(() => {
|
|
2726
3126
|
if (flowMode !== "wallet") return null;
|
|
2727
3127
|
if (canAutoLock) {
|
|
2728
3128
|
return getAddressKey(connectedWalletAddress);
|
|
@@ -2736,7 +3136,7 @@ function DepositFlow({
|
|
|
2736
3136
|
isConnectSelectionConfirmed,
|
|
2737
3137
|
selectedWalletId
|
|
2738
3138
|
]);
|
|
2739
|
-
const walletSignerContext =
|
|
3139
|
+
const walletSignerContext = useMemo6(() => {
|
|
2740
3140
|
if (flowMode === "deposit-address") {
|
|
2741
3141
|
return null;
|
|
2742
3142
|
}
|
|
@@ -2817,7 +3217,7 @@ function DepositFlow({
|
|
|
2817
3217
|
stableWalletSignerRef.current = walletSignerContext;
|
|
2818
3218
|
}
|
|
2819
3219
|
}, [flowMode, walletSelectionKey, walletSignerContext]);
|
|
2820
|
-
const signerContext =
|
|
3220
|
+
const signerContext = useMemo6(() => {
|
|
2821
3221
|
if (flowMode === "deposit-address") {
|
|
2822
3222
|
if (!dappAddress) return null;
|
|
2823
3223
|
return {
|
|
@@ -2846,7 +3246,7 @@ function DepositFlow({
|
|
|
2846
3246
|
walletSelectionKey
|
|
2847
3247
|
]);
|
|
2848
3248
|
const sessionKeyAddress = dappAddress ?? signerContext?.ownerAddress ?? null;
|
|
2849
|
-
const lastTargetRef =
|
|
3249
|
+
const lastTargetRef = useRef6(null);
|
|
2850
3250
|
useEffect9(() => {
|
|
2851
3251
|
const prev = lastTargetRef.current;
|
|
2852
3252
|
if (prev && (prev.chain !== targetChain || prev.token.toLowerCase() !== targetToken.toLowerCase())) {
|
|
@@ -2856,20 +3256,20 @@ function DepositFlow({
|
|
|
2856
3256
|
}
|
|
2857
3257
|
lastTargetRef.current = { chain: targetChain, token: targetToken };
|
|
2858
3258
|
}, [targetChain, targetToken, step.type]);
|
|
2859
|
-
const handleBackFromAmount =
|
|
3259
|
+
const handleBackFromAmount = useCallback4(() => {
|
|
2860
3260
|
setStep((prev) => {
|
|
2861
3261
|
if (prev.type !== "amount") return prev;
|
|
2862
3262
|
return { type: "select-asset", smartAccount: prev.smartAccount };
|
|
2863
3263
|
});
|
|
2864
3264
|
}, []);
|
|
2865
|
-
const handleBackFromSelectAsset =
|
|
3265
|
+
const handleBackFromSelectAsset = useCallback4(() => {
|
|
2866
3266
|
if (hasWalletOptions || reownWallet) {
|
|
2867
3267
|
hasNavigatedBackRef.current = true;
|
|
2868
3268
|
setFlowMode(null);
|
|
2869
3269
|
setIsConnectSelectionConfirmed(false);
|
|
2870
3270
|
}
|
|
2871
3271
|
}, [hasWalletOptions, reownWallet]);
|
|
2872
|
-
const handleBackFromDepositAddress =
|
|
3272
|
+
const handleBackFromDepositAddress = useCallback4(() => {
|
|
2873
3273
|
setFlowMode(null);
|
|
2874
3274
|
setStep({ type: "setup" });
|
|
2875
3275
|
if (hasWalletOptions || reownWallet) {
|
|
@@ -2877,7 +3277,7 @@ function DepositFlow({
|
|
|
2877
3277
|
setIsConnectSelectionConfirmed(false);
|
|
2878
3278
|
}
|
|
2879
3279
|
}, [hasWalletOptions, reownWallet]);
|
|
2880
|
-
const handleBackFromSolanaTokenSelect =
|
|
3280
|
+
const handleBackFromSolanaTokenSelect = useCallback4(() => {
|
|
2881
3281
|
setFlowMode(null);
|
|
2882
3282
|
setStep({ type: "setup" });
|
|
2883
3283
|
if (hasWalletOptions || reownWallet) {
|
|
@@ -2885,7 +3285,7 @@ function DepositFlow({
|
|
|
2885
3285
|
setIsConnectSelectionConfirmed(false);
|
|
2886
3286
|
}
|
|
2887
3287
|
}, [hasWalletOptions, reownWallet]);
|
|
2888
|
-
const handleBackFromSolanaAmount =
|
|
3288
|
+
const handleBackFromSolanaAmount = useCallback4(() => {
|
|
2889
3289
|
setStep((prev) => {
|
|
2890
3290
|
if (prev.type !== "solana-amount") return prev;
|
|
2891
3291
|
return {
|
|
@@ -2895,7 +3295,7 @@ function DepositFlow({
|
|
|
2895
3295
|
};
|
|
2896
3296
|
});
|
|
2897
3297
|
}, []);
|
|
2898
|
-
const handleBackFromSolanaConfirm =
|
|
3298
|
+
const handleBackFromSolanaConfirm = useCallback4(() => {
|
|
2899
3299
|
setStep((prev) => {
|
|
2900
3300
|
if (prev.type !== "solana-confirm") return prev;
|
|
2901
3301
|
return {
|
|
@@ -2909,7 +3309,7 @@ function DepositFlow({
|
|
|
2909
3309
|
};
|
|
2910
3310
|
});
|
|
2911
3311
|
}, []);
|
|
2912
|
-
const handleBackFromConfirm =
|
|
3312
|
+
const handleBackFromConfirm = useCallback4(() => {
|
|
2913
3313
|
setStep((prev) => {
|
|
2914
3314
|
if (prev.type !== "confirm") return prev;
|
|
2915
3315
|
return {
|
|
@@ -2926,7 +3326,7 @@ function DepositFlow({
|
|
|
2926
3326
|
}, [stepIndex, currentBackHandler, onStepChangeRef]);
|
|
2927
3327
|
const stepSendToken = step.type === "amount" ? step.asset.symbol : null;
|
|
2928
3328
|
const stepOpenEventKey = step.type === "select-asset" ? "select-asset" : step.type === "deposit-address" ? "deposit-address" : step.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
2929
|
-
const lastStepOpenEventKeyRef =
|
|
3329
|
+
const lastStepOpenEventKeyRef = useRef6(null);
|
|
2930
3330
|
useEffect9(() => {
|
|
2931
3331
|
if (!stepOpenEventKey) {
|
|
2932
3332
|
lastStepOpenEventKeyRef.current = null;
|
|
@@ -2990,30 +3390,32 @@ function DepositFlow({
|
|
|
2990
3390
|
}, [totalBalanceUsd, onTotalBalanceChangeRef]);
|
|
2991
3391
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2992
3392
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
2993
|
-
const handleSelectProvider =
|
|
3393
|
+
const handleSelectProvider = useCallback4(() => {
|
|
2994
3394
|
setFlowMode("wallet");
|
|
2995
3395
|
}, []);
|
|
2996
|
-
const handleSelectSolanaWallet =
|
|
3396
|
+
const handleSelectSolanaWallet = useCallback4(() => {
|
|
2997
3397
|
setFlowMode("solana-wallet");
|
|
2998
3398
|
}, []);
|
|
2999
|
-
const handleSelectTransferCrypto =
|
|
3399
|
+
const handleSelectTransferCrypto = useCallback4(() => {
|
|
3000
3400
|
setFlowMode("deposit-address");
|
|
3001
3401
|
setStep({ type: "setup" });
|
|
3002
3402
|
}, []);
|
|
3003
|
-
const handleNewDeposit =
|
|
3403
|
+
const handleNewDeposit = useCallback4(() => {
|
|
3404
|
+
onSmartAccountChangeRef.current?.(null);
|
|
3004
3405
|
setFlowMode(null);
|
|
3005
3406
|
setStep({ type: "setup" });
|
|
3006
3407
|
setIsConnectSelectionConfirmed(false);
|
|
3007
3408
|
setSelectedWalletId(null);
|
|
3008
3409
|
hasNavigatedBackRef.current = false;
|
|
3009
|
-
}, []);
|
|
3010
|
-
const handleSetupComplete =
|
|
3410
|
+
}, [onSmartAccountChangeRef]);
|
|
3411
|
+
const handleSetupComplete = useCallback4(
|
|
3011
3412
|
(smartAccount, solanaDepositAddress) => {
|
|
3012
3413
|
logFlow("setup:complete", {
|
|
3013
3414
|
smartAccount,
|
|
3014
3415
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3015
3416
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3016
3417
|
});
|
|
3418
|
+
onSmartAccountChangeRef.current?.(smartAccount);
|
|
3017
3419
|
if (isDepositAddressMode) {
|
|
3018
3420
|
setStep({
|
|
3019
3421
|
type: "deposit-address",
|
|
@@ -3037,37 +3439,20 @@ function DepositFlow({
|
|
|
3037
3439
|
setStep({ type: "select-asset", smartAccount });
|
|
3038
3440
|
}
|
|
3039
3441
|
},
|
|
3040
|
-
[isDepositAddressMode, isSolanaWalletMode, logFlow]
|
|
3442
|
+
[isDepositAddressMode, isSolanaWalletMode, logFlow, onSmartAccountChangeRef]
|
|
3041
3443
|
);
|
|
3042
|
-
const
|
|
3043
|
-
(
|
|
3444
|
+
const handleDepositAddressSubmitted = useCallback4(
|
|
3445
|
+
(data) => {
|
|
3044
3446
|
logFlow("deposit-address:detected", {
|
|
3045
|
-
txHash,
|
|
3046
|
-
sourceChain:
|
|
3047
|
-
|
|
3048
|
-
amount
|
|
3447
|
+
txHash: data.txHash,
|
|
3448
|
+
sourceChain: data.sourceChain,
|
|
3449
|
+
amount: data.amount
|
|
3049
3450
|
});
|
|
3050
|
-
|
|
3051
|
-
if (prev.type !== "deposit-address") return prev;
|
|
3052
|
-
const isEvmToken = /^0x[a-fA-F0-9]{40}$/.test(token);
|
|
3053
|
-
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(chainId, token, targetChain, targetToken);
|
|
3054
|
-
return {
|
|
3055
|
-
type: "processing",
|
|
3056
|
-
smartAccount: prev.smartAccount,
|
|
3057
|
-
txHash,
|
|
3058
|
-
sourceChain: chainId,
|
|
3059
|
-
sourceToken: token,
|
|
3060
|
-
amount,
|
|
3061
|
-
sourceSymbol,
|
|
3062
|
-
sourceDecimals,
|
|
3063
|
-
directTransfer
|
|
3064
|
-
};
|
|
3065
|
-
});
|
|
3066
|
-
onDepositSubmitted?.({ txHash, sourceChain: chainId, amount });
|
|
3451
|
+
onDepositSubmittedRef.current?.(data);
|
|
3067
3452
|
},
|
|
3068
|
-
[
|
|
3453
|
+
[logFlow, onDepositSubmittedRef]
|
|
3069
3454
|
);
|
|
3070
|
-
const handleSolanaTokenContinue =
|
|
3455
|
+
const handleSolanaTokenContinue = useCallback4(
|
|
3071
3456
|
(token, balance, balanceUsd) => {
|
|
3072
3457
|
logFlow("solana:token:continue", { token: token.symbol });
|
|
3073
3458
|
setStep((prev) => {
|
|
@@ -3085,7 +3470,7 @@ function DepositFlow({
|
|
|
3085
3470
|
},
|
|
3086
3471
|
[defaultAmount, logFlow]
|
|
3087
3472
|
);
|
|
3088
|
-
const handleSolanaAmountContinue =
|
|
3473
|
+
const handleSolanaAmountContinue = useCallback4(
|
|
3089
3474
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3090
3475
|
const targetSym = getTokenSymbol(targetToken, targetChain);
|
|
3091
3476
|
const isTargetStable = isStablecoinSymbol(targetSym);
|
|
@@ -3115,7 +3500,7 @@ function DepositFlow({
|
|
|
3115
3500
|
},
|
|
3116
3501
|
[targetToken, targetChain, getTokenPriceUsd, logFlow]
|
|
3117
3502
|
);
|
|
3118
|
-
const handleSolanaConfirmed =
|
|
3503
|
+
const handleSolanaConfirmed = useCallback4(
|
|
3119
3504
|
(txHash, amountUnits) => {
|
|
3120
3505
|
setStep((prev) => {
|
|
3121
3506
|
if (prev.type !== "solana-confirm") return prev;
|
|
@@ -3143,13 +3528,13 @@ function DepositFlow({
|
|
|
3143
3528
|
},
|
|
3144
3529
|
[logFlow, onDepositSubmitted]
|
|
3145
3530
|
);
|
|
3146
|
-
const handleConnected =
|
|
3531
|
+
const handleConnected = useCallback4(
|
|
3147
3532
|
(addr, smartAccount) => {
|
|
3148
3533
|
onConnected?.({ address: addr, smartAccount });
|
|
3149
3534
|
},
|
|
3150
3535
|
[onConnected]
|
|
3151
3536
|
);
|
|
3152
|
-
const handleAssetContinue =
|
|
3537
|
+
const handleAssetContinue = useCallback4(
|
|
3153
3538
|
(asset) => {
|
|
3154
3539
|
onEvent?.({
|
|
3155
3540
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
@@ -3171,7 +3556,7 @@ function DepositFlow({
|
|
|
3171
3556
|
},
|
|
3172
3557
|
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3173
3558
|
);
|
|
3174
|
-
const handleAmountContinue =
|
|
3559
|
+
const handleAmountContinue = useCallback4(
|
|
3175
3560
|
(amount, targetAmount, balance) => {
|
|
3176
3561
|
const targetSym = getTokenSymbol(targetToken, targetChain);
|
|
3177
3562
|
const isTargetStable = isStablecoinSymbol(targetSym);
|
|
@@ -3191,7 +3576,7 @@ function DepositFlow({
|
|
|
3191
3576
|
},
|
|
3192
3577
|
[targetToken, targetChain, getTokenPriceUsd]
|
|
3193
3578
|
);
|
|
3194
|
-
const handleDepositSubmitted =
|
|
3579
|
+
const handleDepositSubmitted = useCallback4(
|
|
3195
3580
|
(txHash, chainId, amount, token) => {
|
|
3196
3581
|
logFlow("evm:submitted", {
|
|
3197
3582
|
txHash,
|
|
@@ -3208,54 +3593,54 @@ function DepositFlow({
|
|
|
3208
3593
|
sourceChain: chainId,
|
|
3209
3594
|
sourceToken: token,
|
|
3210
3595
|
amount,
|
|
3211
|
-
directTransfer:
|
|
3596
|
+
directTransfer: isSameRoute2(chainId, token, targetChain, targetToken)
|
|
3212
3597
|
};
|
|
3213
3598
|
});
|
|
3214
3599
|
},
|
|
3215
3600
|
[targetChain, targetToken]
|
|
3216
3601
|
);
|
|
3217
|
-
const handleDepositSubmittedCallback =
|
|
3602
|
+
const handleDepositSubmittedCallback = useCallback4(
|
|
3218
3603
|
(txHash, sourceChain, amount) => {
|
|
3219
|
-
|
|
3604
|
+
onDepositSubmittedRef.current?.({ txHash, sourceChain, amount });
|
|
3220
3605
|
},
|
|
3221
|
-
[
|
|
3606
|
+
[onDepositSubmittedRef]
|
|
3222
3607
|
);
|
|
3223
|
-
const handleDepositComplete =
|
|
3608
|
+
const handleDepositComplete = useCallback4(
|
|
3224
3609
|
(txHash, destinationTxHash, context) => {
|
|
3225
3610
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3226
|
-
|
|
3611
|
+
onDepositCompleteRef.current?.({ txHash, destinationTxHash, ...context });
|
|
3227
3612
|
},
|
|
3228
|
-
[logFlow,
|
|
3613
|
+
[logFlow, onDepositCompleteRef]
|
|
3229
3614
|
);
|
|
3230
|
-
const handleDepositFailed =
|
|
3615
|
+
const handleDepositFailed = useCallback4(
|
|
3231
3616
|
(txHash, error) => {
|
|
3232
3617
|
logFlowError("deposit:failed", error, { txHash });
|
|
3233
|
-
|
|
3618
|
+
onDepositFailedRef.current?.({ txHash, error });
|
|
3234
3619
|
},
|
|
3235
|
-
[logFlowError,
|
|
3620
|
+
[logFlowError, onDepositFailedRef]
|
|
3236
3621
|
);
|
|
3237
|
-
const handleError =
|
|
3622
|
+
const handleError = useCallback4(
|
|
3238
3623
|
(message, code) => {
|
|
3239
3624
|
logFlowError("flow:error", message, { code });
|
|
3240
|
-
|
|
3625
|
+
onErrorRef.current?.({ message, code });
|
|
3241
3626
|
},
|
|
3242
|
-
[logFlowError,
|
|
3627
|
+
[logFlowError, onErrorRef]
|
|
3243
3628
|
);
|
|
3244
|
-
const handleTotalBalanceComputed =
|
|
3629
|
+
const handleTotalBalanceComputed = useCallback4((total) => {
|
|
3245
3630
|
setTotalBalanceUsd(total);
|
|
3246
3631
|
}, []);
|
|
3247
|
-
const selectedWalletIdEffective =
|
|
3632
|
+
const selectedWalletIdEffective = useMemo6(() => {
|
|
3248
3633
|
if (selectedWalletId) return selectedWalletId;
|
|
3249
3634
|
if (walletOptions.length === 1) {
|
|
3250
3635
|
return walletOptions[0].id;
|
|
3251
3636
|
}
|
|
3252
3637
|
return null;
|
|
3253
3638
|
}, [selectedWalletId, walletOptions]);
|
|
3254
|
-
const walletOptionsKey =
|
|
3639
|
+
const walletOptionsKey = useMemo6(
|
|
3255
3640
|
() => walletOptions.map((option) => option.id).join(","),
|
|
3256
3641
|
[walletOptions]
|
|
3257
3642
|
);
|
|
3258
|
-
const hasNavigatedBackRef =
|
|
3643
|
+
const hasNavigatedBackRef = useRef6(false);
|
|
3259
3644
|
useEffect9(() => {
|
|
3260
3645
|
if (flowModeRef.current) {
|
|
3261
3646
|
return;
|
|
@@ -3323,7 +3708,7 @@ function DepositFlow({
|
|
|
3323
3708
|
handleSelectTransferCrypto
|
|
3324
3709
|
]);
|
|
3325
3710
|
if (showConnectStep) {
|
|
3326
|
-
return /* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsx11("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx11(
|
|
3327
3712
|
ConnectStep,
|
|
3328
3713
|
{
|
|
3329
3714
|
walletOptions,
|
|
@@ -3357,7 +3742,7 @@ function DepositFlow({
|
|
|
3357
3742
|
if (isDepositAddressMode) {
|
|
3358
3743
|
if (!dappAddress || !sessionKeyAddress) return null;
|
|
3359
3744
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
3360
|
-
step.type === "setup" && /* @__PURE__ */
|
|
3745
|
+
step.type === "setup" && /* @__PURE__ */ jsx11(
|
|
3361
3746
|
SetupStep,
|
|
3362
3747
|
{
|
|
3363
3748
|
address: sessionKeyAddress,
|
|
@@ -3367,6 +3752,8 @@ function DepositFlow({
|
|
|
3367
3752
|
sessionChainIds,
|
|
3368
3753
|
recipient,
|
|
3369
3754
|
postBridgeActions,
|
|
3755
|
+
outputTokenRules,
|
|
3756
|
+
rejectUnmapped,
|
|
3370
3757
|
forceRegister,
|
|
3371
3758
|
enableSolana,
|
|
3372
3759
|
service,
|
|
@@ -3375,14 +3762,20 @@ function DepositFlow({
|
|
|
3375
3762
|
onError: handleError
|
|
3376
3763
|
}
|
|
3377
3764
|
),
|
|
3378
|
-
step.type === "deposit-address" && /* @__PURE__ */
|
|
3765
|
+
step.type === "deposit-address" && /* @__PURE__ */ jsx11(
|
|
3379
3766
|
DepositAddressStep,
|
|
3380
3767
|
{
|
|
3381
3768
|
smartAccount: step.smartAccount,
|
|
3382
3769
|
solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
|
|
3383
3770
|
service,
|
|
3384
3771
|
allowedRoutes,
|
|
3385
|
-
|
|
3772
|
+
targetChain,
|
|
3773
|
+
targetToken,
|
|
3774
|
+
waitForFinalTx,
|
|
3775
|
+
hasPostBridgeActions: Boolean(postBridgeActions?.length),
|
|
3776
|
+
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
3777
|
+
onDepositComplete: handleDepositComplete,
|
|
3778
|
+
onDepositFailed: handleDepositFailed,
|
|
3386
3779
|
onCopyAddress: () => {
|
|
3387
3780
|
const chainName = getChainName(targetChain);
|
|
3388
3781
|
const tokenSymbol = getTokenSymbol(targetToken, targetChain);
|
|
@@ -3394,29 +3787,6 @@ function DepositFlow({
|
|
|
3394
3787
|
cta_name: "copy"
|
|
3395
3788
|
});
|
|
3396
3789
|
},
|
|
3397
|
-
onError: handleError
|
|
3398
|
-
}
|
|
3399
|
-
),
|
|
3400
|
-
step.type === "processing" && /* @__PURE__ */ jsx10(
|
|
3401
|
-
ProcessingStep,
|
|
3402
|
-
{
|
|
3403
|
-
smartAccount: step.smartAccount,
|
|
3404
|
-
txHash: step.txHash,
|
|
3405
|
-
sourceChain: step.sourceChain,
|
|
3406
|
-
sourceToken: step.sourceToken,
|
|
3407
|
-
targetChain,
|
|
3408
|
-
targetToken,
|
|
3409
|
-
amount: step.amount,
|
|
3410
|
-
sourceSymbol: step.sourceSymbol,
|
|
3411
|
-
sourceDecimals: step.sourceDecimals,
|
|
3412
|
-
waitForFinalTx,
|
|
3413
|
-
hasPostBridgeActions: Boolean(postBridgeActions?.length),
|
|
3414
|
-
service,
|
|
3415
|
-
directTransfer: step.directTransfer,
|
|
3416
|
-
onClose,
|
|
3417
|
-
onNewDeposit: handleNewDeposit,
|
|
3418
|
-
onDepositComplete: handleDepositComplete,
|
|
3419
|
-
onDepositFailed: handleDepositFailed,
|
|
3420
3790
|
onError: handleError,
|
|
3421
3791
|
debug
|
|
3422
3792
|
}
|
|
@@ -3428,7 +3798,7 @@ function DepositFlow({
|
|
|
3428
3798
|
const solanaAddr = reownWallet?.solanaAddress;
|
|
3429
3799
|
const solanaProvider = reownWallet?.solanaProvider;
|
|
3430
3800
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
3431
|
-
step.type === "setup" && /* @__PURE__ */
|
|
3801
|
+
step.type === "setup" && /* @__PURE__ */ jsx11(
|
|
3432
3802
|
SetupStep,
|
|
3433
3803
|
{
|
|
3434
3804
|
address: sessionKeyAddress,
|
|
@@ -3438,6 +3808,8 @@ function DepositFlow({
|
|
|
3438
3808
|
sessionChainIds,
|
|
3439
3809
|
recipient,
|
|
3440
3810
|
postBridgeActions,
|
|
3811
|
+
outputTokenRules,
|
|
3812
|
+
rejectUnmapped,
|
|
3441
3813
|
forceRegister,
|
|
3442
3814
|
enableSolana,
|
|
3443
3815
|
service,
|
|
@@ -3446,7 +3818,7 @@ function DepositFlow({
|
|
|
3446
3818
|
onError: handleError
|
|
3447
3819
|
}
|
|
3448
3820
|
),
|
|
3449
|
-
step.type === "solana-token-select" && solanaAddr && /* @__PURE__ */
|
|
3821
|
+
step.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx11(
|
|
3450
3822
|
SolanaTokenSelectStep,
|
|
3451
3823
|
{
|
|
3452
3824
|
solanaAddress: solanaAddr,
|
|
@@ -3456,7 +3828,7 @@ function DepositFlow({
|
|
|
3456
3828
|
debug
|
|
3457
3829
|
}
|
|
3458
3830
|
),
|
|
3459
|
-
step.type === "solana-amount" && /* @__PURE__ */
|
|
3831
|
+
step.type === "solana-amount" && /* @__PURE__ */ jsx11(
|
|
3460
3832
|
SolanaAmountStep,
|
|
3461
3833
|
{
|
|
3462
3834
|
token: step.token,
|
|
@@ -3468,7 +3840,7 @@ function DepositFlow({
|
|
|
3468
3840
|
debug
|
|
3469
3841
|
}
|
|
3470
3842
|
),
|
|
3471
|
-
step.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */
|
|
3843
|
+
step.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx11(
|
|
3472
3844
|
SolanaConfirmStep,
|
|
3473
3845
|
{
|
|
3474
3846
|
smartAccount: step.smartAccount,
|
|
@@ -3489,14 +3861,14 @@ function DepositFlow({
|
|
|
3489
3861
|
}
|
|
3490
3862
|
) : step.type === "solana-confirm" ? /* @__PURE__ */ jsxs10("div", { className: "rs-step", children: [
|
|
3491
3863
|
/* @__PURE__ */ jsxs10("div", { className: "rs-loading-state", children: [
|
|
3492
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsx11("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx11(
|
|
3493
3865
|
"svg",
|
|
3494
3866
|
{
|
|
3495
3867
|
viewBox: "0 0 24 24",
|
|
3496
3868
|
fill: "none",
|
|
3497
3869
|
stroke: "currentColor",
|
|
3498
3870
|
strokeWidth: "2",
|
|
3499
|
-
children: /* @__PURE__ */
|
|
3871
|
+
children: /* @__PURE__ */ jsx11(
|
|
3500
3872
|
"path",
|
|
3501
3873
|
{
|
|
3502
3874
|
strokeLinecap: "round",
|
|
@@ -3507,21 +3879,21 @@ function DepositFlow({
|
|
|
3507
3879
|
}
|
|
3508
3880
|
) }),
|
|
3509
3881
|
/* @__PURE__ */ jsxs10("div", { className: "rs-loading-text", children: [
|
|
3510
|
-
/* @__PURE__ */
|
|
3511
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ jsx11("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
|
|
3883
|
+
/* @__PURE__ */ jsx11("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
|
|
3512
3884
|
] })
|
|
3513
3885
|
] }),
|
|
3514
|
-
/* @__PURE__ */
|
|
3886
|
+
/* @__PURE__ */ jsx11("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx11(
|
|
3515
3887
|
"button",
|
|
3516
3888
|
{
|
|
3517
3889
|
type: "button",
|
|
3518
3890
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
3519
3891
|
onClick: handleBackFromSolanaConfirm,
|
|
3520
|
-
children: /* @__PURE__ */
|
|
3892
|
+
children: /* @__PURE__ */ jsx11("span", { children: "Go Back" })
|
|
3521
3893
|
}
|
|
3522
3894
|
) })
|
|
3523
3895
|
] }) : null,
|
|
3524
|
-
step.type === "processing" && /* @__PURE__ */
|
|
3896
|
+
step.type === "processing" && /* @__PURE__ */ jsx11(
|
|
3525
3897
|
ProcessingStep,
|
|
3526
3898
|
{
|
|
3527
3899
|
smartAccount: step.smartAccount,
|
|
@@ -3548,7 +3920,7 @@ function DepositFlow({
|
|
|
3548
3920
|
] });
|
|
3549
3921
|
}
|
|
3550
3922
|
if (!signerContext?.walletClient || !signerContext?.publicClient) {
|
|
3551
|
-
return /* @__PURE__ */
|
|
3923
|
+
return /* @__PURE__ */ jsx11("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx11("div", { className: "rs-step", children: /* @__PURE__ */ jsx11("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx11("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx11("div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
3552
3924
|
}
|
|
3553
3925
|
const ownerAddress = signerContext.ownerAddress;
|
|
3554
3926
|
const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? targetChain;
|
|
@@ -3559,7 +3931,7 @@ function DepositFlow({
|
|
|
3559
3931
|
return getPublicClient(chainId);
|
|
3560
3932
|
};
|
|
3561
3933
|
return /* @__PURE__ */ jsxs10("div", { className: "rs-modal-body", children: [
|
|
3562
|
-
step.type === "setup" && /* @__PURE__ */
|
|
3934
|
+
step.type === "setup" && /* @__PURE__ */ jsx11(
|
|
3563
3935
|
SetupStep,
|
|
3564
3936
|
{
|
|
3565
3937
|
walletClient: signerContext.walletClient,
|
|
@@ -3570,6 +3942,8 @@ function DepositFlow({
|
|
|
3570
3942
|
sessionChainIds,
|
|
3571
3943
|
recipient,
|
|
3572
3944
|
postBridgeActions,
|
|
3945
|
+
outputTokenRules,
|
|
3946
|
+
rejectUnmapped,
|
|
3573
3947
|
forceRegister,
|
|
3574
3948
|
enableSolana,
|
|
3575
3949
|
service,
|
|
@@ -3578,7 +3952,7 @@ function DepositFlow({
|
|
|
3578
3952
|
onError: handleError
|
|
3579
3953
|
}
|
|
3580
3954
|
),
|
|
3581
|
-
step.type === "select-asset" && /* @__PURE__ */
|
|
3955
|
+
step.type === "select-asset" && /* @__PURE__ */ jsx11(
|
|
3582
3956
|
AssetSelectStep,
|
|
3583
3957
|
{
|
|
3584
3958
|
address: ownerAddress,
|
|
@@ -3589,10 +3963,14 @@ function DepositFlow({
|
|
|
3589
3963
|
service,
|
|
3590
3964
|
onContinue: handleAssetContinue,
|
|
3591
3965
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
3592
|
-
onAssetsLoaded: handleAssetsLoaded
|
|
3966
|
+
onAssetsLoaded: handleAssetsLoaded,
|
|
3967
|
+
onDisconnect: onDisconnect ? () => {
|
|
3968
|
+
onDisconnect();
|
|
3969
|
+
handleBackFromSelectAsset();
|
|
3970
|
+
} : void 0
|
|
3593
3971
|
}
|
|
3594
3972
|
),
|
|
3595
|
-
step.type === "amount" && /* @__PURE__ */
|
|
3973
|
+
step.type === "amount" && /* @__PURE__ */ jsx11(
|
|
3596
3974
|
AmountStep,
|
|
3597
3975
|
{
|
|
3598
3976
|
walletClient: signerContext.walletClient,
|
|
@@ -3617,7 +3995,7 @@ function DepositFlow({
|
|
|
3617
3995
|
}
|
|
3618
3996
|
}
|
|
3619
3997
|
),
|
|
3620
|
-
step.type === "confirm" && /* @__PURE__ */
|
|
3998
|
+
step.type === "confirm" && /* @__PURE__ */ jsx11(
|
|
3621
3999
|
ConfirmStep,
|
|
3622
4000
|
{
|
|
3623
4001
|
walletClient: signerContext.walletClient,
|
|
@@ -3637,7 +4015,7 @@ function DepositFlow({
|
|
|
3637
4015
|
onError: handleError
|
|
3638
4016
|
}
|
|
3639
4017
|
),
|
|
3640
|
-
step.type === "processing" && /* @__PURE__ */
|
|
4018
|
+
step.type === "processing" && /* @__PURE__ */ jsx11(
|
|
3641
4019
|
ProcessingStep,
|
|
3642
4020
|
{
|
|
3643
4021
|
smartAccount: step.smartAccount,
|
|
@@ -3664,10 +4042,273 @@ function DepositFlow({
|
|
|
3664
4042
|
] });
|
|
3665
4043
|
}
|
|
3666
4044
|
|
|
4045
|
+
// src/components/history/DepositHistoryPanel.tsx
|
|
4046
|
+
import { useCallback as useCallback5 } from "react";
|
|
4047
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4048
|
+
function shortenHash(hash) {
|
|
4049
|
+
if (hash.length <= 14) return hash;
|
|
4050
|
+
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
4051
|
+
}
|
|
4052
|
+
function formatTimestamp2(iso) {
|
|
4053
|
+
try {
|
|
4054
|
+
const date = new Date(iso);
|
|
4055
|
+
if (Number.isNaN(date.getTime())) return iso;
|
|
4056
|
+
const now = /* @__PURE__ */ new Date();
|
|
4057
|
+
const diffMs = now.getTime() - date.getTime();
|
|
4058
|
+
const diffMin = Math.floor(diffMs / 6e4);
|
|
4059
|
+
if (diffMin < 1) return "Just now";
|
|
4060
|
+
if (diffMin < 60) return `${diffMin}m ago`;
|
|
4061
|
+
const diffHr = Math.floor(diffMin / 60);
|
|
4062
|
+
if (diffHr < 24) return `${diffHr}h ago`;
|
|
4063
|
+
const diffDay = Math.floor(diffHr / 24);
|
|
4064
|
+
if (diffDay < 7) return `${diffDay}d ago`;
|
|
4065
|
+
return date.toLocaleDateString("en-US", {
|
|
4066
|
+
month: "short",
|
|
4067
|
+
day: "numeric"
|
|
4068
|
+
});
|
|
4069
|
+
} catch {
|
|
4070
|
+
return iso;
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
function resolveChainId(value) {
|
|
4074
|
+
if (value === void 0 || value === null) return null;
|
|
4075
|
+
if (typeof value === "number") return value;
|
|
4076
|
+
if (isSolanaCaip2(value) || value === "solana") return "solana";
|
|
4077
|
+
const parsed = parseEvmChainId(value);
|
|
4078
|
+
if (parsed !== null) return parsed;
|
|
4079
|
+
const num = Number(value);
|
|
4080
|
+
return Number.isFinite(num) ? num : null;
|
|
4081
|
+
}
|
|
4082
|
+
function resolveTokenSymbol(token, chainId) {
|
|
4083
|
+
if (!token) return "";
|
|
4084
|
+
if (chainId === "solana") {
|
|
4085
|
+
const normalized = token.toLowerCase();
|
|
4086
|
+
const matched = SOLANA_TOKENS.find(
|
|
4087
|
+
(entry) => entry.mint.toLowerCase() === normalized
|
|
4088
|
+
);
|
|
4089
|
+
if (matched) return matched.symbol;
|
|
4090
|
+
if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
4091
|
+
return "SOL";
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4095
|
+
const sym = getTokenSymbol(token, chainId);
|
|
4096
|
+
if (sym !== "Token") return sym;
|
|
4097
|
+
}
|
|
4098
|
+
return shortenHash(token);
|
|
4099
|
+
}
|
|
4100
|
+
function formatAmount(rawAmount, token, chainId) {
|
|
4101
|
+
if (!rawAmount) return "";
|
|
4102
|
+
let decimals = 18;
|
|
4103
|
+
if (token && chainId !== null && chainId !== void 0) {
|
|
4104
|
+
if (chainId === "solana") {
|
|
4105
|
+
const normalized = token.toLowerCase();
|
|
4106
|
+
const matched = SOLANA_TOKENS.find(
|
|
4107
|
+
(entry) => entry.mint.toLowerCase() === normalized
|
|
4108
|
+
);
|
|
4109
|
+
if (matched) {
|
|
4110
|
+
decimals = matched.decimals;
|
|
4111
|
+
} else if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
4112
|
+
decimals = 9;
|
|
4113
|
+
}
|
|
4114
|
+
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4115
|
+
decimals = getTokenDecimalsByAddress(token, chainId);
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
try {
|
|
4119
|
+
const raw = BigInt(rawAmount);
|
|
4120
|
+
const divisor = 10n ** BigInt(decimals);
|
|
4121
|
+
const whole = raw / divisor;
|
|
4122
|
+
const remainder = raw % divisor;
|
|
4123
|
+
if (remainder === 0n) return whole.toString();
|
|
4124
|
+
const fracStr = remainder.toString().padStart(decimals, "0");
|
|
4125
|
+
const trimmed = fracStr.slice(0, 6).replace(/0+$/, "");
|
|
4126
|
+
if (!trimmed) return whole.toString();
|
|
4127
|
+
return `${whole}.${trimmed}`;
|
|
4128
|
+
} catch {
|
|
4129
|
+
return rawAmount;
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
function getTxExplorerUrl(txHash, chainId) {
|
|
4133
|
+
if (!chainId) return null;
|
|
4134
|
+
const base = getExplorerUrl(chainId);
|
|
4135
|
+
if (!base) return null;
|
|
4136
|
+
return `${base}/tx/${txHash}`;
|
|
4137
|
+
}
|
|
4138
|
+
function normalizeStatus(raw) {
|
|
4139
|
+
const lower = raw.toLowerCase();
|
|
4140
|
+
if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed") return "completed";
|
|
4141
|
+
if (lower === "failed" || lower === "error" || lower === "bridge-failed") return "failed";
|
|
4142
|
+
if (lower === "processing" || lower === "submitted" || lower === "bridging") return "processing";
|
|
4143
|
+
return "pending";
|
|
4144
|
+
}
|
|
4145
|
+
var STATUS_LABEL = {
|
|
4146
|
+
pending: "Pending",
|
|
4147
|
+
processing: "Processing",
|
|
4148
|
+
completed: "Completed",
|
|
4149
|
+
failed: "Failed"
|
|
4150
|
+
};
|
|
4151
|
+
function ExternalLinkIcon() {
|
|
4152
|
+
return /* @__PURE__ */ jsx12("svg", { className: "rs-history-ext-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx12("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
|
+
}
|
|
4154
|
+
function DepositHistoryPanel({
|
|
4155
|
+
deposits,
|
|
4156
|
+
isLoading,
|
|
4157
|
+
error,
|
|
4158
|
+
hasMore,
|
|
4159
|
+
isLoadingMore,
|
|
4160
|
+
onLoadMore,
|
|
4161
|
+
onClose
|
|
4162
|
+
}) {
|
|
4163
|
+
const handleKeyDown = useCallback5(
|
|
4164
|
+
(e) => {
|
|
4165
|
+
if (e.key === "Escape") {
|
|
4166
|
+
e.stopPropagation();
|
|
4167
|
+
onClose();
|
|
4168
|
+
}
|
|
4169
|
+
},
|
|
4170
|
+
[onClose]
|
|
4171
|
+
);
|
|
4172
|
+
return /* @__PURE__ */ jsxs11(
|
|
4173
|
+
"div",
|
|
4174
|
+
{
|
|
4175
|
+
className: "rs-history-panel",
|
|
4176
|
+
role: "dialog",
|
|
4177
|
+
"aria-label": "Deposit history",
|
|
4178
|
+
onKeyDown: handleKeyDown,
|
|
4179
|
+
children: [
|
|
4180
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-history-header", children: [
|
|
4181
|
+
/* @__PURE__ */ jsx12(
|
|
4182
|
+
"button",
|
|
4183
|
+
{
|
|
4184
|
+
type: "button",
|
|
4185
|
+
className: "rs-history-back",
|
|
4186
|
+
"aria-label": "Close history",
|
|
4187
|
+
onClick: onClose,
|
|
4188
|
+
children: /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" }) })
|
|
4189
|
+
}
|
|
4190
|
+
),
|
|
4191
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-header-title", children: "History" }),
|
|
4192
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-history-header-spacer" })
|
|
4193
|
+
] }),
|
|
4194
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-history-body", children: [
|
|
4195
|
+
isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs11("div", { className: "rs-history-state", children: [
|
|
4196
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-history-spinner", children: /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx12("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" }) }) }),
|
|
4197
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-state-text", children: "Loading history..." })
|
|
4198
|
+
] }),
|
|
4199
|
+
error && !isLoading && /* @__PURE__ */ jsxs11("div", { className: "rs-history-state", children: [
|
|
4200
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-history-state-icon rs-history-state-icon--error", children: /* @__PURE__ */ jsxs11("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
4201
|
+
/* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4202
|
+
/* @__PURE__ */ jsx12("path", { strokeLinecap: "round", d: "M12 8v4m0 4h.01" })
|
|
4203
|
+
] }) }),
|
|
4204
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-state-text", children: error })
|
|
4205
|
+
] }),
|
|
4206
|
+
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ jsxs11("div", { className: "rs-history-state", children: [
|
|
4207
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-history-state-icon", children: /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" }) }) }),
|
|
4208
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-state-text", children: "No deposits yet" }),
|
|
4209
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-state-hint", children: "Your deposit history will appear here" })
|
|
4210
|
+
] }),
|
|
4211
|
+
deposits.length > 0 && /* @__PURE__ */ jsxs11("div", { className: "rs-history-list", children: [
|
|
4212
|
+
deposits.map((deposit, i) => /* @__PURE__ */ jsx12(HistoryRow, { deposit }, deposit.txHash || i)),
|
|
4213
|
+
hasMore && /* @__PURE__ */ jsx12(
|
|
4214
|
+
"button",
|
|
4215
|
+
{
|
|
4216
|
+
type: "button",
|
|
4217
|
+
className: "rs-history-load-more",
|
|
4218
|
+
onClick: onLoadMore,
|
|
4219
|
+
disabled: isLoadingMore,
|
|
4220
|
+
children: isLoadingMore ? "Loading..." : "Load more"
|
|
4221
|
+
}
|
|
4222
|
+
)
|
|
4223
|
+
] })
|
|
4224
|
+
] })
|
|
4225
|
+
]
|
|
4226
|
+
}
|
|
4227
|
+
);
|
|
4228
|
+
}
|
|
4229
|
+
function HistoryRow({ deposit }) {
|
|
4230
|
+
const status = normalizeStatus(deposit.status);
|
|
4231
|
+
const sourceChainId = resolveChainId(deposit.chain);
|
|
4232
|
+
const targetChainId = resolveChainId(deposit.targetChain);
|
|
4233
|
+
const sourceChainName = sourceChainId ? getChainName(sourceChainId) : null;
|
|
4234
|
+
const targetChainName = targetChainId ? getChainName(targetChainId) : null;
|
|
4235
|
+
const sourceChainIcon = sourceChainId ? getChainIcon(sourceChainId) : void 0;
|
|
4236
|
+
const targetChainIcon = targetChainId ? getChainIcon(targetChainId) : void 0;
|
|
4237
|
+
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
4238
|
+
const targetSymbol = resolveTokenSymbol(deposit.targetToken, targetChainId);
|
|
4239
|
+
const rawAmount = deposit.sourceAmount ?? deposit.amount;
|
|
4240
|
+
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
4241
|
+
const timestamp = deposit.createdAt ? formatTimestamp2(deposit.createdAt) : null;
|
|
4242
|
+
const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
|
|
4243
|
+
const dstTxUrl = deposit.destinationTxHash ? getTxExplorerUrl(deposit.destinationTxHash, targetChainId) : null;
|
|
4244
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rs-history-row", children: [
|
|
4245
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-history-row-primary", children: [
|
|
4246
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-history-route", children: [
|
|
4247
|
+
/* @__PURE__ */ jsxs11("span", { className: "rs-history-chain", children: [
|
|
4248
|
+
sourceChainIcon && /* @__PURE__ */ jsx12("img", { src: sourceChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4249
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-chain-name", children: sourceChainName ?? "Unknown" })
|
|
4250
|
+
] }),
|
|
4251
|
+
/* @__PURE__ */ jsx12("svg", { className: "rs-history-route-arrow", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.5 6h7m0 0L7 3.5M9.5 6 7 8.5" }) }),
|
|
4252
|
+
/* @__PURE__ */ jsxs11("span", { className: "rs-history-chain", children: [
|
|
4253
|
+
targetChainIcon && /* @__PURE__ */ jsx12("img", { src: targetChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4254
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-chain-name", children: targetChainName ?? "Unknown" })
|
|
4255
|
+
] })
|
|
4256
|
+
] }),
|
|
4257
|
+
/* @__PURE__ */ jsxs11("span", { className: `rs-history-status rs-history-status--${status}`, children: [
|
|
4258
|
+
/* @__PURE__ */ jsx12("span", { className: `rs-history-dot rs-history-dot--${status}` }),
|
|
4259
|
+
STATUS_LABEL[status]
|
|
4260
|
+
] })
|
|
4261
|
+
] }),
|
|
4262
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-history-row-secondary", children: [
|
|
4263
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-amount", children: formattedAmount ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
4264
|
+
formattedAmount,
|
|
4265
|
+
" ",
|
|
4266
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-token", children: sourceSymbol }),
|
|
4267
|
+
targetSymbol && sourceSymbol !== targetSymbol && /* @__PURE__ */ jsxs11("span", { className: "rs-history-token-target", children: [
|
|
4268
|
+
" \u2192 ",
|
|
4269
|
+
targetSymbol
|
|
4270
|
+
] })
|
|
4271
|
+
] }) : /* @__PURE__ */ jsx12("span", { className: "rs-history-no-amount", children: "\u2014" }) }),
|
|
4272
|
+
timestamp && /* @__PURE__ */ jsx12("span", { className: "rs-history-time", children: timestamp })
|
|
4273
|
+
] }),
|
|
4274
|
+
(srcTxUrl || dstTxUrl) && /* @__PURE__ */ jsxs11("div", { className: "rs-history-row-links", children: [
|
|
4275
|
+
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs11(
|
|
4276
|
+
"a",
|
|
4277
|
+
{
|
|
4278
|
+
href: srcTxUrl,
|
|
4279
|
+
target: "_blank",
|
|
4280
|
+
rel: "noopener noreferrer",
|
|
4281
|
+
className: "rs-history-tx-link",
|
|
4282
|
+
title: deposit.sourceTxHash,
|
|
4283
|
+
children: [
|
|
4284
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-tx-hash", children: shortenHash(deposit.sourceTxHash) }),
|
|
4285
|
+
/* @__PURE__ */ jsx12(ExternalLinkIcon, {})
|
|
4286
|
+
]
|
|
4287
|
+
}
|
|
4288
|
+
),
|
|
4289
|
+
dstTxUrl && deposit.destinationTxHash && /* @__PURE__ */ jsxs11(
|
|
4290
|
+
"a",
|
|
4291
|
+
{
|
|
4292
|
+
href: dstTxUrl,
|
|
4293
|
+
target: "_blank",
|
|
4294
|
+
rel: "noopener noreferrer",
|
|
4295
|
+
className: "rs-history-tx-link",
|
|
4296
|
+
title: deposit.destinationTxHash,
|
|
4297
|
+
children: [
|
|
4298
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-history-tx-hash", children: shortenHash(deposit.destinationTxHash) }),
|
|
4299
|
+
/* @__PURE__ */ jsx12(ExternalLinkIcon, {})
|
|
4300
|
+
]
|
|
4301
|
+
}
|
|
4302
|
+
)
|
|
4303
|
+
] })
|
|
4304
|
+
] });
|
|
4305
|
+
}
|
|
4306
|
+
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
4307
|
+
|
|
3667
4308
|
// src/DepositModal.tsx
|
|
3668
|
-
import { jsx as
|
|
4309
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3669
4310
|
var ReownDepositInner = lazy(
|
|
3670
|
-
() => import("./DepositModalReown-
|
|
4311
|
+
() => import("./DepositModalReown-EYIV6APK.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
3671
4312
|
);
|
|
3672
4313
|
function DepositModal(props) {
|
|
3673
4314
|
const needsReown = !!props.reownAppId;
|
|
@@ -3676,7 +4317,7 @@ function DepositModal(props) {
|
|
|
3676
4317
|
"dappWalletClient"
|
|
3677
4318
|
);
|
|
3678
4319
|
if (needsReown) {
|
|
3679
|
-
return /* @__PURE__ */
|
|
4320
|
+
return /* @__PURE__ */ jsx13(Suspense, { fallback: null, children: /* @__PURE__ */ jsx13(
|
|
3680
4321
|
ReownDepositInner,
|
|
3681
4322
|
{
|
|
3682
4323
|
...props,
|
|
@@ -3684,7 +4325,7 @@ function DepositModal(props) {
|
|
|
3684
4325
|
}
|
|
3685
4326
|
) });
|
|
3686
4327
|
}
|
|
3687
|
-
return /* @__PURE__ */
|
|
4328
|
+
return /* @__PURE__ */ jsx13(
|
|
3688
4329
|
DepositModalInner,
|
|
3689
4330
|
{
|
|
3690
4331
|
...props,
|
|
@@ -3716,6 +4357,8 @@ function DepositModalInner({
|
|
|
3716
4357
|
waitForFinalTx = true,
|
|
3717
4358
|
enableSolana = true,
|
|
3718
4359
|
postBridgeActions,
|
|
4360
|
+
outputTokenRules,
|
|
4361
|
+
rejectUnmapped,
|
|
3719
4362
|
reownWallet,
|
|
3720
4363
|
onConnect,
|
|
3721
4364
|
onDisconnect,
|
|
@@ -3735,14 +4378,24 @@ function DepositModalInner({
|
|
|
3735
4378
|
onError,
|
|
3736
4379
|
debug
|
|
3737
4380
|
}) {
|
|
3738
|
-
const modalRef =
|
|
4381
|
+
const modalRef = useRef7(null);
|
|
3739
4382
|
const onReadyRef = useLatestRef(onReady);
|
|
3740
4383
|
const [currentStepIndex, setCurrentStepIndex] = useState11(0);
|
|
3741
4384
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState11(null);
|
|
3742
|
-
const backHandlerRef =
|
|
4385
|
+
const backHandlerRef = useRef7(void 0);
|
|
4386
|
+
const showHistoryButton = uiConfig?.showHistoryButton ?? false;
|
|
4387
|
+
const [activeSmartAccount, setActiveSmartAccount] = useState11(null);
|
|
4388
|
+
const [historyOpen, setHistoryOpen] = useState11(false);
|
|
4389
|
+
const [historyDeposits, setHistoryDeposits] = useState11([]);
|
|
4390
|
+
const [historyNextCursor, setHistoryNextCursor] = useState11(null);
|
|
4391
|
+
const [historyLoading, setHistoryLoading] = useState11(false);
|
|
4392
|
+
const [historyLoadingMore, setHistoryLoadingMore] = useState11(false);
|
|
4393
|
+
const [historyError, setHistoryError] = useState11(null);
|
|
4394
|
+
const historyStaleRef = useRef7(false);
|
|
4395
|
+
const historyLoadedRef = useRef7(false);
|
|
3743
4396
|
const targetChain = getChainId(targetChainProp);
|
|
3744
4397
|
const sourceChain = sourceChainProp ? getChainId(sourceChainProp) : void 0;
|
|
3745
|
-
const service =
|
|
4398
|
+
const service = useMemo7(
|
|
3746
4399
|
() => createDepositService(backendUrl, {
|
|
3747
4400
|
debug,
|
|
3748
4401
|
debugScope: "service:deposit"
|
|
@@ -3757,10 +4410,8 @@ function DepositModalInner({
|
|
|
3757
4410
|
useEffect10(() => {
|
|
3758
4411
|
configureSolanaRpcUrl(solanaRpcUrl);
|
|
3759
4412
|
}, [solanaRpcUrl]);
|
|
3760
|
-
const hasCalledReady = useRef6(false);
|
|
3761
4413
|
useEffect10(() => {
|
|
3762
|
-
if (isOpen
|
|
3763
|
-
hasCalledReady.current = true;
|
|
4414
|
+
if (isOpen) {
|
|
3764
4415
|
onReadyRef.current?.();
|
|
3765
4416
|
}
|
|
3766
4417
|
}, [isOpen, onReadyRef]);
|
|
@@ -3769,19 +4420,121 @@ function DepositModalInner({
|
|
|
3769
4420
|
setCurrentStepIndex(0);
|
|
3770
4421
|
}
|
|
3771
4422
|
}, [isOpen]);
|
|
3772
|
-
const handleStepChange =
|
|
4423
|
+
const handleStepChange = useCallback6(
|
|
3773
4424
|
(stepIndex, onBack) => {
|
|
3774
4425
|
setCurrentStepIndex(stepIndex);
|
|
3775
4426
|
backHandlerRef.current = onBack;
|
|
3776
4427
|
},
|
|
3777
4428
|
[]
|
|
3778
4429
|
);
|
|
3779
|
-
const handleTotalBalanceChange =
|
|
4430
|
+
const handleTotalBalanceChange = useCallback6((balance2) => {
|
|
3780
4431
|
setTotalBalanceUsd(balance2);
|
|
3781
4432
|
}, []);
|
|
3782
|
-
const handleBack =
|
|
4433
|
+
const handleBack = useCallback6(() => {
|
|
3783
4434
|
backHandlerRef.current?.();
|
|
3784
4435
|
}, []);
|
|
4436
|
+
const handleSmartAccountChange = useCallback6(
|
|
4437
|
+
(account) => {
|
|
4438
|
+
setActiveSmartAccount(account);
|
|
4439
|
+
if (!account) {
|
|
4440
|
+
historyStaleRef.current = true;
|
|
4441
|
+
}
|
|
4442
|
+
},
|
|
4443
|
+
[]
|
|
4444
|
+
);
|
|
4445
|
+
const fetchHistory = useCallback6(
|
|
4446
|
+
async (cursor) => {
|
|
4447
|
+
if (!activeSmartAccount) return;
|
|
4448
|
+
const isInitial = !cursor;
|
|
4449
|
+
if (isInitial) {
|
|
4450
|
+
setHistoryLoading(true);
|
|
4451
|
+
} else {
|
|
4452
|
+
setHistoryLoadingMore(true);
|
|
4453
|
+
}
|
|
4454
|
+
setHistoryError(null);
|
|
4455
|
+
try {
|
|
4456
|
+
const result = await service.fetchDepositHistory({
|
|
4457
|
+
account: activeSmartAccount,
|
|
4458
|
+
limit: 20,
|
|
4459
|
+
cursor
|
|
4460
|
+
});
|
|
4461
|
+
if (isInitial) {
|
|
4462
|
+
setHistoryDeposits(result.deposits);
|
|
4463
|
+
} else {
|
|
4464
|
+
setHistoryDeposits((prev) => [...prev, ...result.deposits]);
|
|
4465
|
+
}
|
|
4466
|
+
setHistoryNextCursor(result.nextCursor ?? null);
|
|
4467
|
+
historyStaleRef.current = false;
|
|
4468
|
+
historyLoadedRef.current = true;
|
|
4469
|
+
} catch (err) {
|
|
4470
|
+
setHistoryError(
|
|
4471
|
+
err instanceof Error ? err.message : "Failed to load history"
|
|
4472
|
+
);
|
|
4473
|
+
} finally {
|
|
4474
|
+
if (isInitial) {
|
|
4475
|
+
setHistoryLoading(false);
|
|
4476
|
+
} else {
|
|
4477
|
+
setHistoryLoadingMore(false);
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
},
|
|
4481
|
+
[activeSmartAccount, service]
|
|
4482
|
+
);
|
|
4483
|
+
const handleHistoryOpen = useCallback6(() => {
|
|
4484
|
+
setHistoryOpen(true);
|
|
4485
|
+
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
4486
|
+
fetchHistory();
|
|
4487
|
+
}
|
|
4488
|
+
}, [fetchHistory]);
|
|
4489
|
+
const handleHistoryClose = useCallback6(() => {
|
|
4490
|
+
setHistoryOpen(false);
|
|
4491
|
+
}, []);
|
|
4492
|
+
const handleHistoryLoadMore = useCallback6(() => {
|
|
4493
|
+
if (historyNextCursor) {
|
|
4494
|
+
fetchHistory(historyNextCursor);
|
|
4495
|
+
}
|
|
4496
|
+
}, [fetchHistory, historyNextCursor]);
|
|
4497
|
+
const markHistoryStale = useCallback6(() => {
|
|
4498
|
+
historyStaleRef.current = true;
|
|
4499
|
+
if (historyOpen) {
|
|
4500
|
+
fetchHistory();
|
|
4501
|
+
}
|
|
4502
|
+
}, [historyOpen, fetchHistory]);
|
|
4503
|
+
const onDepositSubmittedRef = useLatestRef(onDepositSubmitted);
|
|
4504
|
+
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
4505
|
+
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
4506
|
+
const handleDepositSubmitted = useCallback6(
|
|
4507
|
+
(data) => {
|
|
4508
|
+
onDepositSubmittedRef.current?.(data);
|
|
4509
|
+
if (showHistoryButton) markHistoryStale();
|
|
4510
|
+
},
|
|
4511
|
+
[onDepositSubmittedRef, showHistoryButton, markHistoryStale]
|
|
4512
|
+
);
|
|
4513
|
+
const handleDepositComplete = useCallback6(
|
|
4514
|
+
(data) => {
|
|
4515
|
+
onDepositCompleteRef.current?.(data);
|
|
4516
|
+
if (showHistoryButton) markHistoryStale();
|
|
4517
|
+
},
|
|
4518
|
+
[onDepositCompleteRef, showHistoryButton, markHistoryStale]
|
|
4519
|
+
);
|
|
4520
|
+
const handleDepositFailed = useCallback6(
|
|
4521
|
+
(data) => {
|
|
4522
|
+
onDepositFailedRef.current?.(data);
|
|
4523
|
+
if (showHistoryButton) markHistoryStale();
|
|
4524
|
+
},
|
|
4525
|
+
[onDepositFailedRef, showHistoryButton, markHistoryStale]
|
|
4526
|
+
);
|
|
4527
|
+
useEffect10(() => {
|
|
4528
|
+
if (!isOpen) {
|
|
4529
|
+
setHistoryOpen(false);
|
|
4530
|
+
setHistoryDeposits([]);
|
|
4531
|
+
setHistoryNextCursor(null);
|
|
4532
|
+
setHistoryError(null);
|
|
4533
|
+
setActiveSmartAccount(null);
|
|
4534
|
+
historyStaleRef.current = false;
|
|
4535
|
+
historyLoadedRef.current = false;
|
|
4536
|
+
}
|
|
4537
|
+
}, [isOpen]);
|
|
3785
4538
|
const showLogo = uiConfig?.showLogo ?? false;
|
|
3786
4539
|
const showStepper = uiConfig?.showStepper ?? false;
|
|
3787
4540
|
const showBackButton = uiConfig?.showBackButton ?? true;
|
|
@@ -3789,7 +4542,7 @@ function DepositModalInner({
|
|
|
3789
4542
|
const logoUrl = branding?.logoUrl ?? "https://github.com/rhinestonewtf.png";
|
|
3790
4543
|
const title = branding?.title ?? "Deposit";
|
|
3791
4544
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3792
|
-
return /* @__PURE__ */
|
|
4545
|
+
return /* @__PURE__ */ jsx13(
|
|
3793
4546
|
Modal,
|
|
3794
4547
|
{
|
|
3795
4548
|
isOpen,
|
|
@@ -3797,23 +4550,23 @@ function DepositModalInner({
|
|
|
3797
4550
|
className,
|
|
3798
4551
|
inline,
|
|
3799
4552
|
closeOnOverlayClick,
|
|
3800
|
-
children: /* @__PURE__ */
|
|
3801
|
-
/* @__PURE__ */
|
|
3802
|
-
/* @__PURE__ */
|
|
4553
|
+
children: /* @__PURE__ */ jsxs12("div", { ref: modalRef, className: "rs-modal", children: [
|
|
4554
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-modal-header--redesigned", children: [
|
|
4555
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ jsx13(
|
|
3803
4556
|
"button",
|
|
3804
4557
|
{
|
|
3805
4558
|
type: "button",
|
|
3806
4559
|
className: "rs-modal-header-back",
|
|
3807
4560
|
"aria-label": "Go back",
|
|
3808
4561
|
onClick: handleBack,
|
|
3809
|
-
children: /* @__PURE__ */
|
|
4562
|
+
children: /* @__PURE__ */ jsx13(
|
|
3810
4563
|
"svg",
|
|
3811
4564
|
{
|
|
3812
4565
|
viewBox: "0 0 24 24",
|
|
3813
4566
|
fill: "none",
|
|
3814
4567
|
stroke: "currentColor",
|
|
3815
4568
|
strokeWidth: "2",
|
|
3816
|
-
children: /* @__PURE__ */
|
|
4569
|
+
children: /* @__PURE__ */ jsx13(
|
|
3817
4570
|
"path",
|
|
3818
4571
|
{
|
|
3819
4572
|
strokeLinecap: "round",
|
|
@@ -3825,9 +4578,9 @@ function DepositModalInner({
|
|
|
3825
4578
|
)
|
|
3826
4579
|
}
|
|
3827
4580
|
) }),
|
|
3828
|
-
/* @__PURE__ */
|
|
3829
|
-
/* @__PURE__ */
|
|
3830
|
-
showLogo && logoUrl && /* @__PURE__ */
|
|
4581
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-modal-header-nav-center", children: [
|
|
4582
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-modal-header-title-row", children: [
|
|
4583
|
+
showLogo && logoUrl && /* @__PURE__ */ jsx13(
|
|
3831
4584
|
"img",
|
|
3832
4585
|
{
|
|
3833
4586
|
src: logoUrl,
|
|
@@ -3838,20 +4591,20 @@ function DepositModalInner({
|
|
|
3838
4591
|
}
|
|
3839
4592
|
}
|
|
3840
4593
|
),
|
|
3841
|
-
/* @__PURE__ */
|
|
3842
|
-
showStepper && currentStepIndex >= 2 && /* @__PURE__ */
|
|
3843
|
-
/* @__PURE__ */
|
|
4594
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-modal-header-title", children: title }),
|
|
4595
|
+
showStepper && currentStepIndex >= 2 && /* @__PURE__ */ jsxs12("div", { className: "rs-step-indicator", style: { marginLeft: 8 }, children: [
|
|
4596
|
+
/* @__PURE__ */ jsx13(
|
|
3844
4597
|
"div",
|
|
3845
4598
|
{
|
|
3846
4599
|
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--complete" : "rs-step-indicator-node--active"}`,
|
|
3847
|
-
children: currentStepIndex >= 4 ? /* @__PURE__ */
|
|
4600
|
+
children: currentStepIndex >= 4 ? /* @__PURE__ */ jsx13(
|
|
3848
4601
|
"svg",
|
|
3849
4602
|
{
|
|
3850
4603
|
viewBox: "0 0 24 24",
|
|
3851
4604
|
fill: "none",
|
|
3852
4605
|
stroke: "currentColor",
|
|
3853
4606
|
strokeWidth: "3",
|
|
3854
|
-
children: /* @__PURE__ */
|
|
4607
|
+
children: /* @__PURE__ */ jsx13(
|
|
3855
4608
|
"path",
|
|
3856
4609
|
{
|
|
3857
4610
|
strokeLinecap: "round",
|
|
@@ -3863,13 +4616,13 @@ function DepositModalInner({
|
|
|
3863
4616
|
) : "1"
|
|
3864
4617
|
}
|
|
3865
4618
|
),
|
|
3866
|
-
/* @__PURE__ */
|
|
4619
|
+
/* @__PURE__ */ jsx13(
|
|
3867
4620
|
"div",
|
|
3868
4621
|
{
|
|
3869
4622
|
className: `rs-step-indicator-line ${currentStepIndex >= 4 ? "rs-step-indicator-line--active" : ""}`
|
|
3870
4623
|
}
|
|
3871
4624
|
),
|
|
3872
|
-
/* @__PURE__ */
|
|
4625
|
+
/* @__PURE__ */ jsx13(
|
|
3873
4626
|
"div",
|
|
3874
4627
|
{
|
|
3875
4628
|
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--active" : "rs-step-indicator-node--inactive"}`,
|
|
@@ -3878,42 +4631,71 @@ function DepositModalInner({
|
|
|
3878
4631
|
)
|
|
3879
4632
|
] })
|
|
3880
4633
|
] }),
|
|
3881
|
-
balance && /* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */
|
|
4634
|
+
balance && /* @__PURE__ */ jsxs12("div", { className: "rs-modal-header-balance", children: [
|
|
4635
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
3883
4636
|
balance.title,
|
|
3884
4637
|
":"
|
|
3885
4638
|
] }),
|
|
3886
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-modal-header-balance-value", children: balance.amount ?? (totalBalanceUsd !== null ? currencyFormatter.format(totalBalanceUsd) : null) })
|
|
3887
4640
|
] })
|
|
3888
4641
|
] }),
|
|
3889
|
-
/* @__PURE__ */
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
"
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
4642
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-modal-header-nav-right", children: [
|
|
4643
|
+
showHistoryButton && /* @__PURE__ */ jsx13(
|
|
4644
|
+
"button",
|
|
4645
|
+
{
|
|
4646
|
+
type: "button",
|
|
4647
|
+
className: "rs-modal-header-history",
|
|
4648
|
+
"aria-label": "Deposit history",
|
|
4649
|
+
onClick: handleHistoryOpen,
|
|
4650
|
+
disabled: !activeSmartAccount,
|
|
4651
|
+
children: /* @__PURE__ */ jsx13(
|
|
4652
|
+
"svg",
|
|
4653
|
+
{
|
|
4654
|
+
viewBox: "0 0 24 24",
|
|
4655
|
+
fill: "none",
|
|
4656
|
+
stroke: "currentColor",
|
|
4657
|
+
strokeWidth: "1.75",
|
|
4658
|
+
children: /* @__PURE__ */ jsx13(
|
|
4659
|
+
"path",
|
|
4660
|
+
{
|
|
4661
|
+
strokeLinecap: "round",
|
|
4662
|
+
strokeLinejoin: "round",
|
|
4663
|
+
d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
4664
|
+
}
|
|
4665
|
+
)
|
|
4666
|
+
}
|
|
4667
|
+
)
|
|
4668
|
+
}
|
|
4669
|
+
),
|
|
4670
|
+
/* @__PURE__ */ jsx13(
|
|
4671
|
+
"button",
|
|
4672
|
+
{
|
|
4673
|
+
type: "button",
|
|
4674
|
+
onClick: onClose,
|
|
4675
|
+
className: "rs-modal-close",
|
|
4676
|
+
"aria-label": "Close",
|
|
4677
|
+
children: /* @__PURE__ */ jsx13(
|
|
4678
|
+
"svg",
|
|
4679
|
+
{
|
|
4680
|
+
viewBox: "0 0 24 24",
|
|
4681
|
+
fill: "none",
|
|
4682
|
+
stroke: "currentColor",
|
|
4683
|
+
strokeWidth: "2",
|
|
4684
|
+
children: /* @__PURE__ */ jsx13(
|
|
4685
|
+
"path",
|
|
4686
|
+
{
|
|
4687
|
+
strokeLinecap: "round",
|
|
4688
|
+
strokeLinejoin: "round",
|
|
4689
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
4690
|
+
}
|
|
4691
|
+
)
|
|
4692
|
+
}
|
|
4693
|
+
)
|
|
4694
|
+
}
|
|
4695
|
+
)
|
|
4696
|
+
] })
|
|
3915
4697
|
] }),
|
|
3916
|
-
/* @__PURE__ */
|
|
4698
|
+
/* @__PURE__ */ jsx13(
|
|
3917
4699
|
DepositFlow,
|
|
3918
4700
|
{
|
|
3919
4701
|
dappWalletClient,
|
|
@@ -3928,6 +4710,8 @@ function DepositModalInner({
|
|
|
3928
4710
|
amount: defaultAmount,
|
|
3929
4711
|
recipient,
|
|
3930
4712
|
postBridgeActions,
|
|
4713
|
+
outputTokenRules,
|
|
4714
|
+
rejectUnmapped,
|
|
3931
4715
|
signerAddress,
|
|
3932
4716
|
sessionChainIds,
|
|
3933
4717
|
forceRegister,
|
|
@@ -3942,15 +4726,28 @@ function DepositModalInner({
|
|
|
3942
4726
|
allowedRoutes,
|
|
3943
4727
|
onStepChange: handleStepChange,
|
|
3944
4728
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
4729
|
+
onSmartAccountChange: showHistoryButton ? handleSmartAccountChange : void 0,
|
|
3945
4730
|
onClose,
|
|
3946
4731
|
onConnected,
|
|
3947
|
-
onDepositSubmitted,
|
|
3948
|
-
onDepositComplete,
|
|
3949
|
-
onDepositFailed,
|
|
4732
|
+
onDepositSubmitted: showHistoryButton ? handleDepositSubmitted : onDepositSubmitted,
|
|
4733
|
+
onDepositComplete: showHistoryButton ? handleDepositComplete : onDepositComplete,
|
|
4734
|
+
onDepositFailed: showHistoryButton ? handleDepositFailed : onDepositFailed,
|
|
3950
4735
|
onEvent,
|
|
3951
4736
|
onError,
|
|
3952
4737
|
debug
|
|
3953
4738
|
}
|
|
4739
|
+
),
|
|
4740
|
+
showHistoryButton && historyOpen && /* @__PURE__ */ jsx13(
|
|
4741
|
+
DepositHistoryPanel,
|
|
4742
|
+
{
|
|
4743
|
+
deposits: historyDeposits,
|
|
4744
|
+
isLoading: historyLoading,
|
|
4745
|
+
error: historyError,
|
|
4746
|
+
hasMore: Boolean(historyNextCursor),
|
|
4747
|
+
isLoadingMore: historyLoadingMore,
|
|
4748
|
+
onLoadMore: handleHistoryLoadMore,
|
|
4749
|
+
onClose: handleHistoryClose
|
|
4750
|
+
}
|
|
3954
4751
|
)
|
|
3955
4752
|
] })
|
|
3956
4753
|
}
|