@trustware/sdk-staging 1.1.9-staging.3 → 1.1.9-staging.5
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/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.cjs +1198 -543
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1173 -518
- package/dist/index.mjs.map +1 -1
- package/dist/smart-account.cjs +1 -1
- package/dist/smart-account.mjs +1 -1
- package/dist/wallet.cjs +1 -1
- package/dist/wallet.mjs +1 -1
- package/dist/widget.cjs +1198 -543
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +1173 -518
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/widget.cjs
CHANGED
|
@@ -585,7 +585,7 @@ var init_constants = __esm({
|
|
|
585
585
|
"src/constants.ts"() {
|
|
586
586
|
"use strict";
|
|
587
587
|
SDK_NAME = "@trustware/sdk";
|
|
588
|
-
SDK_VERSION = "1.1.9-staging.
|
|
588
|
+
SDK_VERSION = "1.1.9-staging.5";
|
|
589
589
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
590
590
|
GTM_ID = "GTM-TZDGNCXB";
|
|
591
591
|
API_PREFIX = "/api";
|
|
@@ -16175,7 +16175,7 @@ function MobileWalletDropdownContent({
|
|
|
16175
16175
|
const mobileWallets = (0, import_react34.useMemo)(
|
|
16176
16176
|
() => WALLETS.filter((w) => {
|
|
16177
16177
|
if (w.id === "walletconnect") return true;
|
|
16178
|
-
const hasMobileLink = Boolean(w.deepLink
|
|
16178
|
+
const hasMobileLink = Boolean(w.deepLink);
|
|
16179
16179
|
if (!hasMobileLink) return false;
|
|
16180
16180
|
return w.ecosystem.trim().toLowerCase() === "multi" || w.ecosystem.trim().toLowerCase() === selectedNamespace.trim().toLowerCase();
|
|
16181
16181
|
}),
|
|
@@ -33490,8 +33490,81 @@ var init_SwapTokenSelect = __esm({
|
|
|
33490
33490
|
}
|
|
33491
33491
|
});
|
|
33492
33492
|
|
|
33493
|
-
// src/modes/swap/
|
|
33494
|
-
function
|
|
33493
|
+
// src/modes/swap/currency.ts
|
|
33494
|
+
function getCurrencyMeta(code) {
|
|
33495
|
+
return BY_CODE.get(code.toUpperCase()) ?? SUPPORTED_CURRENCIES[0];
|
|
33496
|
+
}
|
|
33497
|
+
function fmtCurrency(usdAmount, code, rate) {
|
|
33498
|
+
const meta = getCurrencyMeta(code);
|
|
33499
|
+
const local = usdAmount * rate;
|
|
33500
|
+
return meta.symbol + local.toFixed(meta.decimals);
|
|
33501
|
+
}
|
|
33502
|
+
var SUPPORTED_CURRENCIES, BY_CODE;
|
|
33503
|
+
var init_currency = __esm({
|
|
33504
|
+
"src/modes/swap/currency.ts"() {
|
|
33505
|
+
"use strict";
|
|
33506
|
+
SUPPORTED_CURRENCIES = [
|
|
33507
|
+
{ code: "USD", symbol: "$", name: "US Dollar", decimals: 2 },
|
|
33508
|
+
{ code: "EUR", symbol: "\u20AC", name: "Euro", decimals: 2 },
|
|
33509
|
+
{ code: "GBP", symbol: "\xA3", name: "British Pound", decimals: 2 },
|
|
33510
|
+
{ code: "CAD", symbol: "CA$", name: "Canadian Dollar", decimals: 2 },
|
|
33511
|
+
{ code: "AUD", symbol: "A$", name: "Australian Dollar", decimals: 2 },
|
|
33512
|
+
{ code: "JPY", symbol: "\xA5", name: "Japanese Yen", decimals: 0 },
|
|
33513
|
+
{ code: "CHF", symbol: "Fr", name: "Swiss Franc", decimals: 2 },
|
|
33514
|
+
{ code: "KRW", symbol: "\u20A9", name: "South Korean Won", decimals: 0 },
|
|
33515
|
+
{ code: "INR", symbol: "\u20B9", name: "Indian Rupee", decimals: 2 },
|
|
33516
|
+
{ code: "BRL", symbol: "R$", name: "Brazilian Real", decimals: 2 },
|
|
33517
|
+
{ code: "SGD", symbol: "S$", name: "Singapore Dollar", decimals: 2 },
|
|
33518
|
+
{ code: "MXN", symbol: "MX$", name: "Mexican Peso", decimals: 2 },
|
|
33519
|
+
{ code: "HKD", symbol: "HK$", name: "Hong Kong Dollar", decimals: 2 },
|
|
33520
|
+
{ code: "CNY", symbol: "\xA5", name: "Chinese Yuan", decimals: 2 },
|
|
33521
|
+
{ code: "ZAR", symbol: "R", name: "South African Rand", decimals: 2 },
|
|
33522
|
+
{ code: "TRY", symbol: "\u20BA", name: "Turkish Lira", decimals: 2 },
|
|
33523
|
+
{ code: "RUB", symbol: "\u20BD", name: "Russian Ruble", decimals: 2 },
|
|
33524
|
+
{
|
|
33525
|
+
code: "AED",
|
|
33526
|
+
symbol: "\u062F.\u0625",
|
|
33527
|
+
name: "United Arab Emirates Dirham",
|
|
33528
|
+
decimals: 2
|
|
33529
|
+
},
|
|
33530
|
+
{ code: "SAR", symbol: "\uFDFC", name: "Saudi Riyal", decimals: 2 },
|
|
33531
|
+
{ code: "QAR", symbol: "\uFDFC", name: "Qatari Riyal", decimals: 2 },
|
|
33532
|
+
{ code: "KWD", symbol: "\u062F.\u0643", name: "Kuwaiti Dinar", decimals: 3 },
|
|
33533
|
+
{ code: "OMR", symbol: "\u0631.\u0639.", name: "Omani Rial", decimals: 3 },
|
|
33534
|
+
{ code: "BHD", symbol: "\u0628.\u062F", name: "Bahraini Dinar", decimals: 3 },
|
|
33535
|
+
{ code: "JOD", symbol: "\u062F.\u0627", name: "Jordanian Dinar", decimals: 3 },
|
|
33536
|
+
{ code: "LYD", symbol: "\u0644.\u062F", name: "Libyan Dinar", decimals: 3 },
|
|
33537
|
+
{ code: "TND", symbol: "\u062F.\u062A", name: "Tunisian Dinar", decimals: 3 },
|
|
33538
|
+
{ code: "MAD", symbol: "\u062F.\u0645.", name: "Moroccan Dirham", decimals: 2 },
|
|
33539
|
+
{ code: "EGP", symbol: "\xA3", name: "Egyptian Pound", decimals: 2 },
|
|
33540
|
+
{ code: "NGN", symbol: "\u20A6", name: "Nigerian Naira", decimals: 2 },
|
|
33541
|
+
{ code: "GHS", symbol: "\u20B5", name: "Ghanaian Cedi", decimals: 2 },
|
|
33542
|
+
{ code: "KES", symbol: "KSh", name: "Kenyan Shilling", decimals: 2 },
|
|
33543
|
+
{ code: "TZS", symbol: "TSh", name: "Tanzanian Shilling", decimals: 2 },
|
|
33544
|
+
{ code: "UGX", symbol: "USh", name: "Ugandan Shilling", decimals: 2 },
|
|
33545
|
+
{ code: "RWF", symbol: "FRw", name: "Rwandan Franc", decimals: 2 },
|
|
33546
|
+
{ code: "MUR", symbol: "Rs", name: "Mauritian Rupee", decimals: 2 },
|
|
33547
|
+
{ code: "SCR", symbol: "SR", name: "Seychellois Rupee", decimals: 2 },
|
|
33548
|
+
{ code: "MGA", symbol: "Ar", name: "Malagasy Ariary", decimals: 2 },
|
|
33549
|
+
{
|
|
33550
|
+
code: "XAF",
|
|
33551
|
+
symbol: "FCFA",
|
|
33552
|
+
name: "Central African CFA Franc",
|
|
33553
|
+
decimals: 2
|
|
33554
|
+
},
|
|
33555
|
+
{ code: "XOF", symbol: "CFA", name: "West African CFA Franc", decimals: 2 },
|
|
33556
|
+
{ code: "XPF", symbol: "CFP", name: "CFP Franc", decimals: 2 },
|
|
33557
|
+
{ code: "XCD", symbol: "EC$", name: "East Caribbean Dollar", decimals: 2 },
|
|
33558
|
+
{ code: "XDR", symbol: "SDR", name: "Special Drawing Rights", decimals: 2 },
|
|
33559
|
+
{ code: "XAU", symbol: "Au", name: "Gold (troy ounce)", decimals: 2 },
|
|
33560
|
+
{ code: "XAG", symbol: "Ag", name: "Silver (troy ounce)", decimals: 2 }
|
|
33561
|
+
];
|
|
33562
|
+
BY_CODE = new Map(SUPPORTED_CURRENCIES.map((c) => [c.code, c]));
|
|
33563
|
+
}
|
|
33564
|
+
});
|
|
33565
|
+
|
|
33566
|
+
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorMobile.tsx
|
|
33567
|
+
function SwapWalletSelectorMobile({
|
|
33495
33568
|
walletStatus,
|
|
33496
33569
|
walletAddress,
|
|
33497
33570
|
connectWallet,
|
|
@@ -33503,19 +33576,625 @@ function SwapWalletSelector({
|
|
|
33503
33576
|
walletMetaId,
|
|
33504
33577
|
connectedVia,
|
|
33505
33578
|
disconnect
|
|
33579
|
+
// status,
|
|
33506
33580
|
} = useWalletInfo();
|
|
33507
33581
|
const walletConnectCfg = TrustwareConfigStore.peek()?.walletConnect;
|
|
33508
33582
|
const connectWC = useWalletConnectConnect(walletConnectCfg);
|
|
33509
33583
|
const [wcConnecting, setWcConnecting] = (0, import_react48.useState)(false);
|
|
33510
33584
|
const [connectingId, setConnectingId] = (0, import_react48.useState)(null);
|
|
33511
|
-
const [timerExpired, setTimerExpired] = (0, import_react48.useState)(false);
|
|
33512
33585
|
const [selectedNamespace, setSelectedNamespace] = (0, import_react48.useState)("evm");
|
|
33513
33586
|
const prevStatusRef = (0, import_react48.useRef)(walletStatus);
|
|
33587
|
+
const storeFallbackTimeoutRef = (0, import_react48.useRef)(
|
|
33588
|
+
null
|
|
33589
|
+
);
|
|
33514
33590
|
(0, import_react48.useEffect)(() => {
|
|
33591
|
+
const prev = prevStatusRef.current;
|
|
33592
|
+
if (prev !== walletStatus) {
|
|
33593
|
+
if (prev === "connecting" && (walletStatus === "connected" || walletStatus === "error")) {
|
|
33594
|
+
setConnectingId(null);
|
|
33595
|
+
}
|
|
33596
|
+
prevStatusRef.current = walletStatus;
|
|
33597
|
+
}
|
|
33598
|
+
}, [walletStatus]);
|
|
33599
|
+
(0, import_react48.useEffect)(() => {
|
|
33600
|
+
return () => {
|
|
33601
|
+
if (storeFallbackTimeoutRef.current !== null) {
|
|
33602
|
+
clearTimeout(storeFallbackTimeoutRef.current);
|
|
33603
|
+
}
|
|
33604
|
+
};
|
|
33605
|
+
}, []);
|
|
33606
|
+
const currentUrl = typeof window !== "undefined" ? window.location.href : "";
|
|
33607
|
+
const mobileWalletEntries = (0, import_react48.useMemo)(() => {
|
|
33608
|
+
return WALLETS.filter((w) => {
|
|
33609
|
+
if (w.id === "walletconnect") return false;
|
|
33610
|
+
const hasMobileLink = Boolean(w.deepLink);
|
|
33611
|
+
if (!hasMobileLink) return false;
|
|
33612
|
+
const ecosystem = w.ecosystem.trim().toLowerCase();
|
|
33613
|
+
return ecosystem === "multi" || ecosystem === selectedNamespace;
|
|
33614
|
+
}).map((meta) => ({
|
|
33615
|
+
meta,
|
|
33616
|
+
detectedWallet: detected.find((d) => d.meta.id === meta.id) ?? null
|
|
33617
|
+
}));
|
|
33618
|
+
}, [detected, selectedNamespace]);
|
|
33619
|
+
const handleDisconnect = () => {
|
|
33620
|
+
void disconnect();
|
|
33621
|
+
};
|
|
33622
|
+
const handleWalletConnect = async () => {
|
|
33623
|
+
if (wcConnecting) return;
|
|
33624
|
+
if (connectedVia === "walletconnect" && managerConnected) {
|
|
33625
|
+
return;
|
|
33626
|
+
}
|
|
33627
|
+
setWcConnecting(true);
|
|
33628
|
+
try {
|
|
33629
|
+
const { error } = await connectWC();
|
|
33630
|
+
if (error) {
|
|
33631
|
+
toast.error("WalletConnect Failed", error);
|
|
33632
|
+
}
|
|
33633
|
+
} catch (err) {
|
|
33634
|
+
const msg = err instanceof Error ? err.message : "WalletConnect failed";
|
|
33635
|
+
toast.error("WalletConnect Failed", msg);
|
|
33636
|
+
} finally {
|
|
33637
|
+
setWcConnecting(false);
|
|
33638
|
+
}
|
|
33639
|
+
};
|
|
33640
|
+
const goToAppStore = (meta) => {
|
|
33641
|
+
const isIos = /iPhone|iPad/i.test(navigator.userAgent);
|
|
33642
|
+
const storeUrl = isIos ? meta.ios : meta.android;
|
|
33643
|
+
if (storeUrl) window.location.assign(storeUrl);
|
|
33644
|
+
};
|
|
33645
|
+
const handleClick = async (entry) => {
|
|
33646
|
+
const { meta, detectedWallet } = entry;
|
|
33647
|
+
if (walletStatus === "connecting") return;
|
|
33648
|
+
if (managerConnected && walletMetaId === meta.id) {
|
|
33649
|
+
return;
|
|
33650
|
+
}
|
|
33651
|
+
if (detectedWallet) {
|
|
33652
|
+
setConnectingId(meta.id);
|
|
33653
|
+
try {
|
|
33654
|
+
await connectWallet(detectedWallet);
|
|
33655
|
+
} catch (err) {
|
|
33656
|
+
setConnectingId(null);
|
|
33657
|
+
const msg = err instanceof Error ? err.message : "Failed to connect wallet";
|
|
33658
|
+
if (msg.toLowerCase().includes("rejected") || msg.toLowerCase().includes("denied")) {
|
|
33659
|
+
toast.error(
|
|
33660
|
+
"Connection Declined",
|
|
33661
|
+
"You declined the connection request."
|
|
33662
|
+
);
|
|
33663
|
+
} else {
|
|
33664
|
+
toast.error("Connection Failed", msg);
|
|
33665
|
+
}
|
|
33666
|
+
}
|
|
33667
|
+
return;
|
|
33668
|
+
}
|
|
33669
|
+
if (meta.deepLink) {
|
|
33670
|
+
const deepLinkUrl = meta.deepLink(currentUrl);
|
|
33671
|
+
if (deepLinkUrl) {
|
|
33672
|
+
window.location.assign(deepLinkUrl);
|
|
33673
|
+
if (storeFallbackTimeoutRef.current !== null) {
|
|
33674
|
+
clearTimeout(storeFallbackTimeoutRef.current);
|
|
33675
|
+
}
|
|
33676
|
+
storeFallbackTimeoutRef.current = setTimeout(() => {
|
|
33677
|
+
storeFallbackTimeoutRef.current = null;
|
|
33678
|
+
goToAppStore(meta);
|
|
33679
|
+
}, 1500);
|
|
33680
|
+
return;
|
|
33681
|
+
}
|
|
33682
|
+
}
|
|
33683
|
+
goToAppStore(meta);
|
|
33684
|
+
};
|
|
33685
|
+
const tabs = [
|
|
33686
|
+
{ id: "evm", label: "EVM" },
|
|
33687
|
+
{ id: "solana", label: "Solana" }
|
|
33688
|
+
];
|
|
33689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33690
|
+
"div",
|
|
33691
|
+
{
|
|
33692
|
+
style: {
|
|
33693
|
+
display: "flex",
|
|
33694
|
+
flexDirection: "column",
|
|
33695
|
+
height: "100%"
|
|
33696
|
+
},
|
|
33697
|
+
children: [
|
|
33698
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33699
|
+
"div",
|
|
33700
|
+
{
|
|
33701
|
+
style: {
|
|
33702
|
+
display: "flex",
|
|
33703
|
+
alignItems: "center",
|
|
33704
|
+
padding: `${spacing[4]} ${spacing[4]}`,
|
|
33705
|
+
borderBottom: `1px solid ${colors.border}`
|
|
33706
|
+
},
|
|
33707
|
+
children: [
|
|
33708
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33709
|
+
"button",
|
|
33710
|
+
{
|
|
33711
|
+
type: "button",
|
|
33712
|
+
onClick: onBack,
|
|
33713
|
+
style: {
|
|
33714
|
+
padding: spacing[1],
|
|
33715
|
+
marginRight: spacing[2],
|
|
33716
|
+
borderRadius: borderRadius.lg,
|
|
33717
|
+
backgroundColor: "transparent",
|
|
33718
|
+
border: 0,
|
|
33719
|
+
cursor: "pointer"
|
|
33720
|
+
},
|
|
33721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33722
|
+
"svg",
|
|
33723
|
+
{
|
|
33724
|
+
style: {
|
|
33725
|
+
width: "1.25rem",
|
|
33726
|
+
height: "1.25rem",
|
|
33727
|
+
color: colors.foreground
|
|
33728
|
+
},
|
|
33729
|
+
viewBox: "0 0 24 24",
|
|
33730
|
+
fill: "none",
|
|
33731
|
+
stroke: "currentColor",
|
|
33732
|
+
strokeWidth: 2,
|
|
33733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33734
|
+
"path",
|
|
33735
|
+
{
|
|
33736
|
+
strokeLinecap: "round",
|
|
33737
|
+
strokeLinejoin: "round",
|
|
33738
|
+
d: "M15 19l-7-7 7-7"
|
|
33739
|
+
}
|
|
33740
|
+
)
|
|
33741
|
+
}
|
|
33742
|
+
)
|
|
33743
|
+
}
|
|
33744
|
+
),
|
|
33745
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33746
|
+
"h1",
|
|
33747
|
+
{
|
|
33748
|
+
style: {
|
|
33749
|
+
flex: 1,
|
|
33750
|
+
fontSize: fontSize.lg,
|
|
33751
|
+
fontWeight: fontWeight.semibold,
|
|
33752
|
+
color: colors.foreground,
|
|
33753
|
+
textAlign: "center"
|
|
33754
|
+
},
|
|
33755
|
+
children: "Connect Wallet"
|
|
33756
|
+
}
|
|
33757
|
+
),
|
|
33758
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { width: "1.25rem", marginLeft: spacing[2] }, "aria-hidden": true })
|
|
33759
|
+
]
|
|
33760
|
+
}
|
|
33761
|
+
),
|
|
33762
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { padding: `${spacing[3]} ${spacing[4]} 0` }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33763
|
+
"div",
|
|
33764
|
+
{
|
|
33765
|
+
style: {
|
|
33766
|
+
display: "flex",
|
|
33767
|
+
alignItems: "center",
|
|
33768
|
+
borderRadius: borderRadius.lg,
|
|
33769
|
+
backgroundColor: colors.muted,
|
|
33770
|
+
padding: "3px",
|
|
33771
|
+
gap: "2px"
|
|
33772
|
+
},
|
|
33773
|
+
children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33774
|
+
"button",
|
|
33775
|
+
{
|
|
33776
|
+
onClick: () => setSelectedNamespace(t.id),
|
|
33777
|
+
style: {
|
|
33778
|
+
flex: 1,
|
|
33779
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
33780
|
+
fontSize: fontSize.sm,
|
|
33781
|
+
fontWeight: fontWeight.medium,
|
|
33782
|
+
borderRadius: borderRadius.md,
|
|
33783
|
+
background: selectedNamespace === t.id ? colors.card : "transparent",
|
|
33784
|
+
border: selectedNamespace === t.id ? `1px solid ${colors.border}` : "1px solid transparent",
|
|
33785
|
+
cursor: "pointer",
|
|
33786
|
+
transition: "all 0.15s",
|
|
33787
|
+
color: selectedNamespace === t.id ? colors.foreground : colors.mutedForeground,
|
|
33788
|
+
boxShadow: selectedNamespace === t.id ? "0 1px 3px rgba(0,0,0,0.08)" : "none",
|
|
33789
|
+
outline: "none"
|
|
33790
|
+
},
|
|
33791
|
+
children: t.label
|
|
33792
|
+
},
|
|
33793
|
+
t.id
|
|
33794
|
+
))
|
|
33795
|
+
}
|
|
33796
|
+
) }),
|
|
33797
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33798
|
+
"div",
|
|
33799
|
+
{
|
|
33800
|
+
style: {
|
|
33801
|
+
overflowY: "auto",
|
|
33802
|
+
padding: spacing[4],
|
|
33803
|
+
maxHeight: "31.25rem"
|
|
33804
|
+
},
|
|
33805
|
+
children: [
|
|
33806
|
+
mobileWalletEntries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
33807
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
33808
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33809
|
+
"h3",
|
|
33810
|
+
{
|
|
33811
|
+
style: {
|
|
33812
|
+
fontSize: fontSize.lg,
|
|
33813
|
+
fontWeight: fontWeight.semibold,
|
|
33814
|
+
color: colors.foreground,
|
|
33815
|
+
marginBottom: spacing[2]
|
|
33816
|
+
},
|
|
33817
|
+
children: "No Wallets Found"
|
|
33818
|
+
}
|
|
33819
|
+
),
|
|
33820
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33821
|
+
"p",
|
|
33822
|
+
{
|
|
33823
|
+
style: {
|
|
33824
|
+
fontSize: fontSize.sm,
|
|
33825
|
+
color: colors.mutedForeground,
|
|
33826
|
+
marginBottom: spacing[4]
|
|
33827
|
+
},
|
|
33828
|
+
children: "Please install a web3 wallet to continue."
|
|
33829
|
+
}
|
|
33830
|
+
),
|
|
33831
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33832
|
+
"a",
|
|
33833
|
+
{
|
|
33834
|
+
href: "https://metamask.io/download/",
|
|
33835
|
+
target: "_blank",
|
|
33836
|
+
rel: "noopener noreferrer",
|
|
33837
|
+
style: {
|
|
33838
|
+
display: "inline-flex",
|
|
33839
|
+
alignItems: "center",
|
|
33840
|
+
justifyContent: "center",
|
|
33841
|
+
padding: `${spacing[2]} ${spacing[4]}`,
|
|
33842
|
+
borderRadius: borderRadius.lg,
|
|
33843
|
+
backgroundColor: colors.primary,
|
|
33844
|
+
color: colors.primaryForeground,
|
|
33845
|
+
fontSize: fontSize.sm,
|
|
33846
|
+
fontWeight: fontWeight.medium,
|
|
33847
|
+
textDecoration: "none"
|
|
33848
|
+
},
|
|
33849
|
+
children: "Install MetaMask"
|
|
33850
|
+
}
|
|
33851
|
+
)
|
|
33852
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33853
|
+
"div",
|
|
33854
|
+
{
|
|
33855
|
+
style: {
|
|
33856
|
+
display: "flex",
|
|
33857
|
+
flexDirection: "column",
|
|
33858
|
+
gap: spacing[3]
|
|
33859
|
+
},
|
|
33860
|
+
children: mobileWalletEntries.map((entry) => {
|
|
33861
|
+
const { meta } = entry;
|
|
33862
|
+
const isWalletConnected = managerConnected && walletMetaId === meta.id;
|
|
33863
|
+
const isConnecting = connectingId === meta.id && walletStatus === "connecting";
|
|
33864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33865
|
+
"div",
|
|
33866
|
+
{
|
|
33867
|
+
style: mergeStyles(
|
|
33868
|
+
{
|
|
33869
|
+
width: "100%",
|
|
33870
|
+
display: "flex",
|
|
33871
|
+
alignItems: "center",
|
|
33872
|
+
gap: spacing[4],
|
|
33873
|
+
padding: spacing[4],
|
|
33874
|
+
borderRadius: borderRadius["2xl"],
|
|
33875
|
+
backgroundColor: colors.card,
|
|
33876
|
+
border: `1px solid ${colors.border}`
|
|
33877
|
+
},
|
|
33878
|
+
isWalletConnected && {
|
|
33879
|
+
boxShadow: `0 0 0 2px ${colors.primary}`,
|
|
33880
|
+
border: `1px solid ${colors.primary}`
|
|
33881
|
+
}
|
|
33882
|
+
),
|
|
33883
|
+
children: [
|
|
33884
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33885
|
+
"div",
|
|
33886
|
+
{
|
|
33887
|
+
style: {
|
|
33888
|
+
width: "3rem",
|
|
33889
|
+
height: "3rem",
|
|
33890
|
+
borderRadius: borderRadius.xl,
|
|
33891
|
+
backgroundColor: colors.muted,
|
|
33892
|
+
display: "flex",
|
|
33893
|
+
alignItems: "center",
|
|
33894
|
+
justifyContent: "center",
|
|
33895
|
+
overflow: "hidden",
|
|
33896
|
+
flexShrink: 0
|
|
33897
|
+
},
|
|
33898
|
+
children: meta.logo ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33899
|
+
"img",
|
|
33900
|
+
{
|
|
33901
|
+
src: meta.logo,
|
|
33902
|
+
alt: meta.name,
|
|
33903
|
+
style: {
|
|
33904
|
+
width: "2rem",
|
|
33905
|
+
height: "2rem",
|
|
33906
|
+
objectFit: "contain"
|
|
33907
|
+
}
|
|
33908
|
+
}
|
|
33909
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { fontSize: "1.5rem" }, children: meta.emoji || "\u{1F45B}" })
|
|
33910
|
+
}
|
|
33911
|
+
),
|
|
33912
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
33913
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33914
|
+
"p",
|
|
33915
|
+
{
|
|
33916
|
+
style: {
|
|
33917
|
+
fontWeight: fontWeight.semibold,
|
|
33918
|
+
color: colors.foreground
|
|
33919
|
+
},
|
|
33920
|
+
children: meta.name
|
|
33921
|
+
}
|
|
33922
|
+
),
|
|
33923
|
+
isWalletConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33924
|
+
"p",
|
|
33925
|
+
{
|
|
33926
|
+
style: {
|
|
33927
|
+
fontSize: fontSize.xs,
|
|
33928
|
+
color: colors.mutedForeground
|
|
33929
|
+
},
|
|
33930
|
+
children: [
|
|
33931
|
+
walletAddress.slice(0, 6),
|
|
33932
|
+
"...",
|
|
33933
|
+
walletAddress.slice(-4)
|
|
33934
|
+
]
|
|
33935
|
+
}
|
|
33936
|
+
)
|
|
33937
|
+
] }),
|
|
33938
|
+
isConnecting ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33939
|
+
"div",
|
|
33940
|
+
{
|
|
33941
|
+
style: {
|
|
33942
|
+
width: "1.25rem",
|
|
33943
|
+
height: "1.25rem",
|
|
33944
|
+
border: `2px solid ${colors.mutedForeground}`,
|
|
33945
|
+
borderTopColor: "transparent",
|
|
33946
|
+
borderRadius: "9999px",
|
|
33947
|
+
animation: "tw-spin 1s linear infinite",
|
|
33948
|
+
flexShrink: 0
|
|
33949
|
+
}
|
|
33950
|
+
}
|
|
33951
|
+
) : isWalletConnected ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33952
|
+
"button",
|
|
33953
|
+
{
|
|
33954
|
+
onClick: handleDisconnect,
|
|
33955
|
+
style: {
|
|
33956
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
33957
|
+
borderRadius: "9999px",
|
|
33958
|
+
backgroundColor: "rgba(239,68,68,0.1)",
|
|
33959
|
+
color: "#ef4444",
|
|
33960
|
+
fontSize: fontSize.xs,
|
|
33961
|
+
fontWeight: fontWeight.medium,
|
|
33962
|
+
border: 0,
|
|
33963
|
+
cursor: "pointer",
|
|
33964
|
+
flexShrink: 0
|
|
33965
|
+
},
|
|
33966
|
+
children: "Disconnect"
|
|
33967
|
+
}
|
|
33968
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33969
|
+
"button",
|
|
33970
|
+
{
|
|
33971
|
+
onClick: () => void handleClick(entry),
|
|
33972
|
+
disabled: walletStatus === "connecting",
|
|
33973
|
+
style: mergeStyles(
|
|
33974
|
+
{
|
|
33975
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
33976
|
+
borderRadius: "9999px",
|
|
33977
|
+
backgroundColor: "rgba(59,130,246,0.1)",
|
|
33978
|
+
color: colors.primary,
|
|
33979
|
+
fontSize: fontSize.xs,
|
|
33980
|
+
fontWeight: fontWeight.medium,
|
|
33981
|
+
border: 0,
|
|
33982
|
+
cursor: "pointer",
|
|
33983
|
+
flexShrink: 0
|
|
33984
|
+
},
|
|
33985
|
+
walletStatus === "connecting" && {
|
|
33986
|
+
opacity: 0.5,
|
|
33987
|
+
cursor: "not-allowed"
|
|
33988
|
+
}
|
|
33989
|
+
),
|
|
33990
|
+
children: "Connect"
|
|
33991
|
+
}
|
|
33992
|
+
)
|
|
33993
|
+
]
|
|
33994
|
+
},
|
|
33995
|
+
meta.id
|
|
33996
|
+
);
|
|
33997
|
+
})
|
|
33998
|
+
}
|
|
33999
|
+
),
|
|
34000
|
+
selectedNamespace === "evm" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
34001
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34002
|
+
"div",
|
|
34003
|
+
{
|
|
34004
|
+
style: {
|
|
34005
|
+
height: 1,
|
|
34006
|
+
backgroundColor: colors.border,
|
|
34007
|
+
margin: `${spacing[3]} 0`
|
|
34008
|
+
}
|
|
34009
|
+
}
|
|
34010
|
+
),
|
|
34011
|
+
(() => {
|
|
34012
|
+
const wcConnected = managerConnected && connectedVia === "walletconnect";
|
|
34013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
34014
|
+
"div",
|
|
34015
|
+
{
|
|
34016
|
+
style: mergeStyles(
|
|
34017
|
+
{
|
|
34018
|
+
width: "100%",
|
|
34019
|
+
display: "flex",
|
|
34020
|
+
alignItems: "center",
|
|
34021
|
+
gap: spacing[4],
|
|
34022
|
+
padding: spacing[4],
|
|
34023
|
+
borderRadius: borderRadius["2xl"],
|
|
34024
|
+
backgroundColor: colors.card,
|
|
34025
|
+
border: `1px solid ${colors.border}`,
|
|
34026
|
+
cursor: "pointer"
|
|
34027
|
+
},
|
|
34028
|
+
wcConnected && {
|
|
34029
|
+
boxShadow: `0 0 0 2px ${colors.primary}`,
|
|
34030
|
+
border: `1px solid ${colors.primary}`
|
|
34031
|
+
}
|
|
34032
|
+
),
|
|
34033
|
+
onClick: !wcConnected ? () => void handleWalletConnect() : void 0,
|
|
34034
|
+
children: [
|
|
34035
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34036
|
+
"div",
|
|
34037
|
+
{
|
|
34038
|
+
style: {
|
|
34039
|
+
width: "3rem",
|
|
34040
|
+
height: "3rem",
|
|
34041
|
+
borderRadius: borderRadius.xl,
|
|
34042
|
+
backgroundColor: colors.muted,
|
|
34043
|
+
display: "flex",
|
|
34044
|
+
alignItems: "center",
|
|
34045
|
+
justifyContent: "center",
|
|
34046
|
+
flexShrink: 0
|
|
34047
|
+
},
|
|
34048
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34049
|
+
"svg",
|
|
34050
|
+
{
|
|
34051
|
+
style: {
|
|
34052
|
+
width: "1.5rem",
|
|
34053
|
+
height: "1.5rem",
|
|
34054
|
+
color: colors.blue[500]
|
|
34055
|
+
},
|
|
34056
|
+
viewBox: "0 0 24 24",
|
|
34057
|
+
fill: "currentColor",
|
|
34058
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M6.09 10.56c3.26-3.2 8.56-3.2 11.82 0l.39.39a.4.4 0 010 .58l-1.34 1.31a.21.21 0 01-.3 0l-.54-.53c-2.28-2.23-5.97-2.23-8.24 0l-.58.56a.21.21 0 01-.3 0L5.66 11.6a.4.4 0 010-.58l.43-.46zm14.6 2.72l1.2 1.17a.4.4 0 010 .58l-5.38 5.27a.43.43 0 01-.6 0l-3.82-3.74a.11.11 0 00-.15 0l-3.82 3.74a.43.43 0 01-.6 0L2.15 15.03a.4.4 0 010-.58l1.2-1.17a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0z" })
|
|
34059
|
+
}
|
|
34060
|
+
)
|
|
34061
|
+
}
|
|
34062
|
+
),
|
|
34063
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34064
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34065
|
+
"p",
|
|
34066
|
+
{
|
|
34067
|
+
style: {
|
|
34068
|
+
fontWeight: fontWeight.semibold,
|
|
34069
|
+
color: colors.foreground
|
|
34070
|
+
},
|
|
34071
|
+
children: "WalletConnect"
|
|
34072
|
+
}
|
|
34073
|
+
),
|
|
34074
|
+
wcConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
34075
|
+
"p",
|
|
34076
|
+
{
|
|
34077
|
+
style: {
|
|
34078
|
+
fontSize: fontSize.xs,
|
|
34079
|
+
color: colors.mutedForeground
|
|
34080
|
+
},
|
|
34081
|
+
children: [
|
|
34082
|
+
walletAddress.slice(0, 6),
|
|
34083
|
+
"...",
|
|
34084
|
+
walletAddress.slice(-4)
|
|
34085
|
+
]
|
|
34086
|
+
}
|
|
34087
|
+
)
|
|
34088
|
+
] }),
|
|
34089
|
+
wcConnecting ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34090
|
+
"div",
|
|
34091
|
+
{
|
|
34092
|
+
style: {
|
|
34093
|
+
width: "1.25rem",
|
|
34094
|
+
height: "1.25rem",
|
|
34095
|
+
border: `2px solid ${colors.mutedForeground}`,
|
|
34096
|
+
borderTopColor: "transparent",
|
|
34097
|
+
borderRadius: "9999px",
|
|
34098
|
+
animation: "tw-spin 1s linear infinite",
|
|
34099
|
+
flexShrink: 0
|
|
34100
|
+
}
|
|
34101
|
+
}
|
|
34102
|
+
) : wcConnected ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34103
|
+
"button",
|
|
34104
|
+
{
|
|
34105
|
+
onClick: (e2) => {
|
|
34106
|
+
e2.stopPropagation();
|
|
34107
|
+
handleDisconnect();
|
|
34108
|
+
},
|
|
34109
|
+
style: {
|
|
34110
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34111
|
+
borderRadius: "9999px",
|
|
34112
|
+
backgroundColor: "rgba(239,68,68,0.1)",
|
|
34113
|
+
color: "#ef4444",
|
|
34114
|
+
fontSize: fontSize.xs,
|
|
34115
|
+
fontWeight: fontWeight.medium,
|
|
34116
|
+
border: 0,
|
|
34117
|
+
cursor: "pointer",
|
|
34118
|
+
flexShrink: 0
|
|
34119
|
+
},
|
|
34120
|
+
children: "Disconnect"
|
|
34121
|
+
}
|
|
34122
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34123
|
+
"button",
|
|
34124
|
+
{
|
|
34125
|
+
onClick: (e2) => {
|
|
34126
|
+
e2.stopPropagation();
|
|
34127
|
+
void handleWalletConnect();
|
|
34128
|
+
},
|
|
34129
|
+
disabled: wcConnecting,
|
|
34130
|
+
style: {
|
|
34131
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34132
|
+
borderRadius: "9999px",
|
|
34133
|
+
backgroundColor: "rgba(59,130,246,0.1)",
|
|
34134
|
+
color: colors.primary,
|
|
34135
|
+
fontSize: fontSize.xs,
|
|
34136
|
+
fontWeight: fontWeight.medium,
|
|
34137
|
+
border: 0,
|
|
34138
|
+
cursor: "pointer",
|
|
34139
|
+
flexShrink: 0
|
|
34140
|
+
},
|
|
34141
|
+
children: "Connect"
|
|
34142
|
+
}
|
|
34143
|
+
)
|
|
34144
|
+
]
|
|
34145
|
+
}
|
|
34146
|
+
);
|
|
34147
|
+
})()
|
|
34148
|
+
] })
|
|
34149
|
+
]
|
|
34150
|
+
}
|
|
34151
|
+
)
|
|
34152
|
+
]
|
|
34153
|
+
}
|
|
34154
|
+
);
|
|
34155
|
+
}
|
|
34156
|
+
var import_react48, import_jsx_runtime56, SwapWalletSelectorMobile_default;
|
|
34157
|
+
var init_SwapWalletSelectorMobile = __esm({
|
|
34158
|
+
"src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorMobile.tsx"() {
|
|
34159
|
+
"use strict";
|
|
34160
|
+
import_react48 = require("react");
|
|
34161
|
+
init_styles();
|
|
34162
|
+
init_utils();
|
|
34163
|
+
init_wallets();
|
|
34164
|
+
init_wallets();
|
|
34165
|
+
init_config2();
|
|
34166
|
+
init_Toast();
|
|
34167
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
34168
|
+
SwapWalletSelectorMobile_default = SwapWalletSelectorMobile;
|
|
34169
|
+
}
|
|
34170
|
+
});
|
|
34171
|
+
|
|
34172
|
+
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorDesktop.tsx
|
|
34173
|
+
function SwapWalletSelectorDesktop({
|
|
34174
|
+
walletStatus,
|
|
34175
|
+
walletAddress,
|
|
34176
|
+
connectWallet,
|
|
34177
|
+
onBack
|
|
34178
|
+
}) {
|
|
34179
|
+
const { detected } = useWalletDetection();
|
|
34180
|
+
const {
|
|
34181
|
+
isConnected: managerConnected,
|
|
34182
|
+
walletMetaId,
|
|
34183
|
+
connectedVia,
|
|
34184
|
+
disconnect
|
|
34185
|
+
} = useWalletInfo();
|
|
34186
|
+
const walletConnectCfg = TrustwareConfigStore.peek()?.walletConnect;
|
|
34187
|
+
const connectWC = useWalletConnectConnect(walletConnectCfg);
|
|
34188
|
+
const [wcConnecting, setWcConnecting] = (0, import_react49.useState)(false);
|
|
34189
|
+
const [connectingId, setConnectingId] = (0, import_react49.useState)(null);
|
|
34190
|
+
const [timerExpired, setTimerExpired] = (0, import_react49.useState)(false);
|
|
34191
|
+
const [selectedNamespace, setSelectedNamespace] = (0, import_react49.useState)("evm");
|
|
34192
|
+
const prevStatusRef = (0, import_react49.useRef)(walletStatus);
|
|
34193
|
+
(0, import_react49.useEffect)(() => {
|
|
33515
34194
|
const t = setTimeout(() => setTimerExpired(true), 450);
|
|
33516
34195
|
return () => clearTimeout(t);
|
|
33517
34196
|
}, []);
|
|
33518
|
-
(0,
|
|
34197
|
+
(0, import_react49.useEffect)(() => {
|
|
33519
34198
|
const prev = prevStatusRef.current;
|
|
33520
34199
|
if (prev !== walletStatus) {
|
|
33521
34200
|
if (prev === "connecting" && (walletStatus === "connected" || walletStatus === "error")) {
|
|
@@ -33524,7 +34203,7 @@ function SwapWalletSelector({
|
|
|
33524
34203
|
prevStatusRef.current = walletStatus;
|
|
33525
34204
|
}
|
|
33526
34205
|
}, [walletStatus]);
|
|
33527
|
-
const filteredWallets = (0,
|
|
34206
|
+
const filteredWallets = (0, import_react49.useMemo)(
|
|
33528
34207
|
() => detected.filter(
|
|
33529
34208
|
(w) => (w.meta?.ecosystem ?? "").toLowerCase() === selectedNamespace
|
|
33530
34209
|
),
|
|
@@ -33583,8 +34262,8 @@ function SwapWalletSelector({
|
|
|
33583
34262
|
{ id: "evm", label: "EVM" },
|
|
33584
34263
|
{ id: "solana", label: "Solana" }
|
|
33585
34264
|
];
|
|
33586
|
-
return /* @__PURE__ */ (0,
|
|
33587
|
-
/* @__PURE__ */ (0,
|
|
34265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
34266
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33588
34267
|
"div",
|
|
33589
34268
|
{
|
|
33590
34269
|
style: {
|
|
@@ -33594,7 +34273,7 @@ function SwapWalletSelector({
|
|
|
33594
34273
|
borderBottom: `1px solid ${colors.border}`
|
|
33595
34274
|
},
|
|
33596
34275
|
children: [
|
|
33597
|
-
/* @__PURE__ */ (0,
|
|
34276
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33598
34277
|
"button",
|
|
33599
34278
|
{
|
|
33600
34279
|
type: "button",
|
|
@@ -33607,7 +34286,7 @@ function SwapWalletSelector({
|
|
|
33607
34286
|
border: 0,
|
|
33608
34287
|
cursor: "pointer"
|
|
33609
34288
|
},
|
|
33610
|
-
children: /* @__PURE__ */ (0,
|
|
34289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33611
34290
|
"svg",
|
|
33612
34291
|
{
|
|
33613
34292
|
style: {
|
|
@@ -33619,7 +34298,7 @@ function SwapWalletSelector({
|
|
|
33619
34298
|
fill: "none",
|
|
33620
34299
|
stroke: "currentColor",
|
|
33621
34300
|
strokeWidth: 2,
|
|
33622
|
-
children: /* @__PURE__ */ (0,
|
|
34301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33623
34302
|
"path",
|
|
33624
34303
|
{
|
|
33625
34304
|
strokeLinecap: "round",
|
|
@@ -33631,7 +34310,7 @@ function SwapWalletSelector({
|
|
|
33631
34310
|
)
|
|
33632
34311
|
}
|
|
33633
34312
|
),
|
|
33634
|
-
/* @__PURE__ */ (0,
|
|
34313
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33635
34314
|
"h1",
|
|
33636
34315
|
{
|
|
33637
34316
|
style: {
|
|
@@ -33644,7 +34323,7 @@ function SwapWalletSelector({
|
|
|
33644
34323
|
children: "Connect Wallet"
|
|
33645
34324
|
}
|
|
33646
34325
|
),
|
|
33647
|
-
/* @__PURE__ */ (0,
|
|
34326
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33648
34327
|
"div",
|
|
33649
34328
|
{
|
|
33650
34329
|
style: {
|
|
@@ -33655,7 +34334,7 @@ function SwapWalletSelector({
|
|
|
33655
34334
|
padding: "3px",
|
|
33656
34335
|
gap: "2px"
|
|
33657
34336
|
},
|
|
33658
|
-
children: tabs.map((t) => /* @__PURE__ */ (0,
|
|
34337
|
+
children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33659
34338
|
"button",
|
|
33660
34339
|
{
|
|
33661
34340
|
onClick: () => setSelectedNamespace(t.id),
|
|
@@ -33681,8 +34360,8 @@ function SwapWalletSelector({
|
|
|
33681
34360
|
]
|
|
33682
34361
|
}
|
|
33683
34362
|
),
|
|
33684
|
-
/* @__PURE__ */ (0,
|
|
33685
|
-
isDetecting ? /* @__PURE__ */ (0,
|
|
34363
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { padding: spacing[4] }, children: [
|
|
34364
|
+
isDetecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33686
34365
|
"div",
|
|
33687
34366
|
{
|
|
33688
34367
|
style: {
|
|
@@ -33691,7 +34370,7 @@ function SwapWalletSelector({
|
|
|
33691
34370
|
gap: spacing[3]
|
|
33692
34371
|
},
|
|
33693
34372
|
children: [
|
|
33694
|
-
[1, 2].map((i) => /* @__PURE__ */ (0,
|
|
34373
|
+
[1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33695
34374
|
"div",
|
|
33696
34375
|
{
|
|
33697
34376
|
style: {
|
|
@@ -33704,7 +34383,7 @@ function SwapWalletSelector({
|
|
|
33704
34383
|
animation: "tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
33705
34384
|
},
|
|
33706
34385
|
children: [
|
|
33707
|
-
/* @__PURE__ */ (0,
|
|
34386
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33708
34387
|
"div",
|
|
33709
34388
|
{
|
|
33710
34389
|
style: {
|
|
@@ -33715,7 +34394,7 @@ function SwapWalletSelector({
|
|
|
33715
34394
|
}
|
|
33716
34395
|
}
|
|
33717
34396
|
),
|
|
33718
|
-
/* @__PURE__ */ (0,
|
|
34397
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33719
34398
|
"div",
|
|
33720
34399
|
{
|
|
33721
34400
|
style: {
|
|
@@ -33730,7 +34409,7 @@ function SwapWalletSelector({
|
|
|
33730
34409
|
},
|
|
33731
34410
|
i
|
|
33732
34411
|
)),
|
|
33733
|
-
/* @__PURE__ */ (0,
|
|
34412
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33734
34413
|
"p",
|
|
33735
34414
|
{
|
|
33736
34415
|
style: {
|
|
@@ -33744,9 +34423,9 @@ function SwapWalletSelector({
|
|
|
33744
34423
|
)
|
|
33745
34424
|
]
|
|
33746
34425
|
}
|
|
33747
|
-
) : filteredWallets.length === 0 ? /* @__PURE__ */ (0,
|
|
33748
|
-
/* @__PURE__ */ (0,
|
|
33749
|
-
/* @__PURE__ */ (0,
|
|
34426
|
+
) : filteredWallets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
34427
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
34428
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33750
34429
|
"h3",
|
|
33751
34430
|
{
|
|
33752
34431
|
style: {
|
|
@@ -33758,7 +34437,7 @@ function SwapWalletSelector({
|
|
|
33758
34437
|
children: "No Wallets Found"
|
|
33759
34438
|
}
|
|
33760
34439
|
),
|
|
33761
|
-
/* @__PURE__ */ (0,
|
|
34440
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33762
34441
|
"p",
|
|
33763
34442
|
{
|
|
33764
34443
|
style: {
|
|
@@ -33769,7 +34448,7 @@ function SwapWalletSelector({
|
|
|
33769
34448
|
children: "Please install a web3 wallet to continue."
|
|
33770
34449
|
}
|
|
33771
34450
|
),
|
|
33772
|
-
/* @__PURE__ */ (0,
|
|
34451
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33773
34452
|
"a",
|
|
33774
34453
|
{
|
|
33775
34454
|
href: "https://metamask.io/download/",
|
|
@@ -33790,7 +34469,7 @@ function SwapWalletSelector({
|
|
|
33790
34469
|
children: "Install MetaMask"
|
|
33791
34470
|
}
|
|
33792
34471
|
)
|
|
33793
|
-
] }) : /* @__PURE__ */ (0,
|
|
34472
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33794
34473
|
"div",
|
|
33795
34474
|
{
|
|
33796
34475
|
style: {
|
|
@@ -33801,7 +34480,7 @@ function SwapWalletSelector({
|
|
|
33801
34480
|
children: filteredWallets.map((wallet) => {
|
|
33802
34481
|
const isWalletConnected = managerConnected && walletMetaId === wallet.meta.id;
|
|
33803
34482
|
const isConnecting = connectingId === wallet.meta.id && walletStatus === "connecting";
|
|
33804
|
-
return /* @__PURE__ */ (0,
|
|
34483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33805
34484
|
"div",
|
|
33806
34485
|
{
|
|
33807
34486
|
style: mergeStyles(
|
|
@@ -33821,7 +34500,7 @@ function SwapWalletSelector({
|
|
|
33821
34500
|
}
|
|
33822
34501
|
),
|
|
33823
34502
|
children: [
|
|
33824
|
-
/* @__PURE__ */ (0,
|
|
34503
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33825
34504
|
"div",
|
|
33826
34505
|
{
|
|
33827
34506
|
style: {
|
|
@@ -33835,7 +34514,7 @@ function SwapWalletSelector({
|
|
|
33835
34514
|
overflow: "hidden",
|
|
33836
34515
|
flexShrink: 0
|
|
33837
34516
|
},
|
|
33838
|
-
children: wallet.meta.logo ? /* @__PURE__ */ (0,
|
|
34517
|
+
children: wallet.meta.logo ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33839
34518
|
"img",
|
|
33840
34519
|
{
|
|
33841
34520
|
src: wallet.meta.logo,
|
|
@@ -33846,7 +34525,7 @@ function SwapWalletSelector({
|
|
|
33846
34525
|
objectFit: "contain"
|
|
33847
34526
|
}
|
|
33848
34527
|
}
|
|
33849
|
-
) : wallet.detail?.info?.icon ? /* @__PURE__ */ (0,
|
|
34528
|
+
) : wallet.detail?.info?.icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33850
34529
|
"img",
|
|
33851
34530
|
{
|
|
33852
34531
|
src: wallet.detail.info.icon,
|
|
@@ -33857,11 +34536,11 @@ function SwapWalletSelector({
|
|
|
33857
34536
|
objectFit: "contain"
|
|
33858
34537
|
}
|
|
33859
34538
|
}
|
|
33860
|
-
) : /* @__PURE__ */ (0,
|
|
34539
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { fontSize: "1.5rem" }, children: wallet.meta.emoji || "\u{1F45B}" })
|
|
33861
34540
|
}
|
|
33862
34541
|
),
|
|
33863
|
-
/* @__PURE__ */ (0,
|
|
33864
|
-
/* @__PURE__ */ (0,
|
|
34542
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34543
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33865
34544
|
"p",
|
|
33866
34545
|
{
|
|
33867
34546
|
style: {
|
|
@@ -33871,7 +34550,7 @@ function SwapWalletSelector({
|
|
|
33871
34550
|
children: wallet.meta.name
|
|
33872
34551
|
}
|
|
33873
34552
|
),
|
|
33874
|
-
isWalletConnected && walletAddress && /* @__PURE__ */ (0,
|
|
34553
|
+
isWalletConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33875
34554
|
"p",
|
|
33876
34555
|
{
|
|
33877
34556
|
style: {
|
|
@@ -33886,7 +34565,7 @@ function SwapWalletSelector({
|
|
|
33886
34565
|
}
|
|
33887
34566
|
)
|
|
33888
34567
|
] }),
|
|
33889
|
-
isConnecting ? /* @__PURE__ */ (0,
|
|
34568
|
+
isConnecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33890
34569
|
"div",
|
|
33891
34570
|
{
|
|
33892
34571
|
style: {
|
|
@@ -33899,7 +34578,7 @@ function SwapWalletSelector({
|
|
|
33899
34578
|
flexShrink: 0
|
|
33900
34579
|
}
|
|
33901
34580
|
}
|
|
33902
|
-
) : isWalletConnected ? /* @__PURE__ */ (0,
|
|
34581
|
+
) : isWalletConnected ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33903
34582
|
"button",
|
|
33904
34583
|
{
|
|
33905
34584
|
onClick: handleDisconnect,
|
|
@@ -33916,7 +34595,7 @@ function SwapWalletSelector({
|
|
|
33916
34595
|
},
|
|
33917
34596
|
children: "Disconnect"
|
|
33918
34597
|
}
|
|
33919
|
-
) : /* @__PURE__ */ (0,
|
|
34598
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33920
34599
|
"button",
|
|
33921
34600
|
{
|
|
33922
34601
|
onClick: () => void handleClick(wallet),
|
|
@@ -33948,8 +34627,8 @@ function SwapWalletSelector({
|
|
|
33948
34627
|
})
|
|
33949
34628
|
}
|
|
33950
34629
|
),
|
|
33951
|
-
selectedNamespace === "evm" && /* @__PURE__ */ (0,
|
|
33952
|
-
/* @__PURE__ */ (0,
|
|
34630
|
+
selectedNamespace === "evm" && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
34631
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33953
34632
|
"div",
|
|
33954
34633
|
{
|
|
33955
34634
|
style: {
|
|
@@ -33961,7 +34640,7 @@ function SwapWalletSelector({
|
|
|
33961
34640
|
),
|
|
33962
34641
|
(() => {
|
|
33963
34642
|
const wcConnected = managerConnected && connectedVia === "walletconnect";
|
|
33964
|
-
return /* @__PURE__ */ (0,
|
|
34643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33965
34644
|
"div",
|
|
33966
34645
|
{
|
|
33967
34646
|
style: mergeStyles(
|
|
@@ -33983,7 +34662,7 @@ function SwapWalletSelector({
|
|
|
33983
34662
|
),
|
|
33984
34663
|
onClick: !wcConnected ? () => void handleWalletConnect() : void 0,
|
|
33985
34664
|
children: [
|
|
33986
|
-
/* @__PURE__ */ (0,
|
|
34665
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33987
34666
|
"div",
|
|
33988
34667
|
{
|
|
33989
34668
|
style: {
|
|
@@ -33996,7 +34675,7 @@ function SwapWalletSelector({
|
|
|
33996
34675
|
justifyContent: "center",
|
|
33997
34676
|
flexShrink: 0
|
|
33998
34677
|
},
|
|
33999
|
-
children: /* @__PURE__ */ (0,
|
|
34678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34000
34679
|
"svg",
|
|
34001
34680
|
{
|
|
34002
34681
|
style: {
|
|
@@ -34006,13 +34685,13 @@ function SwapWalletSelector({
|
|
|
34006
34685
|
},
|
|
34007
34686
|
viewBox: "0 0 24 24",
|
|
34008
34687
|
fill: "currentColor",
|
|
34009
|
-
children: /* @__PURE__ */ (0,
|
|
34688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M6.09 10.56c3.26-3.2 8.56-3.2 11.82 0l.39.39a.4.4 0 010 .58l-1.34 1.31a.21.21 0 01-.3 0l-.54-.53c-2.28-2.23-5.97-2.23-8.24 0l-.58.56a.21.21 0 01-.3 0L5.66 11.6a.4.4 0 010-.58l.43-.46zm14.6 2.72l1.2 1.17a.4.4 0 010 .58l-5.38 5.27a.43.43 0 01-.6 0l-3.82-3.74a.11.11 0 00-.15 0l-3.82 3.74a.43.43 0 01-.6 0L2.15 15.03a.4.4 0 010-.58l1.2-1.17a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0z" })
|
|
34010
34689
|
}
|
|
34011
34690
|
)
|
|
34012
34691
|
}
|
|
34013
34692
|
),
|
|
34014
|
-
/* @__PURE__ */ (0,
|
|
34015
|
-
/* @__PURE__ */ (0,
|
|
34693
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34694
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34016
34695
|
"p",
|
|
34017
34696
|
{
|
|
34018
34697
|
style: {
|
|
@@ -34022,7 +34701,7 @@ function SwapWalletSelector({
|
|
|
34022
34701
|
children: "WalletConnect"
|
|
34023
34702
|
}
|
|
34024
34703
|
),
|
|
34025
|
-
wcConnected && walletAddress && /* @__PURE__ */ (0,
|
|
34704
|
+
wcConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
34026
34705
|
"p",
|
|
34027
34706
|
{
|
|
34028
34707
|
style: {
|
|
@@ -34037,7 +34716,7 @@ function SwapWalletSelector({
|
|
|
34037
34716
|
}
|
|
34038
34717
|
)
|
|
34039
34718
|
] }),
|
|
34040
|
-
wcConnecting ? /* @__PURE__ */ (0,
|
|
34719
|
+
wcConnecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34041
34720
|
"div",
|
|
34042
34721
|
{
|
|
34043
34722
|
style: {
|
|
@@ -34050,7 +34729,7 @@ function SwapWalletSelector({
|
|
|
34050
34729
|
flexShrink: 0
|
|
34051
34730
|
}
|
|
34052
34731
|
}
|
|
34053
|
-
) : wcConnected ? /* @__PURE__ */ (0,
|
|
34732
|
+
) : wcConnected ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34054
34733
|
"button",
|
|
34055
34734
|
{
|
|
34056
34735
|
onClick: (e2) => {
|
|
@@ -34070,7 +34749,7 @@ function SwapWalletSelector({
|
|
|
34070
34749
|
},
|
|
34071
34750
|
children: "Disconnect"
|
|
34072
34751
|
}
|
|
34073
|
-
) : /* @__PURE__ */ (0,
|
|
34752
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34074
34753
|
"button",
|
|
34075
34754
|
{
|
|
34076
34755
|
onClick: (e2) => {
|
|
@@ -34100,90 +34779,66 @@ function SwapWalletSelector({
|
|
|
34100
34779
|
] })
|
|
34101
34780
|
] });
|
|
34102
34781
|
}
|
|
34103
|
-
var
|
|
34104
|
-
var
|
|
34105
|
-
"src/modes/swap/components/SwapWalletSelector.tsx"() {
|
|
34782
|
+
var import_react49, import_jsx_runtime57;
|
|
34783
|
+
var init_SwapWalletSelectorDesktop = __esm({
|
|
34784
|
+
"src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorDesktop.tsx"() {
|
|
34106
34785
|
"use strict";
|
|
34107
|
-
|
|
34786
|
+
import_react49 = require("react");
|
|
34108
34787
|
init_styles();
|
|
34109
34788
|
init_utils();
|
|
34110
34789
|
init_wallets();
|
|
34111
34790
|
init_config2();
|
|
34112
34791
|
init_Toast();
|
|
34113
|
-
|
|
34792
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
34114
34793
|
}
|
|
34115
34794
|
});
|
|
34116
34795
|
|
|
34117
|
-
// src/modes/swap/
|
|
34118
|
-
function
|
|
34119
|
-
|
|
34120
|
-
|
|
34121
|
-
|
|
34122
|
-
|
|
34123
|
-
|
|
34124
|
-
|
|
34125
|
-
|
|
34126
|
-
|
|
34127
|
-
|
|
34128
|
-
"src/modes/swap/currency.ts"() {
|
|
34129
|
-
"use strict";
|
|
34130
|
-
SUPPORTED_CURRENCIES = [
|
|
34131
|
-
{ code: "USD", symbol: "$", name: "US Dollar", decimals: 2 },
|
|
34132
|
-
{ code: "EUR", symbol: "\u20AC", name: "Euro", decimals: 2 },
|
|
34133
|
-
{ code: "GBP", symbol: "\xA3", name: "British Pound", decimals: 2 },
|
|
34134
|
-
{ code: "CAD", symbol: "CA$", name: "Canadian Dollar", decimals: 2 },
|
|
34135
|
-
{ code: "AUD", symbol: "A$", name: "Australian Dollar", decimals: 2 },
|
|
34136
|
-
{ code: "JPY", symbol: "\xA5", name: "Japanese Yen", decimals: 0 },
|
|
34137
|
-
{ code: "CHF", symbol: "Fr", name: "Swiss Franc", decimals: 2 },
|
|
34138
|
-
{ code: "KRW", symbol: "\u20A9", name: "South Korean Won", decimals: 0 },
|
|
34139
|
-
{ code: "INR", symbol: "\u20B9", name: "Indian Rupee", decimals: 2 },
|
|
34140
|
-
{ code: "BRL", symbol: "R$", name: "Brazilian Real", decimals: 2 },
|
|
34141
|
-
{ code: "SGD", symbol: "S$", name: "Singapore Dollar", decimals: 2 },
|
|
34142
|
-
{ code: "MXN", symbol: "MX$", name: "Mexican Peso", decimals: 2 },
|
|
34143
|
-
{ code: "HKD", symbol: "HK$", name: "Hong Kong Dollar", decimals: 2 },
|
|
34144
|
-
{ code: "CNY", symbol: "\xA5", name: "Chinese Yuan", decimals: 2 },
|
|
34145
|
-
{ code: "ZAR", symbol: "R", name: "South African Rand", decimals: 2 },
|
|
34146
|
-
{ code: "TRY", symbol: "\u20BA", name: "Turkish Lira", decimals: 2 },
|
|
34147
|
-
{ code: "RUB", symbol: "\u20BD", name: "Russian Ruble", decimals: 2 },
|
|
34796
|
+
// src/modes/swap/components/SwapWalletSelector/index.tsx
|
|
34797
|
+
function SwapWalletSelector({
|
|
34798
|
+
walletStatus,
|
|
34799
|
+
walletAddress,
|
|
34800
|
+
connectWallet,
|
|
34801
|
+
onBack
|
|
34802
|
+
}) {
|
|
34803
|
+
const isMobile = useIsMobile();
|
|
34804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
34805
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
34806
|
+
SwapWalletSelectorMobile_default,
|
|
34148
34807
|
{
|
|
34149
|
-
|
|
34150
|
-
|
|
34151
|
-
|
|
34152
|
-
|
|
34153
|
-
}
|
|
34154
|
-
|
|
34155
|
-
|
|
34156
|
-
|
|
34157
|
-
{ code: "OMR", symbol: "\u0631.\u0639.", name: "Omani Rial", decimals: 3 },
|
|
34158
|
-
{ code: "BHD", symbol: "\u0628.\u062F", name: "Bahraini Dinar", decimals: 3 },
|
|
34159
|
-
{ code: "JOD", symbol: "\u062F.\u0627", name: "Jordanian Dinar", decimals: 3 },
|
|
34160
|
-
{ code: "LYD", symbol: "\u0644.\u062F", name: "Libyan Dinar", decimals: 3 },
|
|
34161
|
-
{ code: "TND", symbol: "\u062F.\u062A", name: "Tunisian Dinar", decimals: 3 },
|
|
34162
|
-
{ code: "MAD", symbol: "\u062F.\u0645.", name: "Moroccan Dirham", decimals: 2 },
|
|
34163
|
-
{ code: "EGP", symbol: "\xA3", name: "Egyptian Pound", decimals: 2 },
|
|
34164
|
-
{ code: "NGN", symbol: "\u20A6", name: "Nigerian Naira", decimals: 2 },
|
|
34165
|
-
{ code: "GHS", symbol: "\u20B5", name: "Ghanaian Cedi", decimals: 2 },
|
|
34166
|
-
{ code: "KES", symbol: "KSh", name: "Kenyan Shilling", decimals: 2 },
|
|
34167
|
-
{ code: "TZS", symbol: "TSh", name: "Tanzanian Shilling", decimals: 2 },
|
|
34168
|
-
{ code: "UGX", symbol: "USh", name: "Ugandan Shilling", decimals: 2 },
|
|
34169
|
-
{ code: "RWF", symbol: "FRw", name: "Rwandan Franc", decimals: 2 },
|
|
34170
|
-
{ code: "MUR", symbol: "Rs", name: "Mauritian Rupee", decimals: 2 },
|
|
34171
|
-
{ code: "SCR", symbol: "SR", name: "Seychellois Rupee", decimals: 2 },
|
|
34172
|
-
{ code: "MGA", symbol: "Ar", name: "Malagasy Ariary", decimals: 2 },
|
|
34808
|
+
walletStatus,
|
|
34809
|
+
walletAddress,
|
|
34810
|
+
connectWallet,
|
|
34811
|
+
onBack
|
|
34812
|
+
}
|
|
34813
|
+
),
|
|
34814
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
34815
|
+
SwapWalletSelectorDesktop,
|
|
34173
34816
|
{
|
|
34174
|
-
|
|
34175
|
-
|
|
34176
|
-
|
|
34177
|
-
|
|
34178
|
-
}
|
|
34179
|
-
|
|
34180
|
-
|
|
34181
|
-
|
|
34182
|
-
|
|
34183
|
-
|
|
34184
|
-
|
|
34185
|
-
|
|
34186
|
-
|
|
34817
|
+
walletStatus,
|
|
34818
|
+
walletAddress,
|
|
34819
|
+
connectWallet,
|
|
34820
|
+
onBack
|
|
34821
|
+
}
|
|
34822
|
+
)
|
|
34823
|
+
] });
|
|
34824
|
+
}
|
|
34825
|
+
var import_jsx_runtime58, SwapWalletSelector_default;
|
|
34826
|
+
var init_SwapWalletSelector = __esm({
|
|
34827
|
+
"src/modes/swap/components/SwapWalletSelector/index.tsx"() {
|
|
34828
|
+
"use strict";
|
|
34829
|
+
init_detect();
|
|
34830
|
+
init_SwapWalletSelectorMobile();
|
|
34831
|
+
init_SwapWalletSelectorDesktop();
|
|
34832
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
34833
|
+
SwapWalletSelector_default = SwapWalletSelector;
|
|
34834
|
+
}
|
|
34835
|
+
});
|
|
34836
|
+
|
|
34837
|
+
// src/modes/swap/components/index.ts
|
|
34838
|
+
var init_components2 = __esm({
|
|
34839
|
+
"src/modes/swap/components/index.ts"() {
|
|
34840
|
+
"use strict";
|
|
34841
|
+
init_SwapWalletSelector();
|
|
34187
34842
|
}
|
|
34188
34843
|
});
|
|
34189
34844
|
|
|
@@ -34260,7 +34915,7 @@ function getActiveStep(status) {
|
|
|
34260
34915
|
}
|
|
34261
34916
|
}
|
|
34262
34917
|
function RateRow({ label, value }) {
|
|
34263
|
-
return /* @__PURE__ */ (0,
|
|
34918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
34264
34919
|
"div",
|
|
34265
34920
|
{
|
|
34266
34921
|
style: {
|
|
@@ -34269,8 +34924,8 @@ function RateRow({ label, value }) {
|
|
|
34269
34924
|
justifyContent: "space-between"
|
|
34270
34925
|
},
|
|
34271
34926
|
children: [
|
|
34272
|
-
/* @__PURE__ */ (0,
|
|
34273
|
-
/* @__PURE__ */ (0,
|
|
34927
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
34928
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value })
|
|
34274
34929
|
]
|
|
34275
34930
|
}
|
|
34276
34931
|
);
|
|
@@ -34279,41 +34934,41 @@ function SwapMode({
|
|
|
34279
34934
|
theme: themeProp,
|
|
34280
34935
|
style
|
|
34281
34936
|
}) {
|
|
34282
|
-
const [stage, setStage] = (0,
|
|
34283
|
-
const [fromToken, setFromToken] = (0,
|
|
34937
|
+
const [stage, setStage] = (0, import_react50.useState)("home");
|
|
34938
|
+
const [fromToken, setFromToken] = (0, import_react50.useState)(
|
|
34284
34939
|
null
|
|
34285
34940
|
);
|
|
34286
|
-
const [fromChain, setFromChain] = (0,
|
|
34287
|
-
const [toToken, setToToken] = (0,
|
|
34288
|
-
const [toChain, setToChain] = (0,
|
|
34289
|
-
const [amount, setAmount] = (0,
|
|
34290
|
-
const [amountInputMode, setAmountInputMode] = (0,
|
|
34941
|
+
const [fromChain, setFromChain] = (0, import_react50.useState)(null);
|
|
34942
|
+
const [toToken, setToToken] = (0, import_react50.useState)(null);
|
|
34943
|
+
const [toChain, setToChain] = (0, import_react50.useState)(null);
|
|
34944
|
+
const [amount, setAmount] = (0, import_react50.useState)("");
|
|
34945
|
+
const [amountInputMode, setAmountInputMode] = (0, import_react50.useState)(
|
|
34291
34946
|
"usd"
|
|
34292
34947
|
);
|
|
34293
|
-
const [hoverSell, setHoverSell] = (0,
|
|
34294
|
-
const [showRateDetails, setShowRateDetails] = (0,
|
|
34295
|
-
const [showReviewDetails, setShowReviewDetails] = (0,
|
|
34296
|
-
const [showSettings, setShowSettings] = (0,
|
|
34297
|
-
const [maxApproval, setMaxApproval] = (0,
|
|
34298
|
-
const [slippage, setSlippage] = (0,
|
|
34299
|
-
const [slippageInput, setSlippageInput] = (0,
|
|
34300
|
-
const [selectedCurrency, setSelectedCurrency] = (0,
|
|
34301
|
-
const [showCurrencyDropdown, setShowCurrencyDropdown] = (0,
|
|
34302
|
-
const [completedAt, setCompletedAt] = (0,
|
|
34303
|
-
const [copiedHash, setCopiedHash] = (0,
|
|
34304
|
-
const [rateUpdated, setRateUpdated] = (0,
|
|
34305
|
-
const prevToAmountRef = (0,
|
|
34306
|
-
const [destAddress, setDestAddress] = (0,
|
|
34307
|
-
const [quoteAge, setQuoteAge] = (0,
|
|
34308
|
-
const quoteTimestampRef = (0,
|
|
34309
|
-
const [quoteLoadingMsgIdx, setQuoteLoadingMsgIdx] = (0,
|
|
34310
|
-
const [quoteLoadingMsgVisible, setQuoteLoadingMsgVisible] = (0,
|
|
34311
|
-
const latestFetchParamsRef = (0,
|
|
34948
|
+
const [hoverSell, setHoverSell] = (0, import_react50.useState)(false);
|
|
34949
|
+
const [showRateDetails, setShowRateDetails] = (0, import_react50.useState)(false);
|
|
34950
|
+
const [showReviewDetails, setShowReviewDetails] = (0, import_react50.useState)(false);
|
|
34951
|
+
const [showSettings, setShowSettings] = (0, import_react50.useState)(false);
|
|
34952
|
+
const [maxApproval, setMaxApproval] = (0, import_react50.useState)(false);
|
|
34953
|
+
const [slippage, setSlippage] = (0, import_react50.useState)(0.5);
|
|
34954
|
+
const [slippageInput, setSlippageInput] = (0, import_react50.useState)("");
|
|
34955
|
+
const [selectedCurrency, setSelectedCurrency] = (0, import_react50.useState)("USD");
|
|
34956
|
+
const [showCurrencyDropdown, setShowCurrencyDropdown] = (0, import_react50.useState)(false);
|
|
34957
|
+
const [completedAt, setCompletedAt] = (0, import_react50.useState)(null);
|
|
34958
|
+
const [copiedHash, setCopiedHash] = (0, import_react50.useState)(null);
|
|
34959
|
+
const [rateUpdated, setRateUpdated] = (0, import_react50.useState)(false);
|
|
34960
|
+
const prevToAmountRef = (0, import_react50.useRef)(null);
|
|
34961
|
+
const [destAddress, setDestAddress] = (0, import_react50.useState)("");
|
|
34962
|
+
const [quoteAge, setQuoteAge] = (0, import_react50.useState)(0);
|
|
34963
|
+
const quoteTimestampRef = (0, import_react50.useRef)(null);
|
|
34964
|
+
const [quoteLoadingMsgIdx, setQuoteLoadingMsgIdx] = (0, import_react50.useState)(0);
|
|
34965
|
+
const [quoteLoadingMsgVisible, setQuoteLoadingMsgVisible] = (0, import_react50.useState)(true);
|
|
34966
|
+
const latestFetchParamsRef = (0, import_react50.useRef)(null);
|
|
34312
34967
|
const { rates: forexRates } = useForex();
|
|
34313
34968
|
const currencyMeta = getCurrencyMeta(selectedCurrency);
|
|
34314
34969
|
const currencyRate = forexRates[selectedCurrency] ?? 1;
|
|
34315
34970
|
const currencySymbol = currencyMeta.symbol;
|
|
34316
|
-
const fmtLocal = (0,
|
|
34971
|
+
const fmtLocal = (0, import_react50.useCallback)(
|
|
34317
34972
|
(usdAmount) => {
|
|
34318
34973
|
const sym = getCurrencyMeta(selectedCurrency).symbol;
|
|
34319
34974
|
if (usdAmount === null || !isFinite(usdAmount) || usdAmount <= 0)
|
|
@@ -34324,8 +34979,8 @@ function SwapMode({
|
|
|
34324
34979
|
},
|
|
34325
34980
|
[currencyRate, selectedCurrency]
|
|
34326
34981
|
);
|
|
34327
|
-
const settingsRef = (0,
|
|
34328
|
-
const currencyDropdownRef = (0,
|
|
34982
|
+
const settingsRef = (0, import_react50.useRef)(null);
|
|
34983
|
+
const currencyDropdownRef = (0, import_react50.useRef)(null);
|
|
34329
34984
|
const { emitEvent } = useTrustware();
|
|
34330
34985
|
const { features, theme: configTheme } = useTrustwareConfig();
|
|
34331
34986
|
const effectiveThemeSetting = themeProp ?? configTheme ?? "system";
|
|
@@ -34341,26 +34996,26 @@ function SwapMode({
|
|
|
34341
34996
|
isLoading: chainsLoading,
|
|
34342
34997
|
error: chainsError
|
|
34343
34998
|
} = useChains();
|
|
34344
|
-
const allowedDestChainIds = (0,
|
|
34999
|
+
const allowedDestChainIds = (0, import_react50.useMemo)(() => {
|
|
34345
35000
|
if (!allowedDestTokens || allowedDestTokens.length === 0) return null;
|
|
34346
35001
|
return new Set(allowedDestTokens.map((t) => t.chainId));
|
|
34347
35002
|
}, [allowedDestTokens]);
|
|
34348
|
-
const toPopularChains = (0,
|
|
35003
|
+
const toPopularChains = (0, import_react50.useMemo)(
|
|
34349
35004
|
() => allowedDestChainIds ? popularChains.filter(
|
|
34350
35005
|
(c) => allowedDestChainIds.has(Number(c.chainId))
|
|
34351
35006
|
) : popularChains,
|
|
34352
35007
|
[popularChains, allowedDestChainIds]
|
|
34353
35008
|
);
|
|
34354
|
-
const toOtherChains = (0,
|
|
35009
|
+
const toOtherChains = (0, import_react50.useMemo)(
|
|
34355
35010
|
() => allowedDestChainIds ? otherChains.filter((c) => allowedDestChainIds.has(Number(c.chainId))) : otherChains,
|
|
34356
35011
|
[otherChains, allowedDestChainIds]
|
|
34357
35012
|
);
|
|
34358
|
-
const allChains = (0,
|
|
35013
|
+
const allChains = (0, import_react50.useMemo)(
|
|
34359
35014
|
() => [...popularChains, ...otherChains],
|
|
34360
35015
|
[popularChains, otherChains]
|
|
34361
35016
|
);
|
|
34362
|
-
const destInitialized = (0,
|
|
34363
|
-
(0,
|
|
35017
|
+
const destInitialized = (0, import_react50.useRef)(false);
|
|
35018
|
+
(0, import_react50.useEffect)(() => {
|
|
34364
35019
|
if (!defaultDestRef || destInitialized.current || allChains.length === 0)
|
|
34365
35020
|
return;
|
|
34366
35021
|
const chain = allChains.find(
|
|
@@ -34391,11 +35046,11 @@ function SwapMode({
|
|
|
34391
35046
|
});
|
|
34392
35047
|
}, [defaultDestRef, allChains]);
|
|
34393
35048
|
const { walletAddress, walletStatus, connectWallet, disconnectWallet } = useWalletSessionState();
|
|
34394
|
-
const setFromTokenStable = (0,
|
|
35049
|
+
const setFromTokenStable = (0, import_react50.useCallback)(
|
|
34395
35050
|
(t) => setFromToken(t),
|
|
34396
35051
|
[]
|
|
34397
35052
|
);
|
|
34398
|
-
const setFromChainStable = (0,
|
|
35053
|
+
const setFromChainStable = (0, import_react50.useCallback)(
|
|
34399
35054
|
(c) => setFromChain(c),
|
|
34400
35055
|
[]
|
|
34401
35056
|
);
|
|
@@ -34408,18 +35063,18 @@ function SwapMode({
|
|
|
34408
35063
|
});
|
|
34409
35064
|
const route = useSwapRoute();
|
|
34410
35065
|
const execution = useSwapExecution(fromChain);
|
|
34411
|
-
const fromTokenPriceUSD = (0,
|
|
35066
|
+
const fromTokenPriceUSD = (0, import_react50.useMemo)(() => {
|
|
34412
35067
|
const p = fromToken?.usdPrice;
|
|
34413
35068
|
return typeof p === "number" && Number.isFinite(p) && p > 0 ? p : 0;
|
|
34414
35069
|
}, [fromToken]);
|
|
34415
35070
|
const hasFromUsdPrice = fromTokenPriceUSD > 0;
|
|
34416
|
-
const toTokenPriceUSD = (0,
|
|
35071
|
+
const toTokenPriceUSD = (0, import_react50.useMemo)(() => {
|
|
34417
35072
|
const p = toToken?.usdPrice;
|
|
34418
35073
|
return typeof p === "number" && Number.isFinite(p) && p > 0 ? p : 0;
|
|
34419
35074
|
}, [toToken]);
|
|
34420
35075
|
const hasToUsdPrice = toTokenPriceUSD > 0;
|
|
34421
35076
|
const rawSellNum = parseFloat(amount) || 0;
|
|
34422
|
-
const usdSellNum = (0,
|
|
35077
|
+
const usdSellNum = (0, import_react50.useMemo)(() => {
|
|
34423
35078
|
if (amountInputMode === "usd") return rawSellNum / currencyRate;
|
|
34424
35079
|
return hasFromUsdPrice ? rawSellNum * fromTokenPriceUSD : 0;
|
|
34425
35080
|
}, [
|
|
@@ -34429,7 +35084,7 @@ function SwapMode({
|
|
|
34429
35084
|
hasFromUsdPrice,
|
|
34430
35085
|
fromTokenPriceUSD
|
|
34431
35086
|
]);
|
|
34432
|
-
const tokenSellNum = (0,
|
|
35087
|
+
const tokenSellNum = (0, import_react50.useMemo)(() => {
|
|
34433
35088
|
if (amountInputMode === "usd") {
|
|
34434
35089
|
return hasFromUsdPrice && fromTokenPriceUSD > 0 ? usdSellNum / fromTokenPriceUSD : 0;
|
|
34435
35090
|
}
|
|
@@ -34441,12 +35096,12 @@ function SwapMode({
|
|
|
34441
35096
|
hasFromUsdPrice,
|
|
34442
35097
|
fromTokenPriceUSD
|
|
34443
35098
|
]);
|
|
34444
|
-
const tokenAmountStr = (0,
|
|
35099
|
+
const tokenAmountStr = (0, import_react50.useMemo)(() => {
|
|
34445
35100
|
if (tokenSellNum <= 0) return "";
|
|
34446
35101
|
const decimals = fromToken?.decimals ?? 18;
|
|
34447
35102
|
return truncateDecimal(tokenSellNum, Math.min(decimals, 18));
|
|
34448
35103
|
}, [tokenSellNum, fromToken?.decimals]);
|
|
34449
|
-
const handleCurrencyChange = (0,
|
|
35104
|
+
const handleCurrencyChange = (0, import_react50.useCallback)(
|
|
34450
35105
|
(newCode) => {
|
|
34451
35106
|
if (amountInputMode === "usd" && amount) {
|
|
34452
35107
|
const oldRate = currencyRate;
|
|
@@ -34461,7 +35116,7 @@ function SwapMode({
|
|
|
34461
35116
|
},
|
|
34462
35117
|
[amountInputMode, amount, currencyRate, forexRates, route]
|
|
34463
35118
|
);
|
|
34464
|
-
const handleSelectFromToken = (0,
|
|
35119
|
+
const handleSelectFromToken = (0, import_react50.useCallback)(
|
|
34465
35120
|
(token, chain) => {
|
|
34466
35121
|
setFromToken(token);
|
|
34467
35122
|
setFromChain(chain);
|
|
@@ -34482,7 +35137,7 @@ function SwapMode({
|
|
|
34482
35137
|
},
|
|
34483
35138
|
[route, emitEvent, toToken, toChain, amount]
|
|
34484
35139
|
);
|
|
34485
|
-
const handleSelectToToken = (0,
|
|
35140
|
+
const handleSelectToToken = (0, import_react50.useCallback)(
|
|
34486
35141
|
(token, chain) => {
|
|
34487
35142
|
setToToken(token);
|
|
34488
35143
|
setToChain(chain);
|
|
@@ -34499,7 +35154,7 @@ function SwapMode({
|
|
|
34499
35154
|
},
|
|
34500
35155
|
[route, emitEvent, fromToken, fromChain, amount]
|
|
34501
35156
|
);
|
|
34502
|
-
const handleFlip = (0,
|
|
35157
|
+
const handleFlip = (0, import_react50.useCallback)(() => {
|
|
34503
35158
|
if (lockDestToken) return;
|
|
34504
35159
|
const newFrom = toToken ?? fromToken;
|
|
34505
35160
|
const newFromChain = toChain ?? fromChain;
|
|
@@ -34521,7 +35176,7 @@ function SwapMode({
|
|
|
34521
35176
|
const toChainType = normalizeChainType2(toChain);
|
|
34522
35177
|
const needsDestAddress = !!fromChainType && !!toChainType && fromChainType !== toChainType;
|
|
34523
35178
|
const isValidDestAddress = !needsDestAddress || validateDestAddress(destAddress, toChainType ?? "");
|
|
34524
|
-
const handleReview = (0,
|
|
35179
|
+
const handleReview = (0, import_react50.useCallback)(async () => {
|
|
34525
35180
|
if (!fromToken || !fromChain || !toToken || !toChain || !tokenAmountStr || !walletAddress) {
|
|
34526
35181
|
if (!walletAddress) setStage("connect-wallet");
|
|
34527
35182
|
return;
|
|
@@ -34556,13 +35211,13 @@ function SwapMode({
|
|
|
34556
35211
|
route,
|
|
34557
35212
|
slippage
|
|
34558
35213
|
]);
|
|
34559
|
-
const handleConnectAndReview = (0,
|
|
35214
|
+
const handleConnectAndReview = (0, import_react50.useCallback)(() => {
|
|
34560
35215
|
setStage("connect-wallet");
|
|
34561
35216
|
}, []);
|
|
34562
|
-
const handleWalletConnected = (0,
|
|
35217
|
+
const handleWalletConnected = (0, import_react50.useCallback)(() => {
|
|
34563
35218
|
setStage("home");
|
|
34564
35219
|
}, []);
|
|
34565
|
-
const handleExecute = (0,
|
|
35220
|
+
const handleExecute = (0, import_react50.useCallback)(async () => {
|
|
34566
35221
|
if (!route.data) return;
|
|
34567
35222
|
setStage("processing");
|
|
34568
35223
|
const fromTokenAddress = fromToken?.address ?? fromToken?.address;
|
|
@@ -34585,7 +35240,7 @@ function SwapMode({
|
|
|
34585
35240
|
() => setStage("error")
|
|
34586
35241
|
);
|
|
34587
35242
|
}, [route, execution, fromToken, walletAddress, maxApproval]);
|
|
34588
|
-
const handleReset = (0,
|
|
35243
|
+
const handleReset = (0, import_react50.useCallback)(() => {
|
|
34589
35244
|
execution.reset();
|
|
34590
35245
|
route.clear();
|
|
34591
35246
|
setAmount("");
|
|
@@ -34595,7 +35250,7 @@ function SwapMode({
|
|
|
34595
35250
|
setStage("home");
|
|
34596
35251
|
reloadWalletTokens();
|
|
34597
35252
|
}, [execution, route, reloadWalletTokens]);
|
|
34598
|
-
const handleSwapBack = (0,
|
|
35253
|
+
const handleSwapBack = (0, import_react50.useCallback)(() => {
|
|
34599
35254
|
const prevFrom = fromToken;
|
|
34600
35255
|
const prevFromChain = fromChain;
|
|
34601
35256
|
setFromToken(toToken);
|
|
@@ -34619,14 +35274,14 @@ function SwapMode({
|
|
|
34619
35274
|
route,
|
|
34620
35275
|
reloadWalletTokens
|
|
34621
35276
|
]);
|
|
34622
|
-
const handleCopyHash = (0,
|
|
35277
|
+
const handleCopyHash = (0, import_react50.useCallback)((hash) => {
|
|
34623
35278
|
if (!navigator?.clipboard?.writeText) return;
|
|
34624
35279
|
void navigator.clipboard.writeText(hash).then(() => {
|
|
34625
35280
|
setCopiedHash(hash);
|
|
34626
35281
|
setTimeout(() => setCopiedHash((v) => v === hash ? null : v), 1500);
|
|
34627
35282
|
});
|
|
34628
35283
|
}, []);
|
|
34629
|
-
const handleToggleDenom = (0,
|
|
35284
|
+
const handleToggleDenom = (0, import_react50.useCallback)(() => {
|
|
34630
35285
|
if (!hasFromUsdPrice) return;
|
|
34631
35286
|
const parsed = parseFloat(amount) || 0;
|
|
34632
35287
|
if (amountInputMode === "usd") {
|
|
@@ -34652,7 +35307,7 @@ function SwapMode({
|
|
|
34652
35307
|
fromToken?.decimals,
|
|
34653
35308
|
route
|
|
34654
35309
|
]);
|
|
34655
|
-
const fromBalance = (0,
|
|
35310
|
+
const fromBalance = (0, import_react50.useMemo)(() => {
|
|
34656
35311
|
const walletToken = fromToken;
|
|
34657
35312
|
if (!walletToken || !("balance" in walletToken)) return null;
|
|
34658
35313
|
const raw = walletToken.balance;
|
|
@@ -34662,7 +35317,7 @@ function SwapMode({
|
|
|
34662
35317
|
return Number.isFinite(n) ? n : null;
|
|
34663
35318
|
}, [fromToken]);
|
|
34664
35319
|
const balanceUsd = fromBalance !== null && hasFromUsdPrice ? fromBalance * fromTokenPriceUSD : null;
|
|
34665
|
-
const estimatedToAmount = (0,
|
|
35320
|
+
const estimatedToAmount = (0, import_react50.useMemo)(() => {
|
|
34666
35321
|
if (tokenSellNum <= 0 || !hasFromUsdPrice || !hasToUsdPrice) return null;
|
|
34667
35322
|
return tokenSellNum * (fromTokenPriceUSD / toTokenPriceUSD);
|
|
34668
35323
|
}, [
|
|
@@ -34672,10 +35327,10 @@ function SwapMode({
|
|
|
34672
35327
|
hasFromUsdPrice,
|
|
34673
35328
|
hasToUsdPrice
|
|
34674
35329
|
]);
|
|
34675
|
-
const backendToUsdStr = (0,
|
|
35330
|
+
const backendToUsdStr = (0, import_react50.useMemo)(() => {
|
|
34676
35331
|
return route.data?.finalExchangeRate?.toAmountMinUSD ?? route.data?.route?.estimate?.toAmountMinUsd ?? route.data?.route?.estimate?.toAmountUsd ?? null;
|
|
34677
35332
|
}, [route.data]);
|
|
34678
|
-
const toAmount = (0,
|
|
35333
|
+
const toAmount = (0, import_react50.useMemo)(() => {
|
|
34679
35334
|
if (backendToUsdStr && toTokenPriceUSD > 0) {
|
|
34680
35335
|
const usd = parseFloat(backendToUsdStr);
|
|
34681
35336
|
if (Number.isFinite(usd) && usd > 0) return usd / toTokenPriceUSD;
|
|
@@ -34701,7 +35356,7 @@ function SwapMode({
|
|
|
34701
35356
|
estimatedToAmount
|
|
34702
35357
|
]);
|
|
34703
35358
|
const fromUsd = usdSellNum;
|
|
34704
|
-
const toUsd = (0,
|
|
35359
|
+
const toUsd = (0, import_react50.useMemo)(() => {
|
|
34705
35360
|
if (backendToUsdStr) {
|
|
34706
35361
|
const n = parseFloat(backendToUsdStr);
|
|
34707
35362
|
if (Number.isFinite(n) && n > 0) return n;
|
|
@@ -34712,12 +35367,12 @@ function SwapMode({
|
|
|
34712
35367
|
const isEstimate = !route.data;
|
|
34713
35368
|
const USD_EPSILON = 1e-3;
|
|
34714
35369
|
const displayToUsd = toUsd > USD_EPSILON ? toUsd : estimatedToAmount !== null && hasToUsdPrice ? estimatedToAmount * toTokenPriceUSD : 0;
|
|
34715
|
-
const priceImpact = (0,
|
|
35370
|
+
const priceImpact = (0, import_react50.useMemo)(() => {
|
|
34716
35371
|
if (!route.data || fromUsd < 0.01 || displayToUsd < 0.01) return null;
|
|
34717
35372
|
const impact = 1 - displayToUsd / fromUsd;
|
|
34718
35373
|
return impact > 1e-3 ? impact : null;
|
|
34719
35374
|
}, [route.data, fromUsd, displayToUsd]);
|
|
34720
|
-
const routePath = (0,
|
|
35375
|
+
const routePath = (0, import_react50.useMemo)(() => {
|
|
34721
35376
|
if (!route.data) return null;
|
|
34722
35377
|
const provider = route.data.route?.provider;
|
|
34723
35378
|
const steps = route.data.route?.steps;
|
|
@@ -34744,19 +35399,19 @@ function SwapMode({
|
|
|
34744
35399
|
return null;
|
|
34745
35400
|
}, [route.data, fromToken?.symbol, toToken?.symbol]);
|
|
34746
35401
|
const isGasSponsored = !!route.data?.sponsorship;
|
|
34747
|
-
const networkCostUsd = (0,
|
|
35402
|
+
const networkCostUsd = (0, import_react50.useMemo)(() => {
|
|
34748
35403
|
const fees = route.data?.route?.estimate?.fees;
|
|
34749
35404
|
if (!fees?.length) return null;
|
|
34750
35405
|
const gasTotal = fees.filter((f) => f.type?.toLowerCase().includes("gas")).reduce((sum, f) => sum + (Number(f.amountUsd) || 0), 0);
|
|
34751
35406
|
return gasTotal > 0 ? gasTotal : null;
|
|
34752
35407
|
}, [route.data]);
|
|
34753
|
-
const protocolFeeUsd = (0,
|
|
35408
|
+
const protocolFeeUsd = (0, import_react50.useMemo)(() => {
|
|
34754
35409
|
const fees = route.data?.route?.estimate?.fees;
|
|
34755
35410
|
if (!fees?.length) return null;
|
|
34756
35411
|
const total = fees.filter((f) => !f.type?.toLowerCase().includes("gas")).reduce((sum, f) => sum + (Number(f.amountUsd) || 0), 0);
|
|
34757
35412
|
return total > 0 ? total : null;
|
|
34758
35413
|
}, [route.data]);
|
|
34759
|
-
const exchangeRate = (0,
|
|
35414
|
+
const exchangeRate = (0, import_react50.useMemo)(() => {
|
|
34760
35415
|
if (!hasFromUsdPrice || !hasToUsdPrice) return null;
|
|
34761
35416
|
return toTokenPriceUSD / fromTokenPriceUSD;
|
|
34762
35417
|
}, [fromTokenPriceUSD, toTokenPriceUSD, hasFromUsdPrice, hasToUsdPrice]);
|
|
@@ -34765,13 +35420,13 @@ function SwapMode({
|
|
|
34765
35420
|
const hasAmount = rawSellNum > 0 && (amountInputMode === "token" || hasFromUsdPrice);
|
|
34766
35421
|
const isConnected = walletStatus === "connected" && !!walletAddress;
|
|
34767
35422
|
const canGetQuote = hasTokens && hasAmount && !insufficient && isConnected && (!needsDestAddress || isValidDestAddress);
|
|
34768
|
-
(0,
|
|
35423
|
+
(0, import_react50.useEffect)(() => {
|
|
34769
35424
|
if (!fromToken) return;
|
|
34770
35425
|
if (!hasFromUsdPrice && amountInputMode === "usd") {
|
|
34771
35426
|
setAmountInputMode("token");
|
|
34772
35427
|
}
|
|
34773
35428
|
}, [fromToken, hasFromUsdPrice, amountInputMode]);
|
|
34774
|
-
(0,
|
|
35429
|
+
(0, import_react50.useEffect)(() => {
|
|
34775
35430
|
if (displayToAmount === null) {
|
|
34776
35431
|
prevToAmountRef.current = null;
|
|
34777
35432
|
return;
|
|
@@ -34785,14 +35440,14 @@ function SwapMode({
|
|
|
34785
35440
|
const t = setTimeout(() => setRateUpdated(false), 700);
|
|
34786
35441
|
return () => clearTimeout(t);
|
|
34787
35442
|
}, [displayToAmount]);
|
|
34788
|
-
(0,
|
|
35443
|
+
(0, import_react50.useEffect)(() => {
|
|
34789
35444
|
setDestAddress("");
|
|
34790
35445
|
}, [toChainType]);
|
|
34791
|
-
const fetchRef = (0,
|
|
34792
|
-
(0,
|
|
35446
|
+
const fetchRef = (0, import_react50.useRef)(route.fetch);
|
|
35447
|
+
(0, import_react50.useEffect)(() => {
|
|
34793
35448
|
fetchRef.current = route.fetch;
|
|
34794
35449
|
});
|
|
34795
|
-
(0,
|
|
35450
|
+
(0, import_react50.useEffect)(() => {
|
|
34796
35451
|
if (!canGetQuote || stage !== "home") return;
|
|
34797
35452
|
if (!fromToken || !fromChain || !toToken || !toChain || !walletAddress)
|
|
34798
35453
|
return;
|
|
@@ -34821,7 +35476,7 @@ function SwapMode({
|
|
|
34821
35476
|
destAddress,
|
|
34822
35477
|
slippage
|
|
34823
35478
|
]);
|
|
34824
|
-
(0,
|
|
35479
|
+
(0, import_react50.useEffect)(() => {
|
|
34825
35480
|
if (!canGetQuote || !fromToken || !fromChain || !toToken || !toChain || !walletAddress) {
|
|
34826
35481
|
latestFetchParamsRef.current = null;
|
|
34827
35482
|
return;
|
|
@@ -34848,12 +35503,12 @@ function SwapMode({
|
|
|
34848
35503
|
destAddress,
|
|
34849
35504
|
slippage
|
|
34850
35505
|
]);
|
|
34851
|
-
(0,
|
|
35506
|
+
(0, import_react50.useEffect)(() => {
|
|
34852
35507
|
quoteTimestampRef.current = route.data ? Date.now() : null;
|
|
34853
35508
|
setQuoteAge(0);
|
|
34854
35509
|
}, [route.data]);
|
|
34855
|
-
const msgTimeoutRef = (0,
|
|
34856
|
-
(0,
|
|
35510
|
+
const msgTimeoutRef = (0, import_react50.useRef)(null);
|
|
35511
|
+
(0, import_react50.useEffect)(() => {
|
|
34857
35512
|
if (!route.loading) {
|
|
34858
35513
|
setQuoteLoadingMsgIdx(0);
|
|
34859
35514
|
setQuoteLoadingMsgVisible(true);
|
|
@@ -34871,7 +35526,7 @@ function SwapMode({
|
|
|
34871
35526
|
if (msgTimeoutRef.current !== null) clearTimeout(msgTimeoutRef.current);
|
|
34872
35527
|
};
|
|
34873
35528
|
}, [route.loading]);
|
|
34874
|
-
(0,
|
|
35529
|
+
(0, import_react50.useEffect)(() => {
|
|
34875
35530
|
if (!route.data) return;
|
|
34876
35531
|
const id = setInterval(() => {
|
|
34877
35532
|
const ts = quoteTimestampRef.current;
|
|
@@ -34885,7 +35540,7 @@ function SwapMode({
|
|
|
34885
35540
|
}, 1e3);
|
|
34886
35541
|
return () => clearInterval(id);
|
|
34887
35542
|
}, [route.data]);
|
|
34888
|
-
(0,
|
|
35543
|
+
(0, import_react50.useEffect)(() => {
|
|
34889
35544
|
if (stage !== "review") return;
|
|
34890
35545
|
if (!route.data || !walletAddress) return;
|
|
34891
35546
|
const fromTokenAddress = fromToken?.address;
|
|
@@ -34896,7 +35551,7 @@ function SwapMode({
|
|
|
34896
35551
|
routeResult: route.data
|
|
34897
35552
|
});
|
|
34898
35553
|
}, [stage, route.data, walletAddress, fromToken]);
|
|
34899
|
-
(0,
|
|
35554
|
+
(0, import_react50.useEffect)(() => {
|
|
34900
35555
|
if (!showSettings) {
|
|
34901
35556
|
setShowCurrencyDropdown(false);
|
|
34902
35557
|
return;
|
|
@@ -34909,7 +35564,7 @@ function SwapMode({
|
|
|
34909
35564
|
document.addEventListener("mousedown", handler);
|
|
34910
35565
|
return () => document.removeEventListener("mousedown", handler);
|
|
34911
35566
|
}, [showSettings]);
|
|
34912
|
-
(0,
|
|
35567
|
+
(0, import_react50.useEffect)(() => {
|
|
34913
35568
|
if (!showCurrencyDropdown) return;
|
|
34914
35569
|
const handler = (e2) => {
|
|
34915
35570
|
if (currencyDropdownRef.current && !currencyDropdownRef.current.contains(e2.target)) {
|
|
@@ -34920,7 +35575,7 @@ function SwapMode({
|
|
|
34920
35575
|
return () => document.removeEventListener("mousedown", handler);
|
|
34921
35576
|
}, [showCurrencyDropdown]);
|
|
34922
35577
|
if (stage === "select-from") {
|
|
34923
|
-
return /* @__PURE__ */ (0,
|
|
35578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
34924
35579
|
SwapTokenSelect,
|
|
34925
35580
|
{
|
|
34926
35581
|
side: "from",
|
|
@@ -34938,7 +35593,7 @@ function SwapMode({
|
|
|
34938
35593
|
) });
|
|
34939
35594
|
}
|
|
34940
35595
|
if (stage === "select-to" && !lockDestToken) {
|
|
34941
|
-
return /* @__PURE__ */ (0,
|
|
35596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
34942
35597
|
SwapTokenSelect,
|
|
34943
35598
|
{
|
|
34944
35599
|
side: "to",
|
|
@@ -34957,9 +35612,9 @@ function SwapMode({
|
|
|
34957
35612
|
) });
|
|
34958
35613
|
}
|
|
34959
35614
|
if (stage === "connect-wallet") {
|
|
34960
|
-
return /* @__PURE__ */ (0,
|
|
34961
|
-
/* @__PURE__ */ (0,
|
|
34962
|
-
|
|
35615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(WidgetContainer, { theme: resolvedTheme, style, children: [
|
|
35616
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35617
|
+
SwapWalletSelector_default,
|
|
34963
35618
|
{
|
|
34964
35619
|
walletStatus,
|
|
34965
35620
|
walletAddress,
|
|
@@ -34967,7 +35622,7 @@ function SwapMode({
|
|
|
34967
35622
|
onBack: handleWalletConnected
|
|
34968
35623
|
}
|
|
34969
35624
|
),
|
|
34970
|
-
isConnected && /* @__PURE__ */ (0,
|
|
35625
|
+
isConnected && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[4]} ${spacing[4]}` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
34971
35626
|
"button",
|
|
34972
35627
|
{
|
|
34973
35628
|
onClick: () => setStage("home"),
|
|
@@ -35000,8 +35655,8 @@ function SwapMode({
|
|
|
35000
35655
|
const offset = circ - progress / 100 * circ;
|
|
35001
35656
|
const isApproving = txStatus === "approving";
|
|
35002
35657
|
const title = isApproving ? "Approving..." : "Order Submitted";
|
|
35003
|
-
return /* @__PURE__ */ (0,
|
|
35004
|
-
/* @__PURE__ */ (0,
|
|
35658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}` }, children: [
|
|
35659
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35005
35660
|
"div",
|
|
35006
35661
|
{
|
|
35007
35662
|
style: {
|
|
@@ -35011,7 +35666,7 @@ function SwapMode({
|
|
|
35011
35666
|
marginBottom: spacing[5]
|
|
35012
35667
|
},
|
|
35013
35668
|
children: [
|
|
35014
|
-
/* @__PURE__ */ (0,
|
|
35669
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35015
35670
|
"button",
|
|
35016
35671
|
{
|
|
35017
35672
|
onClick: handleReset,
|
|
@@ -35026,7 +35681,7 @@ function SwapMode({
|
|
|
35026
35681
|
border: 0,
|
|
35027
35682
|
cursor: "pointer"
|
|
35028
35683
|
},
|
|
35029
|
-
children: /* @__PURE__ */ (0,
|
|
35684
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35030
35685
|
"svg",
|
|
35031
35686
|
{
|
|
35032
35687
|
style: {
|
|
@@ -35040,12 +35695,12 @@ function SwapMode({
|
|
|
35040
35695
|
strokeWidth: 2,
|
|
35041
35696
|
strokeLinecap: "round",
|
|
35042
35697
|
strokeLinejoin: "round",
|
|
35043
|
-
children: /* @__PURE__ */ (0,
|
|
35698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M19 12H5m7-7-7 7 7 7" })
|
|
35044
35699
|
}
|
|
35045
35700
|
)
|
|
35046
35701
|
}
|
|
35047
35702
|
),
|
|
35048
|
-
/* @__PURE__ */ (0,
|
|
35703
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35049
35704
|
"button",
|
|
35050
35705
|
{
|
|
35051
35706
|
onClick: handleReset,
|
|
@@ -35062,7 +35717,7 @@ function SwapMode({
|
|
|
35062
35717
|
]
|
|
35063
35718
|
}
|
|
35064
35719
|
),
|
|
35065
|
-
/* @__PURE__ */ (0,
|
|
35720
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35066
35721
|
"h1",
|
|
35067
35722
|
{
|
|
35068
35723
|
style: {
|
|
@@ -35074,7 +35729,7 @@ function SwapMode({
|
|
|
35074
35729
|
children: title
|
|
35075
35730
|
}
|
|
35076
35731
|
),
|
|
35077
|
-
/* @__PURE__ */ (0,
|
|
35732
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35078
35733
|
"div",
|
|
35079
35734
|
{
|
|
35080
35735
|
style: {
|
|
@@ -35088,7 +35743,7 @@ function SwapMode({
|
|
|
35088
35743
|
gap: spacing[5]
|
|
35089
35744
|
},
|
|
35090
35745
|
children: [
|
|
35091
|
-
/* @__PURE__ */ (0,
|
|
35746
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35092
35747
|
"div",
|
|
35093
35748
|
{
|
|
35094
35749
|
style: {
|
|
@@ -35100,14 +35755,14 @@ function SwapMode({
|
|
|
35100
35755
|
justifyContent: "center"
|
|
35101
35756
|
},
|
|
35102
35757
|
children: [
|
|
35103
|
-
/* @__PURE__ */ (0,
|
|
35758
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35104
35759
|
"svg",
|
|
35105
35760
|
{
|
|
35106
35761
|
width: ringSize,
|
|
35107
35762
|
height: ringSize,
|
|
35108
35763
|
style: { position: "absolute", inset: 0 },
|
|
35109
35764
|
children: [
|
|
35110
|
-
/* @__PURE__ */ (0,
|
|
35765
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35111
35766
|
"circle",
|
|
35112
35767
|
{
|
|
35113
35768
|
cx: ringSize / 2,
|
|
@@ -35118,7 +35773,7 @@ function SwapMode({
|
|
|
35118
35773
|
strokeWidth: ringStroke
|
|
35119
35774
|
}
|
|
35120
35775
|
),
|
|
35121
|
-
/* @__PURE__ */ (0,
|
|
35776
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35122
35777
|
"circle",
|
|
35123
35778
|
{
|
|
35124
35779
|
cx: ringSize / 2,
|
|
@@ -35137,7 +35792,7 @@ function SwapMode({
|
|
|
35137
35792
|
]
|
|
35138
35793
|
}
|
|
35139
35794
|
),
|
|
35140
|
-
/* @__PURE__ */ (0,
|
|
35795
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35141
35796
|
"div",
|
|
35142
35797
|
{
|
|
35143
35798
|
style: {
|
|
@@ -35148,7 +35803,7 @@ function SwapMode({
|
|
|
35148
35803
|
textAlign: "center"
|
|
35149
35804
|
},
|
|
35150
35805
|
children: [
|
|
35151
|
-
/* @__PURE__ */ (0,
|
|
35806
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35152
35807
|
"span",
|
|
35153
35808
|
{
|
|
35154
35809
|
style: {
|
|
@@ -35161,7 +35816,7 @@ function SwapMode({
|
|
|
35161
35816
|
children: isApproving ? "Approving" : "Swapping"
|
|
35162
35817
|
}
|
|
35163
35818
|
),
|
|
35164
|
-
/* @__PURE__ */ (0,
|
|
35819
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35165
35820
|
"div",
|
|
35166
35821
|
{
|
|
35167
35822
|
style: {
|
|
@@ -35171,7 +35826,7 @@ function SwapMode({
|
|
|
35171
35826
|
gap: spacing[1.5]
|
|
35172
35827
|
},
|
|
35173
35828
|
children: [
|
|
35174
|
-
fromToken?.iconUrl ? /* @__PURE__ */ (0,
|
|
35829
|
+
fromToken?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35175
35830
|
"img",
|
|
35176
35831
|
{
|
|
35177
35832
|
src: fromToken.iconUrl,
|
|
@@ -35182,7 +35837,7 @@ function SwapMode({
|
|
|
35182
35837
|
},
|
|
35183
35838
|
alt: ""
|
|
35184
35839
|
}
|
|
35185
|
-
) : /* @__PURE__ */ (0,
|
|
35840
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35186
35841
|
"div",
|
|
35187
35842
|
{
|
|
35188
35843
|
style: {
|
|
@@ -35193,7 +35848,7 @@ function SwapMode({
|
|
|
35193
35848
|
}
|
|
35194
35849
|
}
|
|
35195
35850
|
),
|
|
35196
|
-
/* @__PURE__ */ (0,
|
|
35851
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35197
35852
|
"svg",
|
|
35198
35853
|
{
|
|
35199
35854
|
style: {
|
|
@@ -35207,10 +35862,10 @@ function SwapMode({
|
|
|
35207
35862
|
strokeWidth: 2,
|
|
35208
35863
|
strokeLinecap: "round",
|
|
35209
35864
|
strokeLinejoin: "round",
|
|
35210
|
-
children: /* @__PURE__ */ (0,
|
|
35865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M5 12h14m-7-7 7 7-7 7" })
|
|
35211
35866
|
}
|
|
35212
35867
|
),
|
|
35213
|
-
toToken?.iconUrl ? /* @__PURE__ */ (0,
|
|
35868
|
+
toToken?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35214
35869
|
"img",
|
|
35215
35870
|
{
|
|
35216
35871
|
src: toToken.iconUrl,
|
|
@@ -35221,7 +35876,7 @@ function SwapMode({
|
|
|
35221
35876
|
},
|
|
35222
35877
|
alt: ""
|
|
35223
35878
|
}
|
|
35224
|
-
) : /* @__PURE__ */ (0,
|
|
35879
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35225
35880
|
"div",
|
|
35226
35881
|
{
|
|
35227
35882
|
style: {
|
|
@@ -35235,7 +35890,7 @@ function SwapMode({
|
|
|
35235
35890
|
]
|
|
35236
35891
|
}
|
|
35237
35892
|
),
|
|
35238
|
-
/* @__PURE__ */ (0,
|
|
35893
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35239
35894
|
"span",
|
|
35240
35895
|
{
|
|
35241
35896
|
style: {
|
|
@@ -35247,7 +35902,7 @@ function SwapMode({
|
|
|
35247
35902
|
children: [
|
|
35248
35903
|
fromToken?.symbol,
|
|
35249
35904
|
" ",
|
|
35250
|
-
/* @__PURE__ */ (0,
|
|
35905
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35251
35906
|
"span",
|
|
35252
35907
|
{
|
|
35253
35908
|
style: {
|
|
@@ -35262,7 +35917,7 @@ function SwapMode({
|
|
|
35262
35917
|
]
|
|
35263
35918
|
}
|
|
35264
35919
|
),
|
|
35265
|
-
/* @__PURE__ */ (0,
|
|
35920
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35266
35921
|
"span",
|
|
35267
35922
|
{
|
|
35268
35923
|
style: {
|
|
@@ -35282,7 +35937,7 @@ function SwapMode({
|
|
|
35282
35937
|
]
|
|
35283
35938
|
}
|
|
35284
35939
|
),
|
|
35285
|
-
/* @__PURE__ */ (0,
|
|
35940
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35286
35941
|
"div",
|
|
35287
35942
|
{
|
|
35288
35943
|
style: {
|
|
@@ -35292,7 +35947,7 @@ function SwapMode({
|
|
|
35292
35947
|
justifyContent: "space-between"
|
|
35293
35948
|
},
|
|
35294
35949
|
children: [
|
|
35295
|
-
/* @__PURE__ */ (0,
|
|
35950
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35296
35951
|
ProcessingStepNode,
|
|
35297
35952
|
{
|
|
35298
35953
|
active: activeStep >= 0,
|
|
@@ -35301,8 +35956,8 @@ function SwapMode({
|
|
|
35301
35956
|
label: `Sending ${fromToken?.symbol ?? ""}`
|
|
35302
35957
|
}
|
|
35303
35958
|
),
|
|
35304
|
-
/* @__PURE__ */ (0,
|
|
35305
|
-
/* @__PURE__ */ (0,
|
|
35959
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ProcessingStepLine, { done: activeStep > 0 }),
|
|
35960
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35306
35961
|
ProcessingStepNode,
|
|
35307
35962
|
{
|
|
35308
35963
|
active: activeStep >= 1,
|
|
@@ -35311,8 +35966,8 @@ function SwapMode({
|
|
|
35311
35966
|
label: "Create Order"
|
|
35312
35967
|
}
|
|
35313
35968
|
),
|
|
35314
|
-
/* @__PURE__ */ (0,
|
|
35315
|
-
/* @__PURE__ */ (0,
|
|
35969
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ProcessingStepLine, { done: activeStep > 1 }),
|
|
35970
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35316
35971
|
ProcessingStepNode,
|
|
35317
35972
|
{
|
|
35318
35973
|
active: activeStep >= 2,
|
|
@@ -35331,7 +35986,7 @@ function SwapMode({
|
|
|
35331
35986
|
fromChainTxUrl
|
|
35332
35987
|
);
|
|
35333
35988
|
const isCopied = copiedHash === txHash;
|
|
35334
|
-
return /* @__PURE__ */ (0,
|
|
35989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35335
35990
|
"div",
|
|
35336
35991
|
{
|
|
35337
35992
|
style: {
|
|
@@ -35340,7 +35995,7 @@ function SwapMode({
|
|
|
35340
35995
|
gap: spacing[3]
|
|
35341
35996
|
},
|
|
35342
35997
|
children: [
|
|
35343
|
-
explorerUrl && /* @__PURE__ */ (0,
|
|
35998
|
+
explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35344
35999
|
"a",
|
|
35345
36000
|
{
|
|
35346
36001
|
href: explorerUrl,
|
|
@@ -35359,7 +36014,7 @@ function SwapMode({
|
|
|
35359
36014
|
},
|
|
35360
36015
|
children: [
|
|
35361
36016
|
"View transaction",
|
|
35362
|
-
/* @__PURE__ */ (0,
|
|
36017
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35363
36018
|
"svg",
|
|
35364
36019
|
{
|
|
35365
36020
|
style: { width: "0.875rem", height: "0.875rem" },
|
|
@@ -35370,16 +36025,16 @@ function SwapMode({
|
|
|
35370
36025
|
strokeLinecap: "round",
|
|
35371
36026
|
strokeLinejoin: "round",
|
|
35372
36027
|
children: [
|
|
35373
|
-
/* @__PURE__ */ (0,
|
|
35374
|
-
/* @__PURE__ */ (0,
|
|
35375
|
-
/* @__PURE__ */ (0,
|
|
36028
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
36029
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36030
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
35376
36031
|
]
|
|
35377
36032
|
}
|
|
35378
36033
|
)
|
|
35379
36034
|
]
|
|
35380
36035
|
}
|
|
35381
36036
|
),
|
|
35382
|
-
/* @__PURE__ */ (0,
|
|
36037
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35383
36038
|
"button",
|
|
35384
36039
|
{
|
|
35385
36040
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -35396,11 +36051,11 @@ function SwapMode({
|
|
|
35396
36051
|
padding: 0,
|
|
35397
36052
|
transition: "color 0.15s"
|
|
35398
36053
|
},
|
|
35399
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36054
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
35400
36055
|
txHash.slice(0, 6),
|
|
35401
36056
|
"\u2026",
|
|
35402
36057
|
txHash.slice(-4),
|
|
35403
|
-
/* @__PURE__ */ (0,
|
|
36058
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35404
36059
|
"svg",
|
|
35405
36060
|
{
|
|
35406
36061
|
style: { width: "0.875rem", height: "0.875rem" },
|
|
@@ -35411,7 +36066,7 @@ function SwapMode({
|
|
|
35411
36066
|
strokeLinecap: "round",
|
|
35412
36067
|
strokeLinejoin: "round",
|
|
35413
36068
|
children: [
|
|
35414
|
-
/* @__PURE__ */ (0,
|
|
36069
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35415
36070
|
"rect",
|
|
35416
36071
|
{
|
|
35417
36072
|
x: "9",
|
|
@@ -35422,7 +36077,7 @@ function SwapMode({
|
|
|
35422
36077
|
ry: "2"
|
|
35423
36078
|
}
|
|
35424
36079
|
),
|
|
35425
|
-
/* @__PURE__ */ (0,
|
|
36080
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
35426
36081
|
]
|
|
35427
36082
|
}
|
|
35428
36083
|
)
|
|
@@ -35450,10 +36105,10 @@ function SwapMode({
|
|
|
35450
36105
|
dateStyle: "medium",
|
|
35451
36106
|
timeStyle: "short"
|
|
35452
36107
|
}) ?? null;
|
|
35453
|
-
return /* @__PURE__ */ (0,
|
|
35454
|
-
/* @__PURE__ */ (0,
|
|
35455
|
-
/* @__PURE__ */ (0,
|
|
35456
|
-
/* @__PURE__ */ (0,
|
|
36108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", overflow: "hidden" }, children: [
|
|
36109
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react50.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ConfettiEffect3, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
|
|
36110
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { padding: `${spacing[6]} ${spacing[6]} 0` }, children: [
|
|
36111
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35457
36112
|
"div",
|
|
35458
36113
|
{
|
|
35459
36114
|
style: {
|
|
@@ -35463,7 +36118,7 @@ function SwapMode({
|
|
|
35463
36118
|
marginBottom: spacing[5]
|
|
35464
36119
|
},
|
|
35465
36120
|
children: [
|
|
35466
|
-
/* @__PURE__ */ (0,
|
|
36121
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35467
36122
|
"div",
|
|
35468
36123
|
{
|
|
35469
36124
|
style: {
|
|
@@ -35476,7 +36131,7 @@ function SwapMode({
|
|
|
35476
36131
|
justifyContent: "center",
|
|
35477
36132
|
flexShrink: 0
|
|
35478
36133
|
},
|
|
35479
|
-
children: /* @__PURE__ */ (0,
|
|
36134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35480
36135
|
"svg",
|
|
35481
36136
|
{
|
|
35482
36137
|
style: {
|
|
@@ -35490,12 +36145,12 @@ function SwapMode({
|
|
|
35490
36145
|
strokeWidth: 3,
|
|
35491
36146
|
strokeLinecap: "round",
|
|
35492
36147
|
strokeLinejoin: "round",
|
|
35493
|
-
children: /* @__PURE__ */ (0,
|
|
36148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M20 6L9 17l-5-5" })
|
|
35494
36149
|
}
|
|
35495
36150
|
)
|
|
35496
36151
|
}
|
|
35497
36152
|
),
|
|
35498
|
-
/* @__PURE__ */ (0,
|
|
36153
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35499
36154
|
"h2",
|
|
35500
36155
|
{
|
|
35501
36156
|
style: {
|
|
@@ -35509,7 +36164,7 @@ function SwapMode({
|
|
|
35509
36164
|
]
|
|
35510
36165
|
}
|
|
35511
36166
|
),
|
|
35512
|
-
/* @__PURE__ */ (0,
|
|
36167
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35513
36168
|
"div",
|
|
35514
36169
|
{
|
|
35515
36170
|
style: {
|
|
@@ -35519,7 +36174,7 @@ function SwapMode({
|
|
|
35519
36174
|
padding: spacing[5]
|
|
35520
36175
|
},
|
|
35521
36176
|
children: [
|
|
35522
|
-
/* @__PURE__ */ (0,
|
|
36177
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35523
36178
|
"div",
|
|
35524
36179
|
{
|
|
35525
36180
|
style: {
|
|
@@ -35529,7 +36184,7 @@ function SwapMode({
|
|
|
35529
36184
|
fontSize: fontSize.sm
|
|
35530
36185
|
},
|
|
35531
36186
|
children: [
|
|
35532
|
-
/* @__PURE__ */ (0,
|
|
36187
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35533
36188
|
"div",
|
|
35534
36189
|
{
|
|
35535
36190
|
style: {
|
|
@@ -35538,8 +36193,8 @@ function SwapMode({
|
|
|
35538
36193
|
gap: spacing[2]
|
|
35539
36194
|
},
|
|
35540
36195
|
children: [
|
|
35541
|
-
fromToken?.iconUrl && /* @__PURE__ */ (0,
|
|
35542
|
-
/* @__PURE__ */ (0,
|
|
36196
|
+
fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
36197
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35543
36198
|
"img",
|
|
35544
36199
|
{
|
|
35545
36200
|
src: fromToken.iconUrl,
|
|
@@ -35551,7 +36206,7 @@ function SwapMode({
|
|
|
35551
36206
|
}
|
|
35552
36207
|
}
|
|
35553
36208
|
),
|
|
35554
|
-
fromChain?.chainIconURI && /* @__PURE__ */ (0,
|
|
36209
|
+
fromChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35555
36210
|
"img",
|
|
35556
36211
|
{
|
|
35557
36212
|
src: fromChain.chainIconURI,
|
|
@@ -35569,11 +36224,11 @@ function SwapMode({
|
|
|
35569
36224
|
}
|
|
35570
36225
|
)
|
|
35571
36226
|
] }),
|
|
35572
|
-
/* @__PURE__ */ (0,
|
|
36227
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "You sold" })
|
|
35573
36228
|
]
|
|
35574
36229
|
}
|
|
35575
36230
|
),
|
|
35576
|
-
/* @__PURE__ */ (0,
|
|
36231
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35577
36232
|
"span",
|
|
35578
36233
|
{
|
|
35579
36234
|
style: {
|
|
@@ -35590,7 +36245,7 @@ function SwapMode({
|
|
|
35590
36245
|
]
|
|
35591
36246
|
}
|
|
35592
36247
|
),
|
|
35593
|
-
/* @__PURE__ */ (0,
|
|
36248
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35594
36249
|
"div",
|
|
35595
36250
|
{
|
|
35596
36251
|
style: {
|
|
@@ -35601,7 +36256,7 @@ function SwapMode({
|
|
|
35601
36256
|
marginTop: spacing[3]
|
|
35602
36257
|
},
|
|
35603
36258
|
children: [
|
|
35604
|
-
/* @__PURE__ */ (0,
|
|
36259
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35605
36260
|
"div",
|
|
35606
36261
|
{
|
|
35607
36262
|
style: {
|
|
@@ -35610,8 +36265,8 @@ function SwapMode({
|
|
|
35610
36265
|
gap: spacing[2]
|
|
35611
36266
|
},
|
|
35612
36267
|
children: [
|
|
35613
|
-
toToken?.iconUrl && /* @__PURE__ */ (0,
|
|
35614
|
-
/* @__PURE__ */ (0,
|
|
36268
|
+
toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
36269
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35615
36270
|
"img",
|
|
35616
36271
|
{
|
|
35617
36272
|
src: toToken.iconUrl,
|
|
@@ -35623,7 +36278,7 @@ function SwapMode({
|
|
|
35623
36278
|
}
|
|
35624
36279
|
}
|
|
35625
36280
|
),
|
|
35626
|
-
toChain?.chainIconURI && /* @__PURE__ */ (0,
|
|
36281
|
+
toChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35627
36282
|
"img",
|
|
35628
36283
|
{
|
|
35629
36284
|
src: toChain.chainIconURI,
|
|
@@ -35641,11 +36296,11 @@ function SwapMode({
|
|
|
35641
36296
|
}
|
|
35642
36297
|
)
|
|
35643
36298
|
] }),
|
|
35644
|
-
/* @__PURE__ */ (0,
|
|
36299
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Received" })
|
|
35645
36300
|
]
|
|
35646
36301
|
}
|
|
35647
36302
|
),
|
|
35648
|
-
/* @__PURE__ */ (0,
|
|
36303
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35649
36304
|
"span",
|
|
35650
36305
|
{
|
|
35651
36306
|
style: {
|
|
@@ -35662,7 +36317,7 @@ function SwapMode({
|
|
|
35662
36317
|
]
|
|
35663
36318
|
}
|
|
35664
36319
|
),
|
|
35665
|
-
/* @__PURE__ */ (0,
|
|
36320
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35666
36321
|
"div",
|
|
35667
36322
|
{
|
|
35668
36323
|
style: {
|
|
@@ -35672,7 +36327,7 @@ function SwapMode({
|
|
|
35672
36327
|
}
|
|
35673
36328
|
}
|
|
35674
36329
|
),
|
|
35675
|
-
/* @__PURE__ */ (0,
|
|
36330
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35676
36331
|
"div",
|
|
35677
36332
|
{
|
|
35678
36333
|
style: {
|
|
@@ -35682,28 +36337,28 @@ function SwapMode({
|
|
|
35682
36337
|
fontSize: fontSize.sm
|
|
35683
36338
|
},
|
|
35684
36339
|
children: [
|
|
35685
|
-
fromUsd > 0 && /* @__PURE__ */ (0,
|
|
36340
|
+
fromUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35686
36341
|
SuccessReceiptRow,
|
|
35687
36342
|
{
|
|
35688
36343
|
label: "Value sold",
|
|
35689
36344
|
value: fmtLocal(fromUsd)
|
|
35690
36345
|
}
|
|
35691
36346
|
),
|
|
35692
|
-
toUsd > 0 && /* @__PURE__ */ (0,
|
|
36347
|
+
toUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35693
36348
|
SuccessReceiptRow,
|
|
35694
36349
|
{
|
|
35695
36350
|
label: "Value received",
|
|
35696
36351
|
value: fmtLocal(toUsd)
|
|
35697
36352
|
}
|
|
35698
36353
|
),
|
|
35699
|
-
effectiveRate && /* @__PURE__ */ (0,
|
|
36354
|
+
effectiveRate && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35700
36355
|
SuccessReceiptRow,
|
|
35701
36356
|
{
|
|
35702
36357
|
label: "Effective rate",
|
|
35703
36358
|
value: effectiveRate
|
|
35704
36359
|
}
|
|
35705
36360
|
),
|
|
35706
|
-
completedStr && /* @__PURE__ */ (0,
|
|
36361
|
+
completedStr && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SuccessReceiptRow, { label: "Completed", value: completedStr }),
|
|
35707
36362
|
txHash && (() => {
|
|
35708
36363
|
const srcUrl = buildExplorerUrl(
|
|
35709
36364
|
txHash,
|
|
@@ -35711,7 +36366,7 @@ function SwapMode({
|
|
|
35711
36366
|
fromChainTxUrl
|
|
35712
36367
|
);
|
|
35713
36368
|
const isCopied = copiedHash === txHash;
|
|
35714
|
-
return /* @__PURE__ */ (0,
|
|
36369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35715
36370
|
"div",
|
|
35716
36371
|
{
|
|
35717
36372
|
style: {
|
|
@@ -35720,8 +36375,8 @@ function SwapMode({
|
|
|
35720
36375
|
justifyContent: "space-between"
|
|
35721
36376
|
},
|
|
35722
36377
|
children: [
|
|
35723
|
-
/* @__PURE__ */ (0,
|
|
35724
|
-
/* @__PURE__ */ (0,
|
|
36378
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: destTxHash ? "Source tx" : "Transaction" }),
|
|
36379
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35725
36380
|
"div",
|
|
35726
36381
|
{
|
|
35727
36382
|
style: {
|
|
@@ -35730,7 +36385,7 @@ function SwapMode({
|
|
|
35730
36385
|
gap: spacing[2]
|
|
35731
36386
|
},
|
|
35732
36387
|
children: [
|
|
35733
|
-
srcUrl && /* @__PURE__ */ (0,
|
|
36388
|
+
srcUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35734
36389
|
"a",
|
|
35735
36390
|
{
|
|
35736
36391
|
href: srcUrl,
|
|
@@ -35750,7 +36405,7 @@ function SwapMode({
|
|
|
35750
36405
|
txHash.slice(0, 6),
|
|
35751
36406
|
"\u2026",
|
|
35752
36407
|
txHash.slice(-4),
|
|
35753
|
-
/* @__PURE__ */ (0,
|
|
36408
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35754
36409
|
"svg",
|
|
35755
36410
|
{
|
|
35756
36411
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -35761,16 +36416,16 @@ function SwapMode({
|
|
|
35761
36416
|
strokeLinecap: "round",
|
|
35762
36417
|
strokeLinejoin: "round",
|
|
35763
36418
|
children: [
|
|
35764
|
-
/* @__PURE__ */ (0,
|
|
35765
|
-
/* @__PURE__ */ (0,
|
|
35766
|
-
/* @__PURE__ */ (0,
|
|
36419
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
36420
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36421
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
35767
36422
|
]
|
|
35768
36423
|
}
|
|
35769
36424
|
)
|
|
35770
36425
|
]
|
|
35771
36426
|
}
|
|
35772
36427
|
),
|
|
35773
|
-
/* @__PURE__ */ (0,
|
|
36428
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35774
36429
|
"button",
|
|
35775
36430
|
{
|
|
35776
36431
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -35788,7 +36443,7 @@ function SwapMode({
|
|
|
35788
36443
|
padding: 0,
|
|
35789
36444
|
transition: "color 0.15s"
|
|
35790
36445
|
},
|
|
35791
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36446
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35792
36447
|
"svg",
|
|
35793
36448
|
{
|
|
35794
36449
|
style: {
|
|
@@ -35802,7 +36457,7 @@ function SwapMode({
|
|
|
35802
36457
|
strokeLinecap: "round",
|
|
35803
36458
|
strokeLinejoin: "round",
|
|
35804
36459
|
children: [
|
|
35805
|
-
/* @__PURE__ */ (0,
|
|
36460
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35806
36461
|
"rect",
|
|
35807
36462
|
{
|
|
35808
36463
|
x: "9",
|
|
@@ -35813,7 +36468,7 @@ function SwapMode({
|
|
|
35813
36468
|
ry: "2"
|
|
35814
36469
|
}
|
|
35815
36470
|
),
|
|
35816
|
-
/* @__PURE__ */ (0,
|
|
36471
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
35817
36472
|
]
|
|
35818
36473
|
}
|
|
35819
36474
|
)
|
|
@@ -35833,7 +36488,7 @@ function SwapMode({
|
|
|
35833
36488
|
toChainTxUrl
|
|
35834
36489
|
);
|
|
35835
36490
|
const isCopied = copiedHash === destTxHash;
|
|
35836
|
-
return /* @__PURE__ */ (0,
|
|
36491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35837
36492
|
"div",
|
|
35838
36493
|
{
|
|
35839
36494
|
style: {
|
|
@@ -35842,8 +36497,8 @@ function SwapMode({
|
|
|
35842
36497
|
justifyContent: "space-between"
|
|
35843
36498
|
},
|
|
35844
36499
|
children: [
|
|
35845
|
-
/* @__PURE__ */ (0,
|
|
35846
|
-
/* @__PURE__ */ (0,
|
|
36500
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Destination tx" }),
|
|
36501
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35847
36502
|
"div",
|
|
35848
36503
|
{
|
|
35849
36504
|
style: {
|
|
@@ -35852,7 +36507,7 @@ function SwapMode({
|
|
|
35852
36507
|
gap: spacing[2]
|
|
35853
36508
|
},
|
|
35854
36509
|
children: [
|
|
35855
|
-
destUrl && /* @__PURE__ */ (0,
|
|
36510
|
+
destUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35856
36511
|
"a",
|
|
35857
36512
|
{
|
|
35858
36513
|
href: destUrl,
|
|
@@ -35872,7 +36527,7 @@ function SwapMode({
|
|
|
35872
36527
|
destTxHash.slice(0, 6),
|
|
35873
36528
|
"\u2026",
|
|
35874
36529
|
destTxHash.slice(-4),
|
|
35875
|
-
/* @__PURE__ */ (0,
|
|
36530
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35876
36531
|
"svg",
|
|
35877
36532
|
{
|
|
35878
36533
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -35883,16 +36538,16 @@ function SwapMode({
|
|
|
35883
36538
|
strokeLinecap: "round",
|
|
35884
36539
|
strokeLinejoin: "round",
|
|
35885
36540
|
children: [
|
|
35886
|
-
/* @__PURE__ */ (0,
|
|
35887
|
-
/* @__PURE__ */ (0,
|
|
35888
|
-
/* @__PURE__ */ (0,
|
|
36541
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
36542
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36543
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
35889
36544
|
]
|
|
35890
36545
|
}
|
|
35891
36546
|
)
|
|
35892
36547
|
]
|
|
35893
36548
|
}
|
|
35894
36549
|
),
|
|
35895
|
-
/* @__PURE__ */ (0,
|
|
36550
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35896
36551
|
"button",
|
|
35897
36552
|
{
|
|
35898
36553
|
onClick: () => handleCopyHash(destTxHash),
|
|
@@ -35909,7 +36564,7 @@ function SwapMode({
|
|
|
35909
36564
|
padding: 0,
|
|
35910
36565
|
transition: "color 0.15s"
|
|
35911
36566
|
},
|
|
35912
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36567
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35913
36568
|
"svg",
|
|
35914
36569
|
{
|
|
35915
36570
|
style: {
|
|
@@ -35923,7 +36578,7 @@ function SwapMode({
|
|
|
35923
36578
|
strokeLinecap: "round",
|
|
35924
36579
|
strokeLinejoin: "round",
|
|
35925
36580
|
children: [
|
|
35926
|
-
/* @__PURE__ */ (0,
|
|
36581
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35927
36582
|
"rect",
|
|
35928
36583
|
{
|
|
35929
36584
|
x: "9",
|
|
@@ -35934,7 +36589,7 @@ function SwapMode({
|
|
|
35934
36589
|
ry: "2"
|
|
35935
36590
|
}
|
|
35936
36591
|
),
|
|
35937
|
-
/* @__PURE__ */ (0,
|
|
36592
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
35938
36593
|
]
|
|
35939
36594
|
}
|
|
35940
36595
|
)
|
|
@@ -35954,7 +36609,7 @@ function SwapMode({
|
|
|
35954
36609
|
}
|
|
35955
36610
|
)
|
|
35956
36611
|
] }),
|
|
35957
|
-
/* @__PURE__ */ (0,
|
|
36612
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35958
36613
|
"div",
|
|
35959
36614
|
{
|
|
35960
36615
|
style: {
|
|
@@ -35964,7 +36619,7 @@ function SwapMode({
|
|
|
35964
36619
|
gap: spacing[2]
|
|
35965
36620
|
},
|
|
35966
36621
|
children: [
|
|
35967
|
-
/* @__PURE__ */ (0,
|
|
36622
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35968
36623
|
"button",
|
|
35969
36624
|
{
|
|
35970
36625
|
onClick: handleReset,
|
|
@@ -35982,7 +36637,7 @@ function SwapMode({
|
|
|
35982
36637
|
children: "Done"
|
|
35983
36638
|
}
|
|
35984
36639
|
),
|
|
35985
|
-
fromToken && toToken && /* @__PURE__ */ (0,
|
|
36640
|
+
fromToken && toToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35986
36641
|
"button",
|
|
35987
36642
|
{
|
|
35988
36643
|
onClick: handleSwapBack,
|
|
@@ -36011,7 +36666,7 @@ function SwapMode({
|
|
|
36011
36666
|
] }) });
|
|
36012
36667
|
}
|
|
36013
36668
|
if (stage === "error") {
|
|
36014
|
-
return /* @__PURE__ */ (0,
|
|
36669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36015
36670
|
ErrorPage,
|
|
36016
36671
|
{
|
|
36017
36672
|
error: mapError(execution.errorMessage),
|
|
@@ -36023,7 +36678,7 @@ function SwapMode({
|
|
|
36023
36678
|
if (stage === "review") {
|
|
36024
36679
|
const reviewToAmount = toAmount ?? displayToAmount;
|
|
36025
36680
|
const reviewToUsd = toUsd > 0 ? toUsd : displayToUsd;
|
|
36026
|
-
return /* @__PURE__ */ (0,
|
|
36681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36027
36682
|
"div",
|
|
36028
36683
|
{
|
|
36029
36684
|
style: {
|
|
@@ -36032,7 +36687,7 @@ function SwapMode({
|
|
|
36032
36687
|
overflowY: "auto"
|
|
36033
36688
|
},
|
|
36034
36689
|
children: [
|
|
36035
|
-
/* @__PURE__ */ (0,
|
|
36690
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36036
36691
|
"div",
|
|
36037
36692
|
{
|
|
36038
36693
|
style: {
|
|
@@ -36042,7 +36697,7 @@ function SwapMode({
|
|
|
36042
36697
|
marginBottom: spacing[5]
|
|
36043
36698
|
},
|
|
36044
36699
|
children: [
|
|
36045
|
-
/* @__PURE__ */ (0,
|
|
36700
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36046
36701
|
"span",
|
|
36047
36702
|
{
|
|
36048
36703
|
style: {
|
|
@@ -36053,7 +36708,7 @@ function SwapMode({
|
|
|
36053
36708
|
children: "You're swapping"
|
|
36054
36709
|
}
|
|
36055
36710
|
),
|
|
36056
|
-
/* @__PURE__ */ (0,
|
|
36711
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36057
36712
|
"button",
|
|
36058
36713
|
{
|
|
36059
36714
|
onClick: () => setStage("home"),
|
|
@@ -36068,7 +36723,7 @@ function SwapMode({
|
|
|
36068
36723
|
border: 0,
|
|
36069
36724
|
cursor: "pointer"
|
|
36070
36725
|
},
|
|
36071
|
-
children: /* @__PURE__ */ (0,
|
|
36726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36072
36727
|
"svg",
|
|
36073
36728
|
{
|
|
36074
36729
|
style: {
|
|
@@ -36082,7 +36737,7 @@ function SwapMode({
|
|
|
36082
36737
|
strokeWidth: 2,
|
|
36083
36738
|
strokeLinecap: "round",
|
|
36084
36739
|
strokeLinejoin: "round",
|
|
36085
|
-
children: /* @__PURE__ */ (0,
|
|
36740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
36086
36741
|
}
|
|
36087
36742
|
)
|
|
36088
36743
|
}
|
|
@@ -36090,7 +36745,7 @@ function SwapMode({
|
|
|
36090
36745
|
]
|
|
36091
36746
|
}
|
|
36092
36747
|
),
|
|
36093
|
-
/* @__PURE__ */ (0,
|
|
36748
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36094
36749
|
"div",
|
|
36095
36750
|
{
|
|
36096
36751
|
style: {
|
|
@@ -36099,8 +36754,8 @@ function SwapMode({
|
|
|
36099
36754
|
justifyContent: "space-between"
|
|
36100
36755
|
},
|
|
36101
36756
|
children: [
|
|
36102
|
-
/* @__PURE__ */ (0,
|
|
36103
|
-
/* @__PURE__ */ (0,
|
|
36757
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
36758
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36104
36759
|
"p",
|
|
36105
36760
|
{
|
|
36106
36761
|
style: {
|
|
@@ -36116,7 +36771,7 @@ function SwapMode({
|
|
|
36116
36771
|
]
|
|
36117
36772
|
}
|
|
36118
36773
|
),
|
|
36119
|
-
/* @__PURE__ */ (0,
|
|
36774
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36120
36775
|
"p",
|
|
36121
36776
|
{
|
|
36122
36777
|
style: {
|
|
@@ -36128,7 +36783,7 @@ function SwapMode({
|
|
|
36128
36783
|
}
|
|
36129
36784
|
)
|
|
36130
36785
|
] }),
|
|
36131
|
-
fromToken?.iconUrl && /* @__PURE__ */ (0,
|
|
36786
|
+
fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36132
36787
|
TokenIcon,
|
|
36133
36788
|
{
|
|
36134
36789
|
icon: fromToken.iconUrl,
|
|
@@ -36139,7 +36794,7 @@ function SwapMode({
|
|
|
36139
36794
|
]
|
|
36140
36795
|
}
|
|
36141
36796
|
),
|
|
36142
|
-
/* @__PURE__ */ (0,
|
|
36797
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36143
36798
|
"div",
|
|
36144
36799
|
{
|
|
36145
36800
|
style: {
|
|
@@ -36147,7 +36802,7 @@ function SwapMode({
|
|
|
36147
36802
|
justifyContent: "center",
|
|
36148
36803
|
margin: `${spacing[3]} 0`
|
|
36149
36804
|
},
|
|
36150
|
-
children: /* @__PURE__ */ (0,
|
|
36805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36151
36806
|
"svg",
|
|
36152
36807
|
{
|
|
36153
36808
|
style: {
|
|
@@ -36161,12 +36816,12 @@ function SwapMode({
|
|
|
36161
36816
|
strokeWidth: 2,
|
|
36162
36817
|
strokeLinecap: "round",
|
|
36163
36818
|
strokeLinejoin: "round",
|
|
36164
|
-
children: /* @__PURE__ */ (0,
|
|
36819
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 5v14m-7-7l7 7 7-7" })
|
|
36165
36820
|
}
|
|
36166
36821
|
)
|
|
36167
36822
|
}
|
|
36168
36823
|
),
|
|
36169
|
-
/* @__PURE__ */ (0,
|
|
36824
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36170
36825
|
"div",
|
|
36171
36826
|
{
|
|
36172
36827
|
style: {
|
|
@@ -36175,8 +36830,8 @@ function SwapMode({
|
|
|
36175
36830
|
justifyContent: "space-between"
|
|
36176
36831
|
},
|
|
36177
36832
|
children: [
|
|
36178
|
-
/* @__PURE__ */ (0,
|
|
36179
|
-
/* @__PURE__ */ (0,
|
|
36833
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
36834
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36180
36835
|
"p",
|
|
36181
36836
|
{
|
|
36182
36837
|
style: {
|
|
@@ -36192,7 +36847,7 @@ function SwapMode({
|
|
|
36192
36847
|
]
|
|
36193
36848
|
}
|
|
36194
36849
|
),
|
|
36195
|
-
/* @__PURE__ */ (0,
|
|
36850
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36196
36851
|
"p",
|
|
36197
36852
|
{
|
|
36198
36853
|
style: {
|
|
@@ -36204,7 +36859,7 @@ function SwapMode({
|
|
|
36204
36859
|
}
|
|
36205
36860
|
)
|
|
36206
36861
|
] }),
|
|
36207
|
-
toToken?.iconUrl && /* @__PURE__ */ (0,
|
|
36862
|
+
toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36208
36863
|
TokenIcon,
|
|
36209
36864
|
{
|
|
36210
36865
|
icon: toToken.iconUrl,
|
|
@@ -36215,7 +36870,7 @@ function SwapMode({
|
|
|
36215
36870
|
]
|
|
36216
36871
|
}
|
|
36217
36872
|
),
|
|
36218
|
-
/* @__PURE__ */ (0,
|
|
36873
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36219
36874
|
"button",
|
|
36220
36875
|
{
|
|
36221
36876
|
onClick: () => setShowReviewDetails((v) => !v),
|
|
@@ -36234,13 +36889,13 @@ function SwapMode({
|
|
|
36234
36889
|
padding: 0
|
|
36235
36890
|
},
|
|
36236
36891
|
children: [
|
|
36237
|
-
/* @__PURE__ */ (0,
|
|
36892
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36238
36893
|
"div",
|
|
36239
36894
|
{
|
|
36240
36895
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
36241
36896
|
}
|
|
36242
36897
|
),
|
|
36243
|
-
/* @__PURE__ */ (0,
|
|
36898
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36244
36899
|
"span",
|
|
36245
36900
|
{
|
|
36246
36901
|
style: {
|
|
@@ -36252,7 +36907,7 @@ function SwapMode({
|
|
|
36252
36907
|
},
|
|
36253
36908
|
children: [
|
|
36254
36909
|
showReviewDetails ? "Hide details" : "View details",
|
|
36255
|
-
/* @__PURE__ */ (0,
|
|
36910
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36256
36911
|
"svg",
|
|
36257
36912
|
{
|
|
36258
36913
|
style: {
|
|
@@ -36267,10 +36922,10 @@ function SwapMode({
|
|
|
36267
36922
|
strokeWidth: 2,
|
|
36268
36923
|
strokeLinecap: "round",
|
|
36269
36924
|
strokeLinejoin: "round",
|
|
36270
|
-
children: /* @__PURE__ */ (0,
|
|
36925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
36271
36926
|
}
|
|
36272
36927
|
),
|
|
36273
|
-
route.data && /* @__PURE__ */ (0,
|
|
36928
|
+
route.data && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36274
36929
|
"svg",
|
|
36275
36930
|
{
|
|
36276
36931
|
width: "14",
|
|
@@ -36283,7 +36938,7 @@ function SwapMode({
|
|
|
36283
36938
|
marginLeft: "0.125rem"
|
|
36284
36939
|
},
|
|
36285
36940
|
children: [
|
|
36286
|
-
/* @__PURE__ */ (0,
|
|
36941
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36287
36942
|
"circle",
|
|
36288
36943
|
{
|
|
36289
36944
|
cx: "7",
|
|
@@ -36294,7 +36949,7 @@ function SwapMode({
|
|
|
36294
36949
|
strokeWidth: "1.5"
|
|
36295
36950
|
}
|
|
36296
36951
|
),
|
|
36297
|
-
/* @__PURE__ */ (0,
|
|
36952
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36298
36953
|
"circle",
|
|
36299
36954
|
{
|
|
36300
36955
|
cx: "7",
|
|
@@ -36315,7 +36970,7 @@ function SwapMode({
|
|
|
36315
36970
|
]
|
|
36316
36971
|
}
|
|
36317
36972
|
),
|
|
36318
|
-
/* @__PURE__ */ (0,
|
|
36973
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36319
36974
|
"div",
|
|
36320
36975
|
{
|
|
36321
36976
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
@@ -36324,7 +36979,7 @@ function SwapMode({
|
|
|
36324
36979
|
]
|
|
36325
36980
|
}
|
|
36326
36981
|
),
|
|
36327
|
-
showReviewDetails && /* @__PURE__ */ (0,
|
|
36982
|
+
showReviewDetails && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36328
36983
|
"div",
|
|
36329
36984
|
{
|
|
36330
36985
|
style: {
|
|
@@ -36335,7 +36990,7 @@ function SwapMode({
|
|
|
36335
36990
|
marginBottom: spacing[2]
|
|
36336
36991
|
},
|
|
36337
36992
|
children: [
|
|
36338
|
-
exchangeRate !== null && /* @__PURE__ */ (0,
|
|
36993
|
+
exchangeRate !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36339
36994
|
ReviewDetailRow,
|
|
36340
36995
|
{
|
|
36341
36996
|
label: "Rate",
|
|
@@ -36343,7 +36998,7 @@ function SwapMode({
|
|
|
36343
36998
|
value: `1 ${fromToken?.symbol} = ${fmtAmount(1 / (exchangeRate ?? 1), 4)} ${toToken?.symbol} ($${fmtAmount(fromTokenPriceUSD, 2)})`
|
|
36344
36999
|
}
|
|
36345
37000
|
),
|
|
36346
|
-
/* @__PURE__ */ (0,
|
|
37001
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36347
37002
|
ReviewDetailRow,
|
|
36348
37003
|
{
|
|
36349
37004
|
label: "Fee",
|
|
@@ -36351,12 +37006,12 @@ function SwapMode({
|
|
|
36351
37006
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
36352
37007
|
}
|
|
36353
37008
|
),
|
|
36354
|
-
/* @__PURE__ */ (0,
|
|
37009
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36355
37010
|
ReviewDetailRow,
|
|
36356
37011
|
{
|
|
36357
37012
|
label: "Network cost",
|
|
36358
37013
|
tooltip: "Estimated gas fee paid to the blockchain network",
|
|
36359
|
-
value: isGasSponsored ? /* @__PURE__ */ (0,
|
|
37014
|
+
value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36360
37015
|
"span",
|
|
36361
37016
|
{
|
|
36362
37017
|
style: {
|
|
@@ -36365,14 +37020,14 @@ function SwapMode({
|
|
|
36365
37020
|
gap: "0.25rem"
|
|
36366
37021
|
},
|
|
36367
37022
|
children: [
|
|
36368
|
-
/* @__PURE__ */ (0,
|
|
37023
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, { size: "0.875rem" }),
|
|
36369
37024
|
fmtLocal(networkCostUsd)
|
|
36370
37025
|
]
|
|
36371
37026
|
}
|
|
36372
37027
|
) : "\u2014"
|
|
36373
37028
|
}
|
|
36374
37029
|
),
|
|
36375
|
-
/* @__PURE__ */ (0,
|
|
37030
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36376
37031
|
ReviewDetailRow,
|
|
36377
37032
|
{
|
|
36378
37033
|
label: "Max slippage",
|
|
@@ -36380,12 +37035,12 @@ function SwapMode({
|
|
|
36380
37035
|
value: `${slippage}%`
|
|
36381
37036
|
}
|
|
36382
37037
|
),
|
|
36383
|
-
(routePath || route.data?.route?.provider) && /* @__PURE__ */ (0,
|
|
37038
|
+
(routePath || route.data?.route?.provider) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36384
37039
|
ReviewDetailRow,
|
|
36385
37040
|
{
|
|
36386
37041
|
label: "Route",
|
|
36387
37042
|
tooltip: "Protocol or bridge used to execute your swap",
|
|
36388
|
-
value: /* @__PURE__ */ (0,
|
|
37043
|
+
value: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36389
37044
|
"span",
|
|
36390
37045
|
{
|
|
36391
37046
|
style: {
|
|
@@ -36405,7 +37060,7 @@ function SwapMode({
|
|
|
36405
37060
|
]
|
|
36406
37061
|
}
|
|
36407
37062
|
),
|
|
36408
|
-
/* @__PURE__ */ (0,
|
|
37063
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36409
37064
|
SwapActionArea,
|
|
36410
37065
|
{
|
|
36411
37066
|
fromTokenSymbol: fromToken?.symbol ?? "",
|
|
@@ -36424,12 +37079,12 @@ function SwapMode({
|
|
|
36424
37079
|
const ctaDisabled = !hasTokens || !hasAmount || insufficient || isConnected && needsDestAddress && !isValidDestAddress || route.loading;
|
|
36425
37080
|
const ctaAction = !isConnected ? handleConnectAndReview : () => void handleReview();
|
|
36426
37081
|
const showRateRow = hasTokens && exchangeRate !== null;
|
|
36427
|
-
return /* @__PURE__ */ (0,
|
|
37082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36428
37083
|
"div",
|
|
36429
37084
|
{
|
|
36430
37085
|
style: { display: "flex", flexDirection: "column", minHeight: "500px" },
|
|
36431
37086
|
children: [
|
|
36432
|
-
/* @__PURE__ */ (0,
|
|
37087
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36433
37088
|
"div",
|
|
36434
37089
|
{
|
|
36435
37090
|
style: {
|
|
@@ -36440,7 +37095,7 @@ function SwapMode({
|
|
|
36440
37095
|
marginBottom: spacing[1]
|
|
36441
37096
|
},
|
|
36442
37097
|
children: [
|
|
36443
|
-
/* @__PURE__ */ (0,
|
|
37098
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36444
37099
|
"span",
|
|
36445
37100
|
{
|
|
36446
37101
|
style: {
|
|
@@ -36454,7 +37109,7 @@ function SwapMode({
|
|
|
36454
37109
|
children: "Swap"
|
|
36455
37110
|
}
|
|
36456
37111
|
),
|
|
36457
|
-
/* @__PURE__ */ (0,
|
|
37112
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36458
37113
|
"div",
|
|
36459
37114
|
{
|
|
36460
37115
|
ref: settingsRef,
|
|
@@ -36465,7 +37120,7 @@ function SwapMode({
|
|
|
36465
37120
|
position: "relative"
|
|
36466
37121
|
},
|
|
36467
37122
|
children: [
|
|
36468
|
-
walletAddress ? /* @__PURE__ */ (0,
|
|
37123
|
+
walletAddress ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36469
37124
|
"button",
|
|
36470
37125
|
{
|
|
36471
37126
|
onClick: () => void disconnectWallet(),
|
|
@@ -36483,7 +37138,7 @@ function SwapMode({
|
|
|
36483
37138
|
" \xD7"
|
|
36484
37139
|
]
|
|
36485
37140
|
}
|
|
36486
|
-
) : /* @__PURE__ */ (0,
|
|
37141
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36487
37142
|
"button",
|
|
36488
37143
|
{
|
|
36489
37144
|
onClick: handleConnectAndReview,
|
|
@@ -36498,7 +37153,7 @@ function SwapMode({
|
|
|
36498
37153
|
children: "Connect wallet"
|
|
36499
37154
|
}
|
|
36500
37155
|
),
|
|
36501
|
-
/* @__PURE__ */ (0,
|
|
37156
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36502
37157
|
"button",
|
|
36503
37158
|
{
|
|
36504
37159
|
onClick: () => setShowSettings((v) => !v),
|
|
@@ -36516,7 +37171,7 @@ function SwapMode({
|
|
|
36516
37171
|
color: colors.mutedForeground,
|
|
36517
37172
|
padding: 0
|
|
36518
37173
|
},
|
|
36519
|
-
children: /* @__PURE__ */ (0,
|
|
37174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36520
37175
|
"svg",
|
|
36521
37176
|
{
|
|
36522
37177
|
style: { width: "1rem", height: "1rem" },
|
|
@@ -36527,14 +37182,14 @@ function SwapMode({
|
|
|
36527
37182
|
strokeLinecap: "round",
|
|
36528
37183
|
strokeLinejoin: "round",
|
|
36529
37184
|
children: [
|
|
36530
|
-
/* @__PURE__ */ (0,
|
|
36531
|
-
/* @__PURE__ */ (0,
|
|
37185
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
37186
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
36532
37187
|
]
|
|
36533
37188
|
}
|
|
36534
37189
|
)
|
|
36535
37190
|
}
|
|
36536
37191
|
),
|
|
36537
|
-
showSettings && /* @__PURE__ */ (0,
|
|
37192
|
+
showSettings && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36538
37193
|
"div",
|
|
36539
37194
|
{
|
|
36540
37195
|
style: {
|
|
@@ -36550,7 +37205,7 @@ function SwapMode({
|
|
|
36550
37205
|
zIndex: 100
|
|
36551
37206
|
},
|
|
36552
37207
|
children: [
|
|
36553
|
-
/* @__PURE__ */ (0,
|
|
37208
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36554
37209
|
"p",
|
|
36555
37210
|
{
|
|
36556
37211
|
style: {
|
|
@@ -36564,7 +37219,7 @@ function SwapMode({
|
|
|
36564
37219
|
children: "Appearance"
|
|
36565
37220
|
}
|
|
36566
37221
|
),
|
|
36567
|
-
/* @__PURE__ */ (0,
|
|
37222
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36568
37223
|
"div",
|
|
36569
37224
|
{
|
|
36570
37225
|
style: {
|
|
@@ -36573,8 +37228,8 @@ function SwapMode({
|
|
|
36573
37228
|
justifyContent: "space-between"
|
|
36574
37229
|
},
|
|
36575
37230
|
children: [
|
|
36576
|
-
/* @__PURE__ */ (0,
|
|
36577
|
-
/* @__PURE__ */ (0,
|
|
37231
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
37232
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36578
37233
|
"p",
|
|
36579
37234
|
{
|
|
36580
37235
|
style: {
|
|
@@ -36585,7 +37240,7 @@ function SwapMode({
|
|
|
36585
37240
|
children: "Dark mode"
|
|
36586
37241
|
}
|
|
36587
37242
|
),
|
|
36588
|
-
/* @__PURE__ */ (0,
|
|
37243
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36589
37244
|
"p",
|
|
36590
37245
|
{
|
|
36591
37246
|
style: {
|
|
@@ -36597,7 +37252,7 @@ function SwapMode({
|
|
|
36597
37252
|
}
|
|
36598
37253
|
)
|
|
36599
37254
|
] }),
|
|
36600
|
-
/* @__PURE__ */ (0,
|
|
37255
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36601
37256
|
"button",
|
|
36602
37257
|
{
|
|
36603
37258
|
role: "switch",
|
|
@@ -36614,7 +37269,7 @@ function SwapMode({
|
|
|
36614
37269
|
transition: "background-color 0.2s",
|
|
36615
37270
|
flexShrink: 0
|
|
36616
37271
|
},
|
|
36617
|
-
children: /* @__PURE__ */ (0,
|
|
37272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36618
37273
|
"span",
|
|
36619
37274
|
{
|
|
36620
37275
|
style: {
|
|
@@ -36635,7 +37290,7 @@ function SwapMode({
|
|
|
36635
37290
|
]
|
|
36636
37291
|
}
|
|
36637
37292
|
) }),
|
|
36638
|
-
/* @__PURE__ */ (0,
|
|
37293
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36639
37294
|
"p",
|
|
36640
37295
|
{
|
|
36641
37296
|
style: {
|
|
@@ -36649,8 +37304,8 @@ function SwapMode({
|
|
|
36649
37304
|
children: "Transaction Settings"
|
|
36650
37305
|
}
|
|
36651
37306
|
),
|
|
36652
|
-
/* @__PURE__ */ (0,
|
|
36653
|
-
/* @__PURE__ */ (0,
|
|
37307
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { marginBottom: spacing[4] }, children: [
|
|
37308
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36654
37309
|
"p",
|
|
36655
37310
|
{
|
|
36656
37311
|
style: {
|
|
@@ -36662,8 +37317,8 @@ function SwapMode({
|
|
|
36662
37317
|
children: "Max slippage"
|
|
36663
37318
|
}
|
|
36664
37319
|
),
|
|
36665
|
-
/* @__PURE__ */ (0,
|
|
36666
|
-
[0.1, 0.5, 1].map((v) => /* @__PURE__ */ (0,
|
|
37320
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", gap: spacing[1.5] }, children: [
|
|
37321
|
+
[0.1, 0.5, 1].map((v) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36667
37322
|
"button",
|
|
36668
37323
|
{
|
|
36669
37324
|
onClick: () => {
|
|
@@ -36688,7 +37343,7 @@ function SwapMode({
|
|
|
36688
37343
|
},
|
|
36689
37344
|
v
|
|
36690
37345
|
)),
|
|
36691
|
-
/* @__PURE__ */ (0,
|
|
37346
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { flex: 1.5, position: "relative" }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36692
37347
|
"input",
|
|
36693
37348
|
{
|
|
36694
37349
|
type: "number",
|
|
@@ -36719,7 +37374,7 @@ function SwapMode({
|
|
|
36719
37374
|
}
|
|
36720
37375
|
) })
|
|
36721
37376
|
] }),
|
|
36722
|
-
slippage > 5 && /* @__PURE__ */ (0,
|
|
37377
|
+
slippage > 5 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36723
37378
|
"p",
|
|
36724
37379
|
{
|
|
36725
37380
|
style: {
|
|
@@ -36731,7 +37386,7 @@ function SwapMode({
|
|
|
36731
37386
|
}
|
|
36732
37387
|
)
|
|
36733
37388
|
] }),
|
|
36734
|
-
/* @__PURE__ */ (0,
|
|
37389
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36735
37390
|
"div",
|
|
36736
37391
|
{
|
|
36737
37392
|
style: {
|
|
@@ -36740,8 +37395,8 @@ function SwapMode({
|
|
|
36740
37395
|
justifyContent: "space-between"
|
|
36741
37396
|
},
|
|
36742
37397
|
children: [
|
|
36743
|
-
/* @__PURE__ */ (0,
|
|
36744
|
-
/* @__PURE__ */ (0,
|
|
37398
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
37399
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36745
37400
|
"p",
|
|
36746
37401
|
{
|
|
36747
37402
|
style: {
|
|
@@ -36752,7 +37407,7 @@ function SwapMode({
|
|
|
36752
37407
|
children: "Max approval"
|
|
36753
37408
|
}
|
|
36754
37409
|
),
|
|
36755
|
-
/* @__PURE__ */ (0,
|
|
37410
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36756
37411
|
"p",
|
|
36757
37412
|
{
|
|
36758
37413
|
style: {
|
|
@@ -36764,7 +37419,7 @@ function SwapMode({
|
|
|
36764
37419
|
}
|
|
36765
37420
|
)
|
|
36766
37421
|
] }),
|
|
36767
|
-
/* @__PURE__ */ (0,
|
|
37422
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36768
37423
|
"button",
|
|
36769
37424
|
{
|
|
36770
37425
|
role: "switch",
|
|
@@ -36781,7 +37436,7 @@ function SwapMode({
|
|
|
36781
37436
|
transition: "background-color 0.2s",
|
|
36782
37437
|
flexShrink: 0
|
|
36783
37438
|
},
|
|
36784
|
-
children: /* @__PURE__ */ (0,
|
|
37439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36785
37440
|
"span",
|
|
36786
37441
|
{
|
|
36787
37442
|
style: {
|
|
@@ -36802,7 +37457,7 @@ function SwapMode({
|
|
|
36802
37457
|
]
|
|
36803
37458
|
}
|
|
36804
37459
|
) }),
|
|
36805
|
-
/* @__PURE__ */ (0,
|
|
37460
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36806
37461
|
"div",
|
|
36807
37462
|
{
|
|
36808
37463
|
style: {
|
|
@@ -36812,7 +37467,7 @@ function SwapMode({
|
|
|
36812
37467
|
gap: spacing[3]
|
|
36813
37468
|
},
|
|
36814
37469
|
children: [
|
|
36815
|
-
/* @__PURE__ */ (0,
|
|
37470
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36816
37471
|
"p",
|
|
36817
37472
|
{
|
|
36818
37473
|
style: {
|
|
@@ -36824,13 +37479,13 @@ function SwapMode({
|
|
|
36824
37479
|
children: "Display currency"
|
|
36825
37480
|
}
|
|
36826
37481
|
),
|
|
36827
|
-
/* @__PURE__ */ (0,
|
|
37482
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36828
37483
|
"div",
|
|
36829
37484
|
{
|
|
36830
37485
|
ref: currencyDropdownRef,
|
|
36831
37486
|
style: { position: "relative", flexShrink: 0 },
|
|
36832
37487
|
children: [
|
|
36833
|
-
/* @__PURE__ */ (0,
|
|
37488
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36834
37489
|
"button",
|
|
36835
37490
|
{
|
|
36836
37491
|
onClick: () => setShowCurrencyDropdown((v) => !v),
|
|
@@ -36850,9 +37505,9 @@ function SwapMode({
|
|
|
36850
37505
|
whiteSpace: "nowrap"
|
|
36851
37506
|
},
|
|
36852
37507
|
children: [
|
|
36853
|
-
/* @__PURE__ */ (0,
|
|
36854
|
-
/* @__PURE__ */ (0,
|
|
36855
|
-
/* @__PURE__ */ (0,
|
|
37508
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: currencySymbol }),
|
|
37509
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: selectedCurrency }),
|
|
37510
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36856
37511
|
"svg",
|
|
36857
37512
|
{
|
|
36858
37513
|
style: {
|
|
@@ -36868,13 +37523,13 @@ function SwapMode({
|
|
|
36868
37523
|
strokeWidth: 2.5,
|
|
36869
37524
|
strokeLinecap: "round",
|
|
36870
37525
|
strokeLinejoin: "round",
|
|
36871
|
-
children: /* @__PURE__ */ (0,
|
|
37526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
36872
37527
|
}
|
|
36873
37528
|
)
|
|
36874
37529
|
]
|
|
36875
37530
|
}
|
|
36876
37531
|
),
|
|
36877
|
-
showCurrencyDropdown && /* @__PURE__ */ (0,
|
|
37532
|
+
showCurrencyDropdown && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36878
37533
|
"div",
|
|
36879
37534
|
{
|
|
36880
37535
|
style: {
|
|
@@ -36893,7 +37548,7 @@ function SwapMode({
|
|
|
36893
37548
|
},
|
|
36894
37549
|
children: SUPPORTED_CURRENCIES.map((c) => {
|
|
36895
37550
|
const isSelected = selectedCurrency === c.code;
|
|
36896
|
-
return /* @__PURE__ */ (0,
|
|
37551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36897
37552
|
"button",
|
|
36898
37553
|
{
|
|
36899
37554
|
onClick: () => {
|
|
@@ -36916,7 +37571,7 @@ function SwapMode({
|
|
|
36916
37571
|
fontFamily: "inherit"
|
|
36917
37572
|
},
|
|
36918
37573
|
children: [
|
|
36919
|
-
/* @__PURE__ */ (0,
|
|
37574
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36920
37575
|
"span",
|
|
36921
37576
|
{
|
|
36922
37577
|
style: {
|
|
@@ -36927,8 +37582,8 @@ function SwapMode({
|
|
|
36927
37582
|
children: c.symbol
|
|
36928
37583
|
}
|
|
36929
37584
|
),
|
|
36930
|
-
/* @__PURE__ */ (0,
|
|
36931
|
-
/* @__PURE__ */ (0,
|
|
37585
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { flexShrink: 0 }, children: c.code }),
|
|
37586
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36932
37587
|
"span",
|
|
36933
37588
|
{
|
|
36934
37589
|
style: {
|
|
@@ -36963,7 +37618,7 @@ function SwapMode({
|
|
|
36963
37618
|
]
|
|
36964
37619
|
}
|
|
36965
37620
|
),
|
|
36966
|
-
/* @__PURE__ */ (0,
|
|
37621
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[3]}` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36967
37622
|
"div",
|
|
36968
37623
|
{
|
|
36969
37624
|
onMouseEnter: () => setHoverSell(true),
|
|
@@ -36975,7 +37630,7 @@ function SwapMode({
|
|
|
36975
37630
|
padding: `${spacing[4]} ${spacing[5]} ${spacing[5]}`
|
|
36976
37631
|
},
|
|
36977
37632
|
children: [
|
|
36978
|
-
/* @__PURE__ */ (0,
|
|
37633
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36979
37634
|
"div",
|
|
36980
37635
|
{
|
|
36981
37636
|
style: {
|
|
@@ -36985,7 +37640,7 @@ function SwapMode({
|
|
|
36985
37640
|
marginBottom: spacing[1]
|
|
36986
37641
|
},
|
|
36987
37642
|
children: [
|
|
36988
|
-
/* @__PURE__ */ (0,
|
|
37643
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36989
37644
|
"span",
|
|
36990
37645
|
{
|
|
36991
37646
|
style: {
|
|
@@ -36996,7 +37651,7 @@ function SwapMode({
|
|
|
36996
37651
|
children: "Sell"
|
|
36997
37652
|
}
|
|
36998
37653
|
),
|
|
36999
|
-
/* @__PURE__ */ (0,
|
|
37654
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37000
37655
|
"div",
|
|
37001
37656
|
{
|
|
37002
37657
|
style: {
|
|
@@ -37007,7 +37662,7 @@ function SwapMode({
|
|
|
37007
37662
|
transition: "opacity 0.2s",
|
|
37008
37663
|
pointerEvents: hoverSell && fromBalance !== null ? "auto" : "none"
|
|
37009
37664
|
},
|
|
37010
|
-
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */ (0,
|
|
37665
|
+
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37011
37666
|
"button",
|
|
37012
37667
|
{
|
|
37013
37668
|
onClick: () => {
|
|
@@ -37063,12 +37718,12 @@ function SwapMode({
|
|
|
37063
37718
|
]
|
|
37064
37719
|
}
|
|
37065
37720
|
),
|
|
37066
|
-
/* @__PURE__ */ (0,
|
|
37721
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37067
37722
|
"div",
|
|
37068
37723
|
{
|
|
37069
37724
|
style: { display: "flex", alignItems: "center", gap: spacing[3] },
|
|
37070
37725
|
children: [
|
|
37071
|
-
amountInputMode === "usd" && /* @__PURE__ */ (0,
|
|
37726
|
+
amountInputMode === "usd" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37072
37727
|
"span",
|
|
37073
37728
|
{
|
|
37074
37729
|
style: {
|
|
@@ -37083,7 +37738,7 @@ function SwapMode({
|
|
|
37083
37738
|
children: currencySymbol
|
|
37084
37739
|
}
|
|
37085
37740
|
),
|
|
37086
|
-
/* @__PURE__ */ (0,
|
|
37741
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37087
37742
|
"input",
|
|
37088
37743
|
{
|
|
37089
37744
|
inputMode: "decimal",
|
|
@@ -37109,7 +37764,7 @@ function SwapMode({
|
|
|
37109
37764
|
}
|
|
37110
37765
|
}
|
|
37111
37766
|
),
|
|
37112
|
-
amountInputMode === "token" && fromToken && /* @__PURE__ */ (0,
|
|
37767
|
+
amountInputMode === "token" && fromToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37113
37768
|
"span",
|
|
37114
37769
|
{
|
|
37115
37770
|
style: {
|
|
@@ -37124,7 +37779,7 @@ function SwapMode({
|
|
|
37124
37779
|
children: fromToken.symbol
|
|
37125
37780
|
}
|
|
37126
37781
|
),
|
|
37127
|
-
/* @__PURE__ */ (0,
|
|
37782
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37128
37783
|
TokenPillButton,
|
|
37129
37784
|
{
|
|
37130
37785
|
token: fromToken,
|
|
@@ -37136,7 +37791,7 @@ function SwapMode({
|
|
|
37136
37791
|
]
|
|
37137
37792
|
}
|
|
37138
37793
|
),
|
|
37139
|
-
/* @__PURE__ */ (0,
|
|
37794
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37140
37795
|
"div",
|
|
37141
37796
|
{
|
|
37142
37797
|
style: {
|
|
@@ -37148,7 +37803,7 @@ function SwapMode({
|
|
|
37148
37803
|
color: colors.mutedForeground
|
|
37149
37804
|
},
|
|
37150
37805
|
children: [
|
|
37151
|
-
/* @__PURE__ */ (0,
|
|
37806
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37152
37807
|
"button",
|
|
37153
37808
|
{
|
|
37154
37809
|
type: "button",
|
|
@@ -37166,8 +37821,8 @@ function SwapMode({
|
|
|
37166
37821
|
fontFamily: "inherit"
|
|
37167
37822
|
},
|
|
37168
37823
|
children: [
|
|
37169
|
-
/* @__PURE__ */ (0,
|
|
37170
|
-
hasFromUsdPrice && /* @__PURE__ */ (0,
|
|
37824
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: amountInputMode === "usd" ? fromToken ? `${fmtAmount(tokenSellNum, 5)} ${fromToken.symbol}` : "0" : hasFromUsdPrice ? fmtLocal(usdSellNum) : "USD pricing unavailable" }),
|
|
37825
|
+
hasFromUsdPrice && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37171
37826
|
"svg",
|
|
37172
37827
|
{
|
|
37173
37828
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -37177,17 +37832,17 @@ function SwapMode({
|
|
|
37177
37832
|
strokeWidth: 2,
|
|
37178
37833
|
strokeLinecap: "round",
|
|
37179
37834
|
strokeLinejoin: "round",
|
|
37180
|
-
children: /* @__PURE__ */ (0,
|
|
37835
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" })
|
|
37181
37836
|
}
|
|
37182
37837
|
)
|
|
37183
37838
|
]
|
|
37184
37839
|
}
|
|
37185
37840
|
),
|
|
37186
|
-
fromBalance !== null && fromToken && /* @__PURE__ */ (0,
|
|
37841
|
+
fromBalance !== null && fromToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { children: [
|
|
37187
37842
|
fmtAmount(fromBalance, 6),
|
|
37188
37843
|
" ",
|
|
37189
37844
|
fromToken.symbol,
|
|
37190
|
-
balanceUsd !== null && balanceUsd > 0 && /* @__PURE__ */ (0,
|
|
37845
|
+
balanceUsd !== null && balanceUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { children: [
|
|
37191
37846
|
" \u2248 ",
|
|
37192
37847
|
fmtLocal(balanceUsd)
|
|
37193
37848
|
] })
|
|
@@ -37198,7 +37853,7 @@ function SwapMode({
|
|
|
37198
37853
|
]
|
|
37199
37854
|
}
|
|
37200
37855
|
) }),
|
|
37201
|
-
/* @__PURE__ */ (0,
|
|
37856
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { position: "relative", height: 0, zIndex: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37202
37857
|
"button",
|
|
37203
37858
|
{
|
|
37204
37859
|
onClick: handleFlip,
|
|
@@ -37219,7 +37874,7 @@ function SwapMode({
|
|
|
37219
37874
|
cursor: lockDestToken ? "default" : "pointer",
|
|
37220
37875
|
opacity: lockDestToken ? 0.4 : 1
|
|
37221
37876
|
},
|
|
37222
|
-
children: /* @__PURE__ */ (0,
|
|
37877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37223
37878
|
"svg",
|
|
37224
37879
|
{
|
|
37225
37880
|
style: {
|
|
@@ -37231,7 +37886,7 @@ function SwapMode({
|
|
|
37231
37886
|
fill: "none",
|
|
37232
37887
|
stroke: "currentColor",
|
|
37233
37888
|
strokeWidth: 2,
|
|
37234
|
-
children: /* @__PURE__ */ (0,
|
|
37889
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37235
37890
|
"path",
|
|
37236
37891
|
{
|
|
37237
37892
|
strokeLinecap: "round",
|
|
@@ -37243,7 +37898,7 @@ function SwapMode({
|
|
|
37243
37898
|
)
|
|
37244
37899
|
}
|
|
37245
37900
|
) }),
|
|
37246
|
-
/* @__PURE__ */ (0,
|
|
37901
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[3]}`, marginTop: spacing[3] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37247
37902
|
"div",
|
|
37248
37903
|
{
|
|
37249
37904
|
style: {
|
|
@@ -37252,7 +37907,7 @@ function SwapMode({
|
|
|
37252
37907
|
padding: `${spacing[5]} ${spacing[5]} ${spacing[5]}`
|
|
37253
37908
|
},
|
|
37254
37909
|
children: [
|
|
37255
|
-
/* @__PURE__ */ (0,
|
|
37910
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37256
37911
|
"span",
|
|
37257
37912
|
{
|
|
37258
37913
|
style: {
|
|
@@ -37263,7 +37918,7 @@ function SwapMode({
|
|
|
37263
37918
|
children: "Buy"
|
|
37264
37919
|
}
|
|
37265
37920
|
),
|
|
37266
|
-
/* @__PURE__ */ (0,
|
|
37921
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37267
37922
|
"div",
|
|
37268
37923
|
{
|
|
37269
37924
|
style: {
|
|
@@ -37273,7 +37928,7 @@ function SwapMode({
|
|
|
37273
37928
|
marginTop: spacing[1]
|
|
37274
37929
|
},
|
|
37275
37930
|
children: [
|
|
37276
|
-
/* @__PURE__ */ (0,
|
|
37931
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37277
37932
|
"div",
|
|
37278
37933
|
{
|
|
37279
37934
|
style: {
|
|
@@ -37286,7 +37941,7 @@ function SwapMode({
|
|
|
37286
37941
|
},
|
|
37287
37942
|
children: displayToAmount !== null ? (() => {
|
|
37288
37943
|
const s = `${isEstimate ? "~" : ""}${fmtAmount(displayToAmount, 5)}`;
|
|
37289
|
-
return /* @__PURE__ */ (0,
|
|
37944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37290
37945
|
"span",
|
|
37291
37946
|
{
|
|
37292
37947
|
style: {
|
|
@@ -37297,7 +37952,7 @@ function SwapMode({
|
|
|
37297
37952
|
children: s
|
|
37298
37953
|
}
|
|
37299
37954
|
);
|
|
37300
|
-
})() : route.loading ? /* @__PURE__ */ (0,
|
|
37955
|
+
})() : route.loading ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37301
37956
|
"span",
|
|
37302
37957
|
{
|
|
37303
37958
|
style: {
|
|
@@ -37307,7 +37962,7 @@ function SwapMode({
|
|
|
37307
37962
|
},
|
|
37308
37963
|
children: "\u2026"
|
|
37309
37964
|
}
|
|
37310
|
-
) : /* @__PURE__ */ (0,
|
|
37965
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37311
37966
|
"span",
|
|
37312
37967
|
{
|
|
37313
37968
|
style: {
|
|
@@ -37320,7 +37975,7 @@ function SwapMode({
|
|
|
37320
37975
|
},
|
|
37321
37976
|
rateUpdated ? "flash" : "stable"
|
|
37322
37977
|
),
|
|
37323
|
-
/* @__PURE__ */ (0,
|
|
37978
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37324
37979
|
TokenPillButton,
|
|
37325
37980
|
{
|
|
37326
37981
|
token: toToken,
|
|
@@ -37334,7 +37989,7 @@ function SwapMode({
|
|
|
37334
37989
|
]
|
|
37335
37990
|
}
|
|
37336
37991
|
),
|
|
37337
|
-
/* @__PURE__ */ (0,
|
|
37992
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37338
37993
|
"div",
|
|
37339
37994
|
{
|
|
37340
37995
|
style: {
|
|
@@ -37346,8 +38001,8 @@ function SwapMode({
|
|
|
37346
38001
|
color: colors.mutedForeground
|
|
37347
38002
|
},
|
|
37348
38003
|
children: [
|
|
37349
|
-
/* @__PURE__ */ (0,
|
|
37350
|
-
priceImpact !== null && /* @__PURE__ */ (0,
|
|
38004
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: displayToUsd > 0 ? `${isEstimate ? "~" : ""}${fmtLocal(displayToUsd)}` : "" }),
|
|
38005
|
+
priceImpact !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37351
38006
|
"span",
|
|
37352
38007
|
{
|
|
37353
38008
|
style: {
|
|
@@ -37368,7 +38023,7 @@ function SwapMode({
|
|
|
37368
38023
|
]
|
|
37369
38024
|
}
|
|
37370
38025
|
),
|
|
37371
|
-
needsDestAddress && toChain && /* @__PURE__ */ (0,
|
|
38026
|
+
needsDestAddress && toChain && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37372
38027
|
"div",
|
|
37373
38028
|
{
|
|
37374
38029
|
style: {
|
|
@@ -37377,7 +38032,7 @@ function SwapMode({
|
|
|
37377
38032
|
borderTop: "1px solid hsl(var(--tw-border))"
|
|
37378
38033
|
},
|
|
37379
38034
|
children: [
|
|
37380
|
-
/* @__PURE__ */ (0,
|
|
38035
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37381
38036
|
"p",
|
|
37382
38037
|
{
|
|
37383
38038
|
style: {
|
|
@@ -37392,8 +38047,8 @@ function SwapMode({
|
|
|
37392
38047
|
]
|
|
37393
38048
|
}
|
|
37394
38049
|
),
|
|
37395
|
-
/* @__PURE__ */ (0,
|
|
37396
|
-
/* @__PURE__ */ (0,
|
|
38050
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative" }, children: [
|
|
38051
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37397
38052
|
"input",
|
|
37398
38053
|
{
|
|
37399
38054
|
type: "text",
|
|
@@ -37416,7 +38071,7 @@ function SwapMode({
|
|
|
37416
38071
|
}
|
|
37417
38072
|
}
|
|
37418
38073
|
),
|
|
37419
|
-
/* @__PURE__ */ (0,
|
|
38074
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37420
38075
|
"button",
|
|
37421
38076
|
{
|
|
37422
38077
|
type: "button",
|
|
@@ -37442,7 +38097,7 @@ function SwapMode({
|
|
|
37442
38097
|
}
|
|
37443
38098
|
)
|
|
37444
38099
|
] }),
|
|
37445
|
-
destAddress && !isValidDestAddress && /* @__PURE__ */ (0,
|
|
38100
|
+
destAddress && !isValidDestAddress && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37446
38101
|
"p",
|
|
37447
38102
|
{
|
|
37448
38103
|
style: {
|
|
@@ -37463,7 +38118,7 @@ function SwapMode({
|
|
|
37463
38118
|
]
|
|
37464
38119
|
}
|
|
37465
38120
|
) }),
|
|
37466
|
-
route.error && !route.loading && /* @__PURE__ */ (0,
|
|
38121
|
+
route.error && !route.loading && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37467
38122
|
"p",
|
|
37468
38123
|
{
|
|
37469
38124
|
style: {
|
|
@@ -37476,7 +38131,7 @@ function SwapMode({
|
|
|
37476
38131
|
children: mapError(route.error).message
|
|
37477
38132
|
}
|
|
37478
38133
|
),
|
|
37479
|
-
route.loading && /* @__PURE__ */ (0,
|
|
38134
|
+
route.loading && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37480
38135
|
"div",
|
|
37481
38136
|
{
|
|
37482
38137
|
style: {
|
|
@@ -37488,13 +38143,13 @@ function SwapMode({
|
|
|
37488
38143
|
padding: `0 ${spacing[3]}`
|
|
37489
38144
|
},
|
|
37490
38145
|
children: [
|
|
37491
|
-
/* @__PURE__ */ (0,
|
|
38146
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37492
38147
|
"svg",
|
|
37493
38148
|
{
|
|
37494
38149
|
className: "tw-animate-spin",
|
|
37495
38150
|
style: { width: "0.875rem", height: "0.875rem", flexShrink: 0 },
|
|
37496
38151
|
viewBox: "0 0 88 88",
|
|
37497
|
-
children: /* @__PURE__ */ (0,
|
|
38152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37498
38153
|
"circle",
|
|
37499
38154
|
{
|
|
37500
38155
|
cx: "44",
|
|
@@ -37509,7 +38164,7 @@ function SwapMode({
|
|
|
37509
38164
|
)
|
|
37510
38165
|
}
|
|
37511
38166
|
),
|
|
37512
|
-
/* @__PURE__ */ (0,
|
|
38167
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37513
38168
|
"span",
|
|
37514
38169
|
{
|
|
37515
38170
|
style: {
|
|
@@ -37524,7 +38179,7 @@ function SwapMode({
|
|
|
37524
38179
|
]
|
|
37525
38180
|
}
|
|
37526
38181
|
),
|
|
37527
|
-
/* @__PURE__ */ (0,
|
|
38182
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `${spacing[2]} ${spacing[3]} 0` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37528
38183
|
"button",
|
|
37529
38184
|
{
|
|
37530
38185
|
disabled: ctaDisabled,
|
|
@@ -37553,7 +38208,7 @@ function SwapMode({
|
|
|
37553
38208
|
children: ctaLabel
|
|
37554
38209
|
}
|
|
37555
38210
|
) }),
|
|
37556
|
-
showRateRow && /* @__PURE__ */ (0,
|
|
38211
|
+
showRateRow && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37557
38212
|
"div",
|
|
37558
38213
|
{
|
|
37559
38214
|
style: {
|
|
@@ -37563,7 +38218,7 @@ function SwapMode({
|
|
|
37563
38218
|
color: colors.mutedForeground
|
|
37564
38219
|
},
|
|
37565
38220
|
children: [
|
|
37566
|
-
/* @__PURE__ */ (0,
|
|
38221
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37567
38222
|
"button",
|
|
37568
38223
|
{
|
|
37569
38224
|
onClick: () => setShowRateDetails((v) => !v),
|
|
@@ -37581,7 +38236,7 @@ function SwapMode({
|
|
|
37581
38236
|
padding: `${spacing[1]} 0`
|
|
37582
38237
|
},
|
|
37583
38238
|
children: [
|
|
37584
|
-
/* @__PURE__ */ (0,
|
|
38239
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { style: { flex: 1, textAlign: "left" }, children: [
|
|
37585
38240
|
"1 ",
|
|
37586
38241
|
toToken?.symbol,
|
|
37587
38242
|
" = ",
|
|
@@ -37589,7 +38244,7 @@ function SwapMode({
|
|
|
37589
38244
|
" ",
|
|
37590
38245
|
fromToken?.symbol
|
|
37591
38246
|
] }),
|
|
37592
|
-
/* @__PURE__ */ (0,
|
|
38247
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37593
38248
|
"span",
|
|
37594
38249
|
{
|
|
37595
38250
|
style: {
|
|
@@ -37599,15 +38254,15 @@ function SwapMode({
|
|
|
37599
38254
|
flexShrink: 0
|
|
37600
38255
|
},
|
|
37601
38256
|
children: [
|
|
37602
|
-
!isGasSponsored && /* @__PURE__ */ (0,
|
|
37603
|
-
/* @__PURE__ */ (0,
|
|
38257
|
+
!isGasSponsored && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, {}),
|
|
38258
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37604
38259
|
"span",
|
|
37605
38260
|
{
|
|
37606
38261
|
style: isGasSponsored ? { color: colors.green[500] } : void 0,
|
|
37607
38262
|
children: isGasSponsored ? "\u2726 Sponsored" : networkCostUsd !== null ? fmtLocal(networkCostUsd) : "\u2014"
|
|
37608
38263
|
}
|
|
37609
38264
|
),
|
|
37610
|
-
route.data && /* @__PURE__ */ (0,
|
|
38265
|
+
route.data && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37611
38266
|
"svg",
|
|
37612
38267
|
{
|
|
37613
38268
|
width: "14",
|
|
@@ -37619,7 +38274,7 @@ function SwapMode({
|
|
|
37619
38274
|
opacity: 0.75
|
|
37620
38275
|
},
|
|
37621
38276
|
children: [
|
|
37622
|
-
/* @__PURE__ */ (0,
|
|
38277
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37623
38278
|
"circle",
|
|
37624
38279
|
{
|
|
37625
38280
|
cx: "7",
|
|
@@ -37630,7 +38285,7 @@ function SwapMode({
|
|
|
37630
38285
|
strokeWidth: "1.5"
|
|
37631
38286
|
}
|
|
37632
38287
|
),
|
|
37633
|
-
/* @__PURE__ */ (0,
|
|
38288
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37634
38289
|
"circle",
|
|
37635
38290
|
{
|
|
37636
38291
|
cx: "7",
|
|
@@ -37648,7 +38303,7 @@ function SwapMode({
|
|
|
37648
38303
|
]
|
|
37649
38304
|
}
|
|
37650
38305
|
),
|
|
37651
|
-
/* @__PURE__ */ (0,
|
|
38306
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37652
38307
|
"svg",
|
|
37653
38308
|
{
|
|
37654
38309
|
style: {
|
|
@@ -37663,7 +38318,7 @@ function SwapMode({
|
|
|
37663
38318
|
strokeWidth: 2,
|
|
37664
38319
|
strokeLinecap: "round",
|
|
37665
38320
|
strokeLinejoin: "round",
|
|
37666
|
-
children: /* @__PURE__ */ (0,
|
|
38321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
37667
38322
|
}
|
|
37668
38323
|
)
|
|
37669
38324
|
]
|
|
@@ -37672,7 +38327,7 @@ function SwapMode({
|
|
|
37672
38327
|
]
|
|
37673
38328
|
}
|
|
37674
38329
|
),
|
|
37675
|
-
showRateDetails && /* @__PURE__ */ (0,
|
|
38330
|
+
showRateDetails && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37676
38331
|
"div",
|
|
37677
38332
|
{
|
|
37678
38333
|
style: {
|
|
@@ -37684,18 +38339,18 @@ function SwapMode({
|
|
|
37684
38339
|
gap: spacing[2.5]
|
|
37685
38340
|
},
|
|
37686
38341
|
children: [
|
|
37687
|
-
/* @__PURE__ */ (0,
|
|
38342
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37688
38343
|
RateRow,
|
|
37689
38344
|
{
|
|
37690
38345
|
label: "Fee",
|
|
37691
38346
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
37692
38347
|
}
|
|
37693
38348
|
),
|
|
37694
|
-
/* @__PURE__ */ (0,
|
|
38349
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37695
38350
|
RateRow,
|
|
37696
38351
|
{
|
|
37697
38352
|
label: "Network cost",
|
|
37698
|
-
value: isGasSponsored ? /* @__PURE__ */ (0,
|
|
38353
|
+
value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37699
38354
|
"span",
|
|
37700
38355
|
{
|
|
37701
38356
|
style: {
|
|
@@ -37704,19 +38359,19 @@ function SwapMode({
|
|
|
37704
38359
|
gap: "0.25rem"
|
|
37705
38360
|
},
|
|
37706
38361
|
children: [
|
|
37707
|
-
/* @__PURE__ */ (0,
|
|
38362
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, { size: "0.75rem" }),
|
|
37708
38363
|
fmtLocal(networkCostUsd)
|
|
37709
38364
|
]
|
|
37710
38365
|
}
|
|
37711
|
-
) : /* @__PURE__ */ (0,
|
|
38366
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
37712
38367
|
}
|
|
37713
38368
|
),
|
|
37714
|
-
/* @__PURE__ */ (0,
|
|
37715
|
-
/* @__PURE__ */ (0,
|
|
38369
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RateRow, { label: "Max slippage", value: `${slippage}%` }),
|
|
38370
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37716
38371
|
RateRow,
|
|
37717
38372
|
{
|
|
37718
38373
|
label: "Route",
|
|
37719
|
-
value: routePath ? /* @__PURE__ */ (0,
|
|
38374
|
+
value: routePath ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37720
38375
|
"span",
|
|
37721
38376
|
{
|
|
37722
38377
|
style: {
|
|
@@ -37730,7 +38385,7 @@ function SwapMode({
|
|
|
37730
38385
|
title: routePath,
|
|
37731
38386
|
children: routePath
|
|
37732
38387
|
}
|
|
37733
|
-
) : route.data?.route?.provider ?? /* @__PURE__ */ (0,
|
|
38388
|
+
) : route.data?.route?.provider ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
37734
38389
|
}
|
|
37735
38390
|
)
|
|
37736
38391
|
]
|
|
@@ -37739,7 +38394,7 @@ function SwapMode({
|
|
|
37739
38394
|
]
|
|
37740
38395
|
}
|
|
37741
38396
|
),
|
|
37742
|
-
/* @__PURE__ */ (0,
|
|
38397
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetSecurityFooter, {})
|
|
37743
38398
|
]
|
|
37744
38399
|
}
|
|
37745
38400
|
) });
|
|
@@ -37767,8 +38422,8 @@ function SwapActionArea({
|
|
|
37767
38422
|
label = "Swap";
|
|
37768
38423
|
}
|
|
37769
38424
|
const isDisabled = isSubmitting || isChecking;
|
|
37770
|
-
return /* @__PURE__ */ (0,
|
|
37771
|
-
isGasSponsored && !isSubmitting && /* @__PURE__ */ (0,
|
|
38425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { marginTop: spacing[6] }, children: [
|
|
38426
|
+
isGasSponsored && !isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37772
38427
|
"div",
|
|
37773
38428
|
{
|
|
37774
38429
|
style: {
|
|
@@ -37779,7 +38434,7 @@ function SwapActionArea({
|
|
|
37779
38434
|
marginBottom: spacing[3]
|
|
37780
38435
|
},
|
|
37781
38436
|
children: [
|
|
37782
|
-
/* @__PURE__ */ (0,
|
|
38437
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37783
38438
|
"svg",
|
|
37784
38439
|
{
|
|
37785
38440
|
style: {
|
|
@@ -37789,10 +38444,10 @@ function SwapActionArea({
|
|
|
37789
38444
|
},
|
|
37790
38445
|
viewBox: "0 0 24 24",
|
|
37791
38446
|
fill: "currentColor",
|
|
37792
|
-
children: /* @__PURE__ */ (0,
|
|
38447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 2l2.09 6.26L20 10l-5.91 1.74L12 18l-2.09-6.26L4 10l5.91-1.74z" })
|
|
37793
38448
|
}
|
|
37794
38449
|
),
|
|
37795
|
-
/* @__PURE__ */ (0,
|
|
38450
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37796
38451
|
"span",
|
|
37797
38452
|
{
|
|
37798
38453
|
style: {
|
|
@@ -37806,7 +38461,7 @@ function SwapActionArea({
|
|
|
37806
38461
|
]
|
|
37807
38462
|
}
|
|
37808
38463
|
),
|
|
37809
|
-
/* @__PURE__ */ (0,
|
|
38464
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37810
38465
|
"button",
|
|
37811
38466
|
{
|
|
37812
38467
|
onClick: onExecute,
|
|
@@ -37829,7 +38484,7 @@ function SwapActionArea({
|
|
|
37829
38484
|
children: label
|
|
37830
38485
|
}
|
|
37831
38486
|
),
|
|
37832
|
-
needsApproval && !isSubmitting && /* @__PURE__ */ (0,
|
|
38487
|
+
needsApproval && !isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37833
38488
|
"p",
|
|
37834
38489
|
{
|
|
37835
38490
|
style: {
|
|
@@ -37861,7 +38516,7 @@ function TokenPillButton({
|
|
|
37861
38516
|
const iconUrl = token?.iconUrl ?? token?.logoURI;
|
|
37862
38517
|
const chainIcon = chain?.chainIconURI;
|
|
37863
38518
|
if (!token) {
|
|
37864
|
-
return /* @__PURE__ */ (0,
|
|
38519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37865
38520
|
"button",
|
|
37866
38521
|
{
|
|
37867
38522
|
onClick: disabled ? void 0 : onClick,
|
|
@@ -37884,7 +38539,7 @@ function TokenPillButton({
|
|
|
37884
38539
|
},
|
|
37885
38540
|
children: [
|
|
37886
38541
|
placeholder,
|
|
37887
|
-
/* @__PURE__ */ (0,
|
|
38542
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37888
38543
|
"svg",
|
|
37889
38544
|
{
|
|
37890
38545
|
style: { width: "1rem", height: "1rem" },
|
|
@@ -37892,7 +38547,7 @@ function TokenPillButton({
|
|
|
37892
38547
|
fill: "none",
|
|
37893
38548
|
stroke: "currentColor",
|
|
37894
38549
|
strokeWidth: 2,
|
|
37895
|
-
children: /* @__PURE__ */ (0,
|
|
38550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37896
38551
|
"path",
|
|
37897
38552
|
{
|
|
37898
38553
|
strokeLinecap: "round",
|
|
@@ -37906,7 +38561,7 @@ function TokenPillButton({
|
|
|
37906
38561
|
}
|
|
37907
38562
|
);
|
|
37908
38563
|
}
|
|
37909
|
-
return /* @__PURE__ */ (0,
|
|
38564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37910
38565
|
"button",
|
|
37911
38566
|
{
|
|
37912
38567
|
onClick: disabled ? void 0 : onClick,
|
|
@@ -37926,8 +38581,8 @@ function TokenPillButton({
|
|
|
37926
38581
|
opacity: disabled ? 0.85 : 1
|
|
37927
38582
|
},
|
|
37928
38583
|
children: [
|
|
37929
|
-
/* @__PURE__ */ (0,
|
|
37930
|
-
iconUrl ? /* @__PURE__ */ (0,
|
|
38584
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative" }, children: [
|
|
38585
|
+
iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37931
38586
|
"img",
|
|
37932
38587
|
{
|
|
37933
38588
|
src: iconUrl,
|
|
@@ -37939,7 +38594,7 @@ function TokenPillButton({
|
|
|
37939
38594
|
objectFit: "cover"
|
|
37940
38595
|
}
|
|
37941
38596
|
}
|
|
37942
|
-
) : /* @__PURE__ */ (0,
|
|
38597
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37943
38598
|
"div",
|
|
37944
38599
|
{
|
|
37945
38600
|
style: {
|
|
@@ -37951,7 +38606,7 @@ function TokenPillButton({
|
|
|
37951
38606
|
alignItems: "center",
|
|
37952
38607
|
justifyContent: "center"
|
|
37953
38608
|
},
|
|
37954
|
-
children: /* @__PURE__ */ (0,
|
|
38609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37955
38610
|
"span",
|
|
37956
38611
|
{
|
|
37957
38612
|
style: {
|
|
@@ -37964,7 +38619,7 @@ function TokenPillButton({
|
|
|
37964
38619
|
)
|
|
37965
38620
|
}
|
|
37966
38621
|
),
|
|
37967
|
-
chainIcon && /* @__PURE__ */ (0,
|
|
38622
|
+
chainIcon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37968
38623
|
"img",
|
|
37969
38624
|
{
|
|
37970
38625
|
src: chainIcon,
|
|
@@ -37982,7 +38637,7 @@ function TokenPillButton({
|
|
|
37982
38637
|
}
|
|
37983
38638
|
)
|
|
37984
38639
|
] }),
|
|
37985
|
-
/* @__PURE__ */ (0,
|
|
38640
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37986
38641
|
"span",
|
|
37987
38642
|
{
|
|
37988
38643
|
style: {
|
|
@@ -37993,7 +38648,7 @@ function TokenPillButton({
|
|
|
37993
38648
|
children: token.symbol
|
|
37994
38649
|
}
|
|
37995
38650
|
),
|
|
37996
|
-
!disabled && /* @__PURE__ */ (0,
|
|
38651
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37997
38652
|
"svg",
|
|
37998
38653
|
{
|
|
37999
38654
|
style: {
|
|
@@ -38005,7 +38660,7 @@ function TokenPillButton({
|
|
|
38005
38660
|
fill: "none",
|
|
38006
38661
|
stroke: "currentColor",
|
|
38007
38662
|
strokeWidth: 2,
|
|
38008
|
-
children: /* @__PURE__ */ (0,
|
|
38663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38009
38664
|
"path",
|
|
38010
38665
|
{
|
|
38011
38666
|
strokeLinecap: "round",
|
|
@@ -38026,8 +38681,8 @@ function TokenIcon({
|
|
|
38026
38681
|
}) {
|
|
38027
38682
|
const imgSize = size === "lg" ? "2.75rem" : "2.5rem";
|
|
38028
38683
|
const badgeSize = size === "lg" ? "1.125rem" : "1rem";
|
|
38029
|
-
return /* @__PURE__ */ (0,
|
|
38030
|
-
/* @__PURE__ */ (0,
|
|
38684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
38685
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38031
38686
|
"img",
|
|
38032
38687
|
{
|
|
38033
38688
|
src: icon,
|
|
@@ -38035,7 +38690,7 @@ function TokenIcon({
|
|
|
38035
38690
|
style: { width: imgSize, height: imgSize, borderRadius: "9999px" }
|
|
38036
38691
|
}
|
|
38037
38692
|
),
|
|
38038
|
-
chainIcon && /* @__PURE__ */ (0,
|
|
38693
|
+
chainIcon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38039
38694
|
"img",
|
|
38040
38695
|
{
|
|
38041
38696
|
src: chainIcon,
|
|
@@ -38059,15 +38714,15 @@ function ReviewDetailRow({
|
|
|
38059
38714
|
value,
|
|
38060
38715
|
tooltip
|
|
38061
38716
|
}) {
|
|
38062
|
-
const iconRef = (0,
|
|
38063
|
-
const [tipPos, setTipPos] = (0,
|
|
38717
|
+
const iconRef = (0, import_react50.useRef)(null);
|
|
38718
|
+
const [tipPos, setTipPos] = (0, import_react50.useState)(null);
|
|
38064
38719
|
const handleMouseEnter = () => {
|
|
38065
38720
|
if (!tooltip || !iconRef.current) return;
|
|
38066
38721
|
const r = iconRef.current.getBoundingClientRect();
|
|
38067
38722
|
setTipPos({ x: r.left + r.width / 2, y: r.top - 8 });
|
|
38068
38723
|
};
|
|
38069
38724
|
const handleMouseLeave = () => setTipPos(null);
|
|
38070
|
-
return /* @__PURE__ */ (0,
|
|
38725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38071
38726
|
"div",
|
|
38072
38727
|
{
|
|
38073
38728
|
style: {
|
|
@@ -38076,7 +38731,7 @@ function ReviewDetailRow({
|
|
|
38076
38731
|
justifyContent: "space-between"
|
|
38077
38732
|
},
|
|
38078
38733
|
children: [
|
|
38079
|
-
/* @__PURE__ */ (0,
|
|
38734
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38080
38735
|
"span",
|
|
38081
38736
|
{
|
|
38082
38737
|
style: {
|
|
@@ -38087,14 +38742,14 @@ function ReviewDetailRow({
|
|
|
38087
38742
|
},
|
|
38088
38743
|
children: [
|
|
38089
38744
|
label,
|
|
38090
|
-
/* @__PURE__ */ (0,
|
|
38745
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38091
38746
|
"span",
|
|
38092
38747
|
{
|
|
38093
38748
|
ref: iconRef,
|
|
38094
38749
|
style: { display: "inline-flex", alignItems: "center" },
|
|
38095
38750
|
onMouseEnter: handleMouseEnter,
|
|
38096
38751
|
onMouseLeave: handleMouseLeave,
|
|
38097
|
-
children: /* @__PURE__ */ (0,
|
|
38752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38098
38753
|
"svg",
|
|
38099
38754
|
{
|
|
38100
38755
|
style: {
|
|
@@ -38110,8 +38765,8 @@ function ReviewDetailRow({
|
|
|
38110
38765
|
strokeLinecap: "round",
|
|
38111
38766
|
strokeLinejoin: "round",
|
|
38112
38767
|
children: [
|
|
38113
|
-
/* @__PURE__ */ (0,
|
|
38114
|
-
/* @__PURE__ */ (0,
|
|
38768
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
38769
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 16v-4M12 8h.01" })
|
|
38115
38770
|
]
|
|
38116
38771
|
}
|
|
38117
38772
|
)
|
|
@@ -38120,9 +38775,9 @@ function ReviewDetailRow({
|
|
|
38120
38775
|
]
|
|
38121
38776
|
}
|
|
38122
38777
|
),
|
|
38123
|
-
/* @__PURE__ */ (0,
|
|
38778
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value }),
|
|
38124
38779
|
tooltip && tipPos && typeof document !== "undefined" && import_react_dom.default.createPortal(
|
|
38125
|
-
/* @__PURE__ */ (0,
|
|
38780
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38126
38781
|
"span",
|
|
38127
38782
|
{
|
|
38128
38783
|
style: {
|
|
@@ -38151,7 +38806,7 @@ function ReviewDetailRow({
|
|
|
38151
38806
|
);
|
|
38152
38807
|
}
|
|
38153
38808
|
function GasIcon({ size = "0.875rem" }) {
|
|
38154
|
-
return /* @__PURE__ */ (0,
|
|
38809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38155
38810
|
"svg",
|
|
38156
38811
|
{
|
|
38157
38812
|
style: { width: size, height: size, flexShrink: 0 },
|
|
@@ -38162,16 +38817,16 @@ function GasIcon({ size = "0.875rem" }) {
|
|
|
38162
38817
|
strokeLinecap: "round",
|
|
38163
38818
|
strokeLinejoin: "round",
|
|
38164
38819
|
children: [
|
|
38165
|
-
/* @__PURE__ */ (0,
|
|
38166
|
-
/* @__PURE__ */ (0,
|
|
38167
|
-
/* @__PURE__ */ (0,
|
|
38168
|
-
/* @__PURE__ */ (0,
|
|
38820
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M3 22V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v15" }),
|
|
38821
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M3 11h11" }),
|
|
38822
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M17 5h1a2 2 0 0 1 2 2v2.5a1.5 1.5 0 0 0 3 0V7l-3-3" }),
|
|
38823
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M19 22V12" })
|
|
38169
38824
|
]
|
|
38170
38825
|
}
|
|
38171
38826
|
);
|
|
38172
38827
|
}
|
|
38173
38828
|
function SponsoredBadge() {
|
|
38174
|
-
return /* @__PURE__ */ (0,
|
|
38829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38175
38830
|
"span",
|
|
38176
38831
|
{
|
|
38177
38832
|
style: {
|
|
@@ -38182,13 +38837,13 @@ function SponsoredBadge() {
|
|
|
38182
38837
|
fontWeight: fontWeight.medium
|
|
38183
38838
|
},
|
|
38184
38839
|
children: [
|
|
38185
|
-
/* @__PURE__ */ (0,
|
|
38840
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38186
38841
|
"svg",
|
|
38187
38842
|
{
|
|
38188
38843
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
38189
38844
|
viewBox: "0 0 24 24",
|
|
38190
38845
|
fill: "currentColor",
|
|
38191
|
-
children: /* @__PURE__ */ (0,
|
|
38846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 2l2.09 6.26L20 10l-5.91 1.74L12 18l-2.09-6.26L4 10l5.91-1.74z" })
|
|
38192
38847
|
}
|
|
38193
38848
|
),
|
|
38194
38849
|
"Sponsored"
|
|
@@ -38200,7 +38855,7 @@ function SuccessReceiptRow({
|
|
|
38200
38855
|
label,
|
|
38201
38856
|
value
|
|
38202
38857
|
}) {
|
|
38203
|
-
return /* @__PURE__ */ (0,
|
|
38858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38204
38859
|
"div",
|
|
38205
38860
|
{
|
|
38206
38861
|
style: {
|
|
@@ -38209,8 +38864,8 @@ function SuccessReceiptRow({
|
|
|
38209
38864
|
justifyContent: "space-between"
|
|
38210
38865
|
},
|
|
38211
38866
|
children: [
|
|
38212
|
-
/* @__PURE__ */ (0,
|
|
38213
|
-
/* @__PURE__ */ (0,
|
|
38867
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
38868
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { fontWeight: fontWeight.medium, color: colors.foreground }, children: value })
|
|
38214
38869
|
]
|
|
38215
38870
|
}
|
|
38216
38871
|
);
|
|
@@ -38224,7 +38879,7 @@ function ProcessingStepNode({
|
|
|
38224
38879
|
const nodeColor = done ? colors.green[500] : active ? `hsl(var(--tw-primary))` : colors.border;
|
|
38225
38880
|
const iconColor = done ? "#fff" : active ? `hsl(var(--tw-primary))` : colors.mutedForeground;
|
|
38226
38881
|
const nodeBg = done ? colors.green[500] : "transparent";
|
|
38227
|
-
const iconEl = icon === "send" ? /* @__PURE__ */ (0,
|
|
38882
|
+
const iconEl = icon === "send" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38228
38883
|
"svg",
|
|
38229
38884
|
{
|
|
38230
38885
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38234,9 +38889,9 @@ function ProcessingStepNode({
|
|
|
38234
38889
|
strokeWidth: 2,
|
|
38235
38890
|
strokeLinecap: "round",
|
|
38236
38891
|
strokeLinejoin: "round",
|
|
38237
|
-
children: /* @__PURE__ */ (0,
|
|
38892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
38238
38893
|
}
|
|
38239
|
-
) : icon === "plus" ? /* @__PURE__ */ (0,
|
|
38894
|
+
) : icon === "plus" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38240
38895
|
"svg",
|
|
38241
38896
|
{
|
|
38242
38897
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38246,9 +38901,9 @@ function ProcessingStepNode({
|
|
|
38246
38901
|
strokeWidth: 2,
|
|
38247
38902
|
strokeLinecap: "round",
|
|
38248
38903
|
strokeLinejoin: "round",
|
|
38249
|
-
children: /* @__PURE__ */ (0,
|
|
38904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 5v14M5 12h14" })
|
|
38250
38905
|
}
|
|
38251
|
-
) : /* @__PURE__ */ (0,
|
|
38906
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38252
38907
|
"svg",
|
|
38253
38908
|
{
|
|
38254
38909
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38259,12 +38914,12 @@ function ProcessingStepNode({
|
|
|
38259
38914
|
strokeLinecap: "round",
|
|
38260
38915
|
strokeLinejoin: "round",
|
|
38261
38916
|
children: [
|
|
38262
|
-
/* @__PURE__ */ (0,
|
|
38263
|
-
/* @__PURE__ */ (0,
|
|
38917
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" }),
|
|
38918
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "4", y1: "22", x2: "4", y2: "15" })
|
|
38264
38919
|
]
|
|
38265
38920
|
}
|
|
38266
38921
|
);
|
|
38267
|
-
const doneIcon = /* @__PURE__ */ (0,
|
|
38922
|
+
const doneIcon = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38268
38923
|
"svg",
|
|
38269
38924
|
{
|
|
38270
38925
|
style: { width: "0.875rem", height: "0.875rem", color: "#fff" },
|
|
@@ -38274,10 +38929,10 @@ function ProcessingStepNode({
|
|
|
38274
38929
|
strokeWidth: 3,
|
|
38275
38930
|
strokeLinecap: "round",
|
|
38276
38931
|
strokeLinejoin: "round",
|
|
38277
|
-
children: /* @__PURE__ */ (0,
|
|
38932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M20 6L9 17l-5-5" })
|
|
38278
38933
|
}
|
|
38279
38934
|
);
|
|
38280
|
-
return /* @__PURE__ */ (0,
|
|
38935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38281
38936
|
"div",
|
|
38282
38937
|
{
|
|
38283
38938
|
style: {
|
|
@@ -38288,7 +38943,7 @@ function ProcessingStepNode({
|
|
|
38288
38943
|
maxWidth: "5rem"
|
|
38289
38944
|
},
|
|
38290
38945
|
children: [
|
|
38291
|
-
/* @__PURE__ */ (0,
|
|
38946
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38292
38947
|
"div",
|
|
38293
38948
|
{
|
|
38294
38949
|
style: {
|
|
@@ -38306,7 +38961,7 @@ function ProcessingStepNode({
|
|
|
38306
38961
|
children: done ? doneIcon : iconEl
|
|
38307
38962
|
}
|
|
38308
38963
|
),
|
|
38309
|
-
/* @__PURE__ */ (0,
|
|
38964
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38310
38965
|
"span",
|
|
38311
38966
|
{
|
|
38312
38967
|
style: {
|
|
@@ -38325,7 +38980,7 @@ function ProcessingStepNode({
|
|
|
38325
38980
|
);
|
|
38326
38981
|
}
|
|
38327
38982
|
function ProcessingStepLine({ done }) {
|
|
38328
|
-
return /* @__PURE__ */ (0,
|
|
38983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38329
38984
|
"div",
|
|
38330
38985
|
{
|
|
38331
38986
|
style: {
|
|
@@ -38339,11 +38994,11 @@ function ProcessingStepLine({ done }) {
|
|
|
38339
38994
|
}
|
|
38340
38995
|
);
|
|
38341
38996
|
}
|
|
38342
|
-
var
|
|
38997
|
+
var import_react50, import_react_dom, import_jsx_runtime59, ConfettiEffect3, QUOTE_TTL, QUOTE_LOADING_MESSAGES, PERCENT_OPTIONS;
|
|
38343
38998
|
var init_SwapMode = __esm({
|
|
38344
38999
|
"src/modes/swap/SwapMode.tsx"() {
|
|
38345
39000
|
"use strict";
|
|
38346
|
-
|
|
39001
|
+
import_react50 = require("react");
|
|
38347
39002
|
import_react_dom = __toESM(require("react-dom"), 1);
|
|
38348
39003
|
init_styles();
|
|
38349
39004
|
init_utils();
|
|
@@ -38363,10 +39018,10 @@ var init_SwapMode = __esm({
|
|
|
38363
39018
|
init_useSwapExecution();
|
|
38364
39019
|
init_useForex();
|
|
38365
39020
|
init_SwapTokenSelect();
|
|
38366
|
-
init_SwapWalletSelector();
|
|
38367
39021
|
init_currency();
|
|
38368
|
-
|
|
38369
|
-
|
|
39022
|
+
init_components2();
|
|
39023
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
39024
|
+
ConfettiEffect3 = (0, import_react50.lazy)(
|
|
38370
39025
|
() => Promise.resolve().then(() => (init_ConfettiEffect(), ConfettiEffect_exports))
|
|
38371
39026
|
);
|
|
38372
39027
|
QUOTE_TTL = 60;
|
|
@@ -38407,7 +39062,7 @@ function WidgetContent({
|
|
|
38407
39062
|
const { transactionHash, transactionStatus } = useDepositTransaction();
|
|
38408
39063
|
const { resolvedTheme, toggleTheme } = useDepositUi();
|
|
38409
39064
|
useWalletExternalDisconnect(() => setCurrentStep("home"));
|
|
38410
|
-
(0,
|
|
39065
|
+
(0, import_react51.useEffect)(() => {
|
|
38411
39066
|
const state = {
|
|
38412
39067
|
currentStep,
|
|
38413
39068
|
amount,
|
|
@@ -38427,9 +39082,9 @@ function WidgetContent({
|
|
|
38427
39082
|
transactionStatus,
|
|
38428
39083
|
onStateChange
|
|
38429
39084
|
]);
|
|
38430
|
-
return /* @__PURE__ */ (0,
|
|
38431
|
-
showThemeToggle && /* @__PURE__ */ (0,
|
|
38432
|
-
/* @__PURE__ */ (0,
|
|
39085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
|
|
39086
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
|
|
39087
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38433
39088
|
WidgetRouter,
|
|
38434
39089
|
{
|
|
38435
39090
|
currentStep,
|
|
@@ -38450,8 +39105,8 @@ function WidgetInner({
|
|
|
38450
39105
|
const { transactionStatus } = useDepositTransaction();
|
|
38451
39106
|
const { resolvedTheme } = useDepositUi();
|
|
38452
39107
|
const { status, revalidate, errors } = useTrustware();
|
|
38453
|
-
const [showConfirmDialog, setShowConfirmDialog] = (0,
|
|
38454
|
-
const handleCloseRequest = (0,
|
|
39108
|
+
const [showConfirmDialog, setShowConfirmDialog] = (0, import_react51.useState)(false);
|
|
39109
|
+
const handleCloseRequest = (0, import_react51.useCallback)(() => {
|
|
38455
39110
|
if (ACTIVE_TRANSACTION_STATUSES.includes(transactionStatus)) {
|
|
38456
39111
|
setShowConfirmDialog(true);
|
|
38457
39112
|
} else {
|
|
@@ -38462,32 +39117,32 @@ function WidgetInner({
|
|
|
38462
39117
|
onClose?.();
|
|
38463
39118
|
}
|
|
38464
39119
|
}, [transactionStatus, onClose, resetState]);
|
|
38465
|
-
(0,
|
|
39120
|
+
(0, import_react51.useEffect)(() => {
|
|
38466
39121
|
closeRequestRef.current = handleCloseRequest;
|
|
38467
39122
|
}, [handleCloseRequest, closeRequestRef]);
|
|
38468
|
-
const handleConfirmClose = (0,
|
|
39123
|
+
const handleConfirmClose = (0, import_react51.useCallback)(() => {
|
|
38469
39124
|
setShowConfirmDialog(false);
|
|
38470
39125
|
onClose?.();
|
|
38471
39126
|
}, [onClose]);
|
|
38472
|
-
const handleCancelClose = (0,
|
|
39127
|
+
const handleCancelClose = (0, import_react51.useCallback)(() => {
|
|
38473
39128
|
setShowConfirmDialog(false);
|
|
38474
39129
|
}, []);
|
|
38475
39130
|
const effectiveTheme = resolvedTheme;
|
|
38476
39131
|
const isRefreshing = status === "initializing";
|
|
38477
39132
|
const initBlocked = status === "error";
|
|
38478
|
-
const handleRefresh = (0,
|
|
39133
|
+
const handleRefresh = (0, import_react51.useCallback)(() => {
|
|
38479
39134
|
revalidate?.();
|
|
38480
39135
|
}, [revalidate]);
|
|
38481
|
-
return /* @__PURE__ */ (0,
|
|
38482
|
-
/* @__PURE__ */ (0,
|
|
38483
|
-
/* @__PURE__ */ (0,
|
|
39136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
39137
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(WidgetContainer, { theme: effectiveTheme, style, children: [
|
|
39138
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38484
39139
|
WidgetContent,
|
|
38485
39140
|
{
|
|
38486
39141
|
onStateChange,
|
|
38487
39142
|
showThemeToggle
|
|
38488
39143
|
}
|
|
38489
39144
|
),
|
|
38490
|
-
/* @__PURE__ */ (0,
|
|
39145
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38491
39146
|
InitErrorOverlay,
|
|
38492
39147
|
{
|
|
38493
39148
|
open: initBlocked,
|
|
@@ -38498,7 +39153,7 @@ function WidgetInner({
|
|
|
38498
39153
|
}
|
|
38499
39154
|
)
|
|
38500
39155
|
] }),
|
|
38501
|
-
/* @__PURE__ */ (0,
|
|
39156
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38502
39157
|
ConfirmCloseDialog,
|
|
38503
39158
|
{
|
|
38504
39159
|
open: showConfirmDialog,
|
|
@@ -38509,11 +39164,11 @@ function WidgetInner({
|
|
|
38509
39164
|
)
|
|
38510
39165
|
] });
|
|
38511
39166
|
}
|
|
38512
|
-
var
|
|
39167
|
+
var import_react51, import_jsx_runtime60, widgetContentContainerStyle, themeToggleContainerStyle, TrustwareWidgetV2;
|
|
38513
39168
|
var init_TrustwareWidgetV2 = __esm({
|
|
38514
39169
|
"src/widget/TrustwareWidgetV2.tsx"() {
|
|
38515
39170
|
"use strict";
|
|
38516
|
-
|
|
39171
|
+
import_react51 = require("react");
|
|
38517
39172
|
init_utils();
|
|
38518
39173
|
init_styles();
|
|
38519
39174
|
init_DepositContext();
|
|
@@ -38526,7 +39181,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38526
39181
|
init_manager();
|
|
38527
39182
|
init_useTrustwareConfig();
|
|
38528
39183
|
init_swap();
|
|
38529
|
-
|
|
39184
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
38530
39185
|
widgetContentContainerStyle = {
|
|
38531
39186
|
position: "relative",
|
|
38532
39187
|
width: "100%",
|
|
@@ -38539,7 +39194,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38539
39194
|
right: spacing[3],
|
|
38540
39195
|
zIndex: 12
|
|
38541
39196
|
};
|
|
38542
|
-
TrustwareWidgetV2 = (0,
|
|
39197
|
+
TrustwareWidgetV2 = (0, import_react51.forwardRef)(function TrustwareWidgetV22({
|
|
38543
39198
|
theme,
|
|
38544
39199
|
style,
|
|
38545
39200
|
initialStep = "home",
|
|
@@ -38548,15 +39203,15 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38548
39203
|
onOpen,
|
|
38549
39204
|
showThemeToggle = true
|
|
38550
39205
|
}, ref) {
|
|
38551
|
-
const [isOpen, setIsOpen] = (0,
|
|
38552
|
-
const closeRequestRef = (0,
|
|
39206
|
+
const [isOpen, setIsOpen] = (0, import_react51.useState)(defaultOpen);
|
|
39207
|
+
const closeRequestRef = (0, import_react51.useRef)(null);
|
|
38553
39208
|
const config = useTrustwareConfig();
|
|
38554
39209
|
const effectiveInitialStep = initialStep;
|
|
38555
|
-
const open = (0,
|
|
39210
|
+
const open = (0, import_react51.useCallback)(() => {
|
|
38556
39211
|
setIsOpen(true);
|
|
38557
39212
|
onOpen?.();
|
|
38558
39213
|
}, [onOpen]);
|
|
38559
|
-
const close = (0,
|
|
39214
|
+
const close = (0, import_react51.useCallback)(() => {
|
|
38560
39215
|
if (closeRequestRef.current) {
|
|
38561
39216
|
closeRequestRef.current();
|
|
38562
39217
|
} else {
|
|
@@ -38564,11 +39219,11 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38564
39219
|
onClose?.();
|
|
38565
39220
|
}
|
|
38566
39221
|
}, [onClose]);
|
|
38567
|
-
const handleClose = (0,
|
|
39222
|
+
const handleClose = (0, import_react51.useCallback)(() => {
|
|
38568
39223
|
setIsOpen(false);
|
|
38569
39224
|
onClose?.();
|
|
38570
39225
|
}, [onClose]);
|
|
38571
|
-
(0,
|
|
39226
|
+
(0, import_react51.useImperativeHandle)(
|
|
38572
39227
|
ref,
|
|
38573
39228
|
() => ({
|
|
38574
39229
|
open,
|
|
@@ -38581,9 +39236,9 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38581
39236
|
return null;
|
|
38582
39237
|
}
|
|
38583
39238
|
if (config.features.swapMode) {
|
|
38584
|
-
return /* @__PURE__ */ (0,
|
|
39239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SwapMode, { theme, style });
|
|
38585
39240
|
}
|
|
38586
|
-
return /* @__PURE__ */ (0,
|
|
39241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38587
39242
|
WidgetInner,
|
|
38588
39243
|
{
|
|
38589
39244
|
theme,
|