@rhinestone/deposit-modal 0.7.0 → 0.8.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-T4RRW5FM.mjs → DepositModalReown-4BSHOQ5Y.mjs} +6 -6
- package/dist/{DepositModalReown-CHVDFNEX.cjs → DepositModalReown-UND3DEJH.cjs} +9 -9
- package/dist/{WithdrawModalReown-Q6MUMZTX.mjs → WithdrawModalReown-FVXSSGY5.mjs} +5 -5
- package/dist/{WithdrawModalReown-YZMZTN6E.cjs → WithdrawModalReown-TVZWJKQI.cjs} +8 -8
- package/dist/caip-C_ZYFIGa.d.cts +77 -0
- package/dist/caip-C_ZYFIGa.d.ts +77 -0
- package/dist/{chunk-J52W34Y7.mjs → chunk-2JPB3PLB.mjs} +2 -2
- package/dist/{chunk-XOBLFIGV.cjs → chunk-4NN7UTWQ.cjs} +4 -4
- package/dist/{chunk-UZENNYHS.mjs → chunk-7KHEIMWD.mjs} +102 -59
- package/dist/{chunk-UN6MEOOA.cjs → chunk-7OKA6GNA.cjs} +293 -137
- package/dist/{chunk-QSMPJQTX.cjs → chunk-D3Y7ZBED.cjs} +403 -360
- package/dist/{chunk-4JLYWRQA.mjs → chunk-DABKCJVL.mjs} +1 -1
- package/dist/{chunk-KUURQOTT.cjs → chunk-HQWZCOMS.cjs} +109 -106
- package/dist/{chunk-OYPFPEIT.mjs → chunk-NASHLEVQ.mjs} +304 -148
- package/dist/{chunk-CPMHRMPH.mjs → chunk-O5OKA27M.mjs} +55 -23
- package/dist/{chunk-6P3WNDED.cjs → chunk-Q3W53BKR.cjs} +7 -7
- package/dist/{chunk-CLUR2J72.mjs → chunk-T43VUEJH.mjs} +21 -18
- package/dist/{chunk-HH46H6ZI.cjs → chunk-U7SVYWVD.cjs} +56 -24
- package/dist/{chunk-K6J3RDDK.mjs → chunk-WK5AFRSP.mjs} +1 -1
- package/dist/{chunk-RLMXWLF4.cjs → chunk-XRWQMIBY.cjs} +3 -3
- package/dist/constants.cjs +4 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +5 -3
- 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 +11 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +12 -8
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +29 -0
- package/dist/{types-6ROxwyfG.d.cts → types--LQWg_4W.d.cts} +1 -1
- package/dist/{types-6ROxwyfG.d.ts → types--LQWg_4W.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
- package/dist/caip-CsslyHGL.d.cts +0 -62
- package/dist/caip-CsslyHGL.d.ts +0 -62
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAIN_BY_ID,
|
|
3
|
+
HYPERCORE_CHAIN_ID,
|
|
4
|
+
HYPERCORE_MAINNET_CAIP2,
|
|
5
|
+
HYPERCORE_SOURCE_TOKENS,
|
|
3
6
|
NATIVE_TOKEN_ADDRESS,
|
|
4
7
|
findTokenDecimals,
|
|
5
8
|
getChainIcon,
|
|
@@ -9,11 +12,14 @@ import {
|
|
|
9
12
|
getSupportedChainIds,
|
|
10
13
|
getTokenAddress,
|
|
11
14
|
getTokenDecimalsByAddress,
|
|
12
|
-
getTokenIcon,
|
|
13
15
|
getTokenSymbol,
|
|
16
|
+
isHyperCoreCaip2,
|
|
17
|
+
isRegistryTokenOnChain,
|
|
14
18
|
isSolanaCaip2,
|
|
15
|
-
parseEvmChainId
|
|
16
|
-
|
|
19
|
+
parseEvmChainId,
|
|
20
|
+
toEvmCaip2,
|
|
21
|
+
tokenIconUrl
|
|
22
|
+
} from "./chunk-O5OKA27M.mjs";
|
|
17
23
|
|
|
18
24
|
// src/components/ui/Modal.tsx
|
|
19
25
|
import {
|
|
@@ -1005,7 +1011,8 @@ function createDepositService(baseUrl, options) {
|
|
|
1005
1011
|
const url = apiUrl("/quotes/preview");
|
|
1006
1012
|
const body = {
|
|
1007
1013
|
account: params.account,
|
|
1008
|
-
|
|
1014
|
+
// HyperCore has its own CAIP-2 namespace — never the eip155 placeholder.
|
|
1015
|
+
sourceChainId: params.sourceChainId === "hypercore" ? HYPERCORE_MAINNET_CAIP2 : `eip155:${params.sourceChainId}`,
|
|
1009
1016
|
sourceToken: params.sourceToken,
|
|
1010
1017
|
amount: params.amount
|
|
1011
1018
|
};
|
|
@@ -1069,6 +1076,31 @@ function createDepositService(baseUrl, options) {
|
|
|
1069
1076
|
return {};
|
|
1070
1077
|
}
|
|
1071
1078
|
},
|
|
1079
|
+
async fetchPricesByAddress(caip2Ids) {
|
|
1080
|
+
const list = caip2Ids.filter((id) => id.length > 0);
|
|
1081
|
+
if (list.length === 0) return {};
|
|
1082
|
+
const url = apiUrl(
|
|
1083
|
+
`/prices?${new URLSearchParams({ addresses: list.join(",") }).toString()}`
|
|
1084
|
+
);
|
|
1085
|
+
try {
|
|
1086
|
+
const response = await fetch(url, {
|
|
1087
|
+
method: "GET",
|
|
1088
|
+
headers: { "Content-Type": "application/json" },
|
|
1089
|
+
cache: "no-store"
|
|
1090
|
+
});
|
|
1091
|
+
if (!response.ok) {
|
|
1092
|
+
debugError(debug, scope, "fetchPricesByAddress:failed", {
|
|
1093
|
+
status: response.status
|
|
1094
|
+
});
|
|
1095
|
+
return {};
|
|
1096
|
+
}
|
|
1097
|
+
const data = await response.json();
|
|
1098
|
+
return data.prices ?? {};
|
|
1099
|
+
} catch (err) {
|
|
1100
|
+
debugError(debug, scope, "fetchPricesByAddress:error", err);
|
|
1101
|
+
return {};
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1072
1104
|
async getSwappedWidgetUrl(params) {
|
|
1073
1105
|
const url = apiUrl("/onramp/swapped/widget-url");
|
|
1074
1106
|
debugLog(debug, scope, "getSwappedWidgetUrl:request", {
|
|
@@ -1330,8 +1362,13 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1330
1362
|
function normalizeDirectToken(token) {
|
|
1331
1363
|
const rawChainId = extractNumber(token, "chainId") ?? extractNumber(token.chain, "id");
|
|
1332
1364
|
const rawChainString = extractString(token, "chainId") ?? extractString(token.chain, "id");
|
|
1333
|
-
const chainId = rawChainId ?? (rawChainString ? isSolanaCaip2(rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" :
|
|
1365
|
+
const chainId = rawChainId ?? (rawChainString ? isSolanaCaip2(rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : (
|
|
1366
|
+
// HyperCore (`hypercore:mainnet`) is a non-EVM source; keep its USDC
|
|
1367
|
+
// instead of dropping it as an unparseable chain string.
|
|
1368
|
+
isHyperCoreCaip2(rawChainString) || rawChainString.toLowerCase() === "hypercore" ? "hypercore" : parseEvmChainId(rawChainString)
|
|
1369
|
+
) : null);
|
|
1334
1370
|
if (chainId === null) return null;
|
|
1371
|
+
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ? HYPERCORE_CHAIN_ID : void 0;
|
|
1335
1372
|
const symbol = extractString(token, "symbol") ?? extractString(token, "tokenSymbol") ?? extractString(token, "tokenName") ?? extractString(token, "name");
|
|
1336
1373
|
if (!symbol) return null;
|
|
1337
1374
|
const balanceValue = extractString(token, "balance") ?? extractString(token, "amount") ?? extractString(token, "value") ?? extractString(token, "rawBalance") ?? extractNumber(token, "balance")?.toString() ?? extractNumber(token, "amount")?.toString() ?? extractNumber(token, "value")?.toString() ?? extractNumber(token, "rawBalance")?.toString();
|
|
@@ -1339,14 +1376,14 @@ function normalizeDirectToken(token) {
|
|
|
1339
1376
|
const address = extractString(token, "address") ?? extractString(token, "tokenAddress") ?? extractString(
|
|
1340
1377
|
token.token,
|
|
1341
1378
|
"address"
|
|
1342
|
-
) ?? (
|
|
1379
|
+
) ?? (registryChainId !== void 0 ? getTokenAddress(symbol, registryChainId) : void 0);
|
|
1343
1380
|
if (!address) return null;
|
|
1344
1381
|
const balanceUsd = extractNumber(token, "balanceUsd") ?? extractNumber(token, "usdValue") ?? extractNumber(token, "valueUsd") ?? extractNumericString(token, "balanceUsd") ?? extractNumericString(token, "usdValue") ?? extractNumericString(token, "valueUsd") ?? 0;
|
|
1345
1382
|
const isSolanaToken = chainId === "solana";
|
|
1346
|
-
const registrySymbol = isSolanaToken ? "Token" : getTokenSymbol(address,
|
|
1383
|
+
const registrySymbol = isSolanaToken ? "Token" : getTokenSymbol(address, registryChainId);
|
|
1347
1384
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1348
1385
|
const backendDecimals = extractNumber(token, "decimals") ?? extractNumber(token, "tokenDecimals");
|
|
1349
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? getTokenDecimalsByAddress(address,
|
|
1386
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? getTokenDecimalsByAddress(address, registryChainId) : backendDecimals ?? 18;
|
|
1350
1387
|
return {
|
|
1351
1388
|
chainId,
|
|
1352
1389
|
address,
|
|
@@ -2747,11 +2784,117 @@ function ConnectStep({
|
|
|
2747
2784
|
}
|
|
2748
2785
|
ConnectStep.displayName = "ConnectStep";
|
|
2749
2786
|
|
|
2787
|
+
// src/components/ui/TokenIcon.tsx
|
|
2788
|
+
import { useState as useState2 } from "react";
|
|
2789
|
+
import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
|
|
2790
|
+
function preconnectIconCdn() {
|
|
2791
|
+
if (typeof document === "undefined") return;
|
|
2792
|
+
if (document.getElementById("rs-icon-cdn-preconnect")) return;
|
|
2793
|
+
const link = document.createElement("link");
|
|
2794
|
+
link.id = "rs-icon-cdn-preconnect";
|
|
2795
|
+
link.rel = "preconnect";
|
|
2796
|
+
link.href = "https://s3.rhinestone.dev";
|
|
2797
|
+
link.crossOrigin = "anonymous";
|
|
2798
|
+
document.head.appendChild(link);
|
|
2799
|
+
}
|
|
2800
|
+
preconnectIconCdn();
|
|
2801
|
+
function TokenIcon({ symbol, className, fallback }) {
|
|
2802
|
+
const [loadedSymbol, setLoadedSymbol] = useState2(null);
|
|
2803
|
+
const [erroredSymbol, setErroredSymbol] = useState2(null);
|
|
2804
|
+
if (erroredSymbol === symbol) {
|
|
2805
|
+
return /* @__PURE__ */ jsx19(Fragment3, { children: fallback });
|
|
2806
|
+
}
|
|
2807
|
+
const loading = loadedSymbol !== symbol;
|
|
2808
|
+
return /* @__PURE__ */ jsx19(
|
|
2809
|
+
"img",
|
|
2810
|
+
{
|
|
2811
|
+
src: tokenIconUrl(symbol),
|
|
2812
|
+
alt: "",
|
|
2813
|
+
className: `rs-token-icon ${className ?? ""}`.trimEnd(),
|
|
2814
|
+
decoding: "async",
|
|
2815
|
+
"data-loading": loading ? "" : void 0,
|
|
2816
|
+
onLoad: () => setLoadedSymbol(symbol),
|
|
2817
|
+
onError: () => setErroredSymbol(symbol)
|
|
2818
|
+
},
|
|
2819
|
+
symbol
|
|
2820
|
+
);
|
|
2821
|
+
}
|
|
2822
|
+
TokenIcon.displayName = "TokenIcon";
|
|
2823
|
+
|
|
2824
|
+
// src/core/useTokenPrices.ts
|
|
2825
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
2826
|
+
function isErc20(token) {
|
|
2827
|
+
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !== NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
2828
|
+
}
|
|
2829
|
+
function caip2For(token) {
|
|
2830
|
+
return `${toEvmCaip2(token.chainId)}:${token.address.toLowerCase()}`;
|
|
2831
|
+
}
|
|
2832
|
+
async function fetchTokenPriceUsd(service, token) {
|
|
2833
|
+
if (isErc20(token)) {
|
|
2834
|
+
const caip2 = caip2For(token);
|
|
2835
|
+
const prices2 = await service.fetchPricesByAddress([caip2]);
|
|
2836
|
+
const price2 = prices2[caip2];
|
|
2837
|
+
return typeof price2 === "number" && price2 > 0 ? price2 : null;
|
|
2838
|
+
}
|
|
2839
|
+
const symbol = token.symbol.toUpperCase();
|
|
2840
|
+
const prices = await service.fetchPrices([symbol]);
|
|
2841
|
+
const price = prices[symbol];
|
|
2842
|
+
return typeof price === "number" && price > 0 ? price : null;
|
|
2843
|
+
}
|
|
2844
|
+
function useTokenPrices(service, tokens) {
|
|
2845
|
+
const [prices, setPrices] = useState3({});
|
|
2846
|
+
const defined = tokens.filter((t) => Boolean(t?.symbol));
|
|
2847
|
+
const entries = [
|
|
2848
|
+
...new Map(
|
|
2849
|
+
defined.map((token) => {
|
|
2850
|
+
const erc20 = isErc20(token);
|
|
2851
|
+
const caip2 = erc20 ? caip2For(token) : null;
|
|
2852
|
+
const symbol = token.symbol.toUpperCase();
|
|
2853
|
+
return [caip2 ?? `sym:${symbol}`, { symbol, caip2 }];
|
|
2854
|
+
})
|
|
2855
|
+
).values()
|
|
2856
|
+
].sort(
|
|
2857
|
+
(a, b) => (a.caip2 ?? a.symbol).localeCompare(b.caip2 ?? b.symbol)
|
|
2858
|
+
);
|
|
2859
|
+
const key = JSON.stringify(entries);
|
|
2860
|
+
useEffect4(() => {
|
|
2861
|
+
if (key === "[]") return;
|
|
2862
|
+
let cancelled = false;
|
|
2863
|
+
const parsed = JSON.parse(key);
|
|
2864
|
+
const symbols = [
|
|
2865
|
+
...new Set(parsed.filter((e) => !e.caip2).map((e) => e.symbol))
|
|
2866
|
+
];
|
|
2867
|
+
const caip2Ids = [
|
|
2868
|
+
...new Set(
|
|
2869
|
+
parsed.filter((e) => e.caip2).map((e) => e.caip2)
|
|
2870
|
+
)
|
|
2871
|
+
];
|
|
2872
|
+
Promise.all([
|
|
2873
|
+
symbols.length > 0 ? service.fetchPrices(symbols) : Promise.resolve({}),
|
|
2874
|
+
caip2Ids.length > 0 ? service.fetchPricesByAddress(caip2Ids) : Promise.resolve({})
|
|
2875
|
+
]).then(([bySymbol, byAddress]) => {
|
|
2876
|
+
if (cancelled) return;
|
|
2877
|
+
const merged = { ...bySymbol };
|
|
2878
|
+
for (const entry of parsed) {
|
|
2879
|
+
if (!entry.caip2) continue;
|
|
2880
|
+
const price = byAddress[entry.caip2];
|
|
2881
|
+
if (typeof price === "number") merged[entry.symbol] = price;
|
|
2882
|
+
}
|
|
2883
|
+
setPrices(merged);
|
|
2884
|
+
}).catch(() => {
|
|
2885
|
+
});
|
|
2886
|
+
return () => {
|
|
2887
|
+
cancelled = true;
|
|
2888
|
+
};
|
|
2889
|
+
}, [service, key]);
|
|
2890
|
+
return prices;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2750
2893
|
// src/components/steps/ProcessingStep.tsx
|
|
2751
|
-
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef4, useState as
|
|
2894
|
+
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef4, useState as useState6 } from "react";
|
|
2752
2895
|
|
|
2753
2896
|
// src/components/ui/Button.tsx
|
|
2754
|
-
import { Fragment as
|
|
2897
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2755
2898
|
function Button({
|
|
2756
2899
|
children,
|
|
2757
2900
|
variant = "accent",
|
|
@@ -2771,7 +2914,7 @@ function Button({
|
|
|
2771
2914
|
className
|
|
2772
2915
|
].filter(Boolean).join(" ");
|
|
2773
2916
|
const showInlineLoadingText = loading && loadingText !== void 0;
|
|
2774
|
-
return /* @__PURE__ */
|
|
2917
|
+
return /* @__PURE__ */ jsx20(
|
|
2775
2918
|
"button",
|
|
2776
2919
|
{
|
|
2777
2920
|
className: classes,
|
|
@@ -2779,11 +2922,11 @@ function Button({
|
|
|
2779
2922
|
"aria-busy": loading || void 0,
|
|
2780
2923
|
...props,
|
|
2781
2924
|
children: showInlineLoadingText ? /* @__PURE__ */ jsxs17("span", { className: "rs-button__loading-row", children: [
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2784
|
-
] }) : /* @__PURE__ */ jsxs17(
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
loading && /* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsx20(Spinner, { className: "rs-spinner--sm" }),
|
|
2926
|
+
/* @__PURE__ */ jsx20("span", { children: loadingText })
|
|
2927
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
2928
|
+
/* @__PURE__ */ jsx20("span", { className: loading ? "rs-button__content--hidden" : "", children }),
|
|
2929
|
+
loading && /* @__PURE__ */ jsx20("span", { className: "rs-button__spinner", children: /* @__PURE__ */ jsx20(Spinner, { className: "rs-spinner--sm" }) })
|
|
2787
2930
|
] })
|
|
2788
2931
|
}
|
|
2789
2932
|
);
|
|
@@ -2792,16 +2935,16 @@ Button.displayName = "Button";
|
|
|
2792
2935
|
|
|
2793
2936
|
// src/components/ui/Tooltip.tsx
|
|
2794
2937
|
import {
|
|
2795
|
-
useState as
|
|
2938
|
+
useState as useState4,
|
|
2796
2939
|
useRef as useRef3,
|
|
2797
|
-
useEffect as
|
|
2940
|
+
useEffect as useEffect5,
|
|
2798
2941
|
useCallback as useCallback2
|
|
2799
2942
|
} from "react";
|
|
2800
2943
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2801
|
-
import { jsx as
|
|
2944
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2802
2945
|
function Tooltip({ content, children, className }) {
|
|
2803
|
-
const [open, setOpen] =
|
|
2804
|
-
const [position, setPosition] =
|
|
2946
|
+
const [open, setOpen] = useState4(false);
|
|
2947
|
+
const [position, setPosition] = useState4(null);
|
|
2805
2948
|
const triggerRef = useRef3(null);
|
|
2806
2949
|
const bubbleRef = useRef3(null);
|
|
2807
2950
|
const updatePosition = useCallback2(() => {
|
|
@@ -2813,7 +2956,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2813
2956
|
left: rect.left + rect.width / 2
|
|
2814
2957
|
});
|
|
2815
2958
|
}, []);
|
|
2816
|
-
|
|
2959
|
+
useEffect5(() => {
|
|
2817
2960
|
if (!open) return;
|
|
2818
2961
|
updatePosition();
|
|
2819
2962
|
function handleOutside(event) {
|
|
@@ -2847,7 +2990,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2847
2990
|
onMouseEnter: () => setOpen(true),
|
|
2848
2991
|
onMouseLeave: () => setOpen(false),
|
|
2849
2992
|
children: [
|
|
2850
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ jsx21(
|
|
2851
2994
|
"span",
|
|
2852
2995
|
{
|
|
2853
2996
|
className: "rs-tooltip-trigger",
|
|
@@ -2869,7 +3012,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2869
3012
|
}
|
|
2870
3013
|
),
|
|
2871
3014
|
open && position && typeof document !== "undefined" && createPortal2(
|
|
2872
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ jsx21(
|
|
2873
3016
|
"span",
|
|
2874
3017
|
{
|
|
2875
3018
|
ref: bubbleRef,
|
|
@@ -2888,16 +3031,16 @@ function Tooltip({ content, children, className }) {
|
|
|
2888
3031
|
Tooltip.displayName = "Tooltip";
|
|
2889
3032
|
|
|
2890
3033
|
// src/components/ui/FeesAccordion.tsx
|
|
2891
|
-
import { useState as
|
|
2892
|
-
import { jsx as
|
|
3034
|
+
import { useState as useState5 } from "react";
|
|
3035
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2893
3036
|
function FeesAccordion({ total, rows, tooltip }) {
|
|
2894
|
-
const [open, setOpen] =
|
|
3037
|
+
const [open, setOpen] = useState5(false);
|
|
2895
3038
|
const expandable = rows.length > 0;
|
|
2896
3039
|
return /* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion", children: [
|
|
2897
3040
|
/* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion-summary", children: [
|
|
2898
3041
|
/* @__PURE__ */ jsxs19("span", { className: "rs-fees-accordion-label", children: [
|
|
2899
|
-
/* @__PURE__ */
|
|
2900
|
-
tooltip && /* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx22("span", { children: "Fees" }),
|
|
3043
|
+
tooltip && /* @__PURE__ */ jsx22(Tooltip, { content: tooltip, children: /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ jsx22(InfoIcon, {}) }) })
|
|
2901
3044
|
] }),
|
|
2902
3045
|
/* @__PURE__ */ jsxs19(
|
|
2903
3046
|
"button",
|
|
@@ -2909,35 +3052,35 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
2909
3052
|
disabled: !expandable,
|
|
2910
3053
|
onClick: () => expandable && setOpen((o) => !o),
|
|
2911
3054
|
children: [
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
expandable && /* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsx22("span", { children: total }),
|
|
3056
|
+
expandable && /* @__PURE__ */ jsx22(
|
|
2914
3057
|
"span",
|
|
2915
3058
|
{
|
|
2916
3059
|
className: `rs-fees-accordion-chevron${open ? " rs-fees-accordion-chevron--open" : ""}`,
|
|
2917
3060
|
"aria-hidden": "true",
|
|
2918
|
-
children: /* @__PURE__ */
|
|
3061
|
+
children: /* @__PURE__ */ jsx22(ChevronDownIcon, {})
|
|
2919
3062
|
}
|
|
2920
3063
|
)
|
|
2921
3064
|
]
|
|
2922
3065
|
}
|
|
2923
3066
|
)
|
|
2924
3067
|
] }),
|
|
2925
|
-
expandable && open && /* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
3068
|
+
expandable && open && /* @__PURE__ */ jsx22("div", { className: "rs-fees-accordion-rows", children: rows.map((row, i) => /* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion-row", children: [
|
|
3069
|
+
/* @__PURE__ */ jsx22("span", { children: row.label }),
|
|
2927
3070
|
/* @__PURE__ */ jsxs19("span", { className: "rs-review-detail-value", children: [
|
|
2928
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsx22(
|
|
2929
3072
|
"span",
|
|
2930
3073
|
{
|
|
2931
3074
|
className: row.strike ? "rs-review-detail-value--strike" : void 0,
|
|
2932
3075
|
children: row.value
|
|
2933
3076
|
}
|
|
2934
3077
|
),
|
|
2935
|
-
row.tooltip && /* @__PURE__ */
|
|
3078
|
+
row.tooltip && /* @__PURE__ */ jsx22(Tooltip, { content: row.tooltip, children: /* @__PURE__ */ jsx22(
|
|
2936
3079
|
"span",
|
|
2937
3080
|
{
|
|
2938
3081
|
className: "rs-review-detail-info",
|
|
2939
3082
|
"aria-label": `${row.label} info`,
|
|
2940
|
-
children: /* @__PURE__ */
|
|
3083
|
+
children: /* @__PURE__ */ jsx22(InfoIcon, {})
|
|
2941
3084
|
}
|
|
2942
3085
|
) })
|
|
2943
3086
|
] })
|
|
@@ -2947,13 +3090,13 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
2947
3090
|
FeesAccordion.displayName = "FeesAccordion";
|
|
2948
3091
|
|
|
2949
3092
|
// src/components/steps/SwappedReceipt.tsx
|
|
2950
|
-
import { jsx as
|
|
3093
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2951
3094
|
function SwappedReceipt({
|
|
2952
3095
|
onrampMethod,
|
|
2953
3096
|
onrampMethodIcon,
|
|
2954
3097
|
amountPaid,
|
|
2955
3098
|
depositedAmount,
|
|
2956
|
-
|
|
3099
|
+
depositedSymbol,
|
|
2957
3100
|
feesTotal,
|
|
2958
3101
|
feeRows,
|
|
2959
3102
|
feesTooltip,
|
|
@@ -2963,27 +3106,27 @@ function SwappedReceipt({
|
|
|
2963
3106
|
}) {
|
|
2964
3107
|
return /* @__PURE__ */ jsxs20("div", { className: "rs-screen", children: [
|
|
2965
3108
|
/* @__PURE__ */ jsxs20("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2966
|
-
/* @__PURE__ */
|
|
3109
|
+
/* @__PURE__ */ jsx23(BodyHeader, { icon: /* @__PURE__ */ jsx23(CheckIcon, {}), title: "Deposit successful" }),
|
|
2967
3110
|
/* @__PURE__ */ jsxs20("div", { className: "rs-review-details", children: [
|
|
2968
3111
|
onrampMethod && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
2969
|
-
/* @__PURE__ */
|
|
3112
|
+
/* @__PURE__ */ jsx23("span", { children: "Onramp method" }),
|
|
2970
3113
|
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
onrampMethodIcon && /* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx23("span", { children: onrampMethod }),
|
|
3115
|
+
onrampMethodIcon && /* @__PURE__ */ jsx23("span", { className: "rs-review-detail-icon rs-review-detail-icon--square", children: /* @__PURE__ */ jsx23("img", { src: onrampMethodIcon, alt: "" }) })
|
|
2973
3116
|
] })
|
|
2974
3117
|
] }),
|
|
2975
3118
|
amountPaid && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
3119
|
+
/* @__PURE__ */ jsx23("span", { children: "Amount paid" }),
|
|
3120
|
+
/* @__PURE__ */ jsx23("span", { className: "rs-review-detail-value", children: amountPaid })
|
|
2978
3121
|
] }),
|
|
2979
3122
|
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
2980
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ jsx23("span", { children: "Deposited amount" }),
|
|
2981
3124
|
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
|
|
3125
|
+
/* @__PURE__ */ jsx23("span", { children: depositedAmount }),
|
|
3126
|
+
depositedSymbol && /* @__PURE__ */ jsx23("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx23(TokenIcon, { symbol: depositedSymbol }) })
|
|
2984
3127
|
] })
|
|
2985
3128
|
] }),
|
|
2986
|
-
feesTotal != null && /* @__PURE__ */
|
|
3129
|
+
feesTotal != null && /* @__PURE__ */ jsx23(
|
|
2987
3130
|
FeesAccordion,
|
|
2988
3131
|
{
|
|
2989
3132
|
total: feesTotal,
|
|
@@ -2993,11 +3136,11 @@ function SwappedReceipt({
|
|
|
2993
3136
|
)
|
|
2994
3137
|
] }),
|
|
2995
3138
|
/* @__PURE__ */ jsxs20("div", { className: "rs-screen-button-row", children: [
|
|
2996
|
-
onNewDeposit && /* @__PURE__ */
|
|
2997
|
-
onClose && /* @__PURE__ */
|
|
3139
|
+
onNewDeposit && /* @__PURE__ */ jsx23(Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
3140
|
+
onClose && /* @__PURE__ */ jsx23(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
2998
3141
|
] })
|
|
2999
3142
|
] }),
|
|
3000
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsx23(PoweredBy, {})
|
|
3001
3144
|
] });
|
|
3002
3145
|
}
|
|
3003
3146
|
SwappedReceipt.displayName = "SwappedReceipt";
|
|
@@ -3071,8 +3214,10 @@ function getEventSourceDetails(event) {
|
|
|
3071
3214
|
return {};
|
|
3072
3215
|
}
|
|
3073
3216
|
function asChain(value) {
|
|
3074
|
-
if (typeof value === "string"
|
|
3075
|
-
|
|
3217
|
+
if (typeof value === "string") {
|
|
3218
|
+
const trimmed = value.trim();
|
|
3219
|
+
if (trimmed.startsWith("solana")) return "solana";
|
|
3220
|
+
if (trimmed.startsWith("hypercore")) return "hypercore";
|
|
3076
3221
|
}
|
|
3077
3222
|
return asNumber(value);
|
|
3078
3223
|
}
|
|
@@ -3166,6 +3311,11 @@ function resolveTokenDisplay(token, chain, fallback) {
|
|
|
3166
3311
|
if (solanaToken) {
|
|
3167
3312
|
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
3168
3313
|
}
|
|
3314
|
+
} else if (chain === "hypercore") {
|
|
3315
|
+
const t = HYPERCORE_SOURCE_TOKENS.find(
|
|
3316
|
+
(x) => x.address.toLowerCase() === token.toLowerCase()
|
|
3317
|
+
);
|
|
3318
|
+
if (t) return { symbol: t.symbol, decimals: t.decimals };
|
|
3169
3319
|
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
3170
3320
|
const symbol = getTokenSymbol(token, chain);
|
|
3171
3321
|
const decimals = findTokenDecimals(token, chain);
|
|
@@ -3207,18 +3357,38 @@ function formatRawTokenAmount(rawAmount, token) {
|
|
|
3207
3357
|
if (value === void 0) return void 0;
|
|
3208
3358
|
return formatTokenAmount(value, token.symbol);
|
|
3209
3359
|
}
|
|
3360
|
+
function isDisplayStablecoinSymbol(symbol) {
|
|
3361
|
+
return symbol !== void 0 && STABLECOIN_SYMBOLS.has(symbol.toUpperCase());
|
|
3362
|
+
}
|
|
3210
3363
|
function priceUsdFor(symbol, prices) {
|
|
3211
3364
|
if (!symbol) return void 0;
|
|
3212
|
-
const
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3365
|
+
const quoted = prices[symbol.toUpperCase()];
|
|
3366
|
+
return typeof quoted === "number" && quoted > 0 ? quoted : void 0;
|
|
3367
|
+
}
|
|
3368
|
+
function isRecognizedToken(address, chain) {
|
|
3369
|
+
if (address === void 0 || chain === void 0) return false;
|
|
3370
|
+
if (chain === "solana") return getSolanaTokenByMint(address) !== void 0;
|
|
3371
|
+
if (chain === "hypercore") {
|
|
3372
|
+
return HYPERCORE_SOURCE_TOKENS.some(
|
|
3373
|
+
(t) => t.address.toLowerCase() === address.toLowerCase()
|
|
3374
|
+
);
|
|
3375
|
+
}
|
|
3376
|
+
return EVM_ADDRESS_RE.test(address) && isRegistryTokenOnChain(address, chain);
|
|
3216
3377
|
}
|
|
3217
3378
|
function estimateReceiveAmount(params) {
|
|
3218
|
-
const {
|
|
3219
|
-
|
|
3379
|
+
const {
|
|
3380
|
+
sourceAmount,
|
|
3381
|
+
sourceSymbol,
|
|
3382
|
+
targetSymbol,
|
|
3383
|
+
sourceAmountUsd,
|
|
3384
|
+
prices,
|
|
3385
|
+
sourceTrusted
|
|
3386
|
+
} = params;
|
|
3387
|
+
const trusted = sourceTrusted !== false;
|
|
3388
|
+
if (trusted && sourceSymbol !== void 0 && sourceSymbol.toUpperCase() === targetSymbol.toUpperCase()) {
|
|
3220
3389
|
return sourceAmount;
|
|
3221
3390
|
}
|
|
3391
|
+
if (!trusted) return void 0;
|
|
3222
3392
|
const usdValue = sourceAmountUsd !== void 0 && Number.isFinite(sourceAmountUsd) ? sourceAmountUsd : sourceAmount !== void 0 ? (() => {
|
|
3223
3393
|
const sourcePrice = priceUsdFor(sourceSymbol, prices);
|
|
3224
3394
|
return sourcePrice !== void 0 ? sourceAmount * sourcePrice : void 0;
|
|
@@ -3254,33 +3424,8 @@ function formatReceiveEstimate(params) {
|
|
|
3254
3424
|
return sameSymbol ? `${formatted} ${params.targetSymbol}` : `~${formatted} ${params.targetSymbol}`;
|
|
3255
3425
|
}
|
|
3256
3426
|
|
|
3257
|
-
// src/core/useTokenPrices.ts
|
|
3258
|
-
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
3259
|
-
function useTokenPrices(service, symbols) {
|
|
3260
|
-
const [prices, setPrices] = useState4({});
|
|
3261
|
-
const symbolsKey = [
|
|
3262
|
-
...new Set(
|
|
3263
|
-
symbols.filter((symbol) => Boolean(symbol)).map((symbol) => symbol.toUpperCase())
|
|
3264
|
-
)
|
|
3265
|
-
].sort().join(",");
|
|
3266
|
-
useEffect5(() => {
|
|
3267
|
-
if (!symbolsKey) return;
|
|
3268
|
-
let cancelled = false;
|
|
3269
|
-
service.fetchPrices(symbolsKey.split(",")).then((result) => {
|
|
3270
|
-
if (!cancelled && result && Object.keys(result).length > 0) {
|
|
3271
|
-
setPrices(result);
|
|
3272
|
-
}
|
|
3273
|
-
}).catch(() => {
|
|
3274
|
-
});
|
|
3275
|
-
return () => {
|
|
3276
|
-
cancelled = true;
|
|
3277
|
-
};
|
|
3278
|
-
}, [service, symbolsKey]);
|
|
3279
|
-
return prices;
|
|
3280
|
-
}
|
|
3281
|
-
|
|
3282
3427
|
// src/components/steps/ProcessingStep.tsx
|
|
3283
|
-
import { Fragment as
|
|
3428
|
+
import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3284
3429
|
function SuccessBadge() {
|
|
3285
3430
|
return /* @__PURE__ */ jsxs21(
|
|
3286
3431
|
"svg",
|
|
@@ -3292,7 +3437,7 @@ function SuccessBadge() {
|
|
|
3292
3437
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3293
3438
|
"aria-hidden": "true",
|
|
3294
3439
|
children: [
|
|
3295
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx24(
|
|
3296
3441
|
"rect",
|
|
3297
3442
|
{
|
|
3298
3443
|
width: "40",
|
|
@@ -3301,7 +3446,7 @@ function SuccessBadge() {
|
|
|
3301
3446
|
fill: "var(--rs-icon-wrapper-bg)"
|
|
3302
3447
|
}
|
|
3303
3448
|
),
|
|
3304
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsx24(
|
|
3305
3450
|
"path",
|
|
3306
3451
|
{
|
|
3307
3452
|
d: "M28 14L17 25L12 20",
|
|
@@ -3326,8 +3471,8 @@ function FailedBadge() {
|
|
|
3326
3471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3327
3472
|
"aria-hidden": "true",
|
|
3328
3473
|
children: [
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3474
|
+
/* @__PURE__ */ jsx24("rect", { width: "40", height: "40", rx: "8", fill: "#FB2C36" }),
|
|
3475
|
+
/* @__PURE__ */ jsx24(
|
|
3331
3476
|
"path",
|
|
3332
3477
|
{
|
|
3333
3478
|
d: "M26 14L14 26M14 14L26 26",
|
|
@@ -3459,9 +3604,9 @@ function formatTimer(seconds) {
|
|
|
3459
3604
|
return `${mins}:${String(secs).padStart(2, "0")}`;
|
|
3460
3605
|
}
|
|
3461
3606
|
function TickerChar({ value }) {
|
|
3462
|
-
const [current, setCurrent] =
|
|
3463
|
-
const [previous, setPrevious] =
|
|
3464
|
-
const [animKey, setAnimKey] =
|
|
3607
|
+
const [current, setCurrent] = useState6(value);
|
|
3608
|
+
const [previous, setPrevious] = useState6(null);
|
|
3609
|
+
const [animKey, setAnimKey] = useState6(0);
|
|
3465
3610
|
useEffect6(() => {
|
|
3466
3611
|
if (value === current) return;
|
|
3467
3612
|
setPrevious(current);
|
|
@@ -3471,15 +3616,15 @@ function TickerChar({ value }) {
|
|
|
3471
3616
|
return () => clearTimeout(timeout);
|
|
3472
3617
|
}, [value, current]);
|
|
3473
3618
|
return /* @__PURE__ */ jsxs21("span", { className: "rs-ticker-slot", children: [
|
|
3474
|
-
previous !== null && /* @__PURE__ */
|
|
3475
|
-
/* @__PURE__ */
|
|
3619
|
+
previous !== null && /* @__PURE__ */ jsx24("span", { className: "rs-ticker-out", children: previous }, `out-${animKey}`),
|
|
3620
|
+
/* @__PURE__ */ jsx24("span", { className: "rs-ticker-in", children: current }, `in-${animKey}`)
|
|
3476
3621
|
] });
|
|
3477
3622
|
}
|
|
3478
3623
|
function Ticker({ value }) {
|
|
3479
|
-
return /* @__PURE__ */
|
|
3624
|
+
return /* @__PURE__ */ jsx24("span", { className: "rs-ticker", "aria-label": value, children: value.split("").map((char, index) => (
|
|
3480
3625
|
// Position-stable key so each slot keeps its own animation state.
|
|
3481
3626
|
// eslint-disable-next-line react/no-array-index-key
|
|
3482
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx24(TickerChar, { value: char }, index)
|
|
3483
3628
|
)) });
|
|
3484
3629
|
}
|
|
3485
3630
|
function getPhaseStartTime(phaseId, phaseTimings) {
|
|
@@ -3607,7 +3752,7 @@ function ProcessingStep({
|
|
|
3607
3752
|
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
3608
3753
|
const onErrorRef = useLatestRef(onError);
|
|
3609
3754
|
const initialTerminalEventRef = useRef4(null);
|
|
3610
|
-
const [state, setState] =
|
|
3755
|
+
const [state, setState] = useState6(() => {
|
|
3611
3756
|
if (directTransfer) return { type: "complete" };
|
|
3612
3757
|
const initial = getInitialProcessingState(
|
|
3613
3758
|
initialEvent,
|
|
@@ -3621,8 +3766,8 @@ function ProcessingStep({
|
|
|
3621
3766
|
}
|
|
3622
3767
|
return { type: "processing" };
|
|
3623
3768
|
});
|
|
3624
|
-
const [elapsedSeconds, setElapsedSeconds] =
|
|
3625
|
-
const [phaseTimings, setPhaseTimings] =
|
|
3769
|
+
const [elapsedSeconds, setElapsedSeconds] = useState6(0);
|
|
3770
|
+
const [phaseTimings, setPhaseTimings] = useState6(() => {
|
|
3626
3771
|
const saved = loadPhaseTimings(txHash);
|
|
3627
3772
|
if (saved) {
|
|
3628
3773
|
startTimeRef.current = saved.startedAt;
|
|
@@ -3630,7 +3775,7 @@ function ProcessingStep({
|
|
|
3630
3775
|
}
|
|
3631
3776
|
return { startedAt: startTimeRef.current };
|
|
3632
3777
|
});
|
|
3633
|
-
const [hasEscalatedDelay, setHasEscalatedDelay] =
|
|
3778
|
+
const [hasEscalatedDelay, setHasEscalatedDelay] = useState6(false);
|
|
3634
3779
|
const updatePhaseTimings = useCallback3(
|
|
3635
3780
|
(updater) => {
|
|
3636
3781
|
setPhaseTimings((previous) => {
|
|
@@ -3734,7 +3879,7 @@ function ProcessingStep({
|
|
|
3734
3879
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
3735
3880
|
);
|
|
3736
3881
|
}, [state.lastEvent?.time, state.lastEvent?.type, updatePhaseTimings]);
|
|
3737
|
-
const [swappedFiatContext, setSwappedFiatContext] =
|
|
3882
|
+
const [swappedFiatContext, setSwappedFiatContext] = useState6(null);
|
|
3738
3883
|
useEffect6(() => {
|
|
3739
3884
|
let cancelled = false;
|
|
3740
3885
|
let timeoutId;
|
|
@@ -3971,8 +4116,16 @@ function ProcessingStep({
|
|
|
3971
4116
|
const formattedDestinationAmount = eventDestination.amount !== void 0 ? formatRawTokenAmount(eventDestination.amount, targetDisplay) : void 0;
|
|
3972
4117
|
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
3973
4118
|
const prices = useTokenPrices(service, [
|
|
3974
|
-
|
|
3975
|
-
|
|
4119
|
+
{
|
|
4120
|
+
chainId: displaySourceChain,
|
|
4121
|
+
address: displaySourceToken,
|
|
4122
|
+
symbol: sourceDisplay.symbol
|
|
4123
|
+
},
|
|
4124
|
+
{
|
|
4125
|
+
chainId: eventDestination.chainId ?? targetChain,
|
|
4126
|
+
address: eventDestination.token ?? targetToken,
|
|
4127
|
+
symbol: targetDisplay.symbol
|
|
4128
|
+
}
|
|
3976
4129
|
]);
|
|
3977
4130
|
const estimatedReceiveAmount = (() => {
|
|
3978
4131
|
const estimate = estimateReceiveAmount({
|
|
@@ -3980,6 +4133,7 @@ function ProcessingStep({
|
|
|
3980
4133
|
sourceSymbol: sourceDisplay.symbol,
|
|
3981
4134
|
targetSymbol: targetDisplay.symbol,
|
|
3982
4135
|
sourceAmountUsd: amountUsdNumber,
|
|
4136
|
+
sourceTrusted: isRecognizedToken(displaySourceToken, displaySourceChain),
|
|
3983
4137
|
prices
|
|
3984
4138
|
});
|
|
3985
4139
|
return estimate !== void 0 ? formatTokenAmount(estimate, targetDisplay.symbol) : void 0;
|
|
@@ -4010,10 +4164,8 @@ function ProcessingStep({
|
|
|
4010
4164
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
4011
4165
|
void delayPhaseId;
|
|
4012
4166
|
void hasEscalatedDelay;
|
|
4013
|
-
const targetTokenIcon = getTokenIcon(targetSymbol);
|
|
4014
4167
|
const sourceChainIcon = getChainIcon(displaySourceChain);
|
|
4015
4168
|
const targetChainIcon = getChainIcon(targetChain);
|
|
4016
|
-
const sourceTokenIcon = getTokenIcon(sourceSymbol);
|
|
4017
4169
|
const sourceChainName = getChainName(displaySourceChain);
|
|
4018
4170
|
const targetChainName = getChainName(targetChain);
|
|
4019
4171
|
const timerText = formatTimer(elapsedSeconds);
|
|
@@ -4022,12 +4174,12 @@ function ProcessingStep({
|
|
|
4022
4174
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
4023
4175
|
const handleRetry = onRetry ?? onNewDeposit;
|
|
4024
4176
|
const headerContent = isComplete ? /* @__PURE__ */ jsxs21("div", { className: "rs-body-header", children: [
|
|
4025
|
-
/* @__PURE__ */
|
|
4026
|
-
/* @__PURE__ */
|
|
4177
|
+
/* @__PURE__ */ jsx24(SuccessBadge, {}),
|
|
4178
|
+
/* @__PURE__ */ jsx24("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx24("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
4027
4179
|
] }) : isFailed ? /* @__PURE__ */ jsxs21("div", { className: "rs-body-header", children: [
|
|
4028
|
-
/* @__PURE__ */
|
|
4029
|
-
/* @__PURE__ */
|
|
4030
|
-
] }) : /* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ jsx24(FailedBadge, {}),
|
|
4181
|
+
/* @__PURE__ */ jsx24("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx24("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
4182
|
+
] }) : /* @__PURE__ */ jsx24(BodyHeader, { icon: /* @__PURE__ */ jsx24(WalletIcon, {}), title: stateTitle });
|
|
4031
4183
|
if (isComplete && isSwappedOrder) {
|
|
4032
4184
|
const effectivePaymentMethod = swappedContext?.method ?? swappedFiatContext?.paymentMethod ?? null;
|
|
4033
4185
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
@@ -4070,14 +4222,14 @@ function ProcessingStep({
|
|
|
4070
4222
|
}
|
|
4071
4223
|
const chargeableQuoteFeeUsd = feeSponsored ? 0 : (marketFeeUsd ?? 0) + (networkFeeUsd ?? 0);
|
|
4072
4224
|
const feesTotal = feeRows.length > 0 ? formatUsdFee((onrampFeeUsd ?? 0) + chargeableQuoteFeeUsd) : null;
|
|
4073
|
-
return /* @__PURE__ */
|
|
4225
|
+
return /* @__PURE__ */ jsx24(
|
|
4074
4226
|
SwappedReceipt,
|
|
4075
4227
|
{
|
|
4076
4228
|
onrampMethod,
|
|
4077
4229
|
onrampMethodIcon,
|
|
4078
4230
|
amountPaid,
|
|
4079
4231
|
depositedAmount,
|
|
4080
|
-
|
|
4232
|
+
depositedSymbol: targetSymbol,
|
|
4081
4233
|
feesTotal,
|
|
4082
4234
|
feeRows,
|
|
4083
4235
|
feesTooltip,
|
|
@@ -4092,11 +4244,11 @@ function ProcessingStep({
|
|
|
4092
4244
|
headerContent,
|
|
4093
4245
|
/* @__PURE__ */ jsxs21("div", { className: "rs-review-details", children: [
|
|
4094
4246
|
/* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4095
|
-
/* @__PURE__ */
|
|
4247
|
+
/* @__PURE__ */ jsx24("span", { children: "Source chain" }),
|
|
4096
4248
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
sourceChainIcon && /* @__PURE__ */
|
|
4099
|
-
sourceExplorerUrl && /* @__PURE__ */
|
|
4249
|
+
/* @__PURE__ */ jsx24("span", { children: sourceChainName }),
|
|
4250
|
+
sourceChainIcon && /* @__PURE__ */ jsx24("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx24("img", { src: sourceChainIcon, alt: "" }) }),
|
|
4251
|
+
sourceExplorerUrl && /* @__PURE__ */ jsx24(
|
|
4100
4252
|
"a",
|
|
4101
4253
|
{
|
|
4102
4254
|
href: sourceExplorerUrl,
|
|
@@ -4104,17 +4256,17 @@ function ProcessingStep({
|
|
|
4104
4256
|
rel: "noopener noreferrer",
|
|
4105
4257
|
className: "rs-review-detail-link",
|
|
4106
4258
|
"aria-label": "View source transaction",
|
|
4107
|
-
children: /* @__PURE__ */
|
|
4259
|
+
children: /* @__PURE__ */ jsx24(ExternalLinkIcon, {})
|
|
4108
4260
|
}
|
|
4109
4261
|
)
|
|
4110
4262
|
] })
|
|
4111
4263
|
] }),
|
|
4112
4264
|
/* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4113
|
-
/* @__PURE__ */
|
|
4265
|
+
/* @__PURE__ */ jsx24("span", { children: "Destination chain" }),
|
|
4114
4266
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4115
|
-
/* @__PURE__ */
|
|
4116
|
-
targetChainIcon && /* @__PURE__ */
|
|
4117
|
-
destExplorerUrl && /* @__PURE__ */
|
|
4267
|
+
/* @__PURE__ */ jsx24("span", { children: targetChainName }),
|
|
4268
|
+
targetChainIcon && /* @__PURE__ */ jsx24("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx24("img", { src: targetChainIcon, alt: "" }) }),
|
|
4269
|
+
destExplorerUrl && /* @__PURE__ */ jsx24(
|
|
4118
4270
|
"a",
|
|
4119
4271
|
{
|
|
4120
4272
|
href: destExplorerUrl,
|
|
@@ -4122,18 +4274,18 @@ function ProcessingStep({
|
|
|
4122
4274
|
rel: "noopener noreferrer",
|
|
4123
4275
|
className: "rs-review-detail-link",
|
|
4124
4276
|
"aria-label": "View destination transaction",
|
|
4125
|
-
children: /* @__PURE__ */
|
|
4277
|
+
children: /* @__PURE__ */ jsx24(ExternalLinkIcon, {})
|
|
4126
4278
|
}
|
|
4127
4279
|
)
|
|
4128
4280
|
] })
|
|
4129
4281
|
] }),
|
|
4130
4282
|
/* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4131
|
-
/* @__PURE__ */
|
|
4132
|
-
/* @__PURE__ */
|
|
4283
|
+
/* @__PURE__ */ jsx24("span", { children: isProcessing ? "Time elapsed" : "Total time" }),
|
|
4284
|
+
/* @__PURE__ */ jsx24("span", { className: "rs-review-detail-value", children: /* @__PURE__ */ jsx24(Ticker, { value: timerText }) })
|
|
4133
4285
|
] }),
|
|
4134
|
-
isSwappedOrder ? /* @__PURE__ */ jsxs21(
|
|
4286
|
+
isSwappedOrder ? /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
4135
4287
|
swappedFiatContext?.paidAmountUsd != null && /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4136
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ jsx24("span", { children: "You pay" }),
|
|
4137
4289
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4138
4290
|
"$",
|
|
4139
4291
|
swappedFiatContext.paidAmountUsd.toFixed(2),
|
|
@@ -4145,50 +4297,50 @@ function ProcessingStep({
|
|
|
4145
4297
|
] })
|
|
4146
4298
|
] }),
|
|
4147
4299
|
swappedFiatContext?.onrampFeeUsd != null && /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4148
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsx24("span", { children: "On-ramp fee" }),
|
|
4149
4301
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4150
4302
|
"$",
|
|
4151
4303
|
swappedFiatContext.onrampFeeUsd.toFixed(2)
|
|
4152
4304
|
] })
|
|
4153
4305
|
] }),
|
|
4154
4306
|
formattedBridgingCost && /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4155
|
-
/* @__PURE__ */
|
|
4307
|
+
/* @__PURE__ */ jsx24("span", { children: "Bridging cost" }),
|
|
4156
4308
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4157
4309
|
/* @__PURE__ */ jsxs21("span", { children: [
|
|
4158
4310
|
formattedBridgingCost,
|
|
4159
4311
|
" ",
|
|
4160
4312
|
sourceSymbol
|
|
4161
4313
|
] }),
|
|
4162
|
-
|
|
4314
|
+
/* @__PURE__ */ jsx24("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx24(TokenIcon, { symbol: sourceSymbol }) })
|
|
4163
4315
|
] })
|
|
4164
4316
|
] })
|
|
4165
4317
|
] }) : /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4166
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ jsx24("span", { children: isProcessing ? "You send" : "You sent" }),
|
|
4167
4319
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4168
4320
|
/* @__PURE__ */ jsxs21("span", { children: [
|
|
4169
4321
|
formattedSentAmount,
|
|
4170
4322
|
" ",
|
|
4171
4323
|
sourceSymbol
|
|
4172
4324
|
] }),
|
|
4173
|
-
|
|
4325
|
+
/* @__PURE__ */ jsx24("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx24(TokenIcon, { symbol: sourceSymbol }) })
|
|
4174
4326
|
] })
|
|
4175
4327
|
] }),
|
|
4176
4328
|
/* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4177
|
-
/* @__PURE__ */
|
|
4329
|
+
/* @__PURE__ */ jsx24("span", { children: isProcessing ? "Receive" : "Received" }),
|
|
4178
4330
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4179
|
-
/* @__PURE__ */
|
|
4180
|
-
|
|
4331
|
+
/* @__PURE__ */ jsx24("span", { children: receiveDisplay }),
|
|
4332
|
+
/* @__PURE__ */ jsx24("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx24(TokenIcon, { symbol: targetSymbol }) })
|
|
4181
4333
|
] })
|
|
4182
4334
|
] }),
|
|
4183
4335
|
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4184
|
-
/* @__PURE__ */
|
|
4336
|
+
/* @__PURE__ */ jsx24("span", { children: "Balance" }),
|
|
4185
4337
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4186
4338
|
"$",
|
|
4187
4339
|
balanceAfterUsd.toFixed(2)
|
|
4188
4340
|
] })
|
|
4189
4341
|
] }),
|
|
4190
4342
|
isSwappedOrder ? quotedFeeAmount !== void 0 && /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4191
|
-
/* @__PURE__ */
|
|
4343
|
+
/* @__PURE__ */ jsx24("span", { children: "Fees" }),
|
|
4192
4344
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4193
4345
|
/* @__PURE__ */ jsxs21(
|
|
4194
4346
|
"span",
|
|
@@ -4201,12 +4353,12 @@ function ProcessingStep({
|
|
|
4201
4353
|
]
|
|
4202
4354
|
}
|
|
4203
4355
|
),
|
|
4204
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsx24(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx24(
|
|
4205
4357
|
"span",
|
|
4206
4358
|
{
|
|
4207
4359
|
className: "rs-review-detail-info",
|
|
4208
4360
|
"aria-label": "Fee info",
|
|
4209
|
-
children: /* @__PURE__ */
|
|
4361
|
+
children: /* @__PURE__ */ jsx24(InfoIcon, {})
|
|
4210
4362
|
}
|
|
4211
4363
|
) })
|
|
4212
4364
|
] })
|
|
@@ -4214,7 +4366,7 @@ function ProcessingStep({
|
|
|
4214
4366
|
const feeValue = quotedFeeAmount ?? formattedBridgingCost;
|
|
4215
4367
|
if (feeValue === void 0) return null;
|
|
4216
4368
|
return /* @__PURE__ */ jsxs21("div", { className: "rs-review-detail-row", children: [
|
|
4217
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ jsx24("span", { children: "Fees" }),
|
|
4218
4370
|
/* @__PURE__ */ jsxs21("span", { className: "rs-review-detail-value", children: [
|
|
4219
4371
|
/* @__PURE__ */ jsxs21(
|
|
4220
4372
|
"span",
|
|
@@ -4227,20 +4379,20 @@ function ProcessingStep({
|
|
|
4227
4379
|
]
|
|
4228
4380
|
}
|
|
4229
4381
|
),
|
|
4230
|
-
/* @__PURE__ */
|
|
4382
|
+
/* @__PURE__ */ jsx24(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx24(
|
|
4231
4383
|
"span",
|
|
4232
4384
|
{
|
|
4233
4385
|
className: "rs-review-detail-info",
|
|
4234
4386
|
"aria-label": "Fee info",
|
|
4235
|
-
children: /* @__PURE__ */
|
|
4387
|
+
children: /* @__PURE__ */ jsx24(InfoIcon, {})
|
|
4236
4388
|
}
|
|
4237
4389
|
) })
|
|
4238
4390
|
] })
|
|
4239
4391
|
] });
|
|
4240
4392
|
})()
|
|
4241
4393
|
] }),
|
|
4242
|
-
isFailed && failureMessage && /* @__PURE__ */
|
|
4243
|
-
isProcessing && /* @__PURE__ */
|
|
4394
|
+
isFailed && failureMessage && /* @__PURE__ */ jsx24(Callout, { variant: "error", children: failureMessage }),
|
|
4395
|
+
isProcessing && /* @__PURE__ */ jsx24(
|
|
4244
4396
|
Button,
|
|
4245
4397
|
{
|
|
4246
4398
|
fullWidth: true,
|
|
@@ -4255,14 +4407,14 @@ function ProcessingStep({
|
|
|
4255
4407
|
"New ",
|
|
4256
4408
|
flowNoun
|
|
4257
4409
|
] }),
|
|
4258
|
-
onClose && /* @__PURE__ */
|
|
4410
|
+
onClose && /* @__PURE__ */ jsx24(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
4259
4411
|
] }),
|
|
4260
4412
|
isFailed && /* @__PURE__ */ jsxs21("div", { className: "rs-screen-button-row", children: [
|
|
4261
|
-
onClose && /* @__PURE__ */
|
|
4262
|
-
handleRetry && /* @__PURE__ */
|
|
4413
|
+
onClose && /* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
4414
|
+
handleRetry && /* @__PURE__ */ jsx24(Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
4263
4415
|
] })
|
|
4264
4416
|
] }),
|
|
4265
|
-
/* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ jsx24(PoweredBy, {})
|
|
4266
4418
|
] });
|
|
4267
4419
|
}
|
|
4268
4420
|
|
|
@@ -4344,6 +4496,7 @@ export {
|
|
|
4344
4496
|
ConnectStep,
|
|
4345
4497
|
useLatestRef,
|
|
4346
4498
|
Button,
|
|
4499
|
+
TokenIcon,
|
|
4347
4500
|
debugLog,
|
|
4348
4501
|
debugError,
|
|
4349
4502
|
getAssetId,
|
|
@@ -4357,6 +4510,8 @@ export {
|
|
|
4357
4510
|
formatUserError,
|
|
4358
4511
|
Tooltip,
|
|
4359
4512
|
formatTokenAmount,
|
|
4513
|
+
isDisplayStablecoinSymbol,
|
|
4514
|
+
isRecognizedToken,
|
|
4360
4515
|
formatQuotedReceive,
|
|
4361
4516
|
formatReceiveEstimate,
|
|
4362
4517
|
getEventTxHash,
|
|
@@ -4365,6 +4520,7 @@ export {
|
|
|
4365
4520
|
isFailedEvent,
|
|
4366
4521
|
txRefsMatch,
|
|
4367
4522
|
failureMessageForEvent,
|
|
4523
|
+
fetchTokenPriceUsd,
|
|
4368
4524
|
useTokenPrices,
|
|
4369
4525
|
ProcessingStep,
|
|
4370
4526
|
rpcUrlFor,
|