@rhinestone/deposit-modal 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-G7UX4IBZ.mjs → DepositModalReown-EXI7MW65.mjs} +6 -6
- package/dist/{DepositModalReown-MECHBE6P.cjs → DepositModalReown-FMAPWBQM.cjs} +9 -9
- package/dist/{WithdrawModalReown-WJ6VBZKK.cjs → WithdrawModalReown-CTT3EXMG.cjs} +8 -8
- package/dist/{WithdrawModalReown-CUJAFUQM.mjs → WithdrawModalReown-G7EM6HXO.mjs} +5 -5
- package/dist/{chunk-DZQD3DAV.mjs → chunk-3GLQC2KQ.mjs} +86 -18
- package/dist/{chunk-R5WDHHVM.mjs → chunk-43RTPRQY.mjs} +14 -4
- package/dist/{chunk-3C35DVPE.mjs → chunk-A33QFRKD.mjs} +985 -428
- package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
- package/dist/{chunk-SPUZLWQS.cjs → chunk-BTDRUAPJ.cjs} +514 -543
- package/dist/{chunk-TQ2AYMWS.mjs → chunk-F7P4MV72.mjs} +1 -1
- package/dist/{chunk-BAEB5AFZ.mjs → chunk-FJWLC4AM.mjs} +1 -1
- package/dist/{chunk-LEL6GMEQ.cjs → chunk-JHT2MJ42.cjs} +175 -107
- package/dist/{chunk-MQIJZNTP.cjs → chunk-LJJCPDZO.cjs} +844 -287
- package/dist/{chunk-R5CPOBCF.cjs → chunk-NRNJAQUA.cjs} +4 -4
- package/dist/{chunk-QYSCCX4K.mjs → chunk-RTAIW3WW.mjs} +452 -481
- package/dist/{chunk-AJHFNHG3.cjs → chunk-UEKPBRBY.cjs} +3 -3
- package/dist/{chunk-ULEAK63T.cjs → chunk-ULCCXH2A.cjs} +16 -6
- package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +276 -27
- package/dist/{types-RzfAD14B.d.ts → types-CFRuisqK.d.cts} +1 -1
- package/dist/{types-RzfAD14B.d.cts → types-CFRuisqK.d.ts} +1 -1
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
executePolymarketSafeTransfer,
|
|
8
8
|
fetchPolymarketProxyWallet,
|
|
9
9
|
readPolymarketBalances
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FJWLC4AM.mjs";
|
|
11
11
|
import {
|
|
12
12
|
AlertTriangleIcon,
|
|
13
13
|
ArrowUpRightIcon,
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
Spinner,
|
|
35
35
|
Tooltip,
|
|
36
36
|
TransferCryptoIcon,
|
|
37
|
+
UnplugIcon,
|
|
37
38
|
WalletIcon,
|
|
38
39
|
accountFromPrivateKey,
|
|
39
40
|
applyTheme,
|
|
@@ -44,10 +45,13 @@ import {
|
|
|
44
45
|
debugError,
|
|
45
46
|
debugLog,
|
|
46
47
|
failureMessageForEvent,
|
|
48
|
+
formatReceiveEstimate,
|
|
49
|
+
formatTokenAmount,
|
|
47
50
|
formatUserError,
|
|
48
51
|
getAssetId,
|
|
49
52
|
getEventSourceDetails,
|
|
50
53
|
getEventTxHash,
|
|
54
|
+
getExchangeLogo,
|
|
51
55
|
getHyperEvmReadClient,
|
|
52
56
|
getPublicClient,
|
|
53
57
|
isDepositEvent,
|
|
@@ -59,10 +63,10 @@ import {
|
|
|
59
63
|
tokenFormatter,
|
|
60
64
|
txRefsMatch,
|
|
61
65
|
useLatestRef
|
|
62
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-A33QFRKD.mjs";
|
|
63
67
|
import {
|
|
64
68
|
SAFE_ABI
|
|
65
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-F7P4MV72.mjs";
|
|
66
70
|
import {
|
|
67
71
|
DEFAULT_BACKEND_URL,
|
|
68
72
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -92,7 +96,7 @@ import {
|
|
|
92
96
|
isVirtualDestination,
|
|
93
97
|
parseEvmChainId,
|
|
94
98
|
targetChainToCaip2
|
|
95
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-WJX3TJFK.mjs";
|
|
96
100
|
|
|
97
101
|
// src/DepositModal.tsx
|
|
98
102
|
import {
|
|
@@ -875,25 +879,21 @@ function ConfirmStep({
|
|
|
875
879
|
const targetChainIcon = getChainIcon(targetChain);
|
|
876
880
|
const sourceTokenIcon = getTokenIcon(asset.symbol);
|
|
877
881
|
const targetTokenIcon = getTokenIcon(targetSymbol);
|
|
878
|
-
const formattedSendAmount = amount &&
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
return formattedSendAmount;
|
|
882
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? formatTokenAmount(Number(amount), asset.symbol) ?? "0" : "0";
|
|
883
|
+
const receiveDisplay = (() => {
|
|
884
|
+
if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
|
|
885
|
+
const usdValue = Number(targetAmount);
|
|
886
|
+
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
887
|
+
const estimate = formatReceiveEstimate({
|
|
888
|
+
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
889
|
+
sourceSymbol: asset.symbol,
|
|
890
|
+
targetSymbol,
|
|
891
|
+
sourceAmountUsd,
|
|
892
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
|
|
893
|
+
});
|
|
894
|
+
if (estimate !== void 0) return estimate;
|
|
895
|
+
return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedSendAmount} ${asset.symbol}`;
|
|
895
896
|
})();
|
|
896
|
-
const receiveAmount = sameRoute ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
897
897
|
const feeSponsored = uiConfig?.feeSponsored ?? false;
|
|
898
898
|
const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
|
|
899
899
|
const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
|
|
@@ -1047,11 +1047,7 @@ function ConfirmStep({
|
|
|
1047
1047
|
/* @__PURE__ */ jsxs4("div", { className: "rs-review-detail-row", children: [
|
|
1048
1048
|
/* @__PURE__ */ jsx4("span", { children: "Receive" }),
|
|
1049
1049
|
/* @__PURE__ */ jsxs4("span", { className: "rs-review-detail-value", children: [
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
receiveAmount,
|
|
1052
|
-
" ",
|
|
1053
|
-
targetSymbol
|
|
1054
|
-
] }),
|
|
1050
|
+
/* @__PURE__ */ jsx4("span", { children: receiveDisplay }),
|
|
1055
1051
|
targetTokenIcon && /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4("img", { src: targetTokenIcon, alt: "" }) })
|
|
1056
1052
|
] })
|
|
1057
1053
|
] }),
|
|
@@ -2053,12 +2049,28 @@ import { useCallback as useCallback3 } from "react";
|
|
|
2053
2049
|
// src/components/steps/SwappedIframeStep.tsx
|
|
2054
2050
|
import { useState as useState6, useEffect as useEffect6, useRef as useRef6, useMemo as useMemo4 } from "react";
|
|
2055
2051
|
|
|
2056
|
-
// src/components/steps/
|
|
2052
|
+
// src/components/steps/FinalisingDepositStep.tsx
|
|
2057
2053
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2054
|
+
function FinalisingDepositStep() {
|
|
2055
|
+
return /* @__PURE__ */ jsxs7("div", { className: "rs-screen rs-finalising", children: [
|
|
2056
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-screen-body rs-finalising-body", children: [
|
|
2057
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-finalising-spinner", children: /* @__PURE__ */ jsx7(Spinner, {}) }),
|
|
2058
|
+
/* @__PURE__ */ jsxs7("div", { className: "rs-finalising-text", children: [
|
|
2059
|
+
/* @__PURE__ */ jsx7("h2", { className: "rs-finalising-title", children: "Finalising deposit" }),
|
|
2060
|
+
/* @__PURE__ */ jsx7("p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2061
|
+
] })
|
|
2062
|
+
] }),
|
|
2063
|
+
/* @__PURE__ */ jsx7(PoweredBy, {})
|
|
2064
|
+
] });
|
|
2065
|
+
}
|
|
2066
|
+
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
2067
|
+
|
|
2068
|
+
// src/components/steps/SwappedOrderTracker.tsx
|
|
2069
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2058
2070
|
var STEP_LABELS = [
|
|
2059
2071
|
"Payment received",
|
|
2060
2072
|
null,
|
|
2061
|
-
"Processing
|
|
2073
|
+
"Processing deposit",
|
|
2062
2074
|
"Deposit successful"
|
|
2063
2075
|
];
|
|
2064
2076
|
function SwappedOrderTracker({
|
|
@@ -2077,23 +2089,23 @@ function SwappedOrderTracker({
|
|
|
2077
2089
|
STEP_LABELS[2],
|
|
2078
2090
|
STEP_LABELS[3]
|
|
2079
2091
|
];
|
|
2080
|
-
return /* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ jsxs8("div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2093
|
+
/* @__PURE__ */ jsxs8("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2094
|
+
/* @__PURE__ */ jsx8(BodyHeader, { icon: /* @__PURE__ */ jsx8(HandCoinsIcon, {}), title }),
|
|
2095
|
+
/* @__PURE__ */ jsx8("ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2084
2096
|
const status = stepStates[idx];
|
|
2085
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ jsxs8(
|
|
2086
2098
|
"li",
|
|
2087
2099
|
{
|
|
2088
2100
|
className: `rs-swapped-tracker-step rs-swapped-tracker-step--${status}`,
|
|
2089
2101
|
children: [
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx8("span", { className: "rs-swapped-tracker-step-label", children: label }),
|
|
2103
|
+
/* @__PURE__ */ jsx8(
|
|
2092
2104
|
"span",
|
|
2093
2105
|
{
|
|
2094
2106
|
className: "rs-swapped-tracker-step-marker",
|
|
2095
2107
|
"aria-hidden": "true",
|
|
2096
|
-
children: status === "complete" ? /* @__PURE__ */
|
|
2108
|
+
children: status === "complete" ? /* @__PURE__ */ jsx8(CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ jsx8(CloseIcon, {}) : status === "active" ? /* @__PURE__ */ jsx8(Spinner, {}) : null
|
|
2097
2109
|
}
|
|
2098
2110
|
)
|
|
2099
2111
|
]
|
|
@@ -2101,13 +2113,13 @@ function SwappedOrderTracker({
|
|
|
2101
2113
|
label
|
|
2102
2114
|
);
|
|
2103
2115
|
}) }),
|
|
2104
|
-
terminal && /* @__PURE__ */
|
|
2116
|
+
terminal && /* @__PURE__ */ jsxs8(
|
|
2105
2117
|
"div",
|
|
2106
2118
|
{
|
|
2107
2119
|
className: `rs-swapped-tracker-terminal rs-swapped-tracker-terminal--${terminal.kind}`,
|
|
2108
2120
|
children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
terminal.kind === "cancelled" && onRetry && /* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ jsx8("p", { className: "rs-swapped-tracker-terminal-message", children: terminal.message }),
|
|
2122
|
+
terminal.kind === "cancelled" && onRetry && /* @__PURE__ */ jsx8(
|
|
2111
2123
|
"button",
|
|
2112
2124
|
{
|
|
2113
2125
|
type: "button",
|
|
@@ -2120,7 +2132,7 @@ function SwappedOrderTracker({
|
|
|
2120
2132
|
}
|
|
2121
2133
|
)
|
|
2122
2134
|
] }),
|
|
2123
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsx8(PoweredBy, {})
|
|
2124
2136
|
] });
|
|
2125
2137
|
}
|
|
2126
2138
|
function formatTrackerAmount(amount) {
|
|
@@ -2132,7 +2144,7 @@ function formatTrackerAmount(amount) {
|
|
|
2132
2144
|
SwappedOrderTracker.displayName = "SwappedOrderTracker";
|
|
2133
2145
|
|
|
2134
2146
|
// src/components/steps/SwappedIframeStep.tsx
|
|
2135
|
-
import { jsx as
|
|
2147
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2136
2148
|
var STATUS_POLL_INTERVAL_MS = 2e3;
|
|
2137
2149
|
var DEPOSIT_POLL_INTERVAL_MS = 2e3;
|
|
2138
2150
|
var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
|
|
@@ -2389,7 +2401,11 @@ function SwappedIframeStep({
|
|
|
2389
2401
|
);
|
|
2390
2402
|
}, [latestEvent]);
|
|
2391
2403
|
if (phase === "tracker") {
|
|
2392
|
-
|
|
2404
|
+
const paymentReceived = stepStates[0] === "complete";
|
|
2405
|
+
if (variant === "connect" && !terminalState && paymentReceived) {
|
|
2406
|
+
return /* @__PURE__ */ jsx9(FinalisingDepositStep, {});
|
|
2407
|
+
}
|
|
2408
|
+
return /* @__PURE__ */ jsx9(
|
|
2393
2409
|
SwappedOrderTracker,
|
|
2394
2410
|
{
|
|
2395
2411
|
amount: orderState?.orderCryptoAmount ?? null,
|
|
@@ -2401,45 +2417,35 @@ function SwappedIframeStep({
|
|
|
2401
2417
|
}
|
|
2402
2418
|
);
|
|
2403
2419
|
}
|
|
2404
|
-
return /* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
title: "Deposit",
|
|
2411
|
-
subtitle: "Add money to your balance"
|
|
2412
|
-
}
|
|
2413
|
-
),
|
|
2414
|
-
/* @__PURE__ */ jsxs8("div", { className: "rs-fiat-onramp-iframe-wrap", children: [
|
|
2415
|
-
loadError && /* @__PURE__ */ jsxs8("div", { className: "rs-fiat-onramp-error", children: [
|
|
2416
|
-
/* @__PURE__ */ jsx8("div", { children: loadError }),
|
|
2417
|
-
/* @__PURE__ */ jsx8(
|
|
2418
|
-
"button",
|
|
2419
|
-
{
|
|
2420
|
-
type: "button",
|
|
2421
|
-
className: "rs-fiat-onramp-retry",
|
|
2422
|
-
onClick: () => setRetryToken((n) => n + 1),
|
|
2423
|
-
children: "Retry"
|
|
2424
|
-
}
|
|
2425
|
-
)
|
|
2426
|
-
] }),
|
|
2427
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ jsx8("div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ jsx8(Spinner, {}) }),
|
|
2428
|
-
widgetUrl && !loadError && /* @__PURE__ */ jsx8(
|
|
2429
|
-
"iframe",
|
|
2420
|
+
return /* @__PURE__ */ jsxs9("div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
2421
|
+
/* @__PURE__ */ jsx9("div", { className: "rs-screen-body rs-fiat-onramp-body", children: /* @__PURE__ */ jsxs9("div", { className: "rs-fiat-onramp-iframe-wrap", children: [
|
|
2422
|
+
loadError && /* @__PURE__ */ jsxs9("div", { className: "rs-fiat-onramp-error", children: [
|
|
2423
|
+
/* @__PURE__ */ jsx9("div", { children: loadError }),
|
|
2424
|
+
/* @__PURE__ */ jsx9(
|
|
2425
|
+
"button",
|
|
2430
2426
|
{
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
onLoad: () => setIframeLoaded(true)
|
|
2437
|
-
},
|
|
2438
|
-
retryToken
|
|
2427
|
+
type: "button",
|
|
2428
|
+
className: "rs-fiat-onramp-retry",
|
|
2429
|
+
onClick: () => setRetryToken((n) => n + 1),
|
|
2430
|
+
children: "Retry"
|
|
2431
|
+
}
|
|
2439
2432
|
)
|
|
2440
|
-
] })
|
|
2441
|
-
|
|
2442
|
-
|
|
2433
|
+
] }),
|
|
2434
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ jsx9("div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ jsx9(Spinner, {}) }),
|
|
2435
|
+
widgetUrl && !loadError && /* @__PURE__ */ jsx9(
|
|
2436
|
+
"iframe",
|
|
2437
|
+
{
|
|
2438
|
+
src: widgetUrl,
|
|
2439
|
+
title: iframeTitle,
|
|
2440
|
+
className: "rs-fiat-onramp-iframe",
|
|
2441
|
+
sandbox: "allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",
|
|
2442
|
+
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
2443
|
+
onLoad: () => setIframeLoaded(true)
|
|
2444
|
+
},
|
|
2445
|
+
retryToken
|
|
2446
|
+
)
|
|
2447
|
+
] }) }),
|
|
2448
|
+
/* @__PURE__ */ jsx9(PoweredBy, {})
|
|
2443
2449
|
] });
|
|
2444
2450
|
}
|
|
2445
2451
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
@@ -2466,7 +2472,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
2466
2472
|
SwappedIframeStep.displayName = "SwappedIframeStep";
|
|
2467
2473
|
|
|
2468
2474
|
// src/components/steps/FiatOnrampStep.tsx
|
|
2469
|
-
import { jsx as
|
|
2475
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2470
2476
|
function fiatBannerForStatus(status, context) {
|
|
2471
2477
|
if (context.currencyMismatch) {
|
|
2472
2478
|
return {
|
|
@@ -2507,14 +2513,9 @@ function FiatOnrampStep({
|
|
|
2507
2513
|
smartAccount,
|
|
2508
2514
|
method: paymentMethod
|
|
2509
2515
|
});
|
|
2510
|
-
if (res.currencyCode !== "USDC_BASE") {
|
|
2511
|
-
console.warn(
|
|
2512
|
-
`[FiatOnrampStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped purchases may not bridge as expected.`
|
|
2513
|
-
);
|
|
2514
|
-
}
|
|
2515
2516
|
return res;
|
|
2516
2517
|
}, [service, smartAccount, paymentMethod]);
|
|
2517
|
-
return /* @__PURE__ */
|
|
2518
|
+
return /* @__PURE__ */ jsx10(
|
|
2518
2519
|
SwappedIframeStep,
|
|
2519
2520
|
{
|
|
2520
2521
|
smartAccount,
|
|
@@ -2536,7 +2537,7 @@ FiatOnrampStep.displayName = "FiatOnrampStep";
|
|
|
2536
2537
|
|
|
2537
2538
|
// src/components/steps/ExchangeConnectStep.tsx
|
|
2538
2539
|
import { useCallback as useCallback4 } from "react";
|
|
2539
|
-
import { jsx as
|
|
2540
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2540
2541
|
function connectBannerForStatus(status, context) {
|
|
2541
2542
|
if (context.currencyMismatch) {
|
|
2542
2543
|
return {
|
|
@@ -2580,14 +2581,9 @@ function ExchangeConnectStep({
|
|
|
2580
2581
|
smartAccount,
|
|
2581
2582
|
connection
|
|
2582
2583
|
});
|
|
2583
|
-
if (res.currencyCode !== "USDC_BASE") {
|
|
2584
|
-
console.warn(
|
|
2585
|
-
`[ExchangeConnectStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped Connect pulls may not bridge as expected.`
|
|
2586
|
-
);
|
|
2587
|
-
}
|
|
2588
2584
|
return res;
|
|
2589
2585
|
}, [service, smartAccount, connection]);
|
|
2590
|
-
return /* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ jsx11(
|
|
2591
2587
|
SwappedIframeStep,
|
|
2592
2588
|
{
|
|
2593
2589
|
smartAccount,
|
|
@@ -2609,13 +2605,13 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2609
2605
|
|
|
2610
2606
|
// src/components/steps/ExchangeSelectStep.tsx
|
|
2611
2607
|
import { useCallback as useCallback5, useEffect as useEffect7, useState as useState7 } from "react";
|
|
2612
|
-
import { jsx as
|
|
2608
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2613
2609
|
function ExchangeLogo({ exchange }) {
|
|
2614
2610
|
const [failed, setFailed] = useState7(false);
|
|
2615
2611
|
if (!exchange.logoUrl || failed) {
|
|
2616
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsx12(BankIcon, {});
|
|
2617
2613
|
}
|
|
2618
|
-
return /* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ jsx12(
|
|
2619
2615
|
"img",
|
|
2620
2616
|
{
|
|
2621
2617
|
src: exchange.logoUrl,
|
|
@@ -2656,20 +2652,20 @@ function ExchangeSelectStep({
|
|
|
2656
2652
|
cancelled = true;
|
|
2657
2653
|
};
|
|
2658
2654
|
}, [service, retryToken, onError]);
|
|
2659
|
-
return /* @__PURE__ */
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2655
|
+
return /* @__PURE__ */ jsxs10("div", { className: "rs-screen rs-exchange-select", children: [
|
|
2656
|
+
/* @__PURE__ */ jsxs10("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2657
|
+
/* @__PURE__ */ jsx12(
|
|
2662
2658
|
BodyHeader,
|
|
2663
2659
|
{
|
|
2664
|
-
icon: /* @__PURE__ */
|
|
2665
|
-
title: "
|
|
2666
|
-
subtitle: "
|
|
2660
|
+
icon: /* @__PURE__ */ jsx12(UnplugIcon, {}),
|
|
2661
|
+
title: "Connect exchange",
|
|
2662
|
+
subtitle: "Select an exchange to connect"
|
|
2667
2663
|
}
|
|
2668
2664
|
),
|
|
2669
|
-
loading && /* @__PURE__ */
|
|
2670
|
-
!loading && error && /* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2665
|
+
loading && /* @__PURE__ */ jsx12("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ jsx12(Spinner, {}) }),
|
|
2666
|
+
!loading && error && /* @__PURE__ */ jsxs10("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2667
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2668
|
+
/* @__PURE__ */ jsx12(
|
|
2673
2669
|
"button",
|
|
2674
2670
|
{
|
|
2675
2671
|
type: "button",
|
|
@@ -2679,9 +2675,9 @@ function ExchangeSelectStep({
|
|
|
2679
2675
|
}
|
|
2680
2676
|
)
|
|
2681
2677
|
] }),
|
|
2682
|
-
!loading && !error && exchanges.length === 0 && /* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */
|
|
2684
|
-
/* @__PURE__ */
|
|
2678
|
+
!loading && !error && exchanges.length === 0 && /* @__PURE__ */ jsxs10("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2679
|
+
/* @__PURE__ */ jsx12("div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
|
|
2680
|
+
/* @__PURE__ */ jsx12(
|
|
2685
2681
|
"button",
|
|
2686
2682
|
{
|
|
2687
2683
|
type: "button",
|
|
@@ -2691,28 +2687,37 @@ function ExchangeSelectStep({
|
|
|
2691
2687
|
}
|
|
2692
2688
|
)
|
|
2693
2689
|
] }),
|
|
2694
|
-
!loading && !error && exchanges.length > 0 && /* @__PURE__ */
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2690
|
+
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ jsx12("div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
2691
|
+
const brand = getExchangeLogo(exchange.name, exchange.connection);
|
|
2692
|
+
return /* @__PURE__ */ jsxs10(
|
|
2693
|
+
"button",
|
|
2694
|
+
{
|
|
2695
|
+
type: "button",
|
|
2696
|
+
className: "rs-exchange-card",
|
|
2697
|
+
onClick: () => onSelectExchange(exchange.connection),
|
|
2698
|
+
"aria-label": `Select ${exchange.name}`,
|
|
2699
|
+
children: [
|
|
2700
|
+
/* @__PURE__ */ jsx12(
|
|
2701
|
+
"span",
|
|
2702
|
+
{
|
|
2703
|
+
className: `rs-exchange-card-logo${brand ? " rs-exchange-card-logo--brand" : ""}`,
|
|
2704
|
+
children: brand ?? /* @__PURE__ */ jsx12(ExchangeLogo, { exchange })
|
|
2705
|
+
}
|
|
2706
|
+
),
|
|
2707
|
+
/* @__PURE__ */ jsx12("span", { className: "rs-exchange-card-name", children: exchange.name })
|
|
2708
|
+
]
|
|
2709
|
+
},
|
|
2710
|
+
exchange.connection
|
|
2711
|
+
);
|
|
2712
|
+
}) })
|
|
2708
2713
|
] }),
|
|
2709
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx12(PoweredBy, {})
|
|
2710
2715
|
] });
|
|
2711
2716
|
}
|
|
2712
2717
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
2713
2718
|
|
|
2714
2719
|
// src/components/steps/DepositAddressSkeleton.tsx
|
|
2715
|
-
import { jsx as
|
|
2720
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2716
2721
|
var BASE_CHAIN_ID = 8453;
|
|
2717
2722
|
function DepositAddressSkeleton({
|
|
2718
2723
|
uiConfig,
|
|
@@ -2733,15 +2738,15 @@ function DepositAddressSkeleton({
|
|
|
2733
2738
|
const chainName = getChainName(defaultChainId);
|
|
2734
2739
|
const chainIcon = getChainIcon(defaultChainId);
|
|
2735
2740
|
const tokenIcon = getTokenIcon(defaultToken);
|
|
2736
|
-
return /* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
chainIcon && /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2742
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2743
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-screen-body", children: [
|
|
2744
|
+
/* @__PURE__ */ jsx13(BodyHeader, { icon: /* @__PURE__ */ jsx13(TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2745
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2746
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown", children: [
|
|
2747
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2748
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2749
|
+
chainIcon && /* @__PURE__ */ jsx13(
|
|
2745
2750
|
"img",
|
|
2746
2751
|
{
|
|
2747
2752
|
src: chainIcon,
|
|
@@ -2749,17 +2754,17 @@ function DepositAddressSkeleton({
|
|
|
2749
2754
|
className: "rs-deposit-address-dropdown-icon"
|
|
2750
2755
|
}
|
|
2751
2756
|
),
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsx13("span", { children: chainName }),
|
|
2758
|
+
/* @__PURE__ */ jsx13(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2754
2759
|
] })
|
|
2755
2760
|
] }),
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown", children: [
|
|
2762
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
2763
|
+
/* @__PURE__ */ jsx13("span", { children: "Supported token" }),
|
|
2764
|
+
/* @__PURE__ */ jsxs11("span", { className: "rs-deposit-address-min", children: [
|
|
2760
2765
|
"Min.$",
|
|
2761
2766
|
(uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
|
|
2762
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx13(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx13(
|
|
2763
2768
|
InfoIcon,
|
|
2764
2769
|
{
|
|
2765
2770
|
className: "rs-deposit-address-min-icon",
|
|
@@ -2768,8 +2773,8 @@ function DepositAddressSkeleton({
|
|
|
2768
2773
|
) })
|
|
2769
2774
|
] })
|
|
2770
2775
|
] }),
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
tokenIcon && /* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2777
|
+
tokenIcon && /* @__PURE__ */ jsx13(
|
|
2773
2778
|
"img",
|
|
2774
2779
|
{
|
|
2775
2780
|
src: tokenIcon,
|
|
@@ -2777,21 +2782,21 @@ function DepositAddressSkeleton({
|
|
|
2777
2782
|
className: "rs-deposit-address-dropdown-icon"
|
|
2778
2783
|
}
|
|
2779
2784
|
),
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2785
|
+
/* @__PURE__ */ jsx13("span", { children: defaultToken }),
|
|
2786
|
+
/* @__PURE__ */ jsx13(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2782
2787
|
] })
|
|
2783
2788
|
] })
|
|
2784
2789
|
] }),
|
|
2785
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ jsxs11(
|
|
2786
2791
|
"div",
|
|
2787
2792
|
{
|
|
2788
2793
|
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
2789
2794
|
children: [
|
|
2790
|
-
/* @__PURE__ */
|
|
2791
|
-
/* @__PURE__ */
|
|
2792
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-well", children: [
|
|
2796
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ jsx13("div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
|
|
2797
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
|
|
2793
2798
|
] }),
|
|
2794
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsxs11(
|
|
2795
2800
|
"button",
|
|
2796
2801
|
{
|
|
2797
2802
|
type: "button",
|
|
@@ -2799,7 +2804,7 @@ function DepositAddressSkeleton({
|
|
|
2799
2804
|
disabled: true,
|
|
2800
2805
|
"aria-hidden": "true",
|
|
2801
2806
|
children: [
|
|
2802
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsx13(CopyIcon, {}),
|
|
2803
2808
|
"Copy address"
|
|
2804
2809
|
]
|
|
2805
2810
|
}
|
|
@@ -2807,20 +2812,20 @@ function DepositAddressSkeleton({
|
|
|
2807
2812
|
]
|
|
2808
2813
|
}
|
|
2809
2814
|
),
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ jsx13("div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ jsxs11("div", { className: "rs-price-impact-header", children: [
|
|
2816
|
+
/* @__PURE__ */ jsxs11("span", { className: "rs-price-impact-header-left", children: [
|
|
2817
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2818
|
+
/* @__PURE__ */ jsx13("span", { className: "rs-price-impact-label", children: /* @__PURE__ */ jsx13("strong", { children: "0.00%" }) }),
|
|
2819
|
+
/* @__PURE__ */ jsx13(
|
|
2815
2820
|
Tooltip,
|
|
2816
2821
|
{
|
|
2817
2822
|
className: "rs-price-impact-info",
|
|
2818
2823
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2819
|
-
children: /* @__PURE__ */
|
|
2824
|
+
children: /* @__PURE__ */ jsx13(InfoIcon, { "aria-hidden": "true" })
|
|
2820
2825
|
}
|
|
2821
2826
|
)
|
|
2822
2827
|
] }),
|
|
2823
|
-
/* @__PURE__ */
|
|
2828
|
+
/* @__PURE__ */ jsx13(
|
|
2824
2829
|
ChevronDownIcon,
|
|
2825
2830
|
{
|
|
2826
2831
|
className: "rs-price-impact-chevron",
|
|
@@ -2829,7 +2834,7 @@ function DepositAddressSkeleton({
|
|
|
2829
2834
|
)
|
|
2830
2835
|
] }) })
|
|
2831
2836
|
] }),
|
|
2832
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ jsx13(PoweredBy, {})
|
|
2833
2838
|
] });
|
|
2834
2839
|
}
|
|
2835
2840
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2837,7 +2842,7 @@ DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
|
2837
2842
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
2838
2843
|
import { useState as useState8, useEffect as useEffect8, useMemo as useMemo5 } from "react";
|
|
2839
2844
|
import { formatUnits as formatUnits4 } from "viem";
|
|
2840
|
-
import { jsx as
|
|
2845
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2841
2846
|
function SolanaTokenSelectStep({
|
|
2842
2847
|
solanaAddress,
|
|
2843
2848
|
service,
|
|
@@ -2943,30 +2948,30 @@ function SolanaTokenSelectStep({
|
|
|
2943
2948
|
};
|
|
2944
2949
|
const chainIcon = getChainIcon("solana");
|
|
2945
2950
|
const chainName = getChainName("solana");
|
|
2946
|
-
return /* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
2951
|
+
return /* @__PURE__ */ jsxs12("div", { className: "rs-screen", children: [
|
|
2952
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-screen-body", children: [
|
|
2953
|
+
/* @__PURE__ */ jsx14(
|
|
2949
2954
|
BodyHeader,
|
|
2950
2955
|
{
|
|
2951
|
-
icon: /* @__PURE__ */
|
|
2956
|
+
icon: /* @__PURE__ */ jsx14(WalletIcon, {}),
|
|
2952
2957
|
title: "Your assets",
|
|
2953
2958
|
subtitle: "Select source assets to transfer"
|
|
2954
2959
|
}
|
|
2955
2960
|
),
|
|
2956
|
-
loading && /* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2961
|
+
loading && /* @__PURE__ */ jsxs12("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2962
|
+
/* @__PURE__ */ jsx14(Spinner, { className: "rs-text-tertiary" }),
|
|
2963
|
+
/* @__PURE__ */ jsx14("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2959
2964
|
] }),
|
|
2960
|
-
error && /* @__PURE__ */
|
|
2961
|
-
!loading && !error && rows.length === 0 && /* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
+
error && /* @__PURE__ */ jsx14(Callout, { variant: "error", children: error }),
|
|
2966
|
+
!loading && !error && rows.length === 0 && /* @__PURE__ */ jsxs12("div", { className: "rs-empty-state", children: [
|
|
2967
|
+
/* @__PURE__ */ jsx14(WalletIcon, { className: "rs-empty-icon" }),
|
|
2968
|
+
/* @__PURE__ */ jsx14("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2969
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-empty-address", children: [
|
|
2965
2970
|
solanaAddress.slice(0, 6),
|
|
2966
2971
|
"...",
|
|
2967
2972
|
solanaAddress.slice(-4)
|
|
2968
2973
|
] }),
|
|
2969
|
-
onDisconnect && /* @__PURE__ */
|
|
2974
|
+
onDisconnect && /* @__PURE__ */ jsx14(
|
|
2970
2975
|
"button",
|
|
2971
2976
|
{
|
|
2972
2977
|
type: "button",
|
|
@@ -2976,11 +2981,11 @@ function SolanaTokenSelectStep({
|
|
|
2976
2981
|
}
|
|
2977
2982
|
)
|
|
2978
2983
|
] }),
|
|
2979
|
-
!loading && !error && rows.length > 0 && /* @__PURE__ */
|
|
2984
|
+
!loading && !error && rows.length > 0 && /* @__PURE__ */ jsx14("div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2980
2985
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2981
2986
|
const tokenAmount = formatBalance(entry);
|
|
2982
2987
|
const tokenIcon = getTokenIcon(entry.token.symbol);
|
|
2983
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsxs12(
|
|
2984
2989
|
"button",
|
|
2985
2990
|
{
|
|
2986
2991
|
type: "button",
|
|
@@ -2988,33 +2993,33 @@ function SolanaTokenSelectStep({
|
|
|
2988
2993
|
className: `rs-asset-row ${isSelected ? "rs-asset-row--selected" : ""}`,
|
|
2989
2994
|
"aria-pressed": isSelected,
|
|
2990
2995
|
children: [
|
|
2991
|
-
/* @__PURE__ */
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
tokenIcon ? /* @__PURE__ */
|
|
2994
|
-
chainIcon && /* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-asset-info", children: [
|
|
2997
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-asset-icon-wrapper", children: [
|
|
2998
|
+
tokenIcon ? /* @__PURE__ */ jsx14("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx14("img", { src: tokenIcon, alt: entry.token.symbol }) }) : /* @__PURE__ */ jsx14("span", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
|
|
2999
|
+
chainIcon && /* @__PURE__ */ jsx14("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx14("img", { src: chainIcon, alt: chainName }) })
|
|
2995
3000
|
] }),
|
|
2996
|
-
/* @__PURE__ */
|
|
2997
|
-
/* @__PURE__ */
|
|
2998
|
-
/* @__PURE__ */
|
|
2999
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-asset-text", children: [
|
|
3002
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-asset-name-row", children: [
|
|
3003
|
+
/* @__PURE__ */ jsx14("span", { className: "rs-asset-name", children: entry.token.symbol }),
|
|
3004
|
+
/* @__PURE__ */ jsxs12("span", { className: "rs-asset-chain", children: [
|
|
3000
3005
|
"on ",
|
|
3001
3006
|
chainName
|
|
3002
3007
|
] })
|
|
3003
3008
|
] }),
|
|
3004
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-asset-balance-small", children: [
|
|
3005
3010
|
tokenAmount,
|
|
3006
3011
|
" ",
|
|
3007
3012
|
entry.token.symbol
|
|
3008
3013
|
] })
|
|
3009
3014
|
] })
|
|
3010
3015
|
] }),
|
|
3011
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ jsx14("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3012
3017
|
]
|
|
3013
3018
|
},
|
|
3014
3019
|
entry.token.symbol
|
|
3015
3020
|
);
|
|
3016
3021
|
}) }),
|
|
3017
|
-
/* @__PURE__ */
|
|
3022
|
+
/* @__PURE__ */ jsx14(
|
|
3018
3023
|
Button,
|
|
3019
3024
|
{
|
|
3020
3025
|
onClick: () => selectedEntry && onContinue(
|
|
@@ -3028,14 +3033,14 @@ function SolanaTokenSelectStep({
|
|
|
3028
3033
|
}
|
|
3029
3034
|
)
|
|
3030
3035
|
] }),
|
|
3031
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsx14(PoweredBy, {})
|
|
3032
3037
|
] });
|
|
3033
3038
|
}
|
|
3034
3039
|
|
|
3035
3040
|
// src/components/steps/SolanaAmountStep.tsx
|
|
3036
3041
|
import { useCallback as useCallback6, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef7, useState as useState9 } from "react";
|
|
3037
3042
|
import { formatUnits as formatUnits5, parseUnits as parseUnits3 } from "viem";
|
|
3038
|
-
import { Fragment as Fragment2, jsx as
|
|
3043
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3039
3044
|
var SOL_FEE_RESERVE_LAMPORTS = 1000000n;
|
|
3040
3045
|
var PRESETS2 = [
|
|
3041
3046
|
{ value: 25, label: "25%" },
|
|
@@ -3236,12 +3241,12 @@ function SolanaAmountStep({
|
|
|
3236
3241
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
3237
3242
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3238
3243
|
const sourceTokenIcon = getTokenIcon(token.symbol);
|
|
3239
|
-
return /* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
/* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsxs13("div", { className: "rs-screen", children: [
|
|
3245
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3246
|
+
/* @__PURE__ */ jsx15(BodyHeader, { icon: /* @__PURE__ */ jsx15(WalletIcon, {}), title: "Wallet deposit" }),
|
|
3247
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-amount-section", children: [
|
|
3248
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-amount-display", children: [
|
|
3249
|
+
/* @__PURE__ */ jsx15(
|
|
3245
3250
|
AnimatedAmountInput,
|
|
3246
3251
|
{
|
|
3247
3252
|
value: amount,
|
|
@@ -3250,25 +3255,25 @@ function SolanaAmountStep({
|
|
|
3250
3255
|
autoFocus: true
|
|
3251
3256
|
}
|
|
3252
3257
|
),
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3258
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-amount-meta", children: [
|
|
3259
|
+
/* @__PURE__ */ jsxs13("span", { className: "rs-amount-meta-balance", children: [
|
|
3255
3260
|
formattedBalance,
|
|
3256
3261
|
" ",
|
|
3257
3262
|
token.symbol,
|
|
3258
3263
|
" available",
|
|
3259
|
-
computedBalanceUsd !== null && /* @__PURE__ */
|
|
3264
|
+
computedBalanceUsd !== null && /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
3260
3265
|
" (~",
|
|
3261
3266
|
currencyFormatter.format(computedBalanceUsd),
|
|
3262
3267
|
")"
|
|
3263
3268
|
] })
|
|
3264
3269
|
] }),
|
|
3265
|
-
minDepositUsd !== null && /* @__PURE__ */
|
|
3270
|
+
minDepositUsd !== null && /* @__PURE__ */ jsxs13("span", { className: "rs-amount-meta-minimum", children: [
|
|
3266
3271
|
"Min. deposit ",
|
|
3267
3272
|
currencyFormatter.format(minDepositUsd)
|
|
3268
3273
|
] })
|
|
3269
3274
|
] })
|
|
3270
3275
|
] }),
|
|
3271
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx15("div", { className: "rs-amount-presets", children: PRESETS2.map((preset) => /* @__PURE__ */ jsx15(
|
|
3272
3277
|
"button",
|
|
3273
3278
|
{
|
|
3274
3279
|
type: "button",
|
|
@@ -3279,36 +3284,36 @@ function SolanaAmountStep({
|
|
|
3279
3284
|
preset.value
|
|
3280
3285
|
)) })
|
|
3281
3286
|
] }),
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
/* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-amount-details", children: [
|
|
3288
|
+
/* @__PURE__ */ jsxs13("div", { className: "rs-amount-detail-row", children: [
|
|
3289
|
+
/* @__PURE__ */ jsx15("span", { children: "You send" }),
|
|
3290
|
+
/* @__PURE__ */ jsxs13("span", { className: "rs-amount-detail-value", children: [
|
|
3291
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
3287
3292
|
"Solana ",
|
|
3288
3293
|
token.symbol
|
|
3289
3294
|
] }),
|
|
3290
|
-
sourceTokenIcon && /* @__PURE__ */
|
|
3295
|
+
sourceTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: sourceTokenIcon, alt: "" }) })
|
|
3291
3296
|
] })
|
|
3292
3297
|
] }),
|
|
3293
|
-
targetChainName && targetTokenSymbol && /* @__PURE__ */
|
|
3294
|
-
/* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3298
|
+
targetChainName && targetTokenSymbol && /* @__PURE__ */ jsxs13("div", { className: "rs-amount-detail-row", children: [
|
|
3299
|
+
/* @__PURE__ */ jsx15("span", { children: "Receive" }),
|
|
3300
|
+
/* @__PURE__ */ jsxs13("span", { className: "rs-amount-detail-value", children: [
|
|
3301
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
3297
3302
|
targetChainName,
|
|
3298
3303
|
" ",
|
|
3299
3304
|
targetTokenSymbol
|
|
3300
3305
|
] }),
|
|
3301
|
-
targetTokenIcon && /* @__PURE__ */
|
|
3306
|
+
targetTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: targetTokenIcon, alt: "" }) })
|
|
3302
3307
|
] })
|
|
3303
3308
|
] }),
|
|
3304
|
-
balanceAfterUsd !== null && /* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3309
|
+
balanceAfterUsd !== null && /* @__PURE__ */ jsxs13("div", { className: "rs-amount-detail-row", children: [
|
|
3310
|
+
/* @__PURE__ */ jsx15("span", { children: "Balance after deposit" }),
|
|
3311
|
+
/* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
|
|
3307
3312
|
] })
|
|
3308
3313
|
] }),
|
|
3309
|
-
targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */
|
|
3310
|
-
error && /* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3314
|
+
targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx15(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3315
|
+
error && /* @__PURE__ */ jsx15(Callout, { variant: "error", children: error }),
|
|
3316
|
+
/* @__PURE__ */ jsx15(
|
|
3312
3317
|
Button,
|
|
3313
3318
|
{
|
|
3314
3319
|
onClick: handleContinue,
|
|
@@ -3318,7 +3323,7 @@ function SolanaAmountStep({
|
|
|
3318
3323
|
}
|
|
3319
3324
|
)
|
|
3320
3325
|
] }),
|
|
3321
|
-
/* @__PURE__ */
|
|
3326
|
+
/* @__PURE__ */ jsx15(PoweredBy, {})
|
|
3322
3327
|
] });
|
|
3323
3328
|
}
|
|
3324
3329
|
|
|
@@ -3431,7 +3436,7 @@ async function sendSolanaTransaction(provider, _connection, transaction) {
|
|
|
3431
3436
|
}
|
|
3432
3437
|
|
|
3433
3438
|
// src/components/steps/SolanaConfirmStep.tsx
|
|
3434
|
-
import { jsx as
|
|
3439
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3435
3440
|
function SolanaConfirmStep({
|
|
3436
3441
|
smartAccount,
|
|
3437
3442
|
solanaAddress,
|
|
@@ -3455,7 +3460,6 @@ function SolanaConfirmStep({
|
|
|
3455
3460
|
const [isSubmitting, setIsSubmitting] = useState10(false);
|
|
3456
3461
|
const [error, setError] = useState10(null);
|
|
3457
3462
|
const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
|
|
3458
|
-
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
3459
3463
|
const sourceChainName = getChainName("solana");
|
|
3460
3464
|
const targetChainName = getChainName(targetChain);
|
|
3461
3465
|
const sourceChainIcon = getChainIcon("solana");
|
|
@@ -3464,25 +3468,20 @@ function SolanaConfirmStep({
|
|
|
3464
3468
|
const targetTokenIcon = getTokenIcon(targetSymbol);
|
|
3465
3469
|
const feeSponsored = uiConfig?.feeSponsored ?? false;
|
|
3466
3470
|
const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
|
|
3467
|
-
const formattedAmount = sourceAmount &&
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
maximumFractionDigits: 6
|
|
3481
|
-
});
|
|
3482
|
-
}
|
|
3483
|
-
return formattedAmount;
|
|
3471
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? formatTokenAmount(Number(sourceAmount), token.symbol) ?? "0" : "0";
|
|
3472
|
+
const receiveDisplay = (() => {
|
|
3473
|
+
const usdValue = Number(targetAmount);
|
|
3474
|
+
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
3475
|
+
const estimate = formatReceiveEstimate({
|
|
3476
|
+
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
3477
|
+
sourceSymbol: token.symbol,
|
|
3478
|
+
targetSymbol,
|
|
3479
|
+
sourceAmountUsd,
|
|
3480
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
|
|
3481
|
+
});
|
|
3482
|
+
if (estimate !== void 0) return estimate;
|
|
3483
|
+
return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedAmount} ${token.symbol}`;
|
|
3484
3484
|
})();
|
|
3485
|
-
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
3486
3485
|
const handleConfirm = async () => {
|
|
3487
3486
|
if (!solanaProvider) {
|
|
3488
3487
|
debugLog(debug, "solana-confirm", "submit:blocked", {
|
|
@@ -3572,66 +3571,62 @@ function SolanaConfirmStep({
|
|
|
3572
3571
|
setIsSubmitting(false);
|
|
3573
3572
|
}
|
|
3574
3573
|
};
|
|
3575
|
-
return /* @__PURE__ */
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */
|
|
3578
|
-
/* @__PURE__ */
|
|
3579
|
-
/* @__PURE__ */
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
sourceChainIcon && /* @__PURE__ */
|
|
3574
|
+
return /* @__PURE__ */ jsxs14("div", { className: "rs-screen", children: [
|
|
3575
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3576
|
+
/* @__PURE__ */ jsx16(BodyHeader, { icon: /* @__PURE__ */ jsx16(WalletIcon, {}), title: "Review deposit" }),
|
|
3577
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-details", children: [
|
|
3578
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3579
|
+
/* @__PURE__ */ jsx16("span", { children: "Source chain" }),
|
|
3580
|
+
/* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
|
|
3581
|
+
/* @__PURE__ */ jsx16("span", { children: sourceChainName }),
|
|
3582
|
+
sourceChainIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: sourceChainIcon, alt: "" }) })
|
|
3584
3583
|
] })
|
|
3585
3584
|
] }),
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3588
|
-
/* @__PURE__ */
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
targetChainIcon && /* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3586
|
+
/* @__PURE__ */ jsx16("span", { children: "Destination chain" }),
|
|
3587
|
+
/* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
|
|
3588
|
+
/* @__PURE__ */ jsx16("span", { children: targetChainName }),
|
|
3589
|
+
targetChainIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: targetChainIcon, alt: "" }) })
|
|
3591
3590
|
] })
|
|
3592
3591
|
] }),
|
|
3593
|
-
/* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3593
|
+
/* @__PURE__ */ jsx16("span", { children: "Estimated time" }),
|
|
3594
|
+
/* @__PURE__ */ jsx16("span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
3596
3595
|
] }),
|
|
3597
|
-
/* @__PURE__ */
|
|
3598
|
-
/* @__PURE__ */
|
|
3599
|
-
/* @__PURE__ */
|
|
3600
|
-
/* @__PURE__ */
|
|
3596
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3597
|
+
/* @__PURE__ */ jsx16("span", { children: "You send" }),
|
|
3598
|
+
/* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
|
|
3599
|
+
/* @__PURE__ */ jsxs14("span", { children: [
|
|
3601
3600
|
formattedAmount,
|
|
3602
3601
|
" ",
|
|
3603
3602
|
token.symbol
|
|
3604
3603
|
] }),
|
|
3605
|
-
sourceTokenIcon && /* @__PURE__ */
|
|
3604
|
+
sourceTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: sourceTokenIcon, alt: "" }) })
|
|
3606
3605
|
] })
|
|
3607
3606
|
] }),
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
/* @__PURE__ */
|
|
3611
|
-
/* @__PURE__ */
|
|
3612
|
-
|
|
3613
|
-
" ",
|
|
3614
|
-
targetSymbol
|
|
3615
|
-
] }),
|
|
3616
|
-
targetTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: targetTokenIcon, alt: "" }) })
|
|
3607
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3608
|
+
/* @__PURE__ */ jsx16("span", { children: "Receive" }),
|
|
3609
|
+
/* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
|
|
3610
|
+
/* @__PURE__ */ jsx16("span", { children: receiveDisplay }),
|
|
3611
|
+
targetTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: targetTokenIcon, alt: "" }) })
|
|
3617
3612
|
] })
|
|
3618
3613
|
] }),
|
|
3619
|
-
/* @__PURE__ */
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3614
|
+
/* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
|
|
3615
|
+
/* @__PURE__ */ jsx16("span", { children: "Fees" }),
|
|
3616
|
+
/* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
|
|
3617
|
+
/* @__PURE__ */ jsx16(
|
|
3623
3618
|
"span",
|
|
3624
3619
|
{
|
|
3625
3620
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
3626
3621
|
children: "$0.04"
|
|
3627
3622
|
}
|
|
3628
3623
|
),
|
|
3629
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx16(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ jsx16(InfoIcon, {}) }) })
|
|
3630
3625
|
] })
|
|
3631
3626
|
] })
|
|
3632
3627
|
] }),
|
|
3633
|
-
error && /* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3628
|
+
error && /* @__PURE__ */ jsx16(Callout, { variant: "error", children: error }),
|
|
3629
|
+
/* @__PURE__ */ jsx16(
|
|
3635
3630
|
Button,
|
|
3636
3631
|
{
|
|
3637
3632
|
onClick: handleConfirm,
|
|
@@ -3643,28 +3638,28 @@ function SolanaConfirmStep({
|
|
|
3643
3638
|
}
|
|
3644
3639
|
)
|
|
3645
3640
|
] }),
|
|
3646
|
-
/* @__PURE__ */
|
|
3641
|
+
/* @__PURE__ */ jsx16(PoweredBy, {})
|
|
3647
3642
|
] });
|
|
3648
3643
|
}
|
|
3649
3644
|
|
|
3650
3645
|
// src/components/steps/DappImportAssetSelectStep.tsx
|
|
3651
|
-
import { jsx as
|
|
3646
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3652
3647
|
function DappImportAssetSelectStep({
|
|
3653
3648
|
sourceLabel,
|
|
3654
3649
|
assets,
|
|
3655
3650
|
onSelect
|
|
3656
3651
|
}) {
|
|
3657
|
-
return /* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ jsxs15("div", { className: "rs-screen", children: [
|
|
3653
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3654
|
+
/* @__PURE__ */ jsx17(
|
|
3660
3655
|
BodyHeader,
|
|
3661
3656
|
{
|
|
3662
|
-
icon: /* @__PURE__ */
|
|
3657
|
+
icon: /* @__PURE__ */ jsx17(WalletIcon, {}),
|
|
3663
3658
|
title: `Transfer from ${sourceLabel}`,
|
|
3664
3659
|
subtitle: "Pick the balance to import"
|
|
3665
3660
|
}
|
|
3666
3661
|
),
|
|
3667
|
-
/* @__PURE__ */
|
|
3662
|
+
/* @__PURE__ */ jsx17("div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3668
3663
|
const tokenAmount = asset.balance ? tokenFormatter.format(
|
|
3669
3664
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3670
3665
|
) : "0";
|
|
@@ -3672,23 +3667,23 @@ function DappImportAssetSelectStep({
|
|
|
3672
3667
|
const tokenIcon = asset.icon ?? getTokenIcon(asset.symbol);
|
|
3673
3668
|
const chainIcon = getChainIcon(asset.chainId);
|
|
3674
3669
|
const badge = getChainBadge(asset.chainId);
|
|
3675
|
-
return /* @__PURE__ */
|
|
3670
|
+
return /* @__PURE__ */ jsxs15(
|
|
3676
3671
|
"button",
|
|
3677
3672
|
{
|
|
3678
3673
|
type: "button",
|
|
3679
3674
|
className: "rs-asset-row",
|
|
3680
3675
|
onClick: () => onSelect(asset),
|
|
3681
3676
|
children: [
|
|
3682
|
-
/* @__PURE__ */
|
|
3683
|
-
/* @__PURE__ */
|
|
3684
|
-
/* @__PURE__ */
|
|
3685
|
-
chainIcon ? /* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-asset-info", children: [
|
|
3678
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-asset-icon-wrapper", children: [
|
|
3679
|
+
/* @__PURE__ */ jsx17("span", { className: "rs-asset-icon", children: tokenIcon ? /* @__PURE__ */ jsx17("img", { src: tokenIcon, alt: asset.symbol }) : asset.symbol.slice(0, 4) }),
|
|
3680
|
+
chainIcon ? /* @__PURE__ */ jsx17("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx17(
|
|
3686
3681
|
"img",
|
|
3687
3682
|
{
|
|
3688
3683
|
src: chainIcon,
|
|
3689
3684
|
alt: getChainName(asset.chainId)
|
|
3690
3685
|
}
|
|
3691
|
-
) }) : /* @__PURE__ */
|
|
3686
|
+
) }) : /* @__PURE__ */ jsx17(
|
|
3692
3687
|
"span",
|
|
3693
3688
|
{
|
|
3694
3689
|
className: "rs-asset-chain-badge",
|
|
@@ -3697,86 +3692,86 @@ function DappImportAssetSelectStep({
|
|
|
3697
3692
|
}
|
|
3698
3693
|
)
|
|
3699
3694
|
] }),
|
|
3700
|
-
/* @__PURE__ */
|
|
3701
|
-
/* @__PURE__ */
|
|
3702
|
-
/* @__PURE__ */
|
|
3703
|
-
/* @__PURE__ */
|
|
3695
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-asset-text", children: [
|
|
3696
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-asset-name-row", children: [
|
|
3697
|
+
/* @__PURE__ */ jsx17("span", { className: "rs-asset-name", children: asset.symbol }),
|
|
3698
|
+
/* @__PURE__ */ jsxs15("span", { className: "rs-asset-chain", children: [
|
|
3704
3699
|
"on ",
|
|
3705
3700
|
asset.sourceLabel
|
|
3706
3701
|
] })
|
|
3707
3702
|
] }),
|
|
3708
|
-
/* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-asset-balance-small", children: [
|
|
3709
3704
|
tokenAmount,
|
|
3710
3705
|
" ",
|
|
3711
3706
|
asset.symbol
|
|
3712
3707
|
] })
|
|
3713
3708
|
] })
|
|
3714
3709
|
] }),
|
|
3715
|
-
/* @__PURE__ */
|
|
3710
|
+
/* @__PURE__ */ jsx17("div", { className: "rs-asset-balance", children: balanceUsd })
|
|
3716
3711
|
]
|
|
3717
3712
|
},
|
|
3718
3713
|
asset.id
|
|
3719
3714
|
);
|
|
3720
3715
|
}) })
|
|
3721
3716
|
] }),
|
|
3722
|
-
/* @__PURE__ */
|
|
3717
|
+
/* @__PURE__ */ jsx17(PoweredBy, {})
|
|
3723
3718
|
] });
|
|
3724
3719
|
}
|
|
3725
3720
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
3726
3721
|
|
|
3727
3722
|
// src/components/steps/DappImportAssetSelectSkeleton.tsx
|
|
3728
|
-
import { jsx as
|
|
3723
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3729
3724
|
function DappImportAssetSelectSkeleton({
|
|
3730
3725
|
sourceLabel,
|
|
3731
3726
|
rowCount = 3,
|
|
3732
3727
|
error = false,
|
|
3733
3728
|
onRetry
|
|
3734
3729
|
}) {
|
|
3735
|
-
return /* @__PURE__ */
|
|
3736
|
-
/* @__PURE__ */
|
|
3737
|
-
/* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ jsxs16("div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
|
|
3731
|
+
/* @__PURE__ */ jsx18("span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
3732
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3733
|
+
/* @__PURE__ */ jsx18(
|
|
3739
3734
|
BodyHeader,
|
|
3740
3735
|
{
|
|
3741
|
-
icon: /* @__PURE__ */
|
|
3736
|
+
icon: /* @__PURE__ */ jsx18(WalletIcon, {}),
|
|
3742
3737
|
title: `Transfer from ${sourceLabel}`,
|
|
3743
3738
|
subtitle: "Pick the balance to import"
|
|
3744
3739
|
}
|
|
3745
3740
|
),
|
|
3746
|
-
error ? /* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */
|
|
3748
|
-
/* @__PURE__ */
|
|
3749
|
-
] }) }) : /* @__PURE__ */
|
|
3741
|
+
error ? /* @__PURE__ */ jsx18("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsxs16("div", { className: "rs-loading-text", children: [
|
|
3742
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
|
|
3743
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
|
|
3744
|
+
] }) }) : /* @__PURE__ */ jsx18("div", { className: "rs-asset-list", "aria-hidden": "true", children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ jsxs16(
|
|
3750
3745
|
"div",
|
|
3751
3746
|
{
|
|
3752
3747
|
className: "rs-asset-row rs-asset-row--skeleton",
|
|
3753
3748
|
children: [
|
|
3754
|
-
/* @__PURE__ */
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-asset-info", children: [
|
|
3750
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-asset-icon-wrapper", children: [
|
|
3751
|
+
/* @__PURE__ */ jsx18("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx18("span", { className: "rs-skeleton rs-skeleton-fill" }) }),
|
|
3752
|
+
/* @__PURE__ */ jsx18("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx18("span", { className: "rs-skeleton rs-skeleton-fill" }) })
|
|
3758
3753
|
] }),
|
|
3759
|
-
/* @__PURE__ */
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
3754
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-asset-text", children: [
|
|
3755
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-asset-name-row", children: /* @__PURE__ */ jsx18("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--name" }) }),
|
|
3756
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-asset-balance-small", children: /* @__PURE__ */ jsx18("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--balance" }) })
|
|
3762
3757
|
] })
|
|
3763
3758
|
] }),
|
|
3764
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-asset-balance", children: /* @__PURE__ */ jsx18("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--usd" }) })
|
|
3765
3760
|
]
|
|
3766
3761
|
},
|
|
3767
3762
|
index
|
|
3768
3763
|
)) })
|
|
3769
3764
|
] }),
|
|
3770
|
-
error && onRetry && /* @__PURE__ */
|
|
3765
|
+
error && onRetry && /* @__PURE__ */ jsx18("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx18(
|
|
3771
3766
|
"button",
|
|
3772
3767
|
{
|
|
3773
3768
|
type: "button",
|
|
3774
3769
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
3775
3770
|
onClick: onRetry,
|
|
3776
|
-
children: /* @__PURE__ */
|
|
3771
|
+
children: /* @__PURE__ */ jsx18("span", { children: "Try again" })
|
|
3777
3772
|
}
|
|
3778
3773
|
) }),
|
|
3779
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx18(PoweredBy, {})
|
|
3780
3775
|
] });
|
|
3781
3776
|
}
|
|
3782
3777
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -5136,28 +5131,27 @@ function mapError(error) {
|
|
|
5136
5131
|
}
|
|
5137
5132
|
|
|
5138
5133
|
// src/DepositFlow.tsx
|
|
5139
|
-
import { Fragment as Fragment3, jsx as
|
|
5134
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5140
5135
|
function AccountPreparingSkeleton({
|
|
5141
5136
|
errorMessage,
|
|
5142
5137
|
onRetry
|
|
5143
5138
|
}) {
|
|
5144
|
-
return /* @__PURE__ */
|
|
5145
|
-
/* @__PURE__ */
|
|
5146
|
-
/* @__PURE__ */
|
|
5147
|
-
/* @__PURE__ */
|
|
5148
|
-
] }) : /* @__PURE__ */
|
|
5149
|
-
errorMessage && onRetry && /* @__PURE__ */
|
|
5139
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rs-step", children: [
|
|
5140
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: /* @__PURE__ */ jsx19("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx19("div", { className: "rs-loading-text", children: errorMessage ? /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5141
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t prepare account" }),
|
|
5142
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-loading-subtitle", children: errorMessage })
|
|
5143
|
+
] }) : /* @__PURE__ */ jsx19("div", { className: "rs-loading-title", children: "Preparing\u2026" }) }) }) }),
|
|
5144
|
+
errorMessage && onRetry && /* @__PURE__ */ jsx19("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx19(
|
|
5150
5145
|
"button",
|
|
5151
5146
|
{
|
|
5152
5147
|
type: "button",
|
|
5153
5148
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
5154
5149
|
onClick: onRetry,
|
|
5155
|
-
children: /* @__PURE__ */
|
|
5150
|
+
children: /* @__PURE__ */ jsx19("span", { children: "Try again" })
|
|
5156
5151
|
}
|
|
5157
5152
|
) })
|
|
5158
5153
|
] });
|
|
5159
5154
|
}
|
|
5160
|
-
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
5161
5155
|
var DAPP_IMPORT_RESOLVE_TIMEOUT_MS = 1e4;
|
|
5162
5156
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
5163
5157
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
@@ -5165,6 +5159,26 @@ function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
5165
5159
|
var SWAPPED_SOURCE_CHAIN = 8453;
|
|
5166
5160
|
var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
5167
5161
|
var SWAPPED_SOURCE_DECIMALS = 6;
|
|
5162
|
+
var DEFAULT_FIAT_ONRAMP_METHODS = [
|
|
5163
|
+
{
|
|
5164
|
+
method: "creditcard",
|
|
5165
|
+
label: "Debit/Credit card",
|
|
5166
|
+
sublabel: "Instant - $10,000 limit",
|
|
5167
|
+
icon: "card"
|
|
5168
|
+
},
|
|
5169
|
+
{
|
|
5170
|
+
method: "bank-transfer",
|
|
5171
|
+
label: "Bank transfer",
|
|
5172
|
+
sublabel: "Instant - $10,000 limit",
|
|
5173
|
+
icon: "bank"
|
|
5174
|
+
},
|
|
5175
|
+
{
|
|
5176
|
+
method: "apple-pay",
|
|
5177
|
+
label: "Apple pay",
|
|
5178
|
+
sublabel: "Instant - $10,000 limit",
|
|
5179
|
+
icon: "apple"
|
|
5180
|
+
}
|
|
5181
|
+
];
|
|
5168
5182
|
function getAddressKey(address) {
|
|
5169
5183
|
return address ? address.toLowerCase() : null;
|
|
5170
5184
|
}
|
|
@@ -5345,12 +5359,6 @@ function DepositFlow({
|
|
|
5345
5359
|
const onEventRef = useLatestRef(onEvent);
|
|
5346
5360
|
const onLifecycleRef = useLatestRef(onLifecycle);
|
|
5347
5361
|
const onErrorRef = useLatestRef(onError);
|
|
5348
|
-
const hasInitialReownSession = Boolean(
|
|
5349
|
-
enableSolana ? reownWallet?.isConnected || reownWallet?.address : reownWallet?.address
|
|
5350
|
-
);
|
|
5351
|
-
const hasInitialWalletHydrationPending = Boolean(
|
|
5352
|
-
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
5353
|
-
);
|
|
5354
5362
|
const storeApi = useDepositStoreApi();
|
|
5355
5363
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
5356
5364
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -5360,10 +5368,8 @@ function DepositFlow({
|
|
|
5360
5368
|
const exchangeSlice = useDepositStore((s) => s.exchange);
|
|
5361
5369
|
const flowMode = flowSlice.mode;
|
|
5362
5370
|
const isConnectSelectionConfirmed = flowSlice.isConnectSelectionConfirmed;
|
|
5363
|
-
const hasNavigatedBack = flowSlice.hasNavigatedBack;
|
|
5364
5371
|
const selectedWalletId = useDepositStore(selectedWalletIdSelector);
|
|
5365
5372
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState11(0);
|
|
5366
|
-
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = useState11(() => !hasInitialWalletHydrationPending);
|
|
5367
5373
|
const portfolioAssetsRef = useRef8([]);
|
|
5368
5374
|
const stableWalletSignerRef = useRef8(null);
|
|
5369
5375
|
const stableWalletSelectionKeyRef = useRef8(null);
|
|
@@ -5461,24 +5467,10 @@ function DepositFlow({
|
|
|
5461
5467
|
const hasReownSession = Boolean(
|
|
5462
5468
|
enableSolana ? reownWallet?.isConnected || reownWallet?.address : reownWallet?.address
|
|
5463
5469
|
);
|
|
5464
|
-
const isWalletHydrationPending = Boolean(
|
|
5465
|
-
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
5466
|
-
);
|
|
5467
5470
|
const isDappImportWalletHydrating = Boolean(
|
|
5468
5471
|
hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
5469
5472
|
);
|
|
5470
5473
|
const showConnectStep = flowMode === null && !isConnectSelectionConfirmed;
|
|
5471
|
-
useEffect10(() => {
|
|
5472
|
-
if (!isWalletHydrationPending) {
|
|
5473
|
-
setHasQrAutoAdvanceGraceElapsed(true);
|
|
5474
|
-
return;
|
|
5475
|
-
}
|
|
5476
|
-
setHasQrAutoAdvanceGraceElapsed(false);
|
|
5477
|
-
const timeout = window.setTimeout(() => {
|
|
5478
|
-
setHasQrAutoAdvanceGraceElapsed(true);
|
|
5479
|
-
}, QR_AUTO_ADVANCE_HYDRATION_GRACE_MS);
|
|
5480
|
-
return () => window.clearTimeout(timeout);
|
|
5481
|
-
}, [isWalletHydrationPending]);
|
|
5482
5474
|
const walletSelectionKey = useMemo7(() => {
|
|
5483
5475
|
if (flowMode !== "wallet" && flowMode !== "dapp-import") return null;
|
|
5484
5476
|
if (canAutoLock) {
|
|
@@ -6520,26 +6512,6 @@ function DepositFlow({
|
|
|
6520
6512
|
storeApi.dispatch({ type: "flow/step-set", step: "connect" });
|
|
6521
6513
|
}
|
|
6522
6514
|
}, [enableSolana, flowMode, storeApi]);
|
|
6523
|
-
useEffect10(() => {
|
|
6524
|
-
if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect || initialDappImportProvider) {
|
|
6525
|
-
return;
|
|
6526
|
-
}
|
|
6527
|
-
if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
|
|
6528
|
-
handleSelectTransferCrypto();
|
|
6529
|
-
}
|
|
6530
|
-
}, [
|
|
6531
|
-
enableQrTransfer,
|
|
6532
|
-
hasWalletOptions,
|
|
6533
|
-
hasReownSession,
|
|
6534
|
-
hasQrAutoAdvanceGraceElapsed,
|
|
6535
|
-
isConnectSelectionConfirmed,
|
|
6536
|
-
flowMode,
|
|
6537
|
-
hasNavigatedBack,
|
|
6538
|
-
dappAddress,
|
|
6539
|
-
dappWalletClient,
|
|
6540
|
-
initialDappImportProvider,
|
|
6541
|
-
handleSelectTransferCrypto
|
|
6542
|
-
]);
|
|
6543
6515
|
const walletRows = useMemo7(() => {
|
|
6544
6516
|
return walletOptions.map((option) => {
|
|
6545
6517
|
const ownerForRow = option.kind === "solana" ? dappAddress : option.address ?? null;
|
|
@@ -6568,7 +6540,7 @@ function DepositFlow({
|
|
|
6568
6540
|
[storeApi]
|
|
6569
6541
|
);
|
|
6570
6542
|
if (showConnectStep) {
|
|
6571
|
-
return /* @__PURE__ */
|
|
6543
|
+
return /* @__PURE__ */ jsx19("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx19(
|
|
6572
6544
|
ConnectStep,
|
|
6573
6545
|
{
|
|
6574
6546
|
walletRows,
|
|
@@ -6581,8 +6553,7 @@ function DepositFlow({
|
|
|
6581
6553
|
}
|
|
6582
6554
|
handleSelectTransferCrypto();
|
|
6583
6555
|
} : void 0,
|
|
6584
|
-
|
|
6585
|
-
fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods : void 0,
|
|
6556
|
+
fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
|
|
6586
6557
|
onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
|
|
6587
6558
|
onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
|
|
6588
6559
|
onRequestConnect,
|
|
@@ -6625,21 +6596,21 @@ function DepositFlow({
|
|
|
6625
6596
|
}
|
|
6626
6597
|
if (isDepositAddressMode) {
|
|
6627
6598
|
if (!dappAddress) return null;
|
|
6628
|
-
return /* @__PURE__ */
|
|
6629
|
-
effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */
|
|
6599
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rs-modal-body", children: [
|
|
6600
|
+
effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx19(
|
|
6630
6601
|
AccountPreparingSkeleton,
|
|
6631
6602
|
{
|
|
6632
6603
|
errorMessage: activeEntry.message ?? void 0,
|
|
6633
6604
|
onRetry: () => handleRetrySetup(dappAddress)
|
|
6634
6605
|
}
|
|
6635
|
-
) : /* @__PURE__ */
|
|
6606
|
+
) : /* @__PURE__ */ jsx19(
|
|
6636
6607
|
DepositAddressSkeleton,
|
|
6637
6608
|
{
|
|
6638
6609
|
uiConfig,
|
|
6639
6610
|
allowedRoutes
|
|
6640
6611
|
}
|
|
6641
6612
|
)),
|
|
6642
|
-
effectiveStep.type === "deposit-address" && /* @__PURE__ */
|
|
6613
|
+
effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx19(
|
|
6643
6614
|
DepositAddressStep,
|
|
6644
6615
|
{
|
|
6645
6616
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -6672,21 +6643,21 @@ function DepositFlow({
|
|
|
6672
6643
|
}
|
|
6673
6644
|
if (isFiatOnrampMode) {
|
|
6674
6645
|
if (!dappAddress) return null;
|
|
6675
|
-
return /* @__PURE__ */
|
|
6646
|
+
return /* @__PURE__ */ jsxs17(
|
|
6676
6647
|
"div",
|
|
6677
6648
|
{
|
|
6678
6649
|
className: "rs-modal-body",
|
|
6679
6650
|
"data-flow-mode": "fiat-onramp",
|
|
6680
6651
|
"data-step-type": step.type,
|
|
6681
6652
|
children: [
|
|
6682
|
-
step.type === "setup" && /* @__PURE__ */
|
|
6653
|
+
step.type === "setup" && /* @__PURE__ */ jsx19(
|
|
6683
6654
|
AccountPreparingSkeleton,
|
|
6684
6655
|
{
|
|
6685
6656
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
6686
6657
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
|
|
6687
6658
|
}
|
|
6688
6659
|
),
|
|
6689
|
-
step.type === "fiat-onramp" && /* @__PURE__ */
|
|
6660
|
+
step.type === "fiat-onramp" && /* @__PURE__ */ jsx19(
|
|
6690
6661
|
FiatOnrampStep,
|
|
6691
6662
|
{
|
|
6692
6663
|
smartAccount: step.smartAccount,
|
|
@@ -6699,7 +6670,7 @@ function DepositFlow({
|
|
|
6699
6670
|
onError: handleError
|
|
6700
6671
|
}
|
|
6701
6672
|
),
|
|
6702
|
-
step.type === "processing" && /* @__PURE__ */
|
|
6673
|
+
step.type === "processing" && /* @__PURE__ */ jsx19(
|
|
6703
6674
|
ProcessingStep,
|
|
6704
6675
|
{
|
|
6705
6676
|
smartAccount: step.smartAccount,
|
|
@@ -6731,21 +6702,21 @@ function DepositFlow({
|
|
|
6731
6702
|
}
|
|
6732
6703
|
if (isExchangeConnectMode) {
|
|
6733
6704
|
if (!dappAddress) return null;
|
|
6734
|
-
return /* @__PURE__ */
|
|
6705
|
+
return /* @__PURE__ */ jsxs17(
|
|
6735
6706
|
"div",
|
|
6736
6707
|
{
|
|
6737
6708
|
className: "rs-modal-body",
|
|
6738
6709
|
"data-flow-mode": "exchange-connect",
|
|
6739
6710
|
"data-step-type": step.type,
|
|
6740
6711
|
children: [
|
|
6741
|
-
step.type === "setup" && /* @__PURE__ */
|
|
6712
|
+
step.type === "setup" && /* @__PURE__ */ jsx19(
|
|
6742
6713
|
AccountPreparingSkeleton,
|
|
6743
6714
|
{
|
|
6744
6715
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
6745
6716
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
|
|
6746
6717
|
}
|
|
6747
6718
|
),
|
|
6748
|
-
step.type === "exchange-select" && /* @__PURE__ */
|
|
6719
|
+
step.type === "exchange-select" && /* @__PURE__ */ jsx19(
|
|
6749
6720
|
ExchangeSelectStep,
|
|
6750
6721
|
{
|
|
6751
6722
|
service,
|
|
@@ -6753,7 +6724,7 @@ function DepositFlow({
|
|
|
6753
6724
|
onError: handleError
|
|
6754
6725
|
}
|
|
6755
6726
|
),
|
|
6756
|
-
step.type === "exchange-connect" && /* @__PURE__ */
|
|
6727
|
+
step.type === "exchange-connect" && /* @__PURE__ */ jsx19(
|
|
6757
6728
|
ExchangeConnectStep,
|
|
6758
6729
|
{
|
|
6759
6730
|
smartAccount: step.smartAccount,
|
|
@@ -6766,7 +6737,7 @@ function DepositFlow({
|
|
|
6766
6737
|
onError: handleError
|
|
6767
6738
|
}
|
|
6768
6739
|
),
|
|
6769
|
-
step.type === "processing" && /* @__PURE__ */
|
|
6740
|
+
step.type === "processing" && /* @__PURE__ */ jsx19(
|
|
6770
6741
|
ProcessingStep,
|
|
6771
6742
|
{
|
|
6772
6743
|
smartAccount: step.smartAccount,
|
|
@@ -6800,15 +6771,15 @@ function DepositFlow({
|
|
|
6800
6771
|
if (!dappAddress) return null;
|
|
6801
6772
|
const solanaAddr = reownWallet?.solanaAddress;
|
|
6802
6773
|
const solanaProvider = reownWallet?.solanaProvider;
|
|
6803
|
-
return /* @__PURE__ */
|
|
6804
|
-
effectiveStep.type === "setup" && /* @__PURE__ */
|
|
6774
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rs-modal-body", children: [
|
|
6775
|
+
effectiveStep.type === "setup" && /* @__PURE__ */ jsx19(
|
|
6805
6776
|
AccountPreparingSkeleton,
|
|
6806
6777
|
{
|
|
6807
6778
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
6808
6779
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
|
|
6809
6780
|
}
|
|
6810
6781
|
),
|
|
6811
|
-
effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */
|
|
6782
|
+
effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx19(
|
|
6812
6783
|
SolanaTokenSelectStep,
|
|
6813
6784
|
{
|
|
6814
6785
|
solanaAddress: solanaAddr,
|
|
@@ -6822,7 +6793,7 @@ function DepositFlow({
|
|
|
6822
6793
|
debug
|
|
6823
6794
|
}
|
|
6824
6795
|
),
|
|
6825
|
-
effectiveStep.type === "solana-amount" && /* @__PURE__ */
|
|
6796
|
+
effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx19(
|
|
6826
6797
|
SolanaAmountStep,
|
|
6827
6798
|
{
|
|
6828
6799
|
token: effectiveStep.token,
|
|
@@ -6841,7 +6812,7 @@ function DepositFlow({
|
|
|
6841
6812
|
debug
|
|
6842
6813
|
}
|
|
6843
6814
|
),
|
|
6844
|
-
effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */
|
|
6815
|
+
effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx19(
|
|
6845
6816
|
SolanaConfirmStep,
|
|
6846
6817
|
{
|
|
6847
6818
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -6862,16 +6833,16 @@ function DepositFlow({
|
|
|
6862
6833
|
onError: handleError,
|
|
6863
6834
|
debug
|
|
6864
6835
|
}
|
|
6865
|
-
) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */
|
|
6866
|
-
/* @__PURE__ */
|
|
6867
|
-
/* @__PURE__ */
|
|
6836
|
+
) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs17("div", { className: "rs-step", children: [
|
|
6837
|
+
/* @__PURE__ */ jsxs17("div", { className: "rs-loading-state", children: [
|
|
6838
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx19(
|
|
6868
6839
|
"svg",
|
|
6869
6840
|
{
|
|
6870
6841
|
viewBox: "0 0 24 24",
|
|
6871
6842
|
fill: "none",
|
|
6872
6843
|
stroke: "currentColor",
|
|
6873
6844
|
strokeWidth: "2",
|
|
6874
|
-
children: /* @__PURE__ */
|
|
6845
|
+
children: /* @__PURE__ */ jsx19(
|
|
6875
6846
|
"path",
|
|
6876
6847
|
{
|
|
6877
6848
|
strokeLinecap: "round",
|
|
@@ -6881,22 +6852,22 @@ function DepositFlow({
|
|
|
6881
6852
|
)
|
|
6882
6853
|
}
|
|
6883
6854
|
) }),
|
|
6884
|
-
/* @__PURE__ */
|
|
6885
|
-
/* @__PURE__ */
|
|
6886
|
-
/* @__PURE__ */
|
|
6855
|
+
/* @__PURE__ */ jsxs17("div", { className: "rs-loading-text", children: [
|
|
6856
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
|
|
6857
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
|
|
6887
6858
|
] })
|
|
6888
6859
|
] }),
|
|
6889
|
-
/* @__PURE__ */
|
|
6860
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx19(
|
|
6890
6861
|
"button",
|
|
6891
6862
|
{
|
|
6892
6863
|
type: "button",
|
|
6893
6864
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
6894
6865
|
onClick: handleBack,
|
|
6895
|
-
children: /* @__PURE__ */
|
|
6866
|
+
children: /* @__PURE__ */ jsx19("span", { children: "Go Back" })
|
|
6896
6867
|
}
|
|
6897
6868
|
) })
|
|
6898
6869
|
] }) : null,
|
|
6899
|
-
effectiveStep.type === "processing" && /* @__PURE__ */
|
|
6870
|
+
effectiveStep.type === "processing" && /* @__PURE__ */ jsx19(
|
|
6900
6871
|
ProcessingStep,
|
|
6901
6872
|
{
|
|
6902
6873
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -6924,13 +6895,13 @@ function DepositFlow({
|
|
|
6924
6895
|
] });
|
|
6925
6896
|
}
|
|
6926
6897
|
if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
|
|
6927
|
-
return /* @__PURE__ */
|
|
6898
|
+
return /* @__PURE__ */ jsx19(
|
|
6928
6899
|
"div",
|
|
6929
6900
|
{
|
|
6930
6901
|
className: "rs-modal-body",
|
|
6931
6902
|
"data-flow-mode": "dapp-import",
|
|
6932
6903
|
"data-step-type": effectiveStep.type,
|
|
6933
|
-
children: /* @__PURE__ */
|
|
6904
|
+
children: /* @__PURE__ */ jsx19(
|
|
6934
6905
|
DappImportAssetSelectSkeleton,
|
|
6935
6906
|
{
|
|
6936
6907
|
sourceLabel: activeDappImportProvider?.sourceLabel ?? "",
|
|
@@ -6942,7 +6913,7 @@ function DepositFlow({
|
|
|
6942
6913
|
);
|
|
6943
6914
|
}
|
|
6944
6915
|
if (!signerContext?.walletClient || !signerContext?.publicClient) {
|
|
6945
|
-
return /* @__PURE__ */
|
|
6916
|
+
return /* @__PURE__ */ jsx19("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx19("div", { className: "rs-step", children: /* @__PURE__ */ jsx19("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx19("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx19("div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
|
|
6946
6917
|
}
|
|
6947
6918
|
const ownerAddress = signerContext.ownerAddress;
|
|
6948
6919
|
const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? setupChainId;
|
|
@@ -6952,15 +6923,15 @@ function DepositFlow({
|
|
|
6952
6923
|
}
|
|
6953
6924
|
return getPublicClient(chainId);
|
|
6954
6925
|
};
|
|
6955
|
-
return /* @__PURE__ */
|
|
6956
|
-
effectiveStep.type === "setup" && /* @__PURE__ */
|
|
6926
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rs-modal-body", children: [
|
|
6927
|
+
effectiveStep.type === "setup" && /* @__PURE__ */ jsx19(
|
|
6957
6928
|
AccountPreparingSkeleton,
|
|
6958
6929
|
{
|
|
6959
6930
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
6960
6931
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup(ownerAddress) : void 0
|
|
6961
6932
|
}
|
|
6962
6933
|
),
|
|
6963
|
-
effectiveStep.type === "select-asset" && /* @__PURE__ */
|
|
6934
|
+
effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx19(
|
|
6964
6935
|
AssetSelectStep,
|
|
6965
6936
|
{
|
|
6966
6937
|
address: ownerAddress,
|
|
@@ -6978,7 +6949,7 @@ function DepositFlow({
|
|
|
6978
6949
|
} : void 0
|
|
6979
6950
|
}
|
|
6980
6951
|
),
|
|
6981
|
-
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */
|
|
6952
|
+
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx19(
|
|
6982
6953
|
DappImportAssetSelectStep,
|
|
6983
6954
|
{
|
|
6984
6955
|
sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.sourceLabel,
|
|
@@ -6986,7 +6957,7 @@ function DepositFlow({
|
|
|
6986
6957
|
onSelect: handleDappImportAssetSelected
|
|
6987
6958
|
}
|
|
6988
6959
|
),
|
|
6989
|
-
effectiveStep.type === "amount" && /* @__PURE__ */
|
|
6960
|
+
effectiveStep.type === "amount" && /* @__PURE__ */ jsx19(
|
|
6990
6961
|
AmountStep,
|
|
6991
6962
|
{
|
|
6992
6963
|
walletClient: signerContext.walletClient,
|
|
@@ -7018,7 +6989,7 @@ function DepositFlow({
|
|
|
7018
6989
|
}
|
|
7019
6990
|
}
|
|
7020
6991
|
),
|
|
7021
|
-
effectiveStep.type === "confirm" && /* @__PURE__ */
|
|
6992
|
+
effectiveStep.type === "confirm" && /* @__PURE__ */ jsx19(
|
|
7022
6993
|
ConfirmStep,
|
|
7023
6994
|
{
|
|
7024
6995
|
walletClient: signerContext.walletClient,
|
|
@@ -7059,7 +7030,7 @@ function DepositFlow({
|
|
|
7059
7030
|
onError: handleError
|
|
7060
7031
|
}
|
|
7061
7032
|
),
|
|
7062
|
-
effectiveStep.type === "processing" && /* @__PURE__ */
|
|
7033
|
+
effectiveStep.type === "processing" && /* @__PURE__ */ jsx19(
|
|
7063
7034
|
ProcessingStep,
|
|
7064
7035
|
{
|
|
7065
7036
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -7091,7 +7062,7 @@ function DepositFlow({
|
|
|
7091
7062
|
|
|
7092
7063
|
// src/components/history/DepositHistoryPanel.tsx
|
|
7093
7064
|
import { useCallback as useCallback8, useMemo as useMemo8, useState as useState12 } from "react";
|
|
7094
|
-
import { jsx as
|
|
7065
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7095
7066
|
function shortenHash(hash) {
|
|
7096
7067
|
if (hash.length <= 14) return hash;
|
|
7097
7068
|
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
@@ -7218,7 +7189,7 @@ function DepositHistoryPanel({
|
|
|
7218
7189
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
7219
7190
|
);
|
|
7220
7191
|
}, [deposits]);
|
|
7221
|
-
return /* @__PURE__ */
|
|
7192
|
+
return /* @__PURE__ */ jsxs18(
|
|
7222
7193
|
"div",
|
|
7223
7194
|
{
|
|
7224
7195
|
className: "rs-history-panel",
|
|
@@ -7226,55 +7197,55 @@ function DepositHistoryPanel({
|
|
|
7226
7197
|
"aria-label": "Deposit history",
|
|
7227
7198
|
onKeyDown: handleKeyDown,
|
|
7228
7199
|
children: [
|
|
7229
|
-
/* @__PURE__ */
|
|
7230
|
-
/* @__PURE__ */
|
|
7200
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-modal-header--redesigned", children: [
|
|
7201
|
+
/* @__PURE__ */ jsx20("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx20(
|
|
7231
7202
|
"button",
|
|
7232
7203
|
{
|
|
7233
7204
|
type: "button",
|
|
7234
7205
|
className: "rs-modal-header-back",
|
|
7235
7206
|
"aria-label": "Back",
|
|
7236
7207
|
onClick: onClose,
|
|
7237
|
-
children: /* @__PURE__ */
|
|
7208
|
+
children: /* @__PURE__ */ jsx20(ChevronLeftIcon, {})
|
|
7238
7209
|
}
|
|
7239
7210
|
) }),
|
|
7240
|
-
/* @__PURE__ */
|
|
7211
|
+
/* @__PURE__ */ jsx20("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx20(
|
|
7241
7212
|
"button",
|
|
7242
7213
|
{
|
|
7243
7214
|
type: "button",
|
|
7244
7215
|
className: "rs-modal-close",
|
|
7245
7216
|
"aria-label": "Close",
|
|
7246
7217
|
onClick: onCloseModal,
|
|
7247
|
-
children: /* @__PURE__ */
|
|
7218
|
+
children: /* @__PURE__ */ jsx20(CloseIcon, {})
|
|
7248
7219
|
}
|
|
7249
7220
|
) })
|
|
7250
7221
|
] }),
|
|
7251
|
-
/* @__PURE__ */
|
|
7252
|
-
/* @__PURE__ */
|
|
7253
|
-
/* @__PURE__ */
|
|
7254
|
-
isLoading && deposits.length === 0 && /* @__PURE__ */
|
|
7255
|
-
/* @__PURE__ */
|
|
7256
|
-
/* @__PURE__ */
|
|
7257
|
-
/* @__PURE__ */
|
|
7258
|
-
/* @__PURE__ */
|
|
7222
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-screen", children: [
|
|
7223
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-screen-body", children: [
|
|
7224
|
+
/* @__PURE__ */ jsx20(BodyHeader, { icon: /* @__PURE__ */ jsx20(HistoryIcon, {}), title: "History" }),
|
|
7225
|
+
isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs18("div", { className: "rs-history-empty", children: [
|
|
7226
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(HistoryIcon, {}) }),
|
|
7227
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-empty-text", children: [
|
|
7228
|
+
/* @__PURE__ */ jsx20(Spinner, { className: "rs-spinner--sm" }),
|
|
7229
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7259
7230
|
] })
|
|
7260
7231
|
] }),
|
|
7261
|
-
error && !isLoading && /* @__PURE__ */
|
|
7262
|
-
/* @__PURE__ */
|
|
7263
|
-
/* @__PURE__ */
|
|
7264
|
-
/* @__PURE__ */
|
|
7265
|
-
/* @__PURE__ */
|
|
7232
|
+
error && !isLoading && /* @__PURE__ */ jsxs18("div", { className: "rs-history-empty", children: [
|
|
7233
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(AlertTriangleIcon, {}) }),
|
|
7234
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-empty-text", children: [
|
|
7235
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7236
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-hint", children: error })
|
|
7266
7237
|
] })
|
|
7267
7238
|
] }),
|
|
7268
|
-
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */
|
|
7269
|
-
/* @__PURE__ */
|
|
7270
|
-
/* @__PURE__ */
|
|
7271
|
-
/* @__PURE__ */
|
|
7272
|
-
/* @__PURE__ */
|
|
7239
|
+
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ jsxs18("div", { className: "rs-history-empty", children: [
|
|
7240
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(HistoryIcon, {}) }),
|
|
7241
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-empty-text", children: [
|
|
7242
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7243
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
7273
7244
|
] })
|
|
7274
7245
|
] }),
|
|
7275
|
-
visibleDeposits.length > 0 && /* @__PURE__ */
|
|
7276
|
-
visibleDeposits.map((deposit, i) => /* @__PURE__ */
|
|
7277
|
-
hasMore && /* @__PURE__ */
|
|
7246
|
+
visibleDeposits.length > 0 && /* @__PURE__ */ jsxs18("div", { className: "rs-history-list", children: [
|
|
7247
|
+
visibleDeposits.map((deposit, i) => /* @__PURE__ */ jsx20(HistoryCard, { deposit }, deposit.txHash || i)),
|
|
7248
|
+
hasMore && /* @__PURE__ */ jsx20(
|
|
7278
7249
|
"button",
|
|
7279
7250
|
{
|
|
7280
7251
|
type: "button",
|
|
@@ -7286,7 +7257,7 @@ function DepositHistoryPanel({
|
|
|
7286
7257
|
)
|
|
7287
7258
|
] })
|
|
7288
7259
|
] }),
|
|
7289
|
-
/* @__PURE__ */
|
|
7260
|
+
/* @__PURE__ */ jsx20(PoweredBy, {})
|
|
7290
7261
|
] })
|
|
7291
7262
|
]
|
|
7292
7263
|
}
|
|
@@ -7312,7 +7283,7 @@ function HistoryCard({ deposit }) {
|
|
|
7312
7283
|
const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
|
|
7313
7284
|
const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
|
|
7314
7285
|
const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
|
|
7315
|
-
return /* @__PURE__ */
|
|
7286
|
+
return /* @__PURE__ */ jsxs18(
|
|
7316
7287
|
"button",
|
|
7317
7288
|
{
|
|
7318
7289
|
type: "button",
|
|
@@ -7320,38 +7291,38 @@ function HistoryCard({ deposit }) {
|
|
|
7320
7291
|
onClick: () => setExpanded((v) => !v),
|
|
7321
7292
|
"aria-expanded": expanded,
|
|
7322
7293
|
children: [
|
|
7323
|
-
/* @__PURE__ */
|
|
7324
|
-
/* @__PURE__ */
|
|
7325
|
-
/* @__PURE__ */
|
|
7326
|
-
sourceChainIcon && /* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-card-row", children: [
|
|
7295
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-card-icons", children: [
|
|
7296
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-card-token", children: sourceTokenIcon ? /* @__PURE__ */ jsx20("img", { src: sourceTokenIcon, alt: "" }) : sourceSymbol.slice(0, 2) }),
|
|
7297
|
+
sourceChainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx20("img", { src: sourceChainIcon, alt: "" }) })
|
|
7327
7298
|
] }),
|
|
7328
|
-
/* @__PURE__ */
|
|
7329
|
-
/* @__PURE__ */
|
|
7330
|
-
date && /* @__PURE__ */
|
|
7299
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-card-text", children: [
|
|
7300
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
7301
|
+
date && /* @__PURE__ */ jsx20("span", { className: "rs-history-card-date", children: date })
|
|
7331
7302
|
] }),
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
/* @__PURE__ */
|
|
7334
|
-
/* @__PURE__ */
|
|
7303
|
+
/* @__PURE__ */ jsxs18("div", { className: "rs-history-card-side", children: [
|
|
7304
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-history-card-amount", children: displayAmount }),
|
|
7305
|
+
/* @__PURE__ */ jsx20("span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
|
|
7335
7306
|
] })
|
|
7336
7307
|
] }),
|
|
7337
|
-
/* @__PURE__ */
|
|
7338
|
-
sourceChainName && /* @__PURE__ */
|
|
7339
|
-
/* @__PURE__ */
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
/* @__PURE__ */
|
|
7342
|
-
sourceChainIcon && /* @__PURE__ */
|
|
7308
|
+
/* @__PURE__ */ jsx20("div", { className: "rs-history-card-panel", children: /* @__PURE__ */ jsx20("div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ jsxs18("div", { className: "rs-history-card-details", children: [
|
|
7309
|
+
sourceChainName && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
7310
|
+
/* @__PURE__ */ jsx20("span", { children: "Source chain" }),
|
|
7311
|
+
/* @__PURE__ */ jsxs18("span", { className: "rs-amount-detail-value", children: [
|
|
7312
|
+
/* @__PURE__ */ jsx20("span", { children: sourceChainName }),
|
|
7313
|
+
sourceChainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx20("img", { src: sourceChainIcon, alt: "" }) })
|
|
7343
7314
|
] })
|
|
7344
7315
|
] }),
|
|
7345
|
-
targetChainName && /* @__PURE__ */
|
|
7346
|
-
/* @__PURE__ */
|
|
7347
|
-
/* @__PURE__ */
|
|
7348
|
-
/* @__PURE__ */
|
|
7349
|
-
targetChainIcon && /* @__PURE__ */
|
|
7316
|
+
targetChainName && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
7317
|
+
/* @__PURE__ */ jsx20("span", { children: "Destination chain" }),
|
|
7318
|
+
/* @__PURE__ */ jsxs18("span", { className: "rs-amount-detail-value", children: [
|
|
7319
|
+
/* @__PURE__ */ jsx20("span", { children: targetChainName }),
|
|
7320
|
+
targetChainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx20("img", { src: targetChainIcon, alt: "" }) })
|
|
7350
7321
|
] })
|
|
7351
7322
|
] }),
|
|
7352
|
-
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */
|
|
7353
|
-
/* @__PURE__ */
|
|
7354
|
-
/* @__PURE__ */
|
|
7323
|
+
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
7324
|
+
/* @__PURE__ */ jsx20("span", { children: "Transaction details" }),
|
|
7325
|
+
/* @__PURE__ */ jsxs18(
|
|
7355
7326
|
"a",
|
|
7356
7327
|
{
|
|
7357
7328
|
href: srcTxUrl,
|
|
@@ -7360,8 +7331,8 @@ function HistoryCard({ deposit }) {
|
|
|
7360
7331
|
className: "rs-history-card-link",
|
|
7361
7332
|
onClick: (e) => e.stopPropagation(),
|
|
7362
7333
|
children: [
|
|
7363
|
-
/* @__PURE__ */
|
|
7364
|
-
/* @__PURE__ */
|
|
7334
|
+
/* @__PURE__ */ jsx20("span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7335
|
+
/* @__PURE__ */ jsx20(ArrowUpRightIcon, {})
|
|
7365
7336
|
]
|
|
7366
7337
|
}
|
|
7367
7338
|
)
|
|
@@ -7374,9 +7345,9 @@ function HistoryCard({ deposit }) {
|
|
|
7374
7345
|
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
7375
7346
|
|
|
7376
7347
|
// src/DepositModal.tsx
|
|
7377
|
-
import { jsx as
|
|
7348
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7378
7349
|
var ReownDepositInner = lazy2(
|
|
7379
|
-
() => import("./DepositModalReown-
|
|
7350
|
+
() => import("./DepositModalReown-EXI7MW65.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
7380
7351
|
);
|
|
7381
7352
|
function sortByCreatedAtDesc(items) {
|
|
7382
7353
|
return [...items].sort((a, b) => {
|
|
@@ -7392,7 +7363,7 @@ function DepositModal(props) {
|
|
|
7392
7363
|
"dappWalletClient"
|
|
7393
7364
|
);
|
|
7394
7365
|
if (needsReown) {
|
|
7395
|
-
return /* @__PURE__ */
|
|
7366
|
+
return /* @__PURE__ */ jsx21(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx21(
|
|
7396
7367
|
ReownDepositInner,
|
|
7397
7368
|
{
|
|
7398
7369
|
...props,
|
|
@@ -7400,7 +7371,7 @@ function DepositModal(props) {
|
|
|
7400
7371
|
}
|
|
7401
7372
|
) });
|
|
7402
7373
|
}
|
|
7403
|
-
return /* @__PURE__ */
|
|
7374
|
+
return /* @__PURE__ */ jsx21(
|
|
7404
7375
|
DepositModalInner,
|
|
7405
7376
|
{
|
|
7406
7377
|
...props,
|
|
@@ -7630,7 +7601,7 @@ function DepositModalInner({
|
|
|
7630
7601
|
}, [isOpen, store]);
|
|
7631
7602
|
const showBackButton = uiConfig?.showBackButton ?? true;
|
|
7632
7603
|
const canGoBack = backHandler !== void 0;
|
|
7633
|
-
return /* @__PURE__ */
|
|
7604
|
+
return /* @__PURE__ */ jsx21(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx21(
|
|
7634
7605
|
Modal,
|
|
7635
7606
|
{
|
|
7636
7607
|
isOpen,
|
|
@@ -7638,20 +7609,20 @@ function DepositModalInner({
|
|
|
7638
7609
|
className,
|
|
7639
7610
|
inline,
|
|
7640
7611
|
closeOnOverlayClick,
|
|
7641
|
-
children: /* @__PURE__ */
|
|
7642
|
-
/* @__PURE__ */
|
|
7643
|
-
/* @__PURE__ */
|
|
7612
|
+
children: /* @__PURE__ */ jsxs19("div", { ref: modalRef, className: "rs-modal", children: [
|
|
7613
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
|
|
7614
|
+
/* @__PURE__ */ jsx21("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx21(
|
|
7644
7615
|
"button",
|
|
7645
7616
|
{
|
|
7646
7617
|
type: "button",
|
|
7647
7618
|
className: "rs-modal-header-back",
|
|
7648
7619
|
"aria-label": "Go back",
|
|
7649
7620
|
onClick: backHandler,
|
|
7650
|
-
children: /* @__PURE__ */
|
|
7621
|
+
children: /* @__PURE__ */ jsx21(ChevronLeftIcon, {})
|
|
7651
7622
|
}
|
|
7652
7623
|
) }),
|
|
7653
|
-
/* @__PURE__ */
|
|
7654
|
-
historyButtonVisible && /* @__PURE__ */
|
|
7624
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-modal-header-nav-right", children: [
|
|
7625
|
+
historyButtonVisible && /* @__PURE__ */ jsx21(
|
|
7655
7626
|
"button",
|
|
7656
7627
|
{
|
|
7657
7628
|
type: "button",
|
|
@@ -7659,22 +7630,22 @@ function DepositModalInner({
|
|
|
7659
7630
|
"aria-label": "Deposit history",
|
|
7660
7631
|
onClick: handleHistoryOpen,
|
|
7661
7632
|
disabled: !recipient,
|
|
7662
|
-
children: /* @__PURE__ */
|
|
7633
|
+
children: /* @__PURE__ */ jsx21(HistoryIcon, {})
|
|
7663
7634
|
}
|
|
7664
7635
|
),
|
|
7665
|
-
/* @__PURE__ */
|
|
7636
|
+
/* @__PURE__ */ jsx21(
|
|
7666
7637
|
"button",
|
|
7667
7638
|
{
|
|
7668
7639
|
type: "button",
|
|
7669
7640
|
onClick: onClose,
|
|
7670
7641
|
className: "rs-modal-close",
|
|
7671
7642
|
"aria-label": "Close",
|
|
7672
|
-
children: /* @__PURE__ */
|
|
7643
|
+
children: /* @__PURE__ */ jsx21(CloseIcon, {})
|
|
7673
7644
|
}
|
|
7674
7645
|
)
|
|
7675
7646
|
] })
|
|
7676
7647
|
] }),
|
|
7677
|
-
recipientIsContract ? /* @__PURE__ */
|
|
7648
|
+
recipientIsContract ? /* @__PURE__ */ jsx21("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx21(Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ jsx21(
|
|
7678
7649
|
DepositFlow,
|
|
7679
7650
|
{
|
|
7680
7651
|
dappWalletClient,
|
|
@@ -7716,7 +7687,7 @@ function DepositModalInner({
|
|
|
7716
7687
|
debug
|
|
7717
7688
|
}
|
|
7718
7689
|
),
|
|
7719
|
-
showHistoryButton && historyOpen && /* @__PURE__ */
|
|
7690
|
+
showHistoryButton && historyOpen && /* @__PURE__ */ jsx21(
|
|
7720
7691
|
DepositHistoryPanel,
|
|
7721
7692
|
{
|
|
7722
7693
|
deposits: historyDeposits,
|