@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/index.cjs
CHANGED
|
@@ -430,7 +430,7 @@ var init_constants = __esm({
|
|
|
430
430
|
"src/constants.ts"() {
|
|
431
431
|
"use strict";
|
|
432
432
|
SDK_NAME = "@trustware/sdk";
|
|
433
|
-
SDK_VERSION = "1.1.9-staging.
|
|
433
|
+
SDK_VERSION = "1.1.9-staging.5";
|
|
434
434
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
435
435
|
GTM_ID = "GTM-TZDGNCXB";
|
|
436
436
|
API_PREFIX = "/api";
|
|
@@ -16304,7 +16304,7 @@ function MobileWalletDropdownContent({
|
|
|
16304
16304
|
const mobileWallets = (0, import_react34.useMemo)(
|
|
16305
16305
|
() => WALLETS.filter((w) => {
|
|
16306
16306
|
if (w.id === "walletconnect") return true;
|
|
16307
|
-
const hasMobileLink = Boolean(w.deepLink
|
|
16307
|
+
const hasMobileLink = Boolean(w.deepLink);
|
|
16308
16308
|
if (!hasMobileLink) return false;
|
|
16309
16309
|
return w.ecosystem.trim().toLowerCase() === "multi" || w.ecosystem.trim().toLowerCase() === selectedNamespace.trim().toLowerCase();
|
|
16310
16310
|
}),
|
|
@@ -33619,8 +33619,81 @@ var init_SwapTokenSelect = __esm({
|
|
|
33619
33619
|
}
|
|
33620
33620
|
});
|
|
33621
33621
|
|
|
33622
|
-
// src/modes/swap/
|
|
33623
|
-
function
|
|
33622
|
+
// src/modes/swap/currency.ts
|
|
33623
|
+
function getCurrencyMeta(code) {
|
|
33624
|
+
return BY_CODE.get(code.toUpperCase()) ?? SUPPORTED_CURRENCIES[0];
|
|
33625
|
+
}
|
|
33626
|
+
function fmtCurrency(usdAmount, code, rate) {
|
|
33627
|
+
const meta = getCurrencyMeta(code);
|
|
33628
|
+
const local = usdAmount * rate;
|
|
33629
|
+
return meta.symbol + local.toFixed(meta.decimals);
|
|
33630
|
+
}
|
|
33631
|
+
var SUPPORTED_CURRENCIES, BY_CODE;
|
|
33632
|
+
var init_currency = __esm({
|
|
33633
|
+
"src/modes/swap/currency.ts"() {
|
|
33634
|
+
"use strict";
|
|
33635
|
+
SUPPORTED_CURRENCIES = [
|
|
33636
|
+
{ code: "USD", symbol: "$", name: "US Dollar", decimals: 2 },
|
|
33637
|
+
{ code: "EUR", symbol: "\u20AC", name: "Euro", decimals: 2 },
|
|
33638
|
+
{ code: "GBP", symbol: "\xA3", name: "British Pound", decimals: 2 },
|
|
33639
|
+
{ code: "CAD", symbol: "CA$", name: "Canadian Dollar", decimals: 2 },
|
|
33640
|
+
{ code: "AUD", symbol: "A$", name: "Australian Dollar", decimals: 2 },
|
|
33641
|
+
{ code: "JPY", symbol: "\xA5", name: "Japanese Yen", decimals: 0 },
|
|
33642
|
+
{ code: "CHF", symbol: "Fr", name: "Swiss Franc", decimals: 2 },
|
|
33643
|
+
{ code: "KRW", symbol: "\u20A9", name: "South Korean Won", decimals: 0 },
|
|
33644
|
+
{ code: "INR", symbol: "\u20B9", name: "Indian Rupee", decimals: 2 },
|
|
33645
|
+
{ code: "BRL", symbol: "R$", name: "Brazilian Real", decimals: 2 },
|
|
33646
|
+
{ code: "SGD", symbol: "S$", name: "Singapore Dollar", decimals: 2 },
|
|
33647
|
+
{ code: "MXN", symbol: "MX$", name: "Mexican Peso", decimals: 2 },
|
|
33648
|
+
{ code: "HKD", symbol: "HK$", name: "Hong Kong Dollar", decimals: 2 },
|
|
33649
|
+
{ code: "CNY", symbol: "\xA5", name: "Chinese Yuan", decimals: 2 },
|
|
33650
|
+
{ code: "ZAR", symbol: "R", name: "South African Rand", decimals: 2 },
|
|
33651
|
+
{ code: "TRY", symbol: "\u20BA", name: "Turkish Lira", decimals: 2 },
|
|
33652
|
+
{ code: "RUB", symbol: "\u20BD", name: "Russian Ruble", decimals: 2 },
|
|
33653
|
+
{
|
|
33654
|
+
code: "AED",
|
|
33655
|
+
symbol: "\u062F.\u0625",
|
|
33656
|
+
name: "United Arab Emirates Dirham",
|
|
33657
|
+
decimals: 2
|
|
33658
|
+
},
|
|
33659
|
+
{ code: "SAR", symbol: "\uFDFC", name: "Saudi Riyal", decimals: 2 },
|
|
33660
|
+
{ code: "QAR", symbol: "\uFDFC", name: "Qatari Riyal", decimals: 2 },
|
|
33661
|
+
{ code: "KWD", symbol: "\u062F.\u0643", name: "Kuwaiti Dinar", decimals: 3 },
|
|
33662
|
+
{ code: "OMR", symbol: "\u0631.\u0639.", name: "Omani Rial", decimals: 3 },
|
|
33663
|
+
{ code: "BHD", symbol: "\u0628.\u062F", name: "Bahraini Dinar", decimals: 3 },
|
|
33664
|
+
{ code: "JOD", symbol: "\u062F.\u0627", name: "Jordanian Dinar", decimals: 3 },
|
|
33665
|
+
{ code: "LYD", symbol: "\u0644.\u062F", name: "Libyan Dinar", decimals: 3 },
|
|
33666
|
+
{ code: "TND", symbol: "\u062F.\u062A", name: "Tunisian Dinar", decimals: 3 },
|
|
33667
|
+
{ code: "MAD", symbol: "\u062F.\u0645.", name: "Moroccan Dirham", decimals: 2 },
|
|
33668
|
+
{ code: "EGP", symbol: "\xA3", name: "Egyptian Pound", decimals: 2 },
|
|
33669
|
+
{ code: "NGN", symbol: "\u20A6", name: "Nigerian Naira", decimals: 2 },
|
|
33670
|
+
{ code: "GHS", symbol: "\u20B5", name: "Ghanaian Cedi", decimals: 2 },
|
|
33671
|
+
{ code: "KES", symbol: "KSh", name: "Kenyan Shilling", decimals: 2 },
|
|
33672
|
+
{ code: "TZS", symbol: "TSh", name: "Tanzanian Shilling", decimals: 2 },
|
|
33673
|
+
{ code: "UGX", symbol: "USh", name: "Ugandan Shilling", decimals: 2 },
|
|
33674
|
+
{ code: "RWF", symbol: "FRw", name: "Rwandan Franc", decimals: 2 },
|
|
33675
|
+
{ code: "MUR", symbol: "Rs", name: "Mauritian Rupee", decimals: 2 },
|
|
33676
|
+
{ code: "SCR", symbol: "SR", name: "Seychellois Rupee", decimals: 2 },
|
|
33677
|
+
{ code: "MGA", symbol: "Ar", name: "Malagasy Ariary", decimals: 2 },
|
|
33678
|
+
{
|
|
33679
|
+
code: "XAF",
|
|
33680
|
+
symbol: "FCFA",
|
|
33681
|
+
name: "Central African CFA Franc",
|
|
33682
|
+
decimals: 2
|
|
33683
|
+
},
|
|
33684
|
+
{ code: "XOF", symbol: "CFA", name: "West African CFA Franc", decimals: 2 },
|
|
33685
|
+
{ code: "XPF", symbol: "CFP", name: "CFP Franc", decimals: 2 },
|
|
33686
|
+
{ code: "XCD", symbol: "EC$", name: "East Caribbean Dollar", decimals: 2 },
|
|
33687
|
+
{ code: "XDR", symbol: "SDR", name: "Special Drawing Rights", decimals: 2 },
|
|
33688
|
+
{ code: "XAU", symbol: "Au", name: "Gold (troy ounce)", decimals: 2 },
|
|
33689
|
+
{ code: "XAG", symbol: "Ag", name: "Silver (troy ounce)", decimals: 2 }
|
|
33690
|
+
];
|
|
33691
|
+
BY_CODE = new Map(SUPPORTED_CURRENCIES.map((c) => [c.code, c]));
|
|
33692
|
+
}
|
|
33693
|
+
});
|
|
33694
|
+
|
|
33695
|
+
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorMobile.tsx
|
|
33696
|
+
function SwapWalletSelectorMobile({
|
|
33624
33697
|
walletStatus,
|
|
33625
33698
|
walletAddress,
|
|
33626
33699
|
connectWallet,
|
|
@@ -33632,19 +33705,625 @@ function SwapWalletSelector({
|
|
|
33632
33705
|
walletMetaId,
|
|
33633
33706
|
connectedVia,
|
|
33634
33707
|
disconnect
|
|
33708
|
+
// status,
|
|
33635
33709
|
} = useWalletInfo();
|
|
33636
33710
|
const walletConnectCfg = TrustwareConfigStore.peek()?.walletConnect;
|
|
33637
33711
|
const connectWC = useWalletConnectConnect(walletConnectCfg);
|
|
33638
33712
|
const [wcConnecting, setWcConnecting] = (0, import_react48.useState)(false);
|
|
33639
33713
|
const [connectingId, setConnectingId] = (0, import_react48.useState)(null);
|
|
33640
|
-
const [timerExpired, setTimerExpired] = (0, import_react48.useState)(false);
|
|
33641
33714
|
const [selectedNamespace, setSelectedNamespace] = (0, import_react48.useState)("evm");
|
|
33642
33715
|
const prevStatusRef = (0, import_react48.useRef)(walletStatus);
|
|
33716
|
+
const storeFallbackTimeoutRef = (0, import_react48.useRef)(
|
|
33717
|
+
null
|
|
33718
|
+
);
|
|
33643
33719
|
(0, import_react48.useEffect)(() => {
|
|
33720
|
+
const prev = prevStatusRef.current;
|
|
33721
|
+
if (prev !== walletStatus) {
|
|
33722
|
+
if (prev === "connecting" && (walletStatus === "connected" || walletStatus === "error")) {
|
|
33723
|
+
setConnectingId(null);
|
|
33724
|
+
}
|
|
33725
|
+
prevStatusRef.current = walletStatus;
|
|
33726
|
+
}
|
|
33727
|
+
}, [walletStatus]);
|
|
33728
|
+
(0, import_react48.useEffect)(() => {
|
|
33729
|
+
return () => {
|
|
33730
|
+
if (storeFallbackTimeoutRef.current !== null) {
|
|
33731
|
+
clearTimeout(storeFallbackTimeoutRef.current);
|
|
33732
|
+
}
|
|
33733
|
+
};
|
|
33734
|
+
}, []);
|
|
33735
|
+
const currentUrl = typeof window !== "undefined" ? window.location.href : "";
|
|
33736
|
+
const mobileWalletEntries = (0, import_react48.useMemo)(() => {
|
|
33737
|
+
return WALLETS.filter((w) => {
|
|
33738
|
+
if (w.id === "walletconnect") return false;
|
|
33739
|
+
const hasMobileLink = Boolean(w.deepLink);
|
|
33740
|
+
if (!hasMobileLink) return false;
|
|
33741
|
+
const ecosystem = w.ecosystem.trim().toLowerCase();
|
|
33742
|
+
return ecosystem === "multi" || ecosystem === selectedNamespace;
|
|
33743
|
+
}).map((meta) => ({
|
|
33744
|
+
meta,
|
|
33745
|
+
detectedWallet: detected.find((d) => d.meta.id === meta.id) ?? null
|
|
33746
|
+
}));
|
|
33747
|
+
}, [detected, selectedNamespace]);
|
|
33748
|
+
const handleDisconnect = () => {
|
|
33749
|
+
void disconnect();
|
|
33750
|
+
};
|
|
33751
|
+
const handleWalletConnect = async () => {
|
|
33752
|
+
if (wcConnecting) return;
|
|
33753
|
+
if (connectedVia === "walletconnect" && managerConnected) {
|
|
33754
|
+
return;
|
|
33755
|
+
}
|
|
33756
|
+
setWcConnecting(true);
|
|
33757
|
+
try {
|
|
33758
|
+
const { error } = await connectWC();
|
|
33759
|
+
if (error) {
|
|
33760
|
+
toast.error("WalletConnect Failed", error);
|
|
33761
|
+
}
|
|
33762
|
+
} catch (err) {
|
|
33763
|
+
const msg = err instanceof Error ? err.message : "WalletConnect failed";
|
|
33764
|
+
toast.error("WalletConnect Failed", msg);
|
|
33765
|
+
} finally {
|
|
33766
|
+
setWcConnecting(false);
|
|
33767
|
+
}
|
|
33768
|
+
};
|
|
33769
|
+
const goToAppStore = (meta) => {
|
|
33770
|
+
const isIos = /iPhone|iPad/i.test(navigator.userAgent);
|
|
33771
|
+
const storeUrl = isIos ? meta.ios : meta.android;
|
|
33772
|
+
if (storeUrl) window.location.assign(storeUrl);
|
|
33773
|
+
};
|
|
33774
|
+
const handleClick = async (entry) => {
|
|
33775
|
+
const { meta, detectedWallet } = entry;
|
|
33776
|
+
if (walletStatus === "connecting") return;
|
|
33777
|
+
if (managerConnected && walletMetaId === meta.id) {
|
|
33778
|
+
return;
|
|
33779
|
+
}
|
|
33780
|
+
if (detectedWallet) {
|
|
33781
|
+
setConnectingId(meta.id);
|
|
33782
|
+
try {
|
|
33783
|
+
await connectWallet(detectedWallet);
|
|
33784
|
+
} catch (err) {
|
|
33785
|
+
setConnectingId(null);
|
|
33786
|
+
const msg = err instanceof Error ? err.message : "Failed to connect wallet";
|
|
33787
|
+
if (msg.toLowerCase().includes("rejected") || msg.toLowerCase().includes("denied")) {
|
|
33788
|
+
toast.error(
|
|
33789
|
+
"Connection Declined",
|
|
33790
|
+
"You declined the connection request."
|
|
33791
|
+
);
|
|
33792
|
+
} else {
|
|
33793
|
+
toast.error("Connection Failed", msg);
|
|
33794
|
+
}
|
|
33795
|
+
}
|
|
33796
|
+
return;
|
|
33797
|
+
}
|
|
33798
|
+
if (meta.deepLink) {
|
|
33799
|
+
const deepLinkUrl = meta.deepLink(currentUrl);
|
|
33800
|
+
if (deepLinkUrl) {
|
|
33801
|
+
window.location.assign(deepLinkUrl);
|
|
33802
|
+
if (storeFallbackTimeoutRef.current !== null) {
|
|
33803
|
+
clearTimeout(storeFallbackTimeoutRef.current);
|
|
33804
|
+
}
|
|
33805
|
+
storeFallbackTimeoutRef.current = setTimeout(() => {
|
|
33806
|
+
storeFallbackTimeoutRef.current = null;
|
|
33807
|
+
goToAppStore(meta);
|
|
33808
|
+
}, 1500);
|
|
33809
|
+
return;
|
|
33810
|
+
}
|
|
33811
|
+
}
|
|
33812
|
+
goToAppStore(meta);
|
|
33813
|
+
};
|
|
33814
|
+
const tabs = [
|
|
33815
|
+
{ id: "evm", label: "EVM" },
|
|
33816
|
+
{ id: "solana", label: "Solana" }
|
|
33817
|
+
];
|
|
33818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33819
|
+
"div",
|
|
33820
|
+
{
|
|
33821
|
+
style: {
|
|
33822
|
+
display: "flex",
|
|
33823
|
+
flexDirection: "column",
|
|
33824
|
+
height: "100%"
|
|
33825
|
+
},
|
|
33826
|
+
children: [
|
|
33827
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33828
|
+
"div",
|
|
33829
|
+
{
|
|
33830
|
+
style: {
|
|
33831
|
+
display: "flex",
|
|
33832
|
+
alignItems: "center",
|
|
33833
|
+
padding: `${spacing[4]} ${spacing[4]}`,
|
|
33834
|
+
borderBottom: `1px solid ${colors.border}`
|
|
33835
|
+
},
|
|
33836
|
+
children: [
|
|
33837
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33838
|
+
"button",
|
|
33839
|
+
{
|
|
33840
|
+
type: "button",
|
|
33841
|
+
onClick: onBack,
|
|
33842
|
+
style: {
|
|
33843
|
+
padding: spacing[1],
|
|
33844
|
+
marginRight: spacing[2],
|
|
33845
|
+
borderRadius: borderRadius.lg,
|
|
33846
|
+
backgroundColor: "transparent",
|
|
33847
|
+
border: 0,
|
|
33848
|
+
cursor: "pointer"
|
|
33849
|
+
},
|
|
33850
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33851
|
+
"svg",
|
|
33852
|
+
{
|
|
33853
|
+
style: {
|
|
33854
|
+
width: "1.25rem",
|
|
33855
|
+
height: "1.25rem",
|
|
33856
|
+
color: colors.foreground
|
|
33857
|
+
},
|
|
33858
|
+
viewBox: "0 0 24 24",
|
|
33859
|
+
fill: "none",
|
|
33860
|
+
stroke: "currentColor",
|
|
33861
|
+
strokeWidth: 2,
|
|
33862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33863
|
+
"path",
|
|
33864
|
+
{
|
|
33865
|
+
strokeLinecap: "round",
|
|
33866
|
+
strokeLinejoin: "round",
|
|
33867
|
+
d: "M15 19l-7-7 7-7"
|
|
33868
|
+
}
|
|
33869
|
+
)
|
|
33870
|
+
}
|
|
33871
|
+
)
|
|
33872
|
+
}
|
|
33873
|
+
),
|
|
33874
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33875
|
+
"h1",
|
|
33876
|
+
{
|
|
33877
|
+
style: {
|
|
33878
|
+
flex: 1,
|
|
33879
|
+
fontSize: fontSize.lg,
|
|
33880
|
+
fontWeight: fontWeight.semibold,
|
|
33881
|
+
color: colors.foreground,
|
|
33882
|
+
textAlign: "center"
|
|
33883
|
+
},
|
|
33884
|
+
children: "Connect Wallet"
|
|
33885
|
+
}
|
|
33886
|
+
),
|
|
33887
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { width: "1.25rem", marginLeft: spacing[2] }, "aria-hidden": true })
|
|
33888
|
+
]
|
|
33889
|
+
}
|
|
33890
|
+
),
|
|
33891
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { padding: `${spacing[3]} ${spacing[4]} 0` }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33892
|
+
"div",
|
|
33893
|
+
{
|
|
33894
|
+
style: {
|
|
33895
|
+
display: "flex",
|
|
33896
|
+
alignItems: "center",
|
|
33897
|
+
borderRadius: borderRadius.lg,
|
|
33898
|
+
backgroundColor: colors.muted,
|
|
33899
|
+
padding: "3px",
|
|
33900
|
+
gap: "2px"
|
|
33901
|
+
},
|
|
33902
|
+
children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33903
|
+
"button",
|
|
33904
|
+
{
|
|
33905
|
+
onClick: () => setSelectedNamespace(t.id),
|
|
33906
|
+
style: {
|
|
33907
|
+
flex: 1,
|
|
33908
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
33909
|
+
fontSize: fontSize.sm,
|
|
33910
|
+
fontWeight: fontWeight.medium,
|
|
33911
|
+
borderRadius: borderRadius.md,
|
|
33912
|
+
background: selectedNamespace === t.id ? colors.card : "transparent",
|
|
33913
|
+
border: selectedNamespace === t.id ? `1px solid ${colors.border}` : "1px solid transparent",
|
|
33914
|
+
cursor: "pointer",
|
|
33915
|
+
transition: "all 0.15s",
|
|
33916
|
+
color: selectedNamespace === t.id ? colors.foreground : colors.mutedForeground,
|
|
33917
|
+
boxShadow: selectedNamespace === t.id ? "0 1px 3px rgba(0,0,0,0.08)" : "none",
|
|
33918
|
+
outline: "none"
|
|
33919
|
+
},
|
|
33920
|
+
children: t.label
|
|
33921
|
+
},
|
|
33922
|
+
t.id
|
|
33923
|
+
))
|
|
33924
|
+
}
|
|
33925
|
+
) }),
|
|
33926
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33927
|
+
"div",
|
|
33928
|
+
{
|
|
33929
|
+
style: {
|
|
33930
|
+
overflowY: "auto",
|
|
33931
|
+
padding: spacing[4],
|
|
33932
|
+
maxHeight: "31.25rem"
|
|
33933
|
+
},
|
|
33934
|
+
children: [
|
|
33935
|
+
mobileWalletEntries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
33936
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
33937
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33938
|
+
"h3",
|
|
33939
|
+
{
|
|
33940
|
+
style: {
|
|
33941
|
+
fontSize: fontSize.lg,
|
|
33942
|
+
fontWeight: fontWeight.semibold,
|
|
33943
|
+
color: colors.foreground,
|
|
33944
|
+
marginBottom: spacing[2]
|
|
33945
|
+
},
|
|
33946
|
+
children: "No Wallets Found"
|
|
33947
|
+
}
|
|
33948
|
+
),
|
|
33949
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33950
|
+
"p",
|
|
33951
|
+
{
|
|
33952
|
+
style: {
|
|
33953
|
+
fontSize: fontSize.sm,
|
|
33954
|
+
color: colors.mutedForeground,
|
|
33955
|
+
marginBottom: spacing[4]
|
|
33956
|
+
},
|
|
33957
|
+
children: "Please install a web3 wallet to continue."
|
|
33958
|
+
}
|
|
33959
|
+
),
|
|
33960
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33961
|
+
"a",
|
|
33962
|
+
{
|
|
33963
|
+
href: "https://metamask.io/download/",
|
|
33964
|
+
target: "_blank",
|
|
33965
|
+
rel: "noopener noreferrer",
|
|
33966
|
+
style: {
|
|
33967
|
+
display: "inline-flex",
|
|
33968
|
+
alignItems: "center",
|
|
33969
|
+
justifyContent: "center",
|
|
33970
|
+
padding: `${spacing[2]} ${spacing[4]}`,
|
|
33971
|
+
borderRadius: borderRadius.lg,
|
|
33972
|
+
backgroundColor: colors.primary,
|
|
33973
|
+
color: colors.primaryForeground,
|
|
33974
|
+
fontSize: fontSize.sm,
|
|
33975
|
+
fontWeight: fontWeight.medium,
|
|
33976
|
+
textDecoration: "none"
|
|
33977
|
+
},
|
|
33978
|
+
children: "Install MetaMask"
|
|
33979
|
+
}
|
|
33980
|
+
)
|
|
33981
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
33982
|
+
"div",
|
|
33983
|
+
{
|
|
33984
|
+
style: {
|
|
33985
|
+
display: "flex",
|
|
33986
|
+
flexDirection: "column",
|
|
33987
|
+
gap: spacing[3]
|
|
33988
|
+
},
|
|
33989
|
+
children: mobileWalletEntries.map((entry) => {
|
|
33990
|
+
const { meta } = entry;
|
|
33991
|
+
const isWalletConnected = managerConnected && walletMetaId === meta.id;
|
|
33992
|
+
const isConnecting = connectingId === meta.id && walletStatus === "connecting";
|
|
33993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
33994
|
+
"div",
|
|
33995
|
+
{
|
|
33996
|
+
style: mergeStyles(
|
|
33997
|
+
{
|
|
33998
|
+
width: "100%",
|
|
33999
|
+
display: "flex",
|
|
34000
|
+
alignItems: "center",
|
|
34001
|
+
gap: spacing[4],
|
|
34002
|
+
padding: spacing[4],
|
|
34003
|
+
borderRadius: borderRadius["2xl"],
|
|
34004
|
+
backgroundColor: colors.card,
|
|
34005
|
+
border: `1px solid ${colors.border}`
|
|
34006
|
+
},
|
|
34007
|
+
isWalletConnected && {
|
|
34008
|
+
boxShadow: `0 0 0 2px ${colors.primary}`,
|
|
34009
|
+
border: `1px solid ${colors.primary}`
|
|
34010
|
+
}
|
|
34011
|
+
),
|
|
34012
|
+
children: [
|
|
34013
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34014
|
+
"div",
|
|
34015
|
+
{
|
|
34016
|
+
style: {
|
|
34017
|
+
width: "3rem",
|
|
34018
|
+
height: "3rem",
|
|
34019
|
+
borderRadius: borderRadius.xl,
|
|
34020
|
+
backgroundColor: colors.muted,
|
|
34021
|
+
display: "flex",
|
|
34022
|
+
alignItems: "center",
|
|
34023
|
+
justifyContent: "center",
|
|
34024
|
+
overflow: "hidden",
|
|
34025
|
+
flexShrink: 0
|
|
34026
|
+
},
|
|
34027
|
+
children: meta.logo ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34028
|
+
"img",
|
|
34029
|
+
{
|
|
34030
|
+
src: meta.logo,
|
|
34031
|
+
alt: meta.name,
|
|
34032
|
+
style: {
|
|
34033
|
+
width: "2rem",
|
|
34034
|
+
height: "2rem",
|
|
34035
|
+
objectFit: "contain"
|
|
34036
|
+
}
|
|
34037
|
+
}
|
|
34038
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { fontSize: "1.5rem" }, children: meta.emoji || "\u{1F45B}" })
|
|
34039
|
+
}
|
|
34040
|
+
),
|
|
34041
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34042
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34043
|
+
"p",
|
|
34044
|
+
{
|
|
34045
|
+
style: {
|
|
34046
|
+
fontWeight: fontWeight.semibold,
|
|
34047
|
+
color: colors.foreground
|
|
34048
|
+
},
|
|
34049
|
+
children: meta.name
|
|
34050
|
+
}
|
|
34051
|
+
),
|
|
34052
|
+
isWalletConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
34053
|
+
"p",
|
|
34054
|
+
{
|
|
34055
|
+
style: {
|
|
34056
|
+
fontSize: fontSize.xs,
|
|
34057
|
+
color: colors.mutedForeground
|
|
34058
|
+
},
|
|
34059
|
+
children: [
|
|
34060
|
+
walletAddress.slice(0, 6),
|
|
34061
|
+
"...",
|
|
34062
|
+
walletAddress.slice(-4)
|
|
34063
|
+
]
|
|
34064
|
+
}
|
|
34065
|
+
)
|
|
34066
|
+
] }),
|
|
34067
|
+
isConnecting ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34068
|
+
"div",
|
|
34069
|
+
{
|
|
34070
|
+
style: {
|
|
34071
|
+
width: "1.25rem",
|
|
34072
|
+
height: "1.25rem",
|
|
34073
|
+
border: `2px solid ${colors.mutedForeground}`,
|
|
34074
|
+
borderTopColor: "transparent",
|
|
34075
|
+
borderRadius: "9999px",
|
|
34076
|
+
animation: "tw-spin 1s linear infinite",
|
|
34077
|
+
flexShrink: 0
|
|
34078
|
+
}
|
|
34079
|
+
}
|
|
34080
|
+
) : isWalletConnected ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34081
|
+
"button",
|
|
34082
|
+
{
|
|
34083
|
+
onClick: handleDisconnect,
|
|
34084
|
+
style: {
|
|
34085
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34086
|
+
borderRadius: "9999px",
|
|
34087
|
+
backgroundColor: "rgba(239,68,68,0.1)",
|
|
34088
|
+
color: "#ef4444",
|
|
34089
|
+
fontSize: fontSize.xs,
|
|
34090
|
+
fontWeight: fontWeight.medium,
|
|
34091
|
+
border: 0,
|
|
34092
|
+
cursor: "pointer",
|
|
34093
|
+
flexShrink: 0
|
|
34094
|
+
},
|
|
34095
|
+
children: "Disconnect"
|
|
34096
|
+
}
|
|
34097
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34098
|
+
"button",
|
|
34099
|
+
{
|
|
34100
|
+
onClick: () => void handleClick(entry),
|
|
34101
|
+
disabled: walletStatus === "connecting",
|
|
34102
|
+
style: mergeStyles(
|
|
34103
|
+
{
|
|
34104
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34105
|
+
borderRadius: "9999px",
|
|
34106
|
+
backgroundColor: "rgba(59,130,246,0.1)",
|
|
34107
|
+
color: colors.primary,
|
|
34108
|
+
fontSize: fontSize.xs,
|
|
34109
|
+
fontWeight: fontWeight.medium,
|
|
34110
|
+
border: 0,
|
|
34111
|
+
cursor: "pointer",
|
|
34112
|
+
flexShrink: 0
|
|
34113
|
+
},
|
|
34114
|
+
walletStatus === "connecting" && {
|
|
34115
|
+
opacity: 0.5,
|
|
34116
|
+
cursor: "not-allowed"
|
|
34117
|
+
}
|
|
34118
|
+
),
|
|
34119
|
+
children: "Connect"
|
|
34120
|
+
}
|
|
34121
|
+
)
|
|
34122
|
+
]
|
|
34123
|
+
},
|
|
34124
|
+
meta.id
|
|
34125
|
+
);
|
|
34126
|
+
})
|
|
34127
|
+
}
|
|
34128
|
+
),
|
|
34129
|
+
selectedNamespace === "evm" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
34130
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34131
|
+
"div",
|
|
34132
|
+
{
|
|
34133
|
+
style: {
|
|
34134
|
+
height: 1,
|
|
34135
|
+
backgroundColor: colors.border,
|
|
34136
|
+
margin: `${spacing[3]} 0`
|
|
34137
|
+
}
|
|
34138
|
+
}
|
|
34139
|
+
),
|
|
34140
|
+
(() => {
|
|
34141
|
+
const wcConnected = managerConnected && connectedVia === "walletconnect";
|
|
34142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
34143
|
+
"div",
|
|
34144
|
+
{
|
|
34145
|
+
style: mergeStyles(
|
|
34146
|
+
{
|
|
34147
|
+
width: "100%",
|
|
34148
|
+
display: "flex",
|
|
34149
|
+
alignItems: "center",
|
|
34150
|
+
gap: spacing[4],
|
|
34151
|
+
padding: spacing[4],
|
|
34152
|
+
borderRadius: borderRadius["2xl"],
|
|
34153
|
+
backgroundColor: colors.card,
|
|
34154
|
+
border: `1px solid ${colors.border}`,
|
|
34155
|
+
cursor: "pointer"
|
|
34156
|
+
},
|
|
34157
|
+
wcConnected && {
|
|
34158
|
+
boxShadow: `0 0 0 2px ${colors.primary}`,
|
|
34159
|
+
border: `1px solid ${colors.primary}`
|
|
34160
|
+
}
|
|
34161
|
+
),
|
|
34162
|
+
onClick: !wcConnected ? () => void handleWalletConnect() : void 0,
|
|
34163
|
+
children: [
|
|
34164
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34165
|
+
"div",
|
|
34166
|
+
{
|
|
34167
|
+
style: {
|
|
34168
|
+
width: "3rem",
|
|
34169
|
+
height: "3rem",
|
|
34170
|
+
borderRadius: borderRadius.xl,
|
|
34171
|
+
backgroundColor: colors.muted,
|
|
34172
|
+
display: "flex",
|
|
34173
|
+
alignItems: "center",
|
|
34174
|
+
justifyContent: "center",
|
|
34175
|
+
flexShrink: 0
|
|
34176
|
+
},
|
|
34177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34178
|
+
"svg",
|
|
34179
|
+
{
|
|
34180
|
+
style: {
|
|
34181
|
+
width: "1.5rem",
|
|
34182
|
+
height: "1.5rem",
|
|
34183
|
+
color: colors.blue[500]
|
|
34184
|
+
},
|
|
34185
|
+
viewBox: "0 0 24 24",
|
|
34186
|
+
fill: "currentColor",
|
|
34187
|
+
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" })
|
|
34188
|
+
}
|
|
34189
|
+
)
|
|
34190
|
+
}
|
|
34191
|
+
),
|
|
34192
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34193
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34194
|
+
"p",
|
|
34195
|
+
{
|
|
34196
|
+
style: {
|
|
34197
|
+
fontWeight: fontWeight.semibold,
|
|
34198
|
+
color: colors.foreground
|
|
34199
|
+
},
|
|
34200
|
+
children: "WalletConnect"
|
|
34201
|
+
}
|
|
34202
|
+
),
|
|
34203
|
+
wcConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
34204
|
+
"p",
|
|
34205
|
+
{
|
|
34206
|
+
style: {
|
|
34207
|
+
fontSize: fontSize.xs,
|
|
34208
|
+
color: colors.mutedForeground
|
|
34209
|
+
},
|
|
34210
|
+
children: [
|
|
34211
|
+
walletAddress.slice(0, 6),
|
|
34212
|
+
"...",
|
|
34213
|
+
walletAddress.slice(-4)
|
|
34214
|
+
]
|
|
34215
|
+
}
|
|
34216
|
+
)
|
|
34217
|
+
] }),
|
|
34218
|
+
wcConnecting ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34219
|
+
"div",
|
|
34220
|
+
{
|
|
34221
|
+
style: {
|
|
34222
|
+
width: "1.25rem",
|
|
34223
|
+
height: "1.25rem",
|
|
34224
|
+
border: `2px solid ${colors.mutedForeground}`,
|
|
34225
|
+
borderTopColor: "transparent",
|
|
34226
|
+
borderRadius: "9999px",
|
|
34227
|
+
animation: "tw-spin 1s linear infinite",
|
|
34228
|
+
flexShrink: 0
|
|
34229
|
+
}
|
|
34230
|
+
}
|
|
34231
|
+
) : wcConnected ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34232
|
+
"button",
|
|
34233
|
+
{
|
|
34234
|
+
onClick: (e2) => {
|
|
34235
|
+
e2.stopPropagation();
|
|
34236
|
+
handleDisconnect();
|
|
34237
|
+
},
|
|
34238
|
+
style: {
|
|
34239
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34240
|
+
borderRadius: "9999px",
|
|
34241
|
+
backgroundColor: "rgba(239,68,68,0.1)",
|
|
34242
|
+
color: "#ef4444",
|
|
34243
|
+
fontSize: fontSize.xs,
|
|
34244
|
+
fontWeight: fontWeight.medium,
|
|
34245
|
+
border: 0,
|
|
34246
|
+
cursor: "pointer",
|
|
34247
|
+
flexShrink: 0
|
|
34248
|
+
},
|
|
34249
|
+
children: "Disconnect"
|
|
34250
|
+
}
|
|
34251
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
34252
|
+
"button",
|
|
34253
|
+
{
|
|
34254
|
+
onClick: (e2) => {
|
|
34255
|
+
e2.stopPropagation();
|
|
34256
|
+
void handleWalletConnect();
|
|
34257
|
+
},
|
|
34258
|
+
disabled: wcConnecting,
|
|
34259
|
+
style: {
|
|
34260
|
+
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
34261
|
+
borderRadius: "9999px",
|
|
34262
|
+
backgroundColor: "rgba(59,130,246,0.1)",
|
|
34263
|
+
color: colors.primary,
|
|
34264
|
+
fontSize: fontSize.xs,
|
|
34265
|
+
fontWeight: fontWeight.medium,
|
|
34266
|
+
border: 0,
|
|
34267
|
+
cursor: "pointer",
|
|
34268
|
+
flexShrink: 0
|
|
34269
|
+
},
|
|
34270
|
+
children: "Connect"
|
|
34271
|
+
}
|
|
34272
|
+
)
|
|
34273
|
+
]
|
|
34274
|
+
}
|
|
34275
|
+
);
|
|
34276
|
+
})()
|
|
34277
|
+
] })
|
|
34278
|
+
]
|
|
34279
|
+
}
|
|
34280
|
+
)
|
|
34281
|
+
]
|
|
34282
|
+
}
|
|
34283
|
+
);
|
|
34284
|
+
}
|
|
34285
|
+
var import_react48, import_jsx_runtime56, SwapWalletSelectorMobile_default;
|
|
34286
|
+
var init_SwapWalletSelectorMobile = __esm({
|
|
34287
|
+
"src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorMobile.tsx"() {
|
|
34288
|
+
"use strict";
|
|
34289
|
+
import_react48 = require("react");
|
|
34290
|
+
init_styles();
|
|
34291
|
+
init_utils2();
|
|
34292
|
+
init_wallets();
|
|
34293
|
+
init_wallets();
|
|
34294
|
+
init_config2();
|
|
34295
|
+
init_Toast();
|
|
34296
|
+
import_jsx_runtime56 = require("react/jsx-runtime");
|
|
34297
|
+
SwapWalletSelectorMobile_default = SwapWalletSelectorMobile;
|
|
34298
|
+
}
|
|
34299
|
+
});
|
|
34300
|
+
|
|
34301
|
+
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorDesktop.tsx
|
|
34302
|
+
function SwapWalletSelectorDesktop({
|
|
34303
|
+
walletStatus,
|
|
34304
|
+
walletAddress,
|
|
34305
|
+
connectWallet,
|
|
34306
|
+
onBack
|
|
34307
|
+
}) {
|
|
34308
|
+
const { detected } = useWalletDetection();
|
|
34309
|
+
const {
|
|
34310
|
+
isConnected: managerConnected,
|
|
34311
|
+
walletMetaId,
|
|
34312
|
+
connectedVia,
|
|
34313
|
+
disconnect
|
|
34314
|
+
} = useWalletInfo();
|
|
34315
|
+
const walletConnectCfg = TrustwareConfigStore.peek()?.walletConnect;
|
|
34316
|
+
const connectWC = useWalletConnectConnect(walletConnectCfg);
|
|
34317
|
+
const [wcConnecting, setWcConnecting] = (0, import_react49.useState)(false);
|
|
34318
|
+
const [connectingId, setConnectingId] = (0, import_react49.useState)(null);
|
|
34319
|
+
const [timerExpired, setTimerExpired] = (0, import_react49.useState)(false);
|
|
34320
|
+
const [selectedNamespace, setSelectedNamespace] = (0, import_react49.useState)("evm");
|
|
34321
|
+
const prevStatusRef = (0, import_react49.useRef)(walletStatus);
|
|
34322
|
+
(0, import_react49.useEffect)(() => {
|
|
33644
34323
|
const t = setTimeout(() => setTimerExpired(true), 450);
|
|
33645
34324
|
return () => clearTimeout(t);
|
|
33646
34325
|
}, []);
|
|
33647
|
-
(0,
|
|
34326
|
+
(0, import_react49.useEffect)(() => {
|
|
33648
34327
|
const prev = prevStatusRef.current;
|
|
33649
34328
|
if (prev !== walletStatus) {
|
|
33650
34329
|
if (prev === "connecting" && (walletStatus === "connected" || walletStatus === "error")) {
|
|
@@ -33653,7 +34332,7 @@ function SwapWalletSelector({
|
|
|
33653
34332
|
prevStatusRef.current = walletStatus;
|
|
33654
34333
|
}
|
|
33655
34334
|
}, [walletStatus]);
|
|
33656
|
-
const filteredWallets = (0,
|
|
34335
|
+
const filteredWallets = (0, import_react49.useMemo)(
|
|
33657
34336
|
() => detected.filter(
|
|
33658
34337
|
(w) => (w.meta?.ecosystem ?? "").toLowerCase() === selectedNamespace
|
|
33659
34338
|
),
|
|
@@ -33712,8 +34391,8 @@ function SwapWalletSelector({
|
|
|
33712
34391
|
{ id: "evm", label: "EVM" },
|
|
33713
34392
|
{ id: "solana", label: "Solana" }
|
|
33714
34393
|
];
|
|
33715
|
-
return /* @__PURE__ */ (0,
|
|
33716
|
-
/* @__PURE__ */ (0,
|
|
34394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
34395
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33717
34396
|
"div",
|
|
33718
34397
|
{
|
|
33719
34398
|
style: {
|
|
@@ -33723,7 +34402,7 @@ function SwapWalletSelector({
|
|
|
33723
34402
|
borderBottom: `1px solid ${colors.border}`
|
|
33724
34403
|
},
|
|
33725
34404
|
children: [
|
|
33726
|
-
/* @__PURE__ */ (0,
|
|
34405
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33727
34406
|
"button",
|
|
33728
34407
|
{
|
|
33729
34408
|
type: "button",
|
|
@@ -33736,7 +34415,7 @@ function SwapWalletSelector({
|
|
|
33736
34415
|
border: 0,
|
|
33737
34416
|
cursor: "pointer"
|
|
33738
34417
|
},
|
|
33739
|
-
children: /* @__PURE__ */ (0,
|
|
34418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33740
34419
|
"svg",
|
|
33741
34420
|
{
|
|
33742
34421
|
style: {
|
|
@@ -33748,7 +34427,7 @@ function SwapWalletSelector({
|
|
|
33748
34427
|
fill: "none",
|
|
33749
34428
|
stroke: "currentColor",
|
|
33750
34429
|
strokeWidth: 2,
|
|
33751
|
-
children: /* @__PURE__ */ (0,
|
|
34430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33752
34431
|
"path",
|
|
33753
34432
|
{
|
|
33754
34433
|
strokeLinecap: "round",
|
|
@@ -33760,7 +34439,7 @@ function SwapWalletSelector({
|
|
|
33760
34439
|
)
|
|
33761
34440
|
}
|
|
33762
34441
|
),
|
|
33763
|
-
/* @__PURE__ */ (0,
|
|
34442
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33764
34443
|
"h1",
|
|
33765
34444
|
{
|
|
33766
34445
|
style: {
|
|
@@ -33773,7 +34452,7 @@ function SwapWalletSelector({
|
|
|
33773
34452
|
children: "Connect Wallet"
|
|
33774
34453
|
}
|
|
33775
34454
|
),
|
|
33776
|
-
/* @__PURE__ */ (0,
|
|
34455
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33777
34456
|
"div",
|
|
33778
34457
|
{
|
|
33779
34458
|
style: {
|
|
@@ -33784,7 +34463,7 @@ function SwapWalletSelector({
|
|
|
33784
34463
|
padding: "3px",
|
|
33785
34464
|
gap: "2px"
|
|
33786
34465
|
},
|
|
33787
|
-
children: tabs.map((t) => /* @__PURE__ */ (0,
|
|
34466
|
+
children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33788
34467
|
"button",
|
|
33789
34468
|
{
|
|
33790
34469
|
onClick: () => setSelectedNamespace(t.id),
|
|
@@ -33810,8 +34489,8 @@ function SwapWalletSelector({
|
|
|
33810
34489
|
]
|
|
33811
34490
|
}
|
|
33812
34491
|
),
|
|
33813
|
-
/* @__PURE__ */ (0,
|
|
33814
|
-
isDetecting ? /* @__PURE__ */ (0,
|
|
34492
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { padding: spacing[4] }, children: [
|
|
34493
|
+
isDetecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33815
34494
|
"div",
|
|
33816
34495
|
{
|
|
33817
34496
|
style: {
|
|
@@ -33820,7 +34499,7 @@ function SwapWalletSelector({
|
|
|
33820
34499
|
gap: spacing[3]
|
|
33821
34500
|
},
|
|
33822
34501
|
children: [
|
|
33823
|
-
[1, 2].map((i) => /* @__PURE__ */ (0,
|
|
34502
|
+
[1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33824
34503
|
"div",
|
|
33825
34504
|
{
|
|
33826
34505
|
style: {
|
|
@@ -33833,7 +34512,7 @@ function SwapWalletSelector({
|
|
|
33833
34512
|
animation: "tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
33834
34513
|
},
|
|
33835
34514
|
children: [
|
|
33836
|
-
/* @__PURE__ */ (0,
|
|
34515
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33837
34516
|
"div",
|
|
33838
34517
|
{
|
|
33839
34518
|
style: {
|
|
@@ -33844,7 +34523,7 @@ function SwapWalletSelector({
|
|
|
33844
34523
|
}
|
|
33845
34524
|
}
|
|
33846
34525
|
),
|
|
33847
|
-
/* @__PURE__ */ (0,
|
|
34526
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33848
34527
|
"div",
|
|
33849
34528
|
{
|
|
33850
34529
|
style: {
|
|
@@ -33859,7 +34538,7 @@ function SwapWalletSelector({
|
|
|
33859
34538
|
},
|
|
33860
34539
|
i
|
|
33861
34540
|
)),
|
|
33862
|
-
/* @__PURE__ */ (0,
|
|
34541
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33863
34542
|
"p",
|
|
33864
34543
|
{
|
|
33865
34544
|
style: {
|
|
@@ -33873,9 +34552,9 @@ function SwapWalletSelector({
|
|
|
33873
34552
|
)
|
|
33874
34553
|
]
|
|
33875
34554
|
}
|
|
33876
|
-
) : filteredWallets.length === 0 ? /* @__PURE__ */ (0,
|
|
33877
|
-
/* @__PURE__ */ (0,
|
|
33878
|
-
/* @__PURE__ */ (0,
|
|
34555
|
+
) : filteredWallets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
34556
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
34557
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33879
34558
|
"h3",
|
|
33880
34559
|
{
|
|
33881
34560
|
style: {
|
|
@@ -33887,7 +34566,7 @@ function SwapWalletSelector({
|
|
|
33887
34566
|
children: "No Wallets Found"
|
|
33888
34567
|
}
|
|
33889
34568
|
),
|
|
33890
|
-
/* @__PURE__ */ (0,
|
|
34569
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33891
34570
|
"p",
|
|
33892
34571
|
{
|
|
33893
34572
|
style: {
|
|
@@ -33898,7 +34577,7 @@ function SwapWalletSelector({
|
|
|
33898
34577
|
children: "Please install a web3 wallet to continue."
|
|
33899
34578
|
}
|
|
33900
34579
|
),
|
|
33901
|
-
/* @__PURE__ */ (0,
|
|
34580
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33902
34581
|
"a",
|
|
33903
34582
|
{
|
|
33904
34583
|
href: "https://metamask.io/download/",
|
|
@@ -33919,7 +34598,7 @@ function SwapWalletSelector({
|
|
|
33919
34598
|
children: "Install MetaMask"
|
|
33920
34599
|
}
|
|
33921
34600
|
)
|
|
33922
|
-
] }) : /* @__PURE__ */ (0,
|
|
34601
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33923
34602
|
"div",
|
|
33924
34603
|
{
|
|
33925
34604
|
style: {
|
|
@@ -33930,7 +34609,7 @@ function SwapWalletSelector({
|
|
|
33930
34609
|
children: filteredWallets.map((wallet) => {
|
|
33931
34610
|
const isWalletConnected = managerConnected && walletMetaId === wallet.meta.id;
|
|
33932
34611
|
const isConnecting = connectingId === wallet.meta.id && walletStatus === "connecting";
|
|
33933
|
-
return /* @__PURE__ */ (0,
|
|
34612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
33934
34613
|
"div",
|
|
33935
34614
|
{
|
|
33936
34615
|
style: mergeStyles(
|
|
@@ -33950,7 +34629,7 @@ function SwapWalletSelector({
|
|
|
33950
34629
|
}
|
|
33951
34630
|
),
|
|
33952
34631
|
children: [
|
|
33953
|
-
/* @__PURE__ */ (0,
|
|
34632
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33954
34633
|
"div",
|
|
33955
34634
|
{
|
|
33956
34635
|
style: {
|
|
@@ -33964,7 +34643,7 @@ function SwapWalletSelector({
|
|
|
33964
34643
|
overflow: "hidden",
|
|
33965
34644
|
flexShrink: 0
|
|
33966
34645
|
},
|
|
33967
|
-
children: wallet.meta.logo ? /* @__PURE__ */ (0,
|
|
34646
|
+
children: wallet.meta.logo ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33968
34647
|
"img",
|
|
33969
34648
|
{
|
|
33970
34649
|
src: wallet.meta.logo,
|
|
@@ -33975,7 +34654,7 @@ function SwapWalletSelector({
|
|
|
33975
34654
|
objectFit: "contain"
|
|
33976
34655
|
}
|
|
33977
34656
|
}
|
|
33978
|
-
) : wallet.detail?.info?.icon ? /* @__PURE__ */ (0,
|
|
34657
|
+
) : wallet.detail?.info?.icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33979
34658
|
"img",
|
|
33980
34659
|
{
|
|
33981
34660
|
src: wallet.detail.info.icon,
|
|
@@ -33986,11 +34665,11 @@ function SwapWalletSelector({
|
|
|
33986
34665
|
objectFit: "contain"
|
|
33987
34666
|
}
|
|
33988
34667
|
}
|
|
33989
|
-
) : /* @__PURE__ */ (0,
|
|
34668
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { fontSize: "1.5rem" }, children: wallet.meta.emoji || "\u{1F45B}" })
|
|
33990
34669
|
}
|
|
33991
34670
|
),
|
|
33992
|
-
/* @__PURE__ */ (0,
|
|
33993
|
-
/* @__PURE__ */ (0,
|
|
34671
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34672
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
33994
34673
|
"p",
|
|
33995
34674
|
{
|
|
33996
34675
|
style: {
|
|
@@ -34000,7 +34679,7 @@ function SwapWalletSelector({
|
|
|
34000
34679
|
children: wallet.meta.name
|
|
34001
34680
|
}
|
|
34002
34681
|
),
|
|
34003
|
-
isWalletConnected && walletAddress && /* @__PURE__ */ (0,
|
|
34682
|
+
isWalletConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
34004
34683
|
"p",
|
|
34005
34684
|
{
|
|
34006
34685
|
style: {
|
|
@@ -34015,7 +34694,7 @@ function SwapWalletSelector({
|
|
|
34015
34694
|
}
|
|
34016
34695
|
)
|
|
34017
34696
|
] }),
|
|
34018
|
-
isConnecting ? /* @__PURE__ */ (0,
|
|
34697
|
+
isConnecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34019
34698
|
"div",
|
|
34020
34699
|
{
|
|
34021
34700
|
style: {
|
|
@@ -34028,7 +34707,7 @@ function SwapWalletSelector({
|
|
|
34028
34707
|
flexShrink: 0
|
|
34029
34708
|
}
|
|
34030
34709
|
}
|
|
34031
|
-
) : isWalletConnected ? /* @__PURE__ */ (0,
|
|
34710
|
+
) : isWalletConnected ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34032
34711
|
"button",
|
|
34033
34712
|
{
|
|
34034
34713
|
onClick: handleDisconnect,
|
|
@@ -34045,7 +34724,7 @@ function SwapWalletSelector({
|
|
|
34045
34724
|
},
|
|
34046
34725
|
children: "Disconnect"
|
|
34047
34726
|
}
|
|
34048
|
-
) : /* @__PURE__ */ (0,
|
|
34727
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34049
34728
|
"button",
|
|
34050
34729
|
{
|
|
34051
34730
|
onClick: () => void handleClick(wallet),
|
|
@@ -34077,8 +34756,8 @@ function SwapWalletSelector({
|
|
|
34077
34756
|
})
|
|
34078
34757
|
}
|
|
34079
34758
|
),
|
|
34080
|
-
selectedNamespace === "evm" && /* @__PURE__ */ (0,
|
|
34081
|
-
/* @__PURE__ */ (0,
|
|
34759
|
+
selectedNamespace === "evm" && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
34760
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34082
34761
|
"div",
|
|
34083
34762
|
{
|
|
34084
34763
|
style: {
|
|
@@ -34090,7 +34769,7 @@ function SwapWalletSelector({
|
|
|
34090
34769
|
),
|
|
34091
34770
|
(() => {
|
|
34092
34771
|
const wcConnected = managerConnected && connectedVia === "walletconnect";
|
|
34093
|
-
return /* @__PURE__ */ (0,
|
|
34772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
34094
34773
|
"div",
|
|
34095
34774
|
{
|
|
34096
34775
|
style: mergeStyles(
|
|
@@ -34112,7 +34791,7 @@ function SwapWalletSelector({
|
|
|
34112
34791
|
),
|
|
34113
34792
|
onClick: !wcConnected ? () => void handleWalletConnect() : void 0,
|
|
34114
34793
|
children: [
|
|
34115
|
-
/* @__PURE__ */ (0,
|
|
34794
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34116
34795
|
"div",
|
|
34117
34796
|
{
|
|
34118
34797
|
style: {
|
|
@@ -34125,7 +34804,7 @@ function SwapWalletSelector({
|
|
|
34125
34804
|
justifyContent: "center",
|
|
34126
34805
|
flexShrink: 0
|
|
34127
34806
|
},
|
|
34128
|
-
children: /* @__PURE__ */ (0,
|
|
34807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34129
34808
|
"svg",
|
|
34130
34809
|
{
|
|
34131
34810
|
style: {
|
|
@@ -34135,13 +34814,13 @@ function SwapWalletSelector({
|
|
|
34135
34814
|
},
|
|
34136
34815
|
viewBox: "0 0 24 24",
|
|
34137
34816
|
fill: "currentColor",
|
|
34138
|
-
children: /* @__PURE__ */ (0,
|
|
34817
|
+
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" })
|
|
34139
34818
|
}
|
|
34140
34819
|
)
|
|
34141
34820
|
}
|
|
34142
34821
|
),
|
|
34143
|
-
/* @__PURE__ */ (0,
|
|
34144
|
-
/* @__PURE__ */ (0,
|
|
34822
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34823
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34145
34824
|
"p",
|
|
34146
34825
|
{
|
|
34147
34826
|
style: {
|
|
@@ -34151,7 +34830,7 @@ function SwapWalletSelector({
|
|
|
34151
34830
|
children: "WalletConnect"
|
|
34152
34831
|
}
|
|
34153
34832
|
),
|
|
34154
|
-
wcConnected && walletAddress && /* @__PURE__ */ (0,
|
|
34833
|
+
wcConnected && walletAddress && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
34155
34834
|
"p",
|
|
34156
34835
|
{
|
|
34157
34836
|
style: {
|
|
@@ -34166,7 +34845,7 @@ function SwapWalletSelector({
|
|
|
34166
34845
|
}
|
|
34167
34846
|
)
|
|
34168
34847
|
] }),
|
|
34169
|
-
wcConnecting ? /* @__PURE__ */ (0,
|
|
34848
|
+
wcConnecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34170
34849
|
"div",
|
|
34171
34850
|
{
|
|
34172
34851
|
style: {
|
|
@@ -34179,7 +34858,7 @@ function SwapWalletSelector({
|
|
|
34179
34858
|
flexShrink: 0
|
|
34180
34859
|
}
|
|
34181
34860
|
}
|
|
34182
|
-
) : wcConnected ? /* @__PURE__ */ (0,
|
|
34861
|
+
) : wcConnected ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34183
34862
|
"button",
|
|
34184
34863
|
{
|
|
34185
34864
|
onClick: (e2) => {
|
|
@@ -34199,7 +34878,7 @@ function SwapWalletSelector({
|
|
|
34199
34878
|
},
|
|
34200
34879
|
children: "Disconnect"
|
|
34201
34880
|
}
|
|
34202
|
-
) : /* @__PURE__ */ (0,
|
|
34881
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
34203
34882
|
"button",
|
|
34204
34883
|
{
|
|
34205
34884
|
onClick: (e2) => {
|
|
@@ -34229,90 +34908,66 @@ function SwapWalletSelector({
|
|
|
34229
34908
|
] })
|
|
34230
34909
|
] });
|
|
34231
34910
|
}
|
|
34232
|
-
var
|
|
34233
|
-
var
|
|
34234
|
-
"src/modes/swap/components/SwapWalletSelector.tsx"() {
|
|
34911
|
+
var import_react49, import_jsx_runtime57;
|
|
34912
|
+
var init_SwapWalletSelectorDesktop = __esm({
|
|
34913
|
+
"src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorDesktop.tsx"() {
|
|
34235
34914
|
"use strict";
|
|
34236
|
-
|
|
34915
|
+
import_react49 = require("react");
|
|
34237
34916
|
init_styles();
|
|
34238
34917
|
init_utils2();
|
|
34239
34918
|
init_wallets();
|
|
34240
34919
|
init_config2();
|
|
34241
34920
|
init_Toast();
|
|
34242
|
-
|
|
34921
|
+
import_jsx_runtime57 = require("react/jsx-runtime");
|
|
34243
34922
|
}
|
|
34244
34923
|
});
|
|
34245
34924
|
|
|
34246
|
-
// src/modes/swap/
|
|
34247
|
-
function
|
|
34248
|
-
|
|
34249
|
-
|
|
34250
|
-
|
|
34251
|
-
|
|
34252
|
-
|
|
34253
|
-
|
|
34254
|
-
|
|
34255
|
-
|
|
34256
|
-
|
|
34257
|
-
"src/modes/swap/currency.ts"() {
|
|
34258
|
-
"use strict";
|
|
34259
|
-
SUPPORTED_CURRENCIES = [
|
|
34260
|
-
{ code: "USD", symbol: "$", name: "US Dollar", decimals: 2 },
|
|
34261
|
-
{ code: "EUR", symbol: "\u20AC", name: "Euro", decimals: 2 },
|
|
34262
|
-
{ code: "GBP", symbol: "\xA3", name: "British Pound", decimals: 2 },
|
|
34263
|
-
{ code: "CAD", symbol: "CA$", name: "Canadian Dollar", decimals: 2 },
|
|
34264
|
-
{ code: "AUD", symbol: "A$", name: "Australian Dollar", decimals: 2 },
|
|
34265
|
-
{ code: "JPY", symbol: "\xA5", name: "Japanese Yen", decimals: 0 },
|
|
34266
|
-
{ code: "CHF", symbol: "Fr", name: "Swiss Franc", decimals: 2 },
|
|
34267
|
-
{ code: "KRW", symbol: "\u20A9", name: "South Korean Won", decimals: 0 },
|
|
34268
|
-
{ code: "INR", symbol: "\u20B9", name: "Indian Rupee", decimals: 2 },
|
|
34269
|
-
{ code: "BRL", symbol: "R$", name: "Brazilian Real", decimals: 2 },
|
|
34270
|
-
{ code: "SGD", symbol: "S$", name: "Singapore Dollar", decimals: 2 },
|
|
34271
|
-
{ code: "MXN", symbol: "MX$", name: "Mexican Peso", decimals: 2 },
|
|
34272
|
-
{ code: "HKD", symbol: "HK$", name: "Hong Kong Dollar", decimals: 2 },
|
|
34273
|
-
{ code: "CNY", symbol: "\xA5", name: "Chinese Yuan", decimals: 2 },
|
|
34274
|
-
{ code: "ZAR", symbol: "R", name: "South African Rand", decimals: 2 },
|
|
34275
|
-
{ code: "TRY", symbol: "\u20BA", name: "Turkish Lira", decimals: 2 },
|
|
34276
|
-
{ code: "RUB", symbol: "\u20BD", name: "Russian Ruble", decimals: 2 },
|
|
34925
|
+
// src/modes/swap/components/SwapWalletSelector/index.tsx
|
|
34926
|
+
function SwapWalletSelector({
|
|
34927
|
+
walletStatus,
|
|
34928
|
+
walletAddress,
|
|
34929
|
+
connectWallet,
|
|
34930
|
+
onBack
|
|
34931
|
+
}) {
|
|
34932
|
+
const isMobile = useIsMobile();
|
|
34933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
34934
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
34935
|
+
SwapWalletSelectorMobile_default,
|
|
34277
34936
|
{
|
|
34278
|
-
|
|
34279
|
-
|
|
34280
|
-
|
|
34281
|
-
|
|
34282
|
-
}
|
|
34283
|
-
|
|
34284
|
-
|
|
34285
|
-
|
|
34286
|
-
{ code: "OMR", symbol: "\u0631.\u0639.", name: "Omani Rial", decimals: 3 },
|
|
34287
|
-
{ code: "BHD", symbol: "\u0628.\u062F", name: "Bahraini Dinar", decimals: 3 },
|
|
34288
|
-
{ code: "JOD", symbol: "\u062F.\u0627", name: "Jordanian Dinar", decimals: 3 },
|
|
34289
|
-
{ code: "LYD", symbol: "\u0644.\u062F", name: "Libyan Dinar", decimals: 3 },
|
|
34290
|
-
{ code: "TND", symbol: "\u062F.\u062A", name: "Tunisian Dinar", decimals: 3 },
|
|
34291
|
-
{ code: "MAD", symbol: "\u062F.\u0645.", name: "Moroccan Dirham", decimals: 2 },
|
|
34292
|
-
{ code: "EGP", symbol: "\xA3", name: "Egyptian Pound", decimals: 2 },
|
|
34293
|
-
{ code: "NGN", symbol: "\u20A6", name: "Nigerian Naira", decimals: 2 },
|
|
34294
|
-
{ code: "GHS", symbol: "\u20B5", name: "Ghanaian Cedi", decimals: 2 },
|
|
34295
|
-
{ code: "KES", symbol: "KSh", name: "Kenyan Shilling", decimals: 2 },
|
|
34296
|
-
{ code: "TZS", symbol: "TSh", name: "Tanzanian Shilling", decimals: 2 },
|
|
34297
|
-
{ code: "UGX", symbol: "USh", name: "Ugandan Shilling", decimals: 2 },
|
|
34298
|
-
{ code: "RWF", symbol: "FRw", name: "Rwandan Franc", decimals: 2 },
|
|
34299
|
-
{ code: "MUR", symbol: "Rs", name: "Mauritian Rupee", decimals: 2 },
|
|
34300
|
-
{ code: "SCR", symbol: "SR", name: "Seychellois Rupee", decimals: 2 },
|
|
34301
|
-
{ code: "MGA", symbol: "Ar", name: "Malagasy Ariary", decimals: 2 },
|
|
34937
|
+
walletStatus,
|
|
34938
|
+
walletAddress,
|
|
34939
|
+
connectWallet,
|
|
34940
|
+
onBack
|
|
34941
|
+
}
|
|
34942
|
+
),
|
|
34943
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
34944
|
+
SwapWalletSelectorDesktop,
|
|
34302
34945
|
{
|
|
34303
|
-
|
|
34304
|
-
|
|
34305
|
-
|
|
34306
|
-
|
|
34307
|
-
}
|
|
34308
|
-
|
|
34309
|
-
|
|
34310
|
-
|
|
34311
|
-
|
|
34312
|
-
|
|
34313
|
-
|
|
34314
|
-
|
|
34315
|
-
|
|
34946
|
+
walletStatus,
|
|
34947
|
+
walletAddress,
|
|
34948
|
+
connectWallet,
|
|
34949
|
+
onBack
|
|
34950
|
+
}
|
|
34951
|
+
)
|
|
34952
|
+
] });
|
|
34953
|
+
}
|
|
34954
|
+
var import_jsx_runtime58, SwapWalletSelector_default;
|
|
34955
|
+
var init_SwapWalletSelector = __esm({
|
|
34956
|
+
"src/modes/swap/components/SwapWalletSelector/index.tsx"() {
|
|
34957
|
+
"use strict";
|
|
34958
|
+
init_detect();
|
|
34959
|
+
init_SwapWalletSelectorMobile();
|
|
34960
|
+
init_SwapWalletSelectorDesktop();
|
|
34961
|
+
import_jsx_runtime58 = require("react/jsx-runtime");
|
|
34962
|
+
SwapWalletSelector_default = SwapWalletSelector;
|
|
34963
|
+
}
|
|
34964
|
+
});
|
|
34965
|
+
|
|
34966
|
+
// src/modes/swap/components/index.ts
|
|
34967
|
+
var init_components2 = __esm({
|
|
34968
|
+
"src/modes/swap/components/index.ts"() {
|
|
34969
|
+
"use strict";
|
|
34970
|
+
init_SwapWalletSelector();
|
|
34316
34971
|
}
|
|
34317
34972
|
});
|
|
34318
34973
|
|
|
@@ -34389,7 +35044,7 @@ function getActiveStep(status) {
|
|
|
34389
35044
|
}
|
|
34390
35045
|
}
|
|
34391
35046
|
function RateRow({ label, value }) {
|
|
34392
|
-
return /* @__PURE__ */ (0,
|
|
35047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
34393
35048
|
"div",
|
|
34394
35049
|
{
|
|
34395
35050
|
style: {
|
|
@@ -34398,8 +35053,8 @@ function RateRow({ label, value }) {
|
|
|
34398
35053
|
justifyContent: "space-between"
|
|
34399
35054
|
},
|
|
34400
35055
|
children: [
|
|
34401
|
-
/* @__PURE__ */ (0,
|
|
34402
|
-
/* @__PURE__ */ (0,
|
|
35056
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
35057
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value })
|
|
34403
35058
|
]
|
|
34404
35059
|
}
|
|
34405
35060
|
);
|
|
@@ -34408,41 +35063,41 @@ function SwapMode({
|
|
|
34408
35063
|
theme: themeProp,
|
|
34409
35064
|
style
|
|
34410
35065
|
}) {
|
|
34411
|
-
const [stage, setStage] = (0,
|
|
34412
|
-
const [fromToken, setFromToken] = (0,
|
|
35066
|
+
const [stage, setStage] = (0, import_react50.useState)("home");
|
|
35067
|
+
const [fromToken, setFromToken] = (0, import_react50.useState)(
|
|
34413
35068
|
null
|
|
34414
35069
|
);
|
|
34415
|
-
const [fromChain, setFromChain] = (0,
|
|
34416
|
-
const [toToken, setToToken] = (0,
|
|
34417
|
-
const [toChain, setToChain] = (0,
|
|
34418
|
-
const [amount, setAmount] = (0,
|
|
34419
|
-
const [amountInputMode, setAmountInputMode] = (0,
|
|
35070
|
+
const [fromChain, setFromChain] = (0, import_react50.useState)(null);
|
|
35071
|
+
const [toToken, setToToken] = (0, import_react50.useState)(null);
|
|
35072
|
+
const [toChain, setToChain] = (0, import_react50.useState)(null);
|
|
35073
|
+
const [amount, setAmount] = (0, import_react50.useState)("");
|
|
35074
|
+
const [amountInputMode, setAmountInputMode] = (0, import_react50.useState)(
|
|
34420
35075
|
"usd"
|
|
34421
35076
|
);
|
|
34422
|
-
const [hoverSell, setHoverSell] = (0,
|
|
34423
|
-
const [showRateDetails, setShowRateDetails] = (0,
|
|
34424
|
-
const [showReviewDetails, setShowReviewDetails] = (0,
|
|
34425
|
-
const [showSettings, setShowSettings] = (0,
|
|
34426
|
-
const [maxApproval, setMaxApproval] = (0,
|
|
34427
|
-
const [slippage, setSlippage] = (0,
|
|
34428
|
-
const [slippageInput, setSlippageInput] = (0,
|
|
34429
|
-
const [selectedCurrency, setSelectedCurrency] = (0,
|
|
34430
|
-
const [showCurrencyDropdown, setShowCurrencyDropdown] = (0,
|
|
34431
|
-
const [completedAt, setCompletedAt] = (0,
|
|
34432
|
-
const [copiedHash, setCopiedHash] = (0,
|
|
34433
|
-
const [rateUpdated, setRateUpdated] = (0,
|
|
34434
|
-
const prevToAmountRef = (0,
|
|
34435
|
-
const [destAddress, setDestAddress] = (0,
|
|
34436
|
-
const [quoteAge, setQuoteAge] = (0,
|
|
34437
|
-
const quoteTimestampRef = (0,
|
|
34438
|
-
const [quoteLoadingMsgIdx, setQuoteLoadingMsgIdx] = (0,
|
|
34439
|
-
const [quoteLoadingMsgVisible, setQuoteLoadingMsgVisible] = (0,
|
|
34440
|
-
const latestFetchParamsRef = (0,
|
|
35077
|
+
const [hoverSell, setHoverSell] = (0, import_react50.useState)(false);
|
|
35078
|
+
const [showRateDetails, setShowRateDetails] = (0, import_react50.useState)(false);
|
|
35079
|
+
const [showReviewDetails, setShowReviewDetails] = (0, import_react50.useState)(false);
|
|
35080
|
+
const [showSettings, setShowSettings] = (0, import_react50.useState)(false);
|
|
35081
|
+
const [maxApproval, setMaxApproval] = (0, import_react50.useState)(false);
|
|
35082
|
+
const [slippage, setSlippage] = (0, import_react50.useState)(0.5);
|
|
35083
|
+
const [slippageInput, setSlippageInput] = (0, import_react50.useState)("");
|
|
35084
|
+
const [selectedCurrency, setSelectedCurrency] = (0, import_react50.useState)("USD");
|
|
35085
|
+
const [showCurrencyDropdown, setShowCurrencyDropdown] = (0, import_react50.useState)(false);
|
|
35086
|
+
const [completedAt, setCompletedAt] = (0, import_react50.useState)(null);
|
|
35087
|
+
const [copiedHash, setCopiedHash] = (0, import_react50.useState)(null);
|
|
35088
|
+
const [rateUpdated, setRateUpdated] = (0, import_react50.useState)(false);
|
|
35089
|
+
const prevToAmountRef = (0, import_react50.useRef)(null);
|
|
35090
|
+
const [destAddress, setDestAddress] = (0, import_react50.useState)("");
|
|
35091
|
+
const [quoteAge, setQuoteAge] = (0, import_react50.useState)(0);
|
|
35092
|
+
const quoteTimestampRef = (0, import_react50.useRef)(null);
|
|
35093
|
+
const [quoteLoadingMsgIdx, setQuoteLoadingMsgIdx] = (0, import_react50.useState)(0);
|
|
35094
|
+
const [quoteLoadingMsgVisible, setQuoteLoadingMsgVisible] = (0, import_react50.useState)(true);
|
|
35095
|
+
const latestFetchParamsRef = (0, import_react50.useRef)(null);
|
|
34441
35096
|
const { rates: forexRates } = useForex();
|
|
34442
35097
|
const currencyMeta = getCurrencyMeta(selectedCurrency);
|
|
34443
35098
|
const currencyRate = forexRates[selectedCurrency] ?? 1;
|
|
34444
35099
|
const currencySymbol = currencyMeta.symbol;
|
|
34445
|
-
const fmtLocal = (0,
|
|
35100
|
+
const fmtLocal = (0, import_react50.useCallback)(
|
|
34446
35101
|
(usdAmount) => {
|
|
34447
35102
|
const sym = getCurrencyMeta(selectedCurrency).symbol;
|
|
34448
35103
|
if (usdAmount === null || !isFinite(usdAmount) || usdAmount <= 0)
|
|
@@ -34453,8 +35108,8 @@ function SwapMode({
|
|
|
34453
35108
|
},
|
|
34454
35109
|
[currencyRate, selectedCurrency]
|
|
34455
35110
|
);
|
|
34456
|
-
const settingsRef = (0,
|
|
34457
|
-
const currencyDropdownRef = (0,
|
|
35111
|
+
const settingsRef = (0, import_react50.useRef)(null);
|
|
35112
|
+
const currencyDropdownRef = (0, import_react50.useRef)(null);
|
|
34458
35113
|
const { emitEvent } = useTrustware();
|
|
34459
35114
|
const { features, theme: configTheme } = useTrustwareConfig();
|
|
34460
35115
|
const effectiveThemeSetting = themeProp ?? configTheme ?? "system";
|
|
@@ -34470,26 +35125,26 @@ function SwapMode({
|
|
|
34470
35125
|
isLoading: chainsLoading,
|
|
34471
35126
|
error: chainsError
|
|
34472
35127
|
} = useChains();
|
|
34473
|
-
const allowedDestChainIds = (0,
|
|
35128
|
+
const allowedDestChainIds = (0, import_react50.useMemo)(() => {
|
|
34474
35129
|
if (!allowedDestTokens || allowedDestTokens.length === 0) return null;
|
|
34475
35130
|
return new Set(allowedDestTokens.map((t) => t.chainId));
|
|
34476
35131
|
}, [allowedDestTokens]);
|
|
34477
|
-
const toPopularChains = (0,
|
|
35132
|
+
const toPopularChains = (0, import_react50.useMemo)(
|
|
34478
35133
|
() => allowedDestChainIds ? popularChains.filter(
|
|
34479
35134
|
(c) => allowedDestChainIds.has(Number(c.chainId))
|
|
34480
35135
|
) : popularChains,
|
|
34481
35136
|
[popularChains, allowedDestChainIds]
|
|
34482
35137
|
);
|
|
34483
|
-
const toOtherChains = (0,
|
|
35138
|
+
const toOtherChains = (0, import_react50.useMemo)(
|
|
34484
35139
|
() => allowedDestChainIds ? otherChains.filter((c) => allowedDestChainIds.has(Number(c.chainId))) : otherChains,
|
|
34485
35140
|
[otherChains, allowedDestChainIds]
|
|
34486
35141
|
);
|
|
34487
|
-
const allChains = (0,
|
|
35142
|
+
const allChains = (0, import_react50.useMemo)(
|
|
34488
35143
|
() => [...popularChains, ...otherChains],
|
|
34489
35144
|
[popularChains, otherChains]
|
|
34490
35145
|
);
|
|
34491
|
-
const destInitialized = (0,
|
|
34492
|
-
(0,
|
|
35146
|
+
const destInitialized = (0, import_react50.useRef)(false);
|
|
35147
|
+
(0, import_react50.useEffect)(() => {
|
|
34493
35148
|
if (!defaultDestRef || destInitialized.current || allChains.length === 0)
|
|
34494
35149
|
return;
|
|
34495
35150
|
const chain = allChains.find(
|
|
@@ -34520,11 +35175,11 @@ function SwapMode({
|
|
|
34520
35175
|
});
|
|
34521
35176
|
}, [defaultDestRef, allChains]);
|
|
34522
35177
|
const { walletAddress, walletStatus, connectWallet, disconnectWallet } = useWalletSessionState();
|
|
34523
|
-
const setFromTokenStable = (0,
|
|
35178
|
+
const setFromTokenStable = (0, import_react50.useCallback)(
|
|
34524
35179
|
(t) => setFromToken(t),
|
|
34525
35180
|
[]
|
|
34526
35181
|
);
|
|
34527
|
-
const setFromChainStable = (0,
|
|
35182
|
+
const setFromChainStable = (0, import_react50.useCallback)(
|
|
34528
35183
|
(c) => setFromChain(c),
|
|
34529
35184
|
[]
|
|
34530
35185
|
);
|
|
@@ -34537,18 +35192,18 @@ function SwapMode({
|
|
|
34537
35192
|
});
|
|
34538
35193
|
const route = useSwapRoute();
|
|
34539
35194
|
const execution = useSwapExecution(fromChain);
|
|
34540
|
-
const fromTokenPriceUSD = (0,
|
|
35195
|
+
const fromTokenPriceUSD = (0, import_react50.useMemo)(() => {
|
|
34541
35196
|
const p = fromToken?.usdPrice;
|
|
34542
35197
|
return typeof p === "number" && Number.isFinite(p) && p > 0 ? p : 0;
|
|
34543
35198
|
}, [fromToken]);
|
|
34544
35199
|
const hasFromUsdPrice = fromTokenPriceUSD > 0;
|
|
34545
|
-
const toTokenPriceUSD = (0,
|
|
35200
|
+
const toTokenPriceUSD = (0, import_react50.useMemo)(() => {
|
|
34546
35201
|
const p = toToken?.usdPrice;
|
|
34547
35202
|
return typeof p === "number" && Number.isFinite(p) && p > 0 ? p : 0;
|
|
34548
35203
|
}, [toToken]);
|
|
34549
35204
|
const hasToUsdPrice = toTokenPriceUSD > 0;
|
|
34550
35205
|
const rawSellNum = parseFloat(amount) || 0;
|
|
34551
|
-
const usdSellNum = (0,
|
|
35206
|
+
const usdSellNum = (0, import_react50.useMemo)(() => {
|
|
34552
35207
|
if (amountInputMode === "usd") return rawSellNum / currencyRate;
|
|
34553
35208
|
return hasFromUsdPrice ? rawSellNum * fromTokenPriceUSD : 0;
|
|
34554
35209
|
}, [
|
|
@@ -34558,7 +35213,7 @@ function SwapMode({
|
|
|
34558
35213
|
hasFromUsdPrice,
|
|
34559
35214
|
fromTokenPriceUSD
|
|
34560
35215
|
]);
|
|
34561
|
-
const tokenSellNum = (0,
|
|
35216
|
+
const tokenSellNum = (0, import_react50.useMemo)(() => {
|
|
34562
35217
|
if (amountInputMode === "usd") {
|
|
34563
35218
|
return hasFromUsdPrice && fromTokenPriceUSD > 0 ? usdSellNum / fromTokenPriceUSD : 0;
|
|
34564
35219
|
}
|
|
@@ -34570,12 +35225,12 @@ function SwapMode({
|
|
|
34570
35225
|
hasFromUsdPrice,
|
|
34571
35226
|
fromTokenPriceUSD
|
|
34572
35227
|
]);
|
|
34573
|
-
const tokenAmountStr = (0,
|
|
35228
|
+
const tokenAmountStr = (0, import_react50.useMemo)(() => {
|
|
34574
35229
|
if (tokenSellNum <= 0) return "";
|
|
34575
35230
|
const decimals = fromToken?.decimals ?? 18;
|
|
34576
35231
|
return truncateDecimal(tokenSellNum, Math.min(decimals, 18));
|
|
34577
35232
|
}, [tokenSellNum, fromToken?.decimals]);
|
|
34578
|
-
const handleCurrencyChange = (0,
|
|
35233
|
+
const handleCurrencyChange = (0, import_react50.useCallback)(
|
|
34579
35234
|
(newCode) => {
|
|
34580
35235
|
if (amountInputMode === "usd" && amount) {
|
|
34581
35236
|
const oldRate = currencyRate;
|
|
@@ -34590,7 +35245,7 @@ function SwapMode({
|
|
|
34590
35245
|
},
|
|
34591
35246
|
[amountInputMode, amount, currencyRate, forexRates, route]
|
|
34592
35247
|
);
|
|
34593
|
-
const handleSelectFromToken = (0,
|
|
35248
|
+
const handleSelectFromToken = (0, import_react50.useCallback)(
|
|
34594
35249
|
(token, chain) => {
|
|
34595
35250
|
setFromToken(token);
|
|
34596
35251
|
setFromChain(chain);
|
|
@@ -34611,7 +35266,7 @@ function SwapMode({
|
|
|
34611
35266
|
},
|
|
34612
35267
|
[route, emitEvent, toToken, toChain, amount]
|
|
34613
35268
|
);
|
|
34614
|
-
const handleSelectToToken = (0,
|
|
35269
|
+
const handleSelectToToken = (0, import_react50.useCallback)(
|
|
34615
35270
|
(token, chain) => {
|
|
34616
35271
|
setToToken(token);
|
|
34617
35272
|
setToChain(chain);
|
|
@@ -34628,7 +35283,7 @@ function SwapMode({
|
|
|
34628
35283
|
},
|
|
34629
35284
|
[route, emitEvent, fromToken, fromChain, amount]
|
|
34630
35285
|
);
|
|
34631
|
-
const handleFlip = (0,
|
|
35286
|
+
const handleFlip = (0, import_react50.useCallback)(() => {
|
|
34632
35287
|
if (lockDestToken) return;
|
|
34633
35288
|
const newFrom = toToken ?? fromToken;
|
|
34634
35289
|
const newFromChain = toChain ?? fromChain;
|
|
@@ -34650,7 +35305,7 @@ function SwapMode({
|
|
|
34650
35305
|
const toChainType = normalizeChainType2(toChain);
|
|
34651
35306
|
const needsDestAddress = !!fromChainType && !!toChainType && fromChainType !== toChainType;
|
|
34652
35307
|
const isValidDestAddress = !needsDestAddress || validateDestAddress(destAddress, toChainType ?? "");
|
|
34653
|
-
const handleReview = (0,
|
|
35308
|
+
const handleReview = (0, import_react50.useCallback)(async () => {
|
|
34654
35309
|
if (!fromToken || !fromChain || !toToken || !toChain || !tokenAmountStr || !walletAddress) {
|
|
34655
35310
|
if (!walletAddress) setStage("connect-wallet");
|
|
34656
35311
|
return;
|
|
@@ -34685,13 +35340,13 @@ function SwapMode({
|
|
|
34685
35340
|
route,
|
|
34686
35341
|
slippage
|
|
34687
35342
|
]);
|
|
34688
|
-
const handleConnectAndReview = (0,
|
|
35343
|
+
const handleConnectAndReview = (0, import_react50.useCallback)(() => {
|
|
34689
35344
|
setStage("connect-wallet");
|
|
34690
35345
|
}, []);
|
|
34691
|
-
const handleWalletConnected = (0,
|
|
35346
|
+
const handleWalletConnected = (0, import_react50.useCallback)(() => {
|
|
34692
35347
|
setStage("home");
|
|
34693
35348
|
}, []);
|
|
34694
|
-
const handleExecute = (0,
|
|
35349
|
+
const handleExecute = (0, import_react50.useCallback)(async () => {
|
|
34695
35350
|
if (!route.data) return;
|
|
34696
35351
|
setStage("processing");
|
|
34697
35352
|
const fromTokenAddress = fromToken?.address ?? fromToken?.address;
|
|
@@ -34714,7 +35369,7 @@ function SwapMode({
|
|
|
34714
35369
|
() => setStage("error")
|
|
34715
35370
|
);
|
|
34716
35371
|
}, [route, execution, fromToken, walletAddress, maxApproval]);
|
|
34717
|
-
const handleReset = (0,
|
|
35372
|
+
const handleReset = (0, import_react50.useCallback)(() => {
|
|
34718
35373
|
execution.reset();
|
|
34719
35374
|
route.clear();
|
|
34720
35375
|
setAmount("");
|
|
@@ -34724,7 +35379,7 @@ function SwapMode({
|
|
|
34724
35379
|
setStage("home");
|
|
34725
35380
|
reloadWalletTokens();
|
|
34726
35381
|
}, [execution, route, reloadWalletTokens]);
|
|
34727
|
-
const handleSwapBack = (0,
|
|
35382
|
+
const handleSwapBack = (0, import_react50.useCallback)(() => {
|
|
34728
35383
|
const prevFrom = fromToken;
|
|
34729
35384
|
const prevFromChain = fromChain;
|
|
34730
35385
|
setFromToken(toToken);
|
|
@@ -34748,14 +35403,14 @@ function SwapMode({
|
|
|
34748
35403
|
route,
|
|
34749
35404
|
reloadWalletTokens
|
|
34750
35405
|
]);
|
|
34751
|
-
const handleCopyHash = (0,
|
|
35406
|
+
const handleCopyHash = (0, import_react50.useCallback)((hash) => {
|
|
34752
35407
|
if (!navigator?.clipboard?.writeText) return;
|
|
34753
35408
|
void navigator.clipboard.writeText(hash).then(() => {
|
|
34754
35409
|
setCopiedHash(hash);
|
|
34755
35410
|
setTimeout(() => setCopiedHash((v) => v === hash ? null : v), 1500);
|
|
34756
35411
|
});
|
|
34757
35412
|
}, []);
|
|
34758
|
-
const handleToggleDenom = (0,
|
|
35413
|
+
const handleToggleDenom = (0, import_react50.useCallback)(() => {
|
|
34759
35414
|
if (!hasFromUsdPrice) return;
|
|
34760
35415
|
const parsed = parseFloat(amount) || 0;
|
|
34761
35416
|
if (amountInputMode === "usd") {
|
|
@@ -34781,7 +35436,7 @@ function SwapMode({
|
|
|
34781
35436
|
fromToken?.decimals,
|
|
34782
35437
|
route
|
|
34783
35438
|
]);
|
|
34784
|
-
const fromBalance = (0,
|
|
35439
|
+
const fromBalance = (0, import_react50.useMemo)(() => {
|
|
34785
35440
|
const walletToken = fromToken;
|
|
34786
35441
|
if (!walletToken || !("balance" in walletToken)) return null;
|
|
34787
35442
|
const raw = walletToken.balance;
|
|
@@ -34791,7 +35446,7 @@ function SwapMode({
|
|
|
34791
35446
|
return Number.isFinite(n) ? n : null;
|
|
34792
35447
|
}, [fromToken]);
|
|
34793
35448
|
const balanceUsd = fromBalance !== null && hasFromUsdPrice ? fromBalance * fromTokenPriceUSD : null;
|
|
34794
|
-
const estimatedToAmount = (0,
|
|
35449
|
+
const estimatedToAmount = (0, import_react50.useMemo)(() => {
|
|
34795
35450
|
if (tokenSellNum <= 0 || !hasFromUsdPrice || !hasToUsdPrice) return null;
|
|
34796
35451
|
return tokenSellNum * (fromTokenPriceUSD / toTokenPriceUSD);
|
|
34797
35452
|
}, [
|
|
@@ -34801,10 +35456,10 @@ function SwapMode({
|
|
|
34801
35456
|
hasFromUsdPrice,
|
|
34802
35457
|
hasToUsdPrice
|
|
34803
35458
|
]);
|
|
34804
|
-
const backendToUsdStr = (0,
|
|
35459
|
+
const backendToUsdStr = (0, import_react50.useMemo)(() => {
|
|
34805
35460
|
return route.data?.finalExchangeRate?.toAmountMinUSD ?? route.data?.route?.estimate?.toAmountMinUsd ?? route.data?.route?.estimate?.toAmountUsd ?? null;
|
|
34806
35461
|
}, [route.data]);
|
|
34807
|
-
const toAmount = (0,
|
|
35462
|
+
const toAmount = (0, import_react50.useMemo)(() => {
|
|
34808
35463
|
if (backendToUsdStr && toTokenPriceUSD > 0) {
|
|
34809
35464
|
const usd = parseFloat(backendToUsdStr);
|
|
34810
35465
|
if (Number.isFinite(usd) && usd > 0) return usd / toTokenPriceUSD;
|
|
@@ -34830,7 +35485,7 @@ function SwapMode({
|
|
|
34830
35485
|
estimatedToAmount
|
|
34831
35486
|
]);
|
|
34832
35487
|
const fromUsd = usdSellNum;
|
|
34833
|
-
const toUsd = (0,
|
|
35488
|
+
const toUsd = (0, import_react50.useMemo)(() => {
|
|
34834
35489
|
if (backendToUsdStr) {
|
|
34835
35490
|
const n = parseFloat(backendToUsdStr);
|
|
34836
35491
|
if (Number.isFinite(n) && n > 0) return n;
|
|
@@ -34841,12 +35496,12 @@ function SwapMode({
|
|
|
34841
35496
|
const isEstimate = !route.data;
|
|
34842
35497
|
const USD_EPSILON = 1e-3;
|
|
34843
35498
|
const displayToUsd = toUsd > USD_EPSILON ? toUsd : estimatedToAmount !== null && hasToUsdPrice ? estimatedToAmount * toTokenPriceUSD : 0;
|
|
34844
|
-
const priceImpact = (0,
|
|
35499
|
+
const priceImpact = (0, import_react50.useMemo)(() => {
|
|
34845
35500
|
if (!route.data || fromUsd < 0.01 || displayToUsd < 0.01) return null;
|
|
34846
35501
|
const impact = 1 - displayToUsd / fromUsd;
|
|
34847
35502
|
return impact > 1e-3 ? impact : null;
|
|
34848
35503
|
}, [route.data, fromUsd, displayToUsd]);
|
|
34849
|
-
const routePath = (0,
|
|
35504
|
+
const routePath = (0, import_react50.useMemo)(() => {
|
|
34850
35505
|
if (!route.data) return null;
|
|
34851
35506
|
const provider = route.data.route?.provider;
|
|
34852
35507
|
const steps = route.data.route?.steps;
|
|
@@ -34873,19 +35528,19 @@ function SwapMode({
|
|
|
34873
35528
|
return null;
|
|
34874
35529
|
}, [route.data, fromToken?.symbol, toToken?.symbol]);
|
|
34875
35530
|
const isGasSponsored = !!route.data?.sponsorship;
|
|
34876
|
-
const networkCostUsd = (0,
|
|
35531
|
+
const networkCostUsd = (0, import_react50.useMemo)(() => {
|
|
34877
35532
|
const fees = route.data?.route?.estimate?.fees;
|
|
34878
35533
|
if (!fees?.length) return null;
|
|
34879
35534
|
const gasTotal = fees.filter((f) => f.type?.toLowerCase().includes("gas")).reduce((sum, f) => sum + (Number(f.amountUsd) || 0), 0);
|
|
34880
35535
|
return gasTotal > 0 ? gasTotal : null;
|
|
34881
35536
|
}, [route.data]);
|
|
34882
|
-
const protocolFeeUsd = (0,
|
|
35537
|
+
const protocolFeeUsd = (0, import_react50.useMemo)(() => {
|
|
34883
35538
|
const fees = route.data?.route?.estimate?.fees;
|
|
34884
35539
|
if (!fees?.length) return null;
|
|
34885
35540
|
const total = fees.filter((f) => !f.type?.toLowerCase().includes("gas")).reduce((sum, f) => sum + (Number(f.amountUsd) || 0), 0);
|
|
34886
35541
|
return total > 0 ? total : null;
|
|
34887
35542
|
}, [route.data]);
|
|
34888
|
-
const exchangeRate = (0,
|
|
35543
|
+
const exchangeRate = (0, import_react50.useMemo)(() => {
|
|
34889
35544
|
if (!hasFromUsdPrice || !hasToUsdPrice) return null;
|
|
34890
35545
|
return toTokenPriceUSD / fromTokenPriceUSD;
|
|
34891
35546
|
}, [fromTokenPriceUSD, toTokenPriceUSD, hasFromUsdPrice, hasToUsdPrice]);
|
|
@@ -34894,13 +35549,13 @@ function SwapMode({
|
|
|
34894
35549
|
const hasAmount = rawSellNum > 0 && (amountInputMode === "token" || hasFromUsdPrice);
|
|
34895
35550
|
const isConnected = walletStatus === "connected" && !!walletAddress;
|
|
34896
35551
|
const canGetQuote = hasTokens && hasAmount && !insufficient && isConnected && (!needsDestAddress || isValidDestAddress);
|
|
34897
|
-
(0,
|
|
35552
|
+
(0, import_react50.useEffect)(() => {
|
|
34898
35553
|
if (!fromToken) return;
|
|
34899
35554
|
if (!hasFromUsdPrice && amountInputMode === "usd") {
|
|
34900
35555
|
setAmountInputMode("token");
|
|
34901
35556
|
}
|
|
34902
35557
|
}, [fromToken, hasFromUsdPrice, amountInputMode]);
|
|
34903
|
-
(0,
|
|
35558
|
+
(0, import_react50.useEffect)(() => {
|
|
34904
35559
|
if (displayToAmount === null) {
|
|
34905
35560
|
prevToAmountRef.current = null;
|
|
34906
35561
|
return;
|
|
@@ -34914,14 +35569,14 @@ function SwapMode({
|
|
|
34914
35569
|
const t = setTimeout(() => setRateUpdated(false), 700);
|
|
34915
35570
|
return () => clearTimeout(t);
|
|
34916
35571
|
}, [displayToAmount]);
|
|
34917
|
-
(0,
|
|
35572
|
+
(0, import_react50.useEffect)(() => {
|
|
34918
35573
|
setDestAddress("");
|
|
34919
35574
|
}, [toChainType]);
|
|
34920
|
-
const fetchRef = (0,
|
|
34921
|
-
(0,
|
|
35575
|
+
const fetchRef = (0, import_react50.useRef)(route.fetch);
|
|
35576
|
+
(0, import_react50.useEffect)(() => {
|
|
34922
35577
|
fetchRef.current = route.fetch;
|
|
34923
35578
|
});
|
|
34924
|
-
(0,
|
|
35579
|
+
(0, import_react50.useEffect)(() => {
|
|
34925
35580
|
if (!canGetQuote || stage !== "home") return;
|
|
34926
35581
|
if (!fromToken || !fromChain || !toToken || !toChain || !walletAddress)
|
|
34927
35582
|
return;
|
|
@@ -34950,7 +35605,7 @@ function SwapMode({
|
|
|
34950
35605
|
destAddress,
|
|
34951
35606
|
slippage
|
|
34952
35607
|
]);
|
|
34953
|
-
(0,
|
|
35608
|
+
(0, import_react50.useEffect)(() => {
|
|
34954
35609
|
if (!canGetQuote || !fromToken || !fromChain || !toToken || !toChain || !walletAddress) {
|
|
34955
35610
|
latestFetchParamsRef.current = null;
|
|
34956
35611
|
return;
|
|
@@ -34977,12 +35632,12 @@ function SwapMode({
|
|
|
34977
35632
|
destAddress,
|
|
34978
35633
|
slippage
|
|
34979
35634
|
]);
|
|
34980
|
-
(0,
|
|
35635
|
+
(0, import_react50.useEffect)(() => {
|
|
34981
35636
|
quoteTimestampRef.current = route.data ? Date.now() : null;
|
|
34982
35637
|
setQuoteAge(0);
|
|
34983
35638
|
}, [route.data]);
|
|
34984
|
-
const msgTimeoutRef = (0,
|
|
34985
|
-
(0,
|
|
35639
|
+
const msgTimeoutRef = (0, import_react50.useRef)(null);
|
|
35640
|
+
(0, import_react50.useEffect)(() => {
|
|
34986
35641
|
if (!route.loading) {
|
|
34987
35642
|
setQuoteLoadingMsgIdx(0);
|
|
34988
35643
|
setQuoteLoadingMsgVisible(true);
|
|
@@ -35000,7 +35655,7 @@ function SwapMode({
|
|
|
35000
35655
|
if (msgTimeoutRef.current !== null) clearTimeout(msgTimeoutRef.current);
|
|
35001
35656
|
};
|
|
35002
35657
|
}, [route.loading]);
|
|
35003
|
-
(0,
|
|
35658
|
+
(0, import_react50.useEffect)(() => {
|
|
35004
35659
|
if (!route.data) return;
|
|
35005
35660
|
const id = setInterval(() => {
|
|
35006
35661
|
const ts = quoteTimestampRef.current;
|
|
@@ -35014,7 +35669,7 @@ function SwapMode({
|
|
|
35014
35669
|
}, 1e3);
|
|
35015
35670
|
return () => clearInterval(id);
|
|
35016
35671
|
}, [route.data]);
|
|
35017
|
-
(0,
|
|
35672
|
+
(0, import_react50.useEffect)(() => {
|
|
35018
35673
|
if (stage !== "review") return;
|
|
35019
35674
|
if (!route.data || !walletAddress) return;
|
|
35020
35675
|
const fromTokenAddress = fromToken?.address;
|
|
@@ -35025,7 +35680,7 @@ function SwapMode({
|
|
|
35025
35680
|
routeResult: route.data
|
|
35026
35681
|
});
|
|
35027
35682
|
}, [stage, route.data, walletAddress, fromToken]);
|
|
35028
|
-
(0,
|
|
35683
|
+
(0, import_react50.useEffect)(() => {
|
|
35029
35684
|
if (!showSettings) {
|
|
35030
35685
|
setShowCurrencyDropdown(false);
|
|
35031
35686
|
return;
|
|
@@ -35038,7 +35693,7 @@ function SwapMode({
|
|
|
35038
35693
|
document.addEventListener("mousedown", handler);
|
|
35039
35694
|
return () => document.removeEventListener("mousedown", handler);
|
|
35040
35695
|
}, [showSettings]);
|
|
35041
|
-
(0,
|
|
35696
|
+
(0, import_react50.useEffect)(() => {
|
|
35042
35697
|
if (!showCurrencyDropdown) return;
|
|
35043
35698
|
const handler = (e2) => {
|
|
35044
35699
|
if (currencyDropdownRef.current && !currencyDropdownRef.current.contains(e2.target)) {
|
|
@@ -35049,7 +35704,7 @@ function SwapMode({
|
|
|
35049
35704
|
return () => document.removeEventListener("mousedown", handler);
|
|
35050
35705
|
}, [showCurrencyDropdown]);
|
|
35051
35706
|
if (stage === "select-from") {
|
|
35052
|
-
return /* @__PURE__ */ (0,
|
|
35707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35053
35708
|
SwapTokenSelect,
|
|
35054
35709
|
{
|
|
35055
35710
|
side: "from",
|
|
@@ -35067,7 +35722,7 @@ function SwapMode({
|
|
|
35067
35722
|
) });
|
|
35068
35723
|
}
|
|
35069
35724
|
if (stage === "select-to" && !lockDestToken) {
|
|
35070
|
-
return /* @__PURE__ */ (0,
|
|
35725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35071
35726
|
SwapTokenSelect,
|
|
35072
35727
|
{
|
|
35073
35728
|
side: "to",
|
|
@@ -35086,9 +35741,9 @@ function SwapMode({
|
|
|
35086
35741
|
) });
|
|
35087
35742
|
}
|
|
35088
35743
|
if (stage === "connect-wallet") {
|
|
35089
|
-
return /* @__PURE__ */ (0,
|
|
35090
|
-
/* @__PURE__ */ (0,
|
|
35091
|
-
|
|
35744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(WidgetContainer, { theme: resolvedTheme, style, children: [
|
|
35745
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35746
|
+
SwapWalletSelector_default,
|
|
35092
35747
|
{
|
|
35093
35748
|
walletStatus,
|
|
35094
35749
|
walletAddress,
|
|
@@ -35096,7 +35751,7 @@ function SwapMode({
|
|
|
35096
35751
|
onBack: handleWalletConnected
|
|
35097
35752
|
}
|
|
35098
35753
|
),
|
|
35099
|
-
isConnected && /* @__PURE__ */ (0,
|
|
35754
|
+
isConnected && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[4]} ${spacing[4]}` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35100
35755
|
"button",
|
|
35101
35756
|
{
|
|
35102
35757
|
onClick: () => setStage("home"),
|
|
@@ -35129,8 +35784,8 @@ function SwapMode({
|
|
|
35129
35784
|
const offset = circ - progress / 100 * circ;
|
|
35130
35785
|
const isApproving = txStatus === "approving";
|
|
35131
35786
|
const title = isApproving ? "Approving..." : "Order Submitted";
|
|
35132
|
-
return /* @__PURE__ */ (0,
|
|
35133
|
-
/* @__PURE__ */ (0,
|
|
35787
|
+
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: [
|
|
35788
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35134
35789
|
"div",
|
|
35135
35790
|
{
|
|
35136
35791
|
style: {
|
|
@@ -35140,7 +35795,7 @@ function SwapMode({
|
|
|
35140
35795
|
marginBottom: spacing[5]
|
|
35141
35796
|
},
|
|
35142
35797
|
children: [
|
|
35143
|
-
/* @__PURE__ */ (0,
|
|
35798
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35144
35799
|
"button",
|
|
35145
35800
|
{
|
|
35146
35801
|
onClick: handleReset,
|
|
@@ -35155,7 +35810,7 @@ function SwapMode({
|
|
|
35155
35810
|
border: 0,
|
|
35156
35811
|
cursor: "pointer"
|
|
35157
35812
|
},
|
|
35158
|
-
children: /* @__PURE__ */ (0,
|
|
35813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35159
35814
|
"svg",
|
|
35160
35815
|
{
|
|
35161
35816
|
style: {
|
|
@@ -35169,12 +35824,12 @@ function SwapMode({
|
|
|
35169
35824
|
strokeWidth: 2,
|
|
35170
35825
|
strokeLinecap: "round",
|
|
35171
35826
|
strokeLinejoin: "round",
|
|
35172
|
-
children: /* @__PURE__ */ (0,
|
|
35827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M19 12H5m7-7-7 7 7 7" })
|
|
35173
35828
|
}
|
|
35174
35829
|
)
|
|
35175
35830
|
}
|
|
35176
35831
|
),
|
|
35177
|
-
/* @__PURE__ */ (0,
|
|
35832
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35178
35833
|
"button",
|
|
35179
35834
|
{
|
|
35180
35835
|
onClick: handleReset,
|
|
@@ -35191,7 +35846,7 @@ function SwapMode({
|
|
|
35191
35846
|
]
|
|
35192
35847
|
}
|
|
35193
35848
|
),
|
|
35194
|
-
/* @__PURE__ */ (0,
|
|
35849
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35195
35850
|
"h1",
|
|
35196
35851
|
{
|
|
35197
35852
|
style: {
|
|
@@ -35203,7 +35858,7 @@ function SwapMode({
|
|
|
35203
35858
|
children: title
|
|
35204
35859
|
}
|
|
35205
35860
|
),
|
|
35206
|
-
/* @__PURE__ */ (0,
|
|
35861
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35207
35862
|
"div",
|
|
35208
35863
|
{
|
|
35209
35864
|
style: {
|
|
@@ -35217,7 +35872,7 @@ function SwapMode({
|
|
|
35217
35872
|
gap: spacing[5]
|
|
35218
35873
|
},
|
|
35219
35874
|
children: [
|
|
35220
|
-
/* @__PURE__ */ (0,
|
|
35875
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35221
35876
|
"div",
|
|
35222
35877
|
{
|
|
35223
35878
|
style: {
|
|
@@ -35229,14 +35884,14 @@ function SwapMode({
|
|
|
35229
35884
|
justifyContent: "center"
|
|
35230
35885
|
},
|
|
35231
35886
|
children: [
|
|
35232
|
-
/* @__PURE__ */ (0,
|
|
35887
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35233
35888
|
"svg",
|
|
35234
35889
|
{
|
|
35235
35890
|
width: ringSize,
|
|
35236
35891
|
height: ringSize,
|
|
35237
35892
|
style: { position: "absolute", inset: 0 },
|
|
35238
35893
|
children: [
|
|
35239
|
-
/* @__PURE__ */ (0,
|
|
35894
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35240
35895
|
"circle",
|
|
35241
35896
|
{
|
|
35242
35897
|
cx: ringSize / 2,
|
|
@@ -35247,7 +35902,7 @@ function SwapMode({
|
|
|
35247
35902
|
strokeWidth: ringStroke
|
|
35248
35903
|
}
|
|
35249
35904
|
),
|
|
35250
|
-
/* @__PURE__ */ (0,
|
|
35905
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35251
35906
|
"circle",
|
|
35252
35907
|
{
|
|
35253
35908
|
cx: ringSize / 2,
|
|
@@ -35266,7 +35921,7 @@ function SwapMode({
|
|
|
35266
35921
|
]
|
|
35267
35922
|
}
|
|
35268
35923
|
),
|
|
35269
|
-
/* @__PURE__ */ (0,
|
|
35924
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35270
35925
|
"div",
|
|
35271
35926
|
{
|
|
35272
35927
|
style: {
|
|
@@ -35277,7 +35932,7 @@ function SwapMode({
|
|
|
35277
35932
|
textAlign: "center"
|
|
35278
35933
|
},
|
|
35279
35934
|
children: [
|
|
35280
|
-
/* @__PURE__ */ (0,
|
|
35935
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35281
35936
|
"span",
|
|
35282
35937
|
{
|
|
35283
35938
|
style: {
|
|
@@ -35290,7 +35945,7 @@ function SwapMode({
|
|
|
35290
35945
|
children: isApproving ? "Approving" : "Swapping"
|
|
35291
35946
|
}
|
|
35292
35947
|
),
|
|
35293
|
-
/* @__PURE__ */ (0,
|
|
35948
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35294
35949
|
"div",
|
|
35295
35950
|
{
|
|
35296
35951
|
style: {
|
|
@@ -35300,7 +35955,7 @@ function SwapMode({
|
|
|
35300
35955
|
gap: spacing[1.5]
|
|
35301
35956
|
},
|
|
35302
35957
|
children: [
|
|
35303
|
-
fromToken?.iconUrl ? /* @__PURE__ */ (0,
|
|
35958
|
+
fromToken?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35304
35959
|
"img",
|
|
35305
35960
|
{
|
|
35306
35961
|
src: fromToken.iconUrl,
|
|
@@ -35311,7 +35966,7 @@ function SwapMode({
|
|
|
35311
35966
|
},
|
|
35312
35967
|
alt: ""
|
|
35313
35968
|
}
|
|
35314
|
-
) : /* @__PURE__ */ (0,
|
|
35969
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35315
35970
|
"div",
|
|
35316
35971
|
{
|
|
35317
35972
|
style: {
|
|
@@ -35322,7 +35977,7 @@ function SwapMode({
|
|
|
35322
35977
|
}
|
|
35323
35978
|
}
|
|
35324
35979
|
),
|
|
35325
|
-
/* @__PURE__ */ (0,
|
|
35980
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35326
35981
|
"svg",
|
|
35327
35982
|
{
|
|
35328
35983
|
style: {
|
|
@@ -35336,10 +35991,10 @@ function SwapMode({
|
|
|
35336
35991
|
strokeWidth: 2,
|
|
35337
35992
|
strokeLinecap: "round",
|
|
35338
35993
|
strokeLinejoin: "round",
|
|
35339
|
-
children: /* @__PURE__ */ (0,
|
|
35994
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M5 12h14m-7-7 7 7-7 7" })
|
|
35340
35995
|
}
|
|
35341
35996
|
),
|
|
35342
|
-
toToken?.iconUrl ? /* @__PURE__ */ (0,
|
|
35997
|
+
toToken?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35343
35998
|
"img",
|
|
35344
35999
|
{
|
|
35345
36000
|
src: toToken.iconUrl,
|
|
@@ -35350,7 +36005,7 @@ function SwapMode({
|
|
|
35350
36005
|
},
|
|
35351
36006
|
alt: ""
|
|
35352
36007
|
}
|
|
35353
|
-
) : /* @__PURE__ */ (0,
|
|
36008
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35354
36009
|
"div",
|
|
35355
36010
|
{
|
|
35356
36011
|
style: {
|
|
@@ -35364,7 +36019,7 @@ function SwapMode({
|
|
|
35364
36019
|
]
|
|
35365
36020
|
}
|
|
35366
36021
|
),
|
|
35367
|
-
/* @__PURE__ */ (0,
|
|
36022
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35368
36023
|
"span",
|
|
35369
36024
|
{
|
|
35370
36025
|
style: {
|
|
@@ -35376,7 +36031,7 @@ function SwapMode({
|
|
|
35376
36031
|
children: [
|
|
35377
36032
|
fromToken?.symbol,
|
|
35378
36033
|
" ",
|
|
35379
|
-
/* @__PURE__ */ (0,
|
|
36034
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35380
36035
|
"span",
|
|
35381
36036
|
{
|
|
35382
36037
|
style: {
|
|
@@ -35391,7 +36046,7 @@ function SwapMode({
|
|
|
35391
36046
|
]
|
|
35392
36047
|
}
|
|
35393
36048
|
),
|
|
35394
|
-
/* @__PURE__ */ (0,
|
|
36049
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35395
36050
|
"span",
|
|
35396
36051
|
{
|
|
35397
36052
|
style: {
|
|
@@ -35411,7 +36066,7 @@ function SwapMode({
|
|
|
35411
36066
|
]
|
|
35412
36067
|
}
|
|
35413
36068
|
),
|
|
35414
|
-
/* @__PURE__ */ (0,
|
|
36069
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35415
36070
|
"div",
|
|
35416
36071
|
{
|
|
35417
36072
|
style: {
|
|
@@ -35421,7 +36076,7 @@ function SwapMode({
|
|
|
35421
36076
|
justifyContent: "space-between"
|
|
35422
36077
|
},
|
|
35423
36078
|
children: [
|
|
35424
|
-
/* @__PURE__ */ (0,
|
|
36079
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35425
36080
|
ProcessingStepNode,
|
|
35426
36081
|
{
|
|
35427
36082
|
active: activeStep >= 0,
|
|
@@ -35430,8 +36085,8 @@ function SwapMode({
|
|
|
35430
36085
|
label: `Sending ${fromToken?.symbol ?? ""}`
|
|
35431
36086
|
}
|
|
35432
36087
|
),
|
|
35433
|
-
/* @__PURE__ */ (0,
|
|
35434
|
-
/* @__PURE__ */ (0,
|
|
36088
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ProcessingStepLine, { done: activeStep > 0 }),
|
|
36089
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35435
36090
|
ProcessingStepNode,
|
|
35436
36091
|
{
|
|
35437
36092
|
active: activeStep >= 1,
|
|
@@ -35440,8 +36095,8 @@ function SwapMode({
|
|
|
35440
36095
|
label: "Create Order"
|
|
35441
36096
|
}
|
|
35442
36097
|
),
|
|
35443
|
-
/* @__PURE__ */ (0,
|
|
35444
|
-
/* @__PURE__ */ (0,
|
|
36098
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ProcessingStepLine, { done: activeStep > 1 }),
|
|
36099
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35445
36100
|
ProcessingStepNode,
|
|
35446
36101
|
{
|
|
35447
36102
|
active: activeStep >= 2,
|
|
@@ -35460,7 +36115,7 @@ function SwapMode({
|
|
|
35460
36115
|
fromChainTxUrl
|
|
35461
36116
|
);
|
|
35462
36117
|
const isCopied = copiedHash === txHash;
|
|
35463
|
-
return /* @__PURE__ */ (0,
|
|
36118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35464
36119
|
"div",
|
|
35465
36120
|
{
|
|
35466
36121
|
style: {
|
|
@@ -35469,7 +36124,7 @@ function SwapMode({
|
|
|
35469
36124
|
gap: spacing[3]
|
|
35470
36125
|
},
|
|
35471
36126
|
children: [
|
|
35472
|
-
explorerUrl && /* @__PURE__ */ (0,
|
|
36127
|
+
explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35473
36128
|
"a",
|
|
35474
36129
|
{
|
|
35475
36130
|
href: explorerUrl,
|
|
@@ -35488,7 +36143,7 @@ function SwapMode({
|
|
|
35488
36143
|
},
|
|
35489
36144
|
children: [
|
|
35490
36145
|
"View transaction",
|
|
35491
|
-
/* @__PURE__ */ (0,
|
|
36146
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35492
36147
|
"svg",
|
|
35493
36148
|
{
|
|
35494
36149
|
style: { width: "0.875rem", height: "0.875rem" },
|
|
@@ -35499,16 +36154,16 @@ function SwapMode({
|
|
|
35499
36154
|
strokeLinecap: "round",
|
|
35500
36155
|
strokeLinejoin: "round",
|
|
35501
36156
|
children: [
|
|
35502
|
-
/* @__PURE__ */ (0,
|
|
35503
|
-
/* @__PURE__ */ (0,
|
|
35504
|
-
/* @__PURE__ */ (0,
|
|
36157
|
+
/* @__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" }),
|
|
36158
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36159
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
35505
36160
|
]
|
|
35506
36161
|
}
|
|
35507
36162
|
)
|
|
35508
36163
|
]
|
|
35509
36164
|
}
|
|
35510
36165
|
),
|
|
35511
|
-
/* @__PURE__ */ (0,
|
|
36166
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35512
36167
|
"button",
|
|
35513
36168
|
{
|
|
35514
36169
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -35525,11 +36180,11 @@ function SwapMode({
|
|
|
35525
36180
|
padding: 0,
|
|
35526
36181
|
transition: "color 0.15s"
|
|
35527
36182
|
},
|
|
35528
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36183
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
35529
36184
|
txHash.slice(0, 6),
|
|
35530
36185
|
"\u2026",
|
|
35531
36186
|
txHash.slice(-4),
|
|
35532
|
-
/* @__PURE__ */ (0,
|
|
36187
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35533
36188
|
"svg",
|
|
35534
36189
|
{
|
|
35535
36190
|
style: { width: "0.875rem", height: "0.875rem" },
|
|
@@ -35540,7 +36195,7 @@ function SwapMode({
|
|
|
35540
36195
|
strokeLinecap: "round",
|
|
35541
36196
|
strokeLinejoin: "round",
|
|
35542
36197
|
children: [
|
|
35543
|
-
/* @__PURE__ */ (0,
|
|
36198
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35544
36199
|
"rect",
|
|
35545
36200
|
{
|
|
35546
36201
|
x: "9",
|
|
@@ -35551,7 +36206,7 @@ function SwapMode({
|
|
|
35551
36206
|
ry: "2"
|
|
35552
36207
|
}
|
|
35553
36208
|
),
|
|
35554
|
-
/* @__PURE__ */ (0,
|
|
36209
|
+
/* @__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" })
|
|
35555
36210
|
]
|
|
35556
36211
|
}
|
|
35557
36212
|
)
|
|
@@ -35579,10 +36234,10 @@ function SwapMode({
|
|
|
35579
36234
|
dateStyle: "medium",
|
|
35580
36235
|
timeStyle: "short"
|
|
35581
36236
|
}) ?? null;
|
|
35582
|
-
return /* @__PURE__ */ (0,
|
|
35583
|
-
/* @__PURE__ */ (0,
|
|
35584
|
-
/* @__PURE__ */ (0,
|
|
35585
|
-
/* @__PURE__ */ (0,
|
|
36237
|
+
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: [
|
|
36238
|
+
/* @__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 }) }),
|
|
36239
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { padding: `${spacing[6]} ${spacing[6]} 0` }, children: [
|
|
36240
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35586
36241
|
"div",
|
|
35587
36242
|
{
|
|
35588
36243
|
style: {
|
|
@@ -35592,7 +36247,7 @@ function SwapMode({
|
|
|
35592
36247
|
marginBottom: spacing[5]
|
|
35593
36248
|
},
|
|
35594
36249
|
children: [
|
|
35595
|
-
/* @__PURE__ */ (0,
|
|
36250
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35596
36251
|
"div",
|
|
35597
36252
|
{
|
|
35598
36253
|
style: {
|
|
@@ -35605,7 +36260,7 @@ function SwapMode({
|
|
|
35605
36260
|
justifyContent: "center",
|
|
35606
36261
|
flexShrink: 0
|
|
35607
36262
|
},
|
|
35608
|
-
children: /* @__PURE__ */ (0,
|
|
36263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35609
36264
|
"svg",
|
|
35610
36265
|
{
|
|
35611
36266
|
style: {
|
|
@@ -35619,12 +36274,12 @@ function SwapMode({
|
|
|
35619
36274
|
strokeWidth: 3,
|
|
35620
36275
|
strokeLinecap: "round",
|
|
35621
36276
|
strokeLinejoin: "round",
|
|
35622
|
-
children: /* @__PURE__ */ (0,
|
|
36277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M20 6L9 17l-5-5" })
|
|
35623
36278
|
}
|
|
35624
36279
|
)
|
|
35625
36280
|
}
|
|
35626
36281
|
),
|
|
35627
|
-
/* @__PURE__ */ (0,
|
|
36282
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35628
36283
|
"h2",
|
|
35629
36284
|
{
|
|
35630
36285
|
style: {
|
|
@@ -35638,7 +36293,7 @@ function SwapMode({
|
|
|
35638
36293
|
]
|
|
35639
36294
|
}
|
|
35640
36295
|
),
|
|
35641
|
-
/* @__PURE__ */ (0,
|
|
36296
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35642
36297
|
"div",
|
|
35643
36298
|
{
|
|
35644
36299
|
style: {
|
|
@@ -35648,7 +36303,7 @@ function SwapMode({
|
|
|
35648
36303
|
padding: spacing[5]
|
|
35649
36304
|
},
|
|
35650
36305
|
children: [
|
|
35651
|
-
/* @__PURE__ */ (0,
|
|
36306
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35652
36307
|
"div",
|
|
35653
36308
|
{
|
|
35654
36309
|
style: {
|
|
@@ -35658,7 +36313,7 @@ function SwapMode({
|
|
|
35658
36313
|
fontSize: fontSize.sm
|
|
35659
36314
|
},
|
|
35660
36315
|
children: [
|
|
35661
|
-
/* @__PURE__ */ (0,
|
|
36316
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35662
36317
|
"div",
|
|
35663
36318
|
{
|
|
35664
36319
|
style: {
|
|
@@ -35667,8 +36322,8 @@ function SwapMode({
|
|
|
35667
36322
|
gap: spacing[2]
|
|
35668
36323
|
},
|
|
35669
36324
|
children: [
|
|
35670
|
-
fromToken?.iconUrl && /* @__PURE__ */ (0,
|
|
35671
|
-
/* @__PURE__ */ (0,
|
|
36325
|
+
fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
36326
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35672
36327
|
"img",
|
|
35673
36328
|
{
|
|
35674
36329
|
src: fromToken.iconUrl,
|
|
@@ -35680,7 +36335,7 @@ function SwapMode({
|
|
|
35680
36335
|
}
|
|
35681
36336
|
}
|
|
35682
36337
|
),
|
|
35683
|
-
fromChain?.chainIconURI && /* @__PURE__ */ (0,
|
|
36338
|
+
fromChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35684
36339
|
"img",
|
|
35685
36340
|
{
|
|
35686
36341
|
src: fromChain.chainIconURI,
|
|
@@ -35698,11 +36353,11 @@ function SwapMode({
|
|
|
35698
36353
|
}
|
|
35699
36354
|
)
|
|
35700
36355
|
] }),
|
|
35701
|
-
/* @__PURE__ */ (0,
|
|
36356
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "You sold" })
|
|
35702
36357
|
]
|
|
35703
36358
|
}
|
|
35704
36359
|
),
|
|
35705
|
-
/* @__PURE__ */ (0,
|
|
36360
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35706
36361
|
"span",
|
|
35707
36362
|
{
|
|
35708
36363
|
style: {
|
|
@@ -35719,7 +36374,7 @@ function SwapMode({
|
|
|
35719
36374
|
]
|
|
35720
36375
|
}
|
|
35721
36376
|
),
|
|
35722
|
-
/* @__PURE__ */ (0,
|
|
36377
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35723
36378
|
"div",
|
|
35724
36379
|
{
|
|
35725
36380
|
style: {
|
|
@@ -35730,7 +36385,7 @@ function SwapMode({
|
|
|
35730
36385
|
marginTop: spacing[3]
|
|
35731
36386
|
},
|
|
35732
36387
|
children: [
|
|
35733
|
-
/* @__PURE__ */ (0,
|
|
36388
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35734
36389
|
"div",
|
|
35735
36390
|
{
|
|
35736
36391
|
style: {
|
|
@@ -35739,8 +36394,8 @@ function SwapMode({
|
|
|
35739
36394
|
gap: spacing[2]
|
|
35740
36395
|
},
|
|
35741
36396
|
children: [
|
|
35742
|
-
toToken?.iconUrl && /* @__PURE__ */ (0,
|
|
35743
|
-
/* @__PURE__ */ (0,
|
|
36397
|
+
toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
36398
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35744
36399
|
"img",
|
|
35745
36400
|
{
|
|
35746
36401
|
src: toToken.iconUrl,
|
|
@@ -35752,7 +36407,7 @@ function SwapMode({
|
|
|
35752
36407
|
}
|
|
35753
36408
|
}
|
|
35754
36409
|
),
|
|
35755
|
-
toChain?.chainIconURI && /* @__PURE__ */ (0,
|
|
36410
|
+
toChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35756
36411
|
"img",
|
|
35757
36412
|
{
|
|
35758
36413
|
src: toChain.chainIconURI,
|
|
@@ -35770,11 +36425,11 @@ function SwapMode({
|
|
|
35770
36425
|
}
|
|
35771
36426
|
)
|
|
35772
36427
|
] }),
|
|
35773
|
-
/* @__PURE__ */ (0,
|
|
36428
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Received" })
|
|
35774
36429
|
]
|
|
35775
36430
|
}
|
|
35776
36431
|
),
|
|
35777
|
-
/* @__PURE__ */ (0,
|
|
36432
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35778
36433
|
"span",
|
|
35779
36434
|
{
|
|
35780
36435
|
style: {
|
|
@@ -35791,7 +36446,7 @@ function SwapMode({
|
|
|
35791
36446
|
]
|
|
35792
36447
|
}
|
|
35793
36448
|
),
|
|
35794
|
-
/* @__PURE__ */ (0,
|
|
36449
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35795
36450
|
"div",
|
|
35796
36451
|
{
|
|
35797
36452
|
style: {
|
|
@@ -35801,7 +36456,7 @@ function SwapMode({
|
|
|
35801
36456
|
}
|
|
35802
36457
|
}
|
|
35803
36458
|
),
|
|
35804
|
-
/* @__PURE__ */ (0,
|
|
36459
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35805
36460
|
"div",
|
|
35806
36461
|
{
|
|
35807
36462
|
style: {
|
|
@@ -35811,28 +36466,28 @@ function SwapMode({
|
|
|
35811
36466
|
fontSize: fontSize.sm
|
|
35812
36467
|
},
|
|
35813
36468
|
children: [
|
|
35814
|
-
fromUsd > 0 && /* @__PURE__ */ (0,
|
|
36469
|
+
fromUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35815
36470
|
SuccessReceiptRow,
|
|
35816
36471
|
{
|
|
35817
36472
|
label: "Value sold",
|
|
35818
36473
|
value: fmtLocal(fromUsd)
|
|
35819
36474
|
}
|
|
35820
36475
|
),
|
|
35821
|
-
toUsd > 0 && /* @__PURE__ */ (0,
|
|
36476
|
+
toUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35822
36477
|
SuccessReceiptRow,
|
|
35823
36478
|
{
|
|
35824
36479
|
label: "Value received",
|
|
35825
36480
|
value: fmtLocal(toUsd)
|
|
35826
36481
|
}
|
|
35827
36482
|
),
|
|
35828
|
-
effectiveRate && /* @__PURE__ */ (0,
|
|
36483
|
+
effectiveRate && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35829
36484
|
SuccessReceiptRow,
|
|
35830
36485
|
{
|
|
35831
36486
|
label: "Effective rate",
|
|
35832
36487
|
value: effectiveRate
|
|
35833
36488
|
}
|
|
35834
36489
|
),
|
|
35835
|
-
completedStr && /* @__PURE__ */ (0,
|
|
36490
|
+
completedStr && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SuccessReceiptRow, { label: "Completed", value: completedStr }),
|
|
35836
36491
|
txHash && (() => {
|
|
35837
36492
|
const srcUrl = buildExplorerUrl(
|
|
35838
36493
|
txHash,
|
|
@@ -35840,7 +36495,7 @@ function SwapMode({
|
|
|
35840
36495
|
fromChainTxUrl
|
|
35841
36496
|
);
|
|
35842
36497
|
const isCopied = copiedHash === txHash;
|
|
35843
|
-
return /* @__PURE__ */ (0,
|
|
36498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35844
36499
|
"div",
|
|
35845
36500
|
{
|
|
35846
36501
|
style: {
|
|
@@ -35849,8 +36504,8 @@ function SwapMode({
|
|
|
35849
36504
|
justifyContent: "space-between"
|
|
35850
36505
|
},
|
|
35851
36506
|
children: [
|
|
35852
|
-
/* @__PURE__ */ (0,
|
|
35853
|
-
/* @__PURE__ */ (0,
|
|
36507
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: destTxHash ? "Source tx" : "Transaction" }),
|
|
36508
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35854
36509
|
"div",
|
|
35855
36510
|
{
|
|
35856
36511
|
style: {
|
|
@@ -35859,7 +36514,7 @@ function SwapMode({
|
|
|
35859
36514
|
gap: spacing[2]
|
|
35860
36515
|
},
|
|
35861
36516
|
children: [
|
|
35862
|
-
srcUrl && /* @__PURE__ */ (0,
|
|
36517
|
+
srcUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35863
36518
|
"a",
|
|
35864
36519
|
{
|
|
35865
36520
|
href: srcUrl,
|
|
@@ -35879,7 +36534,7 @@ function SwapMode({
|
|
|
35879
36534
|
txHash.slice(0, 6),
|
|
35880
36535
|
"\u2026",
|
|
35881
36536
|
txHash.slice(-4),
|
|
35882
|
-
/* @__PURE__ */ (0,
|
|
36537
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35883
36538
|
"svg",
|
|
35884
36539
|
{
|
|
35885
36540
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -35890,16 +36545,16 @@ function SwapMode({
|
|
|
35890
36545
|
strokeLinecap: "round",
|
|
35891
36546
|
strokeLinejoin: "round",
|
|
35892
36547
|
children: [
|
|
35893
|
-
/* @__PURE__ */ (0,
|
|
35894
|
-
/* @__PURE__ */ (0,
|
|
35895
|
-
/* @__PURE__ */ (0,
|
|
36548
|
+
/* @__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" }),
|
|
36549
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36550
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
35896
36551
|
]
|
|
35897
36552
|
}
|
|
35898
36553
|
)
|
|
35899
36554
|
]
|
|
35900
36555
|
}
|
|
35901
36556
|
),
|
|
35902
|
-
/* @__PURE__ */ (0,
|
|
36557
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35903
36558
|
"button",
|
|
35904
36559
|
{
|
|
35905
36560
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -35917,7 +36572,7 @@ function SwapMode({
|
|
|
35917
36572
|
padding: 0,
|
|
35918
36573
|
transition: "color 0.15s"
|
|
35919
36574
|
},
|
|
35920
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36575
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35921
36576
|
"svg",
|
|
35922
36577
|
{
|
|
35923
36578
|
style: {
|
|
@@ -35931,7 +36586,7 @@ function SwapMode({
|
|
|
35931
36586
|
strokeLinecap: "round",
|
|
35932
36587
|
strokeLinejoin: "round",
|
|
35933
36588
|
children: [
|
|
35934
|
-
/* @__PURE__ */ (0,
|
|
36589
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
35935
36590
|
"rect",
|
|
35936
36591
|
{
|
|
35937
36592
|
x: "9",
|
|
@@ -35942,7 +36597,7 @@ function SwapMode({
|
|
|
35942
36597
|
ry: "2"
|
|
35943
36598
|
}
|
|
35944
36599
|
),
|
|
35945
|
-
/* @__PURE__ */ (0,
|
|
36600
|
+
/* @__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" })
|
|
35946
36601
|
]
|
|
35947
36602
|
}
|
|
35948
36603
|
)
|
|
@@ -35962,7 +36617,7 @@ function SwapMode({
|
|
|
35962
36617
|
toChainTxUrl
|
|
35963
36618
|
);
|
|
35964
36619
|
const isCopied = copiedHash === destTxHash;
|
|
35965
|
-
return /* @__PURE__ */ (0,
|
|
36620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35966
36621
|
"div",
|
|
35967
36622
|
{
|
|
35968
36623
|
style: {
|
|
@@ -35971,8 +36626,8 @@ function SwapMode({
|
|
|
35971
36626
|
justifyContent: "space-between"
|
|
35972
36627
|
},
|
|
35973
36628
|
children: [
|
|
35974
|
-
/* @__PURE__ */ (0,
|
|
35975
|
-
/* @__PURE__ */ (0,
|
|
36629
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Destination tx" }),
|
|
36630
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35976
36631
|
"div",
|
|
35977
36632
|
{
|
|
35978
36633
|
style: {
|
|
@@ -35981,7 +36636,7 @@ function SwapMode({
|
|
|
35981
36636
|
gap: spacing[2]
|
|
35982
36637
|
},
|
|
35983
36638
|
children: [
|
|
35984
|
-
destUrl && /* @__PURE__ */ (0,
|
|
36639
|
+
destUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
35985
36640
|
"a",
|
|
35986
36641
|
{
|
|
35987
36642
|
href: destUrl,
|
|
@@ -36001,7 +36656,7 @@ function SwapMode({
|
|
|
36001
36656
|
destTxHash.slice(0, 6),
|
|
36002
36657
|
"\u2026",
|
|
36003
36658
|
destTxHash.slice(-4),
|
|
36004
|
-
/* @__PURE__ */ (0,
|
|
36659
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36005
36660
|
"svg",
|
|
36006
36661
|
{
|
|
36007
36662
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -36012,16 +36667,16 @@ function SwapMode({
|
|
|
36012
36667
|
strokeLinecap: "round",
|
|
36013
36668
|
strokeLinejoin: "round",
|
|
36014
36669
|
children: [
|
|
36015
|
-
/* @__PURE__ */ (0,
|
|
36016
|
-
/* @__PURE__ */ (0,
|
|
36017
|
-
/* @__PURE__ */ (0,
|
|
36670
|
+
/* @__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" }),
|
|
36671
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
36672
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
36018
36673
|
]
|
|
36019
36674
|
}
|
|
36020
36675
|
)
|
|
36021
36676
|
]
|
|
36022
36677
|
}
|
|
36023
36678
|
),
|
|
36024
|
-
/* @__PURE__ */ (0,
|
|
36679
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36025
36680
|
"button",
|
|
36026
36681
|
{
|
|
36027
36682
|
onClick: () => handleCopyHash(destTxHash),
|
|
@@ -36038,7 +36693,7 @@ function SwapMode({
|
|
|
36038
36693
|
padding: 0,
|
|
36039
36694
|
transition: "color 0.15s"
|
|
36040
36695
|
},
|
|
36041
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ (0,
|
|
36696
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36042
36697
|
"svg",
|
|
36043
36698
|
{
|
|
36044
36699
|
style: {
|
|
@@ -36052,7 +36707,7 @@ function SwapMode({
|
|
|
36052
36707
|
strokeLinecap: "round",
|
|
36053
36708
|
strokeLinejoin: "round",
|
|
36054
36709
|
children: [
|
|
36055
|
-
/* @__PURE__ */ (0,
|
|
36710
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36056
36711
|
"rect",
|
|
36057
36712
|
{
|
|
36058
36713
|
x: "9",
|
|
@@ -36063,7 +36718,7 @@ function SwapMode({
|
|
|
36063
36718
|
ry: "2"
|
|
36064
36719
|
}
|
|
36065
36720
|
),
|
|
36066
|
-
/* @__PURE__ */ (0,
|
|
36721
|
+
/* @__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" })
|
|
36067
36722
|
]
|
|
36068
36723
|
}
|
|
36069
36724
|
)
|
|
@@ -36083,7 +36738,7 @@ function SwapMode({
|
|
|
36083
36738
|
}
|
|
36084
36739
|
)
|
|
36085
36740
|
] }),
|
|
36086
|
-
/* @__PURE__ */ (0,
|
|
36741
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36087
36742
|
"div",
|
|
36088
36743
|
{
|
|
36089
36744
|
style: {
|
|
@@ -36093,7 +36748,7 @@ function SwapMode({
|
|
|
36093
36748
|
gap: spacing[2]
|
|
36094
36749
|
},
|
|
36095
36750
|
children: [
|
|
36096
|
-
/* @__PURE__ */ (0,
|
|
36751
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36097
36752
|
"button",
|
|
36098
36753
|
{
|
|
36099
36754
|
onClick: handleReset,
|
|
@@ -36111,7 +36766,7 @@ function SwapMode({
|
|
|
36111
36766
|
children: "Done"
|
|
36112
36767
|
}
|
|
36113
36768
|
),
|
|
36114
|
-
fromToken && toToken && /* @__PURE__ */ (0,
|
|
36769
|
+
fromToken && toToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36115
36770
|
"button",
|
|
36116
36771
|
{
|
|
36117
36772
|
onClick: handleSwapBack,
|
|
@@ -36140,7 +36795,7 @@ function SwapMode({
|
|
|
36140
36795
|
] }) });
|
|
36141
36796
|
}
|
|
36142
36797
|
if (stage === "error") {
|
|
36143
|
-
return /* @__PURE__ */ (0,
|
|
36798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36144
36799
|
ErrorPage,
|
|
36145
36800
|
{
|
|
36146
36801
|
error: mapError(execution.errorMessage),
|
|
@@ -36152,7 +36807,7 @@ function SwapMode({
|
|
|
36152
36807
|
if (stage === "review") {
|
|
36153
36808
|
const reviewToAmount = toAmount ?? displayToAmount;
|
|
36154
36809
|
const reviewToUsd = toUsd > 0 ? toUsd : displayToUsd;
|
|
36155
|
-
return /* @__PURE__ */ (0,
|
|
36810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36156
36811
|
"div",
|
|
36157
36812
|
{
|
|
36158
36813
|
style: {
|
|
@@ -36161,7 +36816,7 @@ function SwapMode({
|
|
|
36161
36816
|
overflowY: "auto"
|
|
36162
36817
|
},
|
|
36163
36818
|
children: [
|
|
36164
|
-
/* @__PURE__ */ (0,
|
|
36819
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36165
36820
|
"div",
|
|
36166
36821
|
{
|
|
36167
36822
|
style: {
|
|
@@ -36171,7 +36826,7 @@ function SwapMode({
|
|
|
36171
36826
|
marginBottom: spacing[5]
|
|
36172
36827
|
},
|
|
36173
36828
|
children: [
|
|
36174
|
-
/* @__PURE__ */ (0,
|
|
36829
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36175
36830
|
"span",
|
|
36176
36831
|
{
|
|
36177
36832
|
style: {
|
|
@@ -36182,7 +36837,7 @@ function SwapMode({
|
|
|
36182
36837
|
children: "You're swapping"
|
|
36183
36838
|
}
|
|
36184
36839
|
),
|
|
36185
|
-
/* @__PURE__ */ (0,
|
|
36840
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36186
36841
|
"button",
|
|
36187
36842
|
{
|
|
36188
36843
|
onClick: () => setStage("home"),
|
|
@@ -36197,7 +36852,7 @@ function SwapMode({
|
|
|
36197
36852
|
border: 0,
|
|
36198
36853
|
cursor: "pointer"
|
|
36199
36854
|
},
|
|
36200
|
-
children: /* @__PURE__ */ (0,
|
|
36855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36201
36856
|
"svg",
|
|
36202
36857
|
{
|
|
36203
36858
|
style: {
|
|
@@ -36211,7 +36866,7 @@ function SwapMode({
|
|
|
36211
36866
|
strokeWidth: 2,
|
|
36212
36867
|
strokeLinecap: "round",
|
|
36213
36868
|
strokeLinejoin: "round",
|
|
36214
|
-
children: /* @__PURE__ */ (0,
|
|
36869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
36215
36870
|
}
|
|
36216
36871
|
)
|
|
36217
36872
|
}
|
|
@@ -36219,7 +36874,7 @@ function SwapMode({
|
|
|
36219
36874
|
]
|
|
36220
36875
|
}
|
|
36221
36876
|
),
|
|
36222
|
-
/* @__PURE__ */ (0,
|
|
36877
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36223
36878
|
"div",
|
|
36224
36879
|
{
|
|
36225
36880
|
style: {
|
|
@@ -36228,8 +36883,8 @@ function SwapMode({
|
|
|
36228
36883
|
justifyContent: "space-between"
|
|
36229
36884
|
},
|
|
36230
36885
|
children: [
|
|
36231
|
-
/* @__PURE__ */ (0,
|
|
36232
|
-
/* @__PURE__ */ (0,
|
|
36886
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
36887
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36233
36888
|
"p",
|
|
36234
36889
|
{
|
|
36235
36890
|
style: {
|
|
@@ -36245,7 +36900,7 @@ function SwapMode({
|
|
|
36245
36900
|
]
|
|
36246
36901
|
}
|
|
36247
36902
|
),
|
|
36248
|
-
/* @__PURE__ */ (0,
|
|
36903
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36249
36904
|
"p",
|
|
36250
36905
|
{
|
|
36251
36906
|
style: {
|
|
@@ -36257,7 +36912,7 @@ function SwapMode({
|
|
|
36257
36912
|
}
|
|
36258
36913
|
)
|
|
36259
36914
|
] }),
|
|
36260
|
-
fromToken?.iconUrl && /* @__PURE__ */ (0,
|
|
36915
|
+
fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36261
36916
|
TokenIcon,
|
|
36262
36917
|
{
|
|
36263
36918
|
icon: fromToken.iconUrl,
|
|
@@ -36268,7 +36923,7 @@ function SwapMode({
|
|
|
36268
36923
|
]
|
|
36269
36924
|
}
|
|
36270
36925
|
),
|
|
36271
|
-
/* @__PURE__ */ (0,
|
|
36926
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36272
36927
|
"div",
|
|
36273
36928
|
{
|
|
36274
36929
|
style: {
|
|
@@ -36276,7 +36931,7 @@ function SwapMode({
|
|
|
36276
36931
|
justifyContent: "center",
|
|
36277
36932
|
margin: `${spacing[3]} 0`
|
|
36278
36933
|
},
|
|
36279
|
-
children: /* @__PURE__ */ (0,
|
|
36934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36280
36935
|
"svg",
|
|
36281
36936
|
{
|
|
36282
36937
|
style: {
|
|
@@ -36290,12 +36945,12 @@ function SwapMode({
|
|
|
36290
36945
|
strokeWidth: 2,
|
|
36291
36946
|
strokeLinecap: "round",
|
|
36292
36947
|
strokeLinejoin: "round",
|
|
36293
|
-
children: /* @__PURE__ */ (0,
|
|
36948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 5v14m-7-7l7 7 7-7" })
|
|
36294
36949
|
}
|
|
36295
36950
|
)
|
|
36296
36951
|
}
|
|
36297
36952
|
),
|
|
36298
|
-
/* @__PURE__ */ (0,
|
|
36953
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36299
36954
|
"div",
|
|
36300
36955
|
{
|
|
36301
36956
|
style: {
|
|
@@ -36304,8 +36959,8 @@ function SwapMode({
|
|
|
36304
36959
|
justifyContent: "space-between"
|
|
36305
36960
|
},
|
|
36306
36961
|
children: [
|
|
36307
|
-
/* @__PURE__ */ (0,
|
|
36308
|
-
/* @__PURE__ */ (0,
|
|
36962
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
36963
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36309
36964
|
"p",
|
|
36310
36965
|
{
|
|
36311
36966
|
style: {
|
|
@@ -36321,7 +36976,7 @@ function SwapMode({
|
|
|
36321
36976
|
]
|
|
36322
36977
|
}
|
|
36323
36978
|
),
|
|
36324
|
-
/* @__PURE__ */ (0,
|
|
36979
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36325
36980
|
"p",
|
|
36326
36981
|
{
|
|
36327
36982
|
style: {
|
|
@@ -36333,7 +36988,7 @@ function SwapMode({
|
|
|
36333
36988
|
}
|
|
36334
36989
|
)
|
|
36335
36990
|
] }),
|
|
36336
|
-
toToken?.iconUrl && /* @__PURE__ */ (0,
|
|
36991
|
+
toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36337
36992
|
TokenIcon,
|
|
36338
36993
|
{
|
|
36339
36994
|
icon: toToken.iconUrl,
|
|
@@ -36344,7 +36999,7 @@ function SwapMode({
|
|
|
36344
36999
|
]
|
|
36345
37000
|
}
|
|
36346
37001
|
),
|
|
36347
|
-
/* @__PURE__ */ (0,
|
|
37002
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36348
37003
|
"button",
|
|
36349
37004
|
{
|
|
36350
37005
|
onClick: () => setShowReviewDetails((v) => !v),
|
|
@@ -36363,13 +37018,13 @@ function SwapMode({
|
|
|
36363
37018
|
padding: 0
|
|
36364
37019
|
},
|
|
36365
37020
|
children: [
|
|
36366
|
-
/* @__PURE__ */ (0,
|
|
37021
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36367
37022
|
"div",
|
|
36368
37023
|
{
|
|
36369
37024
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
36370
37025
|
}
|
|
36371
37026
|
),
|
|
36372
|
-
/* @__PURE__ */ (0,
|
|
37027
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36373
37028
|
"span",
|
|
36374
37029
|
{
|
|
36375
37030
|
style: {
|
|
@@ -36381,7 +37036,7 @@ function SwapMode({
|
|
|
36381
37036
|
},
|
|
36382
37037
|
children: [
|
|
36383
37038
|
showReviewDetails ? "Hide details" : "View details",
|
|
36384
|
-
/* @__PURE__ */ (0,
|
|
37039
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36385
37040
|
"svg",
|
|
36386
37041
|
{
|
|
36387
37042
|
style: {
|
|
@@ -36396,10 +37051,10 @@ function SwapMode({
|
|
|
36396
37051
|
strokeWidth: 2,
|
|
36397
37052
|
strokeLinecap: "round",
|
|
36398
37053
|
strokeLinejoin: "round",
|
|
36399
|
-
children: /* @__PURE__ */ (0,
|
|
37054
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
36400
37055
|
}
|
|
36401
37056
|
),
|
|
36402
|
-
route.data && /* @__PURE__ */ (0,
|
|
37057
|
+
route.data && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36403
37058
|
"svg",
|
|
36404
37059
|
{
|
|
36405
37060
|
width: "14",
|
|
@@ -36412,7 +37067,7 @@ function SwapMode({
|
|
|
36412
37067
|
marginLeft: "0.125rem"
|
|
36413
37068
|
},
|
|
36414
37069
|
children: [
|
|
36415
|
-
/* @__PURE__ */ (0,
|
|
37070
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36416
37071
|
"circle",
|
|
36417
37072
|
{
|
|
36418
37073
|
cx: "7",
|
|
@@ -36423,7 +37078,7 @@ function SwapMode({
|
|
|
36423
37078
|
strokeWidth: "1.5"
|
|
36424
37079
|
}
|
|
36425
37080
|
),
|
|
36426
|
-
/* @__PURE__ */ (0,
|
|
37081
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36427
37082
|
"circle",
|
|
36428
37083
|
{
|
|
36429
37084
|
cx: "7",
|
|
@@ -36444,7 +37099,7 @@ function SwapMode({
|
|
|
36444
37099
|
]
|
|
36445
37100
|
}
|
|
36446
37101
|
),
|
|
36447
|
-
/* @__PURE__ */ (0,
|
|
37102
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36448
37103
|
"div",
|
|
36449
37104
|
{
|
|
36450
37105
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
@@ -36453,7 +37108,7 @@ function SwapMode({
|
|
|
36453
37108
|
]
|
|
36454
37109
|
}
|
|
36455
37110
|
),
|
|
36456
|
-
showReviewDetails && /* @__PURE__ */ (0,
|
|
37111
|
+
showReviewDetails && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36457
37112
|
"div",
|
|
36458
37113
|
{
|
|
36459
37114
|
style: {
|
|
@@ -36464,7 +37119,7 @@ function SwapMode({
|
|
|
36464
37119
|
marginBottom: spacing[2]
|
|
36465
37120
|
},
|
|
36466
37121
|
children: [
|
|
36467
|
-
exchangeRate !== null && /* @__PURE__ */ (0,
|
|
37122
|
+
exchangeRate !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36468
37123
|
ReviewDetailRow,
|
|
36469
37124
|
{
|
|
36470
37125
|
label: "Rate",
|
|
@@ -36472,7 +37127,7 @@ function SwapMode({
|
|
|
36472
37127
|
value: `1 ${fromToken?.symbol} = ${fmtAmount(1 / (exchangeRate ?? 1), 4)} ${toToken?.symbol} ($${fmtAmount(fromTokenPriceUSD, 2)})`
|
|
36473
37128
|
}
|
|
36474
37129
|
),
|
|
36475
|
-
/* @__PURE__ */ (0,
|
|
37130
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36476
37131
|
ReviewDetailRow,
|
|
36477
37132
|
{
|
|
36478
37133
|
label: "Fee",
|
|
@@ -36480,12 +37135,12 @@ function SwapMode({
|
|
|
36480
37135
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
36481
37136
|
}
|
|
36482
37137
|
),
|
|
36483
|
-
/* @__PURE__ */ (0,
|
|
37138
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36484
37139
|
ReviewDetailRow,
|
|
36485
37140
|
{
|
|
36486
37141
|
label: "Network cost",
|
|
36487
37142
|
tooltip: "Estimated gas fee paid to the blockchain network",
|
|
36488
|
-
value: isGasSponsored ? /* @__PURE__ */ (0,
|
|
37143
|
+
value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36489
37144
|
"span",
|
|
36490
37145
|
{
|
|
36491
37146
|
style: {
|
|
@@ -36494,14 +37149,14 @@ function SwapMode({
|
|
|
36494
37149
|
gap: "0.25rem"
|
|
36495
37150
|
},
|
|
36496
37151
|
children: [
|
|
36497
|
-
/* @__PURE__ */ (0,
|
|
37152
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, { size: "0.875rem" }),
|
|
36498
37153
|
fmtLocal(networkCostUsd)
|
|
36499
37154
|
]
|
|
36500
37155
|
}
|
|
36501
37156
|
) : "\u2014"
|
|
36502
37157
|
}
|
|
36503
37158
|
),
|
|
36504
|
-
/* @__PURE__ */ (0,
|
|
37159
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36505
37160
|
ReviewDetailRow,
|
|
36506
37161
|
{
|
|
36507
37162
|
label: "Max slippage",
|
|
@@ -36509,12 +37164,12 @@ function SwapMode({
|
|
|
36509
37164
|
value: `${slippage}%`
|
|
36510
37165
|
}
|
|
36511
37166
|
),
|
|
36512
|
-
(routePath || route.data?.route?.provider) && /* @__PURE__ */ (0,
|
|
37167
|
+
(routePath || route.data?.route?.provider) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36513
37168
|
ReviewDetailRow,
|
|
36514
37169
|
{
|
|
36515
37170
|
label: "Route",
|
|
36516
37171
|
tooltip: "Protocol or bridge used to execute your swap",
|
|
36517
|
-
value: /* @__PURE__ */ (0,
|
|
37172
|
+
value: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36518
37173
|
"span",
|
|
36519
37174
|
{
|
|
36520
37175
|
style: {
|
|
@@ -36534,7 +37189,7 @@ function SwapMode({
|
|
|
36534
37189
|
]
|
|
36535
37190
|
}
|
|
36536
37191
|
),
|
|
36537
|
-
/* @__PURE__ */ (0,
|
|
37192
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36538
37193
|
SwapActionArea,
|
|
36539
37194
|
{
|
|
36540
37195
|
fromTokenSymbol: fromToken?.symbol ?? "",
|
|
@@ -36553,12 +37208,12 @@ function SwapMode({
|
|
|
36553
37208
|
const ctaDisabled = !hasTokens || !hasAmount || insufficient || isConnected && needsDestAddress && !isValidDestAddress || route.loading;
|
|
36554
37209
|
const ctaAction = !isConnected ? handleConnectAndReview : () => void handleReview();
|
|
36555
37210
|
const showRateRow = hasTokens && exchangeRate !== null;
|
|
36556
|
-
return /* @__PURE__ */ (0,
|
|
37211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36557
37212
|
"div",
|
|
36558
37213
|
{
|
|
36559
37214
|
style: { display: "flex", flexDirection: "column", minHeight: "500px" },
|
|
36560
37215
|
children: [
|
|
36561
|
-
/* @__PURE__ */ (0,
|
|
37216
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36562
37217
|
"div",
|
|
36563
37218
|
{
|
|
36564
37219
|
style: {
|
|
@@ -36569,7 +37224,7 @@ function SwapMode({
|
|
|
36569
37224
|
marginBottom: spacing[1]
|
|
36570
37225
|
},
|
|
36571
37226
|
children: [
|
|
36572
|
-
/* @__PURE__ */ (0,
|
|
37227
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36573
37228
|
"span",
|
|
36574
37229
|
{
|
|
36575
37230
|
style: {
|
|
@@ -36583,7 +37238,7 @@ function SwapMode({
|
|
|
36583
37238
|
children: "Swap"
|
|
36584
37239
|
}
|
|
36585
37240
|
),
|
|
36586
|
-
/* @__PURE__ */ (0,
|
|
37241
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36587
37242
|
"div",
|
|
36588
37243
|
{
|
|
36589
37244
|
ref: settingsRef,
|
|
@@ -36594,7 +37249,7 @@ function SwapMode({
|
|
|
36594
37249
|
position: "relative"
|
|
36595
37250
|
},
|
|
36596
37251
|
children: [
|
|
36597
|
-
walletAddress ? /* @__PURE__ */ (0,
|
|
37252
|
+
walletAddress ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36598
37253
|
"button",
|
|
36599
37254
|
{
|
|
36600
37255
|
onClick: () => void disconnectWallet(),
|
|
@@ -36612,7 +37267,7 @@ function SwapMode({
|
|
|
36612
37267
|
" \xD7"
|
|
36613
37268
|
]
|
|
36614
37269
|
}
|
|
36615
|
-
) : /* @__PURE__ */ (0,
|
|
37270
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36616
37271
|
"button",
|
|
36617
37272
|
{
|
|
36618
37273
|
onClick: handleConnectAndReview,
|
|
@@ -36627,7 +37282,7 @@ function SwapMode({
|
|
|
36627
37282
|
children: "Connect wallet"
|
|
36628
37283
|
}
|
|
36629
37284
|
),
|
|
36630
|
-
/* @__PURE__ */ (0,
|
|
37285
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36631
37286
|
"button",
|
|
36632
37287
|
{
|
|
36633
37288
|
onClick: () => setShowSettings((v) => !v),
|
|
@@ -36645,7 +37300,7 @@ function SwapMode({
|
|
|
36645
37300
|
color: colors.mutedForeground,
|
|
36646
37301
|
padding: 0
|
|
36647
37302
|
},
|
|
36648
|
-
children: /* @__PURE__ */ (0,
|
|
37303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36649
37304
|
"svg",
|
|
36650
37305
|
{
|
|
36651
37306
|
style: { width: "1rem", height: "1rem" },
|
|
@@ -36656,14 +37311,14 @@ function SwapMode({
|
|
|
36656
37311
|
strokeLinecap: "round",
|
|
36657
37312
|
strokeLinejoin: "round",
|
|
36658
37313
|
children: [
|
|
36659
|
-
/* @__PURE__ */ (0,
|
|
36660
|
-
/* @__PURE__ */ (0,
|
|
37314
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
37315
|
+
/* @__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" })
|
|
36661
37316
|
]
|
|
36662
37317
|
}
|
|
36663
37318
|
)
|
|
36664
37319
|
}
|
|
36665
37320
|
),
|
|
36666
|
-
showSettings && /* @__PURE__ */ (0,
|
|
37321
|
+
showSettings && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36667
37322
|
"div",
|
|
36668
37323
|
{
|
|
36669
37324
|
style: {
|
|
@@ -36679,7 +37334,7 @@ function SwapMode({
|
|
|
36679
37334
|
zIndex: 100
|
|
36680
37335
|
},
|
|
36681
37336
|
children: [
|
|
36682
|
-
/* @__PURE__ */ (0,
|
|
37337
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36683
37338
|
"p",
|
|
36684
37339
|
{
|
|
36685
37340
|
style: {
|
|
@@ -36693,7 +37348,7 @@ function SwapMode({
|
|
|
36693
37348
|
children: "Appearance"
|
|
36694
37349
|
}
|
|
36695
37350
|
),
|
|
36696
|
-
/* @__PURE__ */ (0,
|
|
37351
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36697
37352
|
"div",
|
|
36698
37353
|
{
|
|
36699
37354
|
style: {
|
|
@@ -36702,8 +37357,8 @@ function SwapMode({
|
|
|
36702
37357
|
justifyContent: "space-between"
|
|
36703
37358
|
},
|
|
36704
37359
|
children: [
|
|
36705
|
-
/* @__PURE__ */ (0,
|
|
36706
|
-
/* @__PURE__ */ (0,
|
|
37360
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
37361
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36707
37362
|
"p",
|
|
36708
37363
|
{
|
|
36709
37364
|
style: {
|
|
@@ -36714,7 +37369,7 @@ function SwapMode({
|
|
|
36714
37369
|
children: "Dark mode"
|
|
36715
37370
|
}
|
|
36716
37371
|
),
|
|
36717
|
-
/* @__PURE__ */ (0,
|
|
37372
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36718
37373
|
"p",
|
|
36719
37374
|
{
|
|
36720
37375
|
style: {
|
|
@@ -36726,7 +37381,7 @@ function SwapMode({
|
|
|
36726
37381
|
}
|
|
36727
37382
|
)
|
|
36728
37383
|
] }),
|
|
36729
|
-
/* @__PURE__ */ (0,
|
|
37384
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36730
37385
|
"button",
|
|
36731
37386
|
{
|
|
36732
37387
|
role: "switch",
|
|
@@ -36743,7 +37398,7 @@ function SwapMode({
|
|
|
36743
37398
|
transition: "background-color 0.2s",
|
|
36744
37399
|
flexShrink: 0
|
|
36745
37400
|
},
|
|
36746
|
-
children: /* @__PURE__ */ (0,
|
|
37401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36747
37402
|
"span",
|
|
36748
37403
|
{
|
|
36749
37404
|
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
|
"p",
|
|
36769
37424
|
{
|
|
36770
37425
|
style: {
|
|
@@ -36778,8 +37433,8 @@ function SwapMode({
|
|
|
36778
37433
|
children: "Transaction Settings"
|
|
36779
37434
|
}
|
|
36780
37435
|
),
|
|
36781
|
-
/* @__PURE__ */ (0,
|
|
36782
|
-
/* @__PURE__ */ (0,
|
|
37436
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { marginBottom: spacing[4] }, children: [
|
|
37437
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36783
37438
|
"p",
|
|
36784
37439
|
{
|
|
36785
37440
|
style: {
|
|
@@ -36791,8 +37446,8 @@ function SwapMode({
|
|
|
36791
37446
|
children: "Max slippage"
|
|
36792
37447
|
}
|
|
36793
37448
|
),
|
|
36794
|
-
/* @__PURE__ */ (0,
|
|
36795
|
-
[0.1, 0.5, 1].map((v) => /* @__PURE__ */ (0,
|
|
37449
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", gap: spacing[1.5] }, children: [
|
|
37450
|
+
[0.1, 0.5, 1].map((v) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36796
37451
|
"button",
|
|
36797
37452
|
{
|
|
36798
37453
|
onClick: () => {
|
|
@@ -36817,7 +37472,7 @@ function SwapMode({
|
|
|
36817
37472
|
},
|
|
36818
37473
|
v
|
|
36819
37474
|
)),
|
|
36820
|
-
/* @__PURE__ */ (0,
|
|
37475
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { flex: 1.5, position: "relative" }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36821
37476
|
"input",
|
|
36822
37477
|
{
|
|
36823
37478
|
type: "number",
|
|
@@ -36848,7 +37503,7 @@ function SwapMode({
|
|
|
36848
37503
|
}
|
|
36849
37504
|
) })
|
|
36850
37505
|
] }),
|
|
36851
|
-
slippage > 5 && /* @__PURE__ */ (0,
|
|
37506
|
+
slippage > 5 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36852
37507
|
"p",
|
|
36853
37508
|
{
|
|
36854
37509
|
style: {
|
|
@@ -36860,7 +37515,7 @@ function SwapMode({
|
|
|
36860
37515
|
}
|
|
36861
37516
|
)
|
|
36862
37517
|
] }),
|
|
36863
|
-
/* @__PURE__ */ (0,
|
|
37518
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36864
37519
|
"div",
|
|
36865
37520
|
{
|
|
36866
37521
|
style: {
|
|
@@ -36869,8 +37524,8 @@ function SwapMode({
|
|
|
36869
37524
|
justifyContent: "space-between"
|
|
36870
37525
|
},
|
|
36871
37526
|
children: [
|
|
36872
|
-
/* @__PURE__ */ (0,
|
|
36873
|
-
/* @__PURE__ */ (0,
|
|
37527
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
37528
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36874
37529
|
"p",
|
|
36875
37530
|
{
|
|
36876
37531
|
style: {
|
|
@@ -36881,7 +37536,7 @@ function SwapMode({
|
|
|
36881
37536
|
children: "Max approval"
|
|
36882
37537
|
}
|
|
36883
37538
|
),
|
|
36884
|
-
/* @__PURE__ */ (0,
|
|
37539
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36885
37540
|
"p",
|
|
36886
37541
|
{
|
|
36887
37542
|
style: {
|
|
@@ -36893,7 +37548,7 @@ function SwapMode({
|
|
|
36893
37548
|
}
|
|
36894
37549
|
)
|
|
36895
37550
|
] }),
|
|
36896
|
-
/* @__PURE__ */ (0,
|
|
37551
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36897
37552
|
"button",
|
|
36898
37553
|
{
|
|
36899
37554
|
role: "switch",
|
|
@@ -36910,7 +37565,7 @@ function SwapMode({
|
|
|
36910
37565
|
transition: "background-color 0.2s",
|
|
36911
37566
|
flexShrink: 0
|
|
36912
37567
|
},
|
|
36913
|
-
children: /* @__PURE__ */ (0,
|
|
37568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36914
37569
|
"span",
|
|
36915
37570
|
{
|
|
36916
37571
|
style: {
|
|
@@ -36931,7 +37586,7 @@ function SwapMode({
|
|
|
36931
37586
|
]
|
|
36932
37587
|
}
|
|
36933
37588
|
) }),
|
|
36934
|
-
/* @__PURE__ */ (0,
|
|
37589
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36935
37590
|
"div",
|
|
36936
37591
|
{
|
|
36937
37592
|
style: {
|
|
@@ -36941,7 +37596,7 @@ function SwapMode({
|
|
|
36941
37596
|
gap: spacing[3]
|
|
36942
37597
|
},
|
|
36943
37598
|
children: [
|
|
36944
|
-
/* @__PURE__ */ (0,
|
|
37599
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36945
37600
|
"p",
|
|
36946
37601
|
{
|
|
36947
37602
|
style: {
|
|
@@ -36953,13 +37608,13 @@ function SwapMode({
|
|
|
36953
37608
|
children: "Display currency"
|
|
36954
37609
|
}
|
|
36955
37610
|
),
|
|
36956
|
-
/* @__PURE__ */ (0,
|
|
37611
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36957
37612
|
"div",
|
|
36958
37613
|
{
|
|
36959
37614
|
ref: currencyDropdownRef,
|
|
36960
37615
|
style: { position: "relative", flexShrink: 0 },
|
|
36961
37616
|
children: [
|
|
36962
|
-
/* @__PURE__ */ (0,
|
|
37617
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
36963
37618
|
"button",
|
|
36964
37619
|
{
|
|
36965
37620
|
onClick: () => setShowCurrencyDropdown((v) => !v),
|
|
@@ -36979,9 +37634,9 @@ function SwapMode({
|
|
|
36979
37634
|
whiteSpace: "nowrap"
|
|
36980
37635
|
},
|
|
36981
37636
|
children: [
|
|
36982
|
-
/* @__PURE__ */ (0,
|
|
36983
|
-
/* @__PURE__ */ (0,
|
|
36984
|
-
/* @__PURE__ */ (0,
|
|
37637
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: currencySymbol }),
|
|
37638
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: selectedCurrency }),
|
|
37639
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
36985
37640
|
"svg",
|
|
36986
37641
|
{
|
|
36987
37642
|
style: {
|
|
@@ -36997,13 +37652,13 @@ function SwapMode({
|
|
|
36997
37652
|
strokeWidth: 2.5,
|
|
36998
37653
|
strokeLinecap: "round",
|
|
36999
37654
|
strokeLinejoin: "round",
|
|
37000
|
-
children: /* @__PURE__ */ (0,
|
|
37655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
37001
37656
|
}
|
|
37002
37657
|
)
|
|
37003
37658
|
]
|
|
37004
37659
|
}
|
|
37005
37660
|
),
|
|
37006
|
-
showCurrencyDropdown && /* @__PURE__ */ (0,
|
|
37661
|
+
showCurrencyDropdown && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37007
37662
|
"div",
|
|
37008
37663
|
{
|
|
37009
37664
|
style: {
|
|
@@ -37022,7 +37677,7 @@ function SwapMode({
|
|
|
37022
37677
|
},
|
|
37023
37678
|
children: SUPPORTED_CURRENCIES.map((c) => {
|
|
37024
37679
|
const isSelected = selectedCurrency === c.code;
|
|
37025
|
-
return /* @__PURE__ */ (0,
|
|
37680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37026
37681
|
"button",
|
|
37027
37682
|
{
|
|
37028
37683
|
onClick: () => {
|
|
@@ -37045,7 +37700,7 @@ function SwapMode({
|
|
|
37045
37700
|
fontFamily: "inherit"
|
|
37046
37701
|
},
|
|
37047
37702
|
children: [
|
|
37048
|
-
/* @__PURE__ */ (0,
|
|
37703
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37049
37704
|
"span",
|
|
37050
37705
|
{
|
|
37051
37706
|
style: {
|
|
@@ -37056,8 +37711,8 @@ function SwapMode({
|
|
|
37056
37711
|
children: c.symbol
|
|
37057
37712
|
}
|
|
37058
37713
|
),
|
|
37059
|
-
/* @__PURE__ */ (0,
|
|
37060
|
-
/* @__PURE__ */ (0,
|
|
37714
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { flexShrink: 0 }, children: c.code }),
|
|
37715
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37061
37716
|
"span",
|
|
37062
37717
|
{
|
|
37063
37718
|
style: {
|
|
@@ -37092,7 +37747,7 @@ function SwapMode({
|
|
|
37092
37747
|
]
|
|
37093
37748
|
}
|
|
37094
37749
|
),
|
|
37095
|
-
/* @__PURE__ */ (0,
|
|
37750
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[3]}` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37096
37751
|
"div",
|
|
37097
37752
|
{
|
|
37098
37753
|
onMouseEnter: () => setHoverSell(true),
|
|
@@ -37104,7 +37759,7 @@ function SwapMode({
|
|
|
37104
37759
|
padding: `${spacing[4]} ${spacing[5]} ${spacing[5]}`
|
|
37105
37760
|
},
|
|
37106
37761
|
children: [
|
|
37107
|
-
/* @__PURE__ */ (0,
|
|
37762
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37108
37763
|
"div",
|
|
37109
37764
|
{
|
|
37110
37765
|
style: {
|
|
@@ -37114,7 +37769,7 @@ function SwapMode({
|
|
|
37114
37769
|
marginBottom: spacing[1]
|
|
37115
37770
|
},
|
|
37116
37771
|
children: [
|
|
37117
|
-
/* @__PURE__ */ (0,
|
|
37772
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37118
37773
|
"span",
|
|
37119
37774
|
{
|
|
37120
37775
|
style: {
|
|
@@ -37125,7 +37780,7 @@ function SwapMode({
|
|
|
37125
37780
|
children: "Sell"
|
|
37126
37781
|
}
|
|
37127
37782
|
),
|
|
37128
|
-
/* @__PURE__ */ (0,
|
|
37783
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37129
37784
|
"div",
|
|
37130
37785
|
{
|
|
37131
37786
|
style: {
|
|
@@ -37136,7 +37791,7 @@ function SwapMode({
|
|
|
37136
37791
|
transition: "opacity 0.2s",
|
|
37137
37792
|
pointerEvents: hoverSell && fromBalance !== null ? "auto" : "none"
|
|
37138
37793
|
},
|
|
37139
|
-
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */ (0,
|
|
37794
|
+
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37140
37795
|
"button",
|
|
37141
37796
|
{
|
|
37142
37797
|
onClick: () => {
|
|
@@ -37192,12 +37847,12 @@ function SwapMode({
|
|
|
37192
37847
|
]
|
|
37193
37848
|
}
|
|
37194
37849
|
),
|
|
37195
|
-
/* @__PURE__ */ (0,
|
|
37850
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37196
37851
|
"div",
|
|
37197
37852
|
{
|
|
37198
37853
|
style: { display: "flex", alignItems: "center", gap: spacing[3] },
|
|
37199
37854
|
children: [
|
|
37200
|
-
amountInputMode === "usd" && /* @__PURE__ */ (0,
|
|
37855
|
+
amountInputMode === "usd" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37201
37856
|
"span",
|
|
37202
37857
|
{
|
|
37203
37858
|
style: {
|
|
@@ -37212,7 +37867,7 @@ function SwapMode({
|
|
|
37212
37867
|
children: currencySymbol
|
|
37213
37868
|
}
|
|
37214
37869
|
),
|
|
37215
|
-
/* @__PURE__ */ (0,
|
|
37870
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37216
37871
|
"input",
|
|
37217
37872
|
{
|
|
37218
37873
|
inputMode: "decimal",
|
|
@@ -37238,7 +37893,7 @@ function SwapMode({
|
|
|
37238
37893
|
}
|
|
37239
37894
|
}
|
|
37240
37895
|
),
|
|
37241
|
-
amountInputMode === "token" && fromToken && /* @__PURE__ */ (0,
|
|
37896
|
+
amountInputMode === "token" && fromToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37242
37897
|
"span",
|
|
37243
37898
|
{
|
|
37244
37899
|
style: {
|
|
@@ -37253,7 +37908,7 @@ function SwapMode({
|
|
|
37253
37908
|
children: fromToken.symbol
|
|
37254
37909
|
}
|
|
37255
37910
|
),
|
|
37256
|
-
/* @__PURE__ */ (0,
|
|
37911
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37257
37912
|
TokenPillButton,
|
|
37258
37913
|
{
|
|
37259
37914
|
token: fromToken,
|
|
@@ -37265,7 +37920,7 @@ function SwapMode({
|
|
|
37265
37920
|
]
|
|
37266
37921
|
}
|
|
37267
37922
|
),
|
|
37268
|
-
/* @__PURE__ */ (0,
|
|
37923
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37269
37924
|
"div",
|
|
37270
37925
|
{
|
|
37271
37926
|
style: {
|
|
@@ -37277,7 +37932,7 @@ function SwapMode({
|
|
|
37277
37932
|
color: colors.mutedForeground
|
|
37278
37933
|
},
|
|
37279
37934
|
children: [
|
|
37280
|
-
/* @__PURE__ */ (0,
|
|
37935
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37281
37936
|
"button",
|
|
37282
37937
|
{
|
|
37283
37938
|
type: "button",
|
|
@@ -37295,8 +37950,8 @@ function SwapMode({
|
|
|
37295
37950
|
fontFamily: "inherit"
|
|
37296
37951
|
},
|
|
37297
37952
|
children: [
|
|
37298
|
-
/* @__PURE__ */ (0,
|
|
37299
|
-
hasFromUsdPrice && /* @__PURE__ */ (0,
|
|
37953
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: amountInputMode === "usd" ? fromToken ? `${fmtAmount(tokenSellNum, 5)} ${fromToken.symbol}` : "0" : hasFromUsdPrice ? fmtLocal(usdSellNum) : "USD pricing unavailable" }),
|
|
37954
|
+
hasFromUsdPrice && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37300
37955
|
"svg",
|
|
37301
37956
|
{
|
|
37302
37957
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -37306,17 +37961,17 @@ function SwapMode({
|
|
|
37306
37961
|
strokeWidth: 2,
|
|
37307
37962
|
strokeLinecap: "round",
|
|
37308
37963
|
strokeLinejoin: "round",
|
|
37309
|
-
children: /* @__PURE__ */ (0,
|
|
37964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" })
|
|
37310
37965
|
}
|
|
37311
37966
|
)
|
|
37312
37967
|
]
|
|
37313
37968
|
}
|
|
37314
37969
|
),
|
|
37315
|
-
fromBalance !== null && fromToken && /* @__PURE__ */ (0,
|
|
37970
|
+
fromBalance !== null && fromToken && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { children: [
|
|
37316
37971
|
fmtAmount(fromBalance, 6),
|
|
37317
37972
|
" ",
|
|
37318
37973
|
fromToken.symbol,
|
|
37319
|
-
balanceUsd !== null && balanceUsd > 0 && /* @__PURE__ */ (0,
|
|
37974
|
+
balanceUsd !== null && balanceUsd > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { children: [
|
|
37320
37975
|
" \u2248 ",
|
|
37321
37976
|
fmtLocal(balanceUsd)
|
|
37322
37977
|
] })
|
|
@@ -37327,7 +37982,7 @@ function SwapMode({
|
|
|
37327
37982
|
]
|
|
37328
37983
|
}
|
|
37329
37984
|
) }),
|
|
37330
|
-
/* @__PURE__ */ (0,
|
|
37985
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { position: "relative", height: 0, zIndex: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37331
37986
|
"button",
|
|
37332
37987
|
{
|
|
37333
37988
|
onClick: handleFlip,
|
|
@@ -37348,7 +38003,7 @@ function SwapMode({
|
|
|
37348
38003
|
cursor: lockDestToken ? "default" : "pointer",
|
|
37349
38004
|
opacity: lockDestToken ? 0.4 : 1
|
|
37350
38005
|
},
|
|
37351
|
-
children: /* @__PURE__ */ (0,
|
|
38006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37352
38007
|
"svg",
|
|
37353
38008
|
{
|
|
37354
38009
|
style: {
|
|
@@ -37360,7 +38015,7 @@ function SwapMode({
|
|
|
37360
38015
|
fill: "none",
|
|
37361
38016
|
stroke: "currentColor",
|
|
37362
38017
|
strokeWidth: 2,
|
|
37363
|
-
children: /* @__PURE__ */ (0,
|
|
38018
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37364
38019
|
"path",
|
|
37365
38020
|
{
|
|
37366
38021
|
strokeLinecap: "round",
|
|
@@ -37372,7 +38027,7 @@ function SwapMode({
|
|
|
37372
38027
|
)
|
|
37373
38028
|
}
|
|
37374
38029
|
) }),
|
|
37375
|
-
/* @__PURE__ */ (0,
|
|
38030
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `0 ${spacing[3]}`, marginTop: spacing[3] }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37376
38031
|
"div",
|
|
37377
38032
|
{
|
|
37378
38033
|
style: {
|
|
@@ -37381,7 +38036,7 @@ function SwapMode({
|
|
|
37381
38036
|
padding: `${spacing[5]} ${spacing[5]} ${spacing[5]}`
|
|
37382
38037
|
},
|
|
37383
38038
|
children: [
|
|
37384
|
-
/* @__PURE__ */ (0,
|
|
38039
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37385
38040
|
"span",
|
|
37386
38041
|
{
|
|
37387
38042
|
style: {
|
|
@@ -37392,7 +38047,7 @@ function SwapMode({
|
|
|
37392
38047
|
children: "Buy"
|
|
37393
38048
|
}
|
|
37394
38049
|
),
|
|
37395
|
-
/* @__PURE__ */ (0,
|
|
38050
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37396
38051
|
"div",
|
|
37397
38052
|
{
|
|
37398
38053
|
style: {
|
|
@@ -37402,7 +38057,7 @@ function SwapMode({
|
|
|
37402
38057
|
marginTop: spacing[1]
|
|
37403
38058
|
},
|
|
37404
38059
|
children: [
|
|
37405
|
-
/* @__PURE__ */ (0,
|
|
38060
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37406
38061
|
"div",
|
|
37407
38062
|
{
|
|
37408
38063
|
style: {
|
|
@@ -37415,7 +38070,7 @@ function SwapMode({
|
|
|
37415
38070
|
},
|
|
37416
38071
|
children: displayToAmount !== null ? (() => {
|
|
37417
38072
|
const s = `${isEstimate ? "~" : ""}${fmtAmount(displayToAmount, 5)}`;
|
|
37418
|
-
return /* @__PURE__ */ (0,
|
|
38073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37419
38074
|
"span",
|
|
37420
38075
|
{
|
|
37421
38076
|
style: {
|
|
@@ -37426,7 +38081,7 @@ function SwapMode({
|
|
|
37426
38081
|
children: s
|
|
37427
38082
|
}
|
|
37428
38083
|
);
|
|
37429
|
-
})() : route.loading ? /* @__PURE__ */ (0,
|
|
38084
|
+
})() : route.loading ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37430
38085
|
"span",
|
|
37431
38086
|
{
|
|
37432
38087
|
style: {
|
|
@@ -37436,7 +38091,7 @@ function SwapMode({
|
|
|
37436
38091
|
},
|
|
37437
38092
|
children: "\u2026"
|
|
37438
38093
|
}
|
|
37439
|
-
) : /* @__PURE__ */ (0,
|
|
38094
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37440
38095
|
"span",
|
|
37441
38096
|
{
|
|
37442
38097
|
style: {
|
|
@@ -37449,7 +38104,7 @@ function SwapMode({
|
|
|
37449
38104
|
},
|
|
37450
38105
|
rateUpdated ? "flash" : "stable"
|
|
37451
38106
|
),
|
|
37452
|
-
/* @__PURE__ */ (0,
|
|
38107
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37453
38108
|
TokenPillButton,
|
|
37454
38109
|
{
|
|
37455
38110
|
token: toToken,
|
|
@@ -37463,7 +38118,7 @@ function SwapMode({
|
|
|
37463
38118
|
]
|
|
37464
38119
|
}
|
|
37465
38120
|
),
|
|
37466
|
-
/* @__PURE__ */ (0,
|
|
38121
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37467
38122
|
"div",
|
|
37468
38123
|
{
|
|
37469
38124
|
style: {
|
|
@@ -37475,8 +38130,8 @@ function SwapMode({
|
|
|
37475
38130
|
color: colors.mutedForeground
|
|
37476
38131
|
},
|
|
37477
38132
|
children: [
|
|
37478
|
-
/* @__PURE__ */ (0,
|
|
37479
|
-
priceImpact !== null && /* @__PURE__ */ (0,
|
|
38133
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: displayToUsd > 0 ? `${isEstimate ? "~" : ""}${fmtLocal(displayToUsd)}` : "" }),
|
|
38134
|
+
priceImpact !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37480
38135
|
"span",
|
|
37481
38136
|
{
|
|
37482
38137
|
style: {
|
|
@@ -37497,7 +38152,7 @@ function SwapMode({
|
|
|
37497
38152
|
]
|
|
37498
38153
|
}
|
|
37499
38154
|
),
|
|
37500
|
-
needsDestAddress && toChain && /* @__PURE__ */ (0,
|
|
38155
|
+
needsDestAddress && toChain && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37501
38156
|
"div",
|
|
37502
38157
|
{
|
|
37503
38158
|
style: {
|
|
@@ -37506,7 +38161,7 @@ function SwapMode({
|
|
|
37506
38161
|
borderTop: "1px solid hsl(var(--tw-border))"
|
|
37507
38162
|
},
|
|
37508
38163
|
children: [
|
|
37509
|
-
/* @__PURE__ */ (0,
|
|
38164
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37510
38165
|
"p",
|
|
37511
38166
|
{
|
|
37512
38167
|
style: {
|
|
@@ -37521,8 +38176,8 @@ function SwapMode({
|
|
|
37521
38176
|
]
|
|
37522
38177
|
}
|
|
37523
38178
|
),
|
|
37524
|
-
/* @__PURE__ */ (0,
|
|
37525
|
-
/* @__PURE__ */ (0,
|
|
38179
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative" }, children: [
|
|
38180
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37526
38181
|
"input",
|
|
37527
38182
|
{
|
|
37528
38183
|
type: "text",
|
|
@@ -37545,7 +38200,7 @@ function SwapMode({
|
|
|
37545
38200
|
}
|
|
37546
38201
|
}
|
|
37547
38202
|
),
|
|
37548
|
-
/* @__PURE__ */ (0,
|
|
38203
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37549
38204
|
"button",
|
|
37550
38205
|
{
|
|
37551
38206
|
type: "button",
|
|
@@ -37571,7 +38226,7 @@ function SwapMode({
|
|
|
37571
38226
|
}
|
|
37572
38227
|
)
|
|
37573
38228
|
] }),
|
|
37574
|
-
destAddress && !isValidDestAddress && /* @__PURE__ */ (0,
|
|
38229
|
+
destAddress && !isValidDestAddress && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37575
38230
|
"p",
|
|
37576
38231
|
{
|
|
37577
38232
|
style: {
|
|
@@ -37592,7 +38247,7 @@ function SwapMode({
|
|
|
37592
38247
|
]
|
|
37593
38248
|
}
|
|
37594
38249
|
) }),
|
|
37595
|
-
route.error && !route.loading && /* @__PURE__ */ (0,
|
|
38250
|
+
route.error && !route.loading && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37596
38251
|
"p",
|
|
37597
38252
|
{
|
|
37598
38253
|
style: {
|
|
@@ -37605,7 +38260,7 @@ function SwapMode({
|
|
|
37605
38260
|
children: mapError(route.error).message
|
|
37606
38261
|
}
|
|
37607
38262
|
),
|
|
37608
|
-
route.loading && /* @__PURE__ */ (0,
|
|
38263
|
+
route.loading && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37609
38264
|
"div",
|
|
37610
38265
|
{
|
|
37611
38266
|
style: {
|
|
@@ -37617,13 +38272,13 @@ function SwapMode({
|
|
|
37617
38272
|
padding: `0 ${spacing[3]}`
|
|
37618
38273
|
},
|
|
37619
38274
|
children: [
|
|
37620
|
-
/* @__PURE__ */ (0,
|
|
38275
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37621
38276
|
"svg",
|
|
37622
38277
|
{
|
|
37623
38278
|
className: "tw-animate-spin",
|
|
37624
38279
|
style: { width: "0.875rem", height: "0.875rem", flexShrink: 0 },
|
|
37625
38280
|
viewBox: "0 0 88 88",
|
|
37626
|
-
children: /* @__PURE__ */ (0,
|
|
38281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37627
38282
|
"circle",
|
|
37628
38283
|
{
|
|
37629
38284
|
cx: "44",
|
|
@@ -37638,7 +38293,7 @@ function SwapMode({
|
|
|
37638
38293
|
)
|
|
37639
38294
|
}
|
|
37640
38295
|
),
|
|
37641
|
-
/* @__PURE__ */ (0,
|
|
38296
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37642
38297
|
"span",
|
|
37643
38298
|
{
|
|
37644
38299
|
style: {
|
|
@@ -37653,7 +38308,7 @@ function SwapMode({
|
|
|
37653
38308
|
]
|
|
37654
38309
|
}
|
|
37655
38310
|
),
|
|
37656
|
-
/* @__PURE__ */ (0,
|
|
38311
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { style: { padding: `${spacing[2]} ${spacing[3]} 0` }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37657
38312
|
"button",
|
|
37658
38313
|
{
|
|
37659
38314
|
disabled: ctaDisabled,
|
|
@@ -37682,7 +38337,7 @@ function SwapMode({
|
|
|
37682
38337
|
children: ctaLabel
|
|
37683
38338
|
}
|
|
37684
38339
|
) }),
|
|
37685
|
-
showRateRow && /* @__PURE__ */ (0,
|
|
38340
|
+
showRateRow && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37686
38341
|
"div",
|
|
37687
38342
|
{
|
|
37688
38343
|
style: {
|
|
@@ -37692,7 +38347,7 @@ function SwapMode({
|
|
|
37692
38347
|
color: colors.mutedForeground
|
|
37693
38348
|
},
|
|
37694
38349
|
children: [
|
|
37695
|
-
/* @__PURE__ */ (0,
|
|
38350
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37696
38351
|
"button",
|
|
37697
38352
|
{
|
|
37698
38353
|
onClick: () => setShowRateDetails((v) => !v),
|
|
@@ -37710,7 +38365,7 @@ function SwapMode({
|
|
|
37710
38365
|
padding: `${spacing[1]} 0`
|
|
37711
38366
|
},
|
|
37712
38367
|
children: [
|
|
37713
|
-
/* @__PURE__ */ (0,
|
|
38368
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { style: { flex: 1, textAlign: "left" }, children: [
|
|
37714
38369
|
"1 ",
|
|
37715
38370
|
toToken?.symbol,
|
|
37716
38371
|
" = ",
|
|
@@ -37718,7 +38373,7 @@ function SwapMode({
|
|
|
37718
38373
|
" ",
|
|
37719
38374
|
fromToken?.symbol
|
|
37720
38375
|
] }),
|
|
37721
|
-
/* @__PURE__ */ (0,
|
|
38376
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37722
38377
|
"span",
|
|
37723
38378
|
{
|
|
37724
38379
|
style: {
|
|
@@ -37728,15 +38383,15 @@ function SwapMode({
|
|
|
37728
38383
|
flexShrink: 0
|
|
37729
38384
|
},
|
|
37730
38385
|
children: [
|
|
37731
|
-
!isGasSponsored && /* @__PURE__ */ (0,
|
|
37732
|
-
/* @__PURE__ */ (0,
|
|
38386
|
+
!isGasSponsored && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, {}),
|
|
38387
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37733
38388
|
"span",
|
|
37734
38389
|
{
|
|
37735
38390
|
style: isGasSponsored ? { color: colors.green[500] } : void 0,
|
|
37736
38391
|
children: isGasSponsored ? "\u2726 Sponsored" : networkCostUsd !== null ? fmtLocal(networkCostUsd) : "\u2014"
|
|
37737
38392
|
}
|
|
37738
38393
|
),
|
|
37739
|
-
route.data && /* @__PURE__ */ (0,
|
|
38394
|
+
route.data && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37740
38395
|
"svg",
|
|
37741
38396
|
{
|
|
37742
38397
|
width: "14",
|
|
@@ -37748,7 +38403,7 @@ function SwapMode({
|
|
|
37748
38403
|
opacity: 0.75
|
|
37749
38404
|
},
|
|
37750
38405
|
children: [
|
|
37751
|
-
/* @__PURE__ */ (0,
|
|
38406
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37752
38407
|
"circle",
|
|
37753
38408
|
{
|
|
37754
38409
|
cx: "7",
|
|
@@ -37759,7 +38414,7 @@ function SwapMode({
|
|
|
37759
38414
|
strokeWidth: "1.5"
|
|
37760
38415
|
}
|
|
37761
38416
|
),
|
|
37762
|
-
/* @__PURE__ */ (0,
|
|
38417
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37763
38418
|
"circle",
|
|
37764
38419
|
{
|
|
37765
38420
|
cx: "7",
|
|
@@ -37777,7 +38432,7 @@ function SwapMode({
|
|
|
37777
38432
|
]
|
|
37778
38433
|
}
|
|
37779
38434
|
),
|
|
37780
|
-
/* @__PURE__ */ (0,
|
|
38435
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37781
38436
|
"svg",
|
|
37782
38437
|
{
|
|
37783
38438
|
style: {
|
|
@@ -37792,7 +38447,7 @@ function SwapMode({
|
|
|
37792
38447
|
strokeWidth: 2,
|
|
37793
38448
|
strokeLinecap: "round",
|
|
37794
38449
|
strokeLinejoin: "round",
|
|
37795
|
-
children: /* @__PURE__ */ (0,
|
|
38450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M6 9l6 6 6-6" })
|
|
37796
38451
|
}
|
|
37797
38452
|
)
|
|
37798
38453
|
]
|
|
@@ -37801,7 +38456,7 @@ function SwapMode({
|
|
|
37801
38456
|
]
|
|
37802
38457
|
}
|
|
37803
38458
|
),
|
|
37804
|
-
showRateDetails && /* @__PURE__ */ (0,
|
|
38459
|
+
showRateDetails && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37805
38460
|
"div",
|
|
37806
38461
|
{
|
|
37807
38462
|
style: {
|
|
@@ -37813,18 +38468,18 @@ function SwapMode({
|
|
|
37813
38468
|
gap: spacing[2.5]
|
|
37814
38469
|
},
|
|
37815
38470
|
children: [
|
|
37816
|
-
/* @__PURE__ */ (0,
|
|
38471
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37817
38472
|
RateRow,
|
|
37818
38473
|
{
|
|
37819
38474
|
label: "Fee",
|
|
37820
38475
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
37821
38476
|
}
|
|
37822
38477
|
),
|
|
37823
|
-
/* @__PURE__ */ (0,
|
|
38478
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37824
38479
|
RateRow,
|
|
37825
38480
|
{
|
|
37826
38481
|
label: "Network cost",
|
|
37827
|
-
value: isGasSponsored ? /* @__PURE__ */ (0,
|
|
38482
|
+
value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37828
38483
|
"span",
|
|
37829
38484
|
{
|
|
37830
38485
|
style: {
|
|
@@ -37833,19 +38488,19 @@ function SwapMode({
|
|
|
37833
38488
|
gap: "0.25rem"
|
|
37834
38489
|
},
|
|
37835
38490
|
children: [
|
|
37836
|
-
/* @__PURE__ */ (0,
|
|
38491
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(GasIcon, { size: "0.75rem" }),
|
|
37837
38492
|
fmtLocal(networkCostUsd)
|
|
37838
38493
|
]
|
|
37839
38494
|
}
|
|
37840
|
-
) : /* @__PURE__ */ (0,
|
|
38495
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
37841
38496
|
}
|
|
37842
38497
|
),
|
|
37843
|
-
/* @__PURE__ */ (0,
|
|
37844
|
-
/* @__PURE__ */ (0,
|
|
38498
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RateRow, { label: "Max slippage", value: `${slippage}%` }),
|
|
38499
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37845
38500
|
RateRow,
|
|
37846
38501
|
{
|
|
37847
38502
|
label: "Route",
|
|
37848
|
-
value: routePath ? /* @__PURE__ */ (0,
|
|
38503
|
+
value: routePath ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37849
38504
|
"span",
|
|
37850
38505
|
{
|
|
37851
38506
|
style: {
|
|
@@ -37859,7 +38514,7 @@ function SwapMode({
|
|
|
37859
38514
|
title: routePath,
|
|
37860
38515
|
children: routePath
|
|
37861
38516
|
}
|
|
37862
|
-
) : route.data?.route?.provider ?? /* @__PURE__ */ (0,
|
|
38517
|
+
) : route.data?.route?.provider ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
37863
38518
|
}
|
|
37864
38519
|
)
|
|
37865
38520
|
]
|
|
@@ -37868,7 +38523,7 @@ function SwapMode({
|
|
|
37868
38523
|
]
|
|
37869
38524
|
}
|
|
37870
38525
|
),
|
|
37871
|
-
/* @__PURE__ */ (0,
|
|
38526
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(WidgetSecurityFooter, {})
|
|
37872
38527
|
]
|
|
37873
38528
|
}
|
|
37874
38529
|
) });
|
|
@@ -37896,8 +38551,8 @@ function SwapActionArea({
|
|
|
37896
38551
|
label = "Swap";
|
|
37897
38552
|
}
|
|
37898
38553
|
const isDisabled = isSubmitting || isChecking;
|
|
37899
|
-
return /* @__PURE__ */ (0,
|
|
37900
|
-
isGasSponsored && !isSubmitting && /* @__PURE__ */ (0,
|
|
38554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { marginTop: spacing[6] }, children: [
|
|
38555
|
+
isGasSponsored && !isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37901
38556
|
"div",
|
|
37902
38557
|
{
|
|
37903
38558
|
style: {
|
|
@@ -37908,7 +38563,7 @@ function SwapActionArea({
|
|
|
37908
38563
|
marginBottom: spacing[3]
|
|
37909
38564
|
},
|
|
37910
38565
|
children: [
|
|
37911
|
-
/* @__PURE__ */ (0,
|
|
38566
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37912
38567
|
"svg",
|
|
37913
38568
|
{
|
|
37914
38569
|
style: {
|
|
@@ -37918,10 +38573,10 @@ function SwapActionArea({
|
|
|
37918
38573
|
},
|
|
37919
38574
|
viewBox: "0 0 24 24",
|
|
37920
38575
|
fill: "currentColor",
|
|
37921
|
-
children: /* @__PURE__ */ (0,
|
|
38576
|
+
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" })
|
|
37922
38577
|
}
|
|
37923
38578
|
),
|
|
37924
|
-
/* @__PURE__ */ (0,
|
|
38579
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37925
38580
|
"span",
|
|
37926
38581
|
{
|
|
37927
38582
|
style: {
|
|
@@ -37935,7 +38590,7 @@ function SwapActionArea({
|
|
|
37935
38590
|
]
|
|
37936
38591
|
}
|
|
37937
38592
|
),
|
|
37938
|
-
/* @__PURE__ */ (0,
|
|
38593
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
37939
38594
|
"button",
|
|
37940
38595
|
{
|
|
37941
38596
|
onClick: onExecute,
|
|
@@ -37958,7 +38613,7 @@ function SwapActionArea({
|
|
|
37958
38613
|
children: label
|
|
37959
38614
|
}
|
|
37960
38615
|
),
|
|
37961
|
-
needsApproval && !isSubmitting && /* @__PURE__ */ (0,
|
|
38616
|
+
needsApproval && !isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37962
38617
|
"p",
|
|
37963
38618
|
{
|
|
37964
38619
|
style: {
|
|
@@ -37990,7 +38645,7 @@ function TokenPillButton({
|
|
|
37990
38645
|
const iconUrl = token?.iconUrl ?? token?.logoURI;
|
|
37991
38646
|
const chainIcon = chain?.chainIconURI;
|
|
37992
38647
|
if (!token) {
|
|
37993
|
-
return /* @__PURE__ */ (0,
|
|
38648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
37994
38649
|
"button",
|
|
37995
38650
|
{
|
|
37996
38651
|
onClick: disabled ? void 0 : onClick,
|
|
@@ -38013,7 +38668,7 @@ function TokenPillButton({
|
|
|
38013
38668
|
},
|
|
38014
38669
|
children: [
|
|
38015
38670
|
placeholder,
|
|
38016
|
-
/* @__PURE__ */ (0,
|
|
38671
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38017
38672
|
"svg",
|
|
38018
38673
|
{
|
|
38019
38674
|
style: { width: "1rem", height: "1rem" },
|
|
@@ -38021,7 +38676,7 @@ function TokenPillButton({
|
|
|
38021
38676
|
fill: "none",
|
|
38022
38677
|
stroke: "currentColor",
|
|
38023
38678
|
strokeWidth: 2,
|
|
38024
|
-
children: /* @__PURE__ */ (0,
|
|
38679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38025
38680
|
"path",
|
|
38026
38681
|
{
|
|
38027
38682
|
strokeLinecap: "round",
|
|
@@ -38035,7 +38690,7 @@ function TokenPillButton({
|
|
|
38035
38690
|
}
|
|
38036
38691
|
);
|
|
38037
38692
|
}
|
|
38038
|
-
return /* @__PURE__ */ (0,
|
|
38693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38039
38694
|
"button",
|
|
38040
38695
|
{
|
|
38041
38696
|
onClick: disabled ? void 0 : onClick,
|
|
@@ -38055,8 +38710,8 @@ function TokenPillButton({
|
|
|
38055
38710
|
opacity: disabled ? 0.85 : 1
|
|
38056
38711
|
},
|
|
38057
38712
|
children: [
|
|
38058
|
-
/* @__PURE__ */ (0,
|
|
38059
|
-
iconUrl ? /* @__PURE__ */ (0,
|
|
38713
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative" }, children: [
|
|
38714
|
+
iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38060
38715
|
"img",
|
|
38061
38716
|
{
|
|
38062
38717
|
src: iconUrl,
|
|
@@ -38068,7 +38723,7 @@ function TokenPillButton({
|
|
|
38068
38723
|
objectFit: "cover"
|
|
38069
38724
|
}
|
|
38070
38725
|
}
|
|
38071
|
-
) : /* @__PURE__ */ (0,
|
|
38726
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38072
38727
|
"div",
|
|
38073
38728
|
{
|
|
38074
38729
|
style: {
|
|
@@ -38080,7 +38735,7 @@ function TokenPillButton({
|
|
|
38080
38735
|
alignItems: "center",
|
|
38081
38736
|
justifyContent: "center"
|
|
38082
38737
|
},
|
|
38083
|
-
children: /* @__PURE__ */ (0,
|
|
38738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38084
38739
|
"span",
|
|
38085
38740
|
{
|
|
38086
38741
|
style: {
|
|
@@ -38093,7 +38748,7 @@ function TokenPillButton({
|
|
|
38093
38748
|
)
|
|
38094
38749
|
}
|
|
38095
38750
|
),
|
|
38096
|
-
chainIcon && /* @__PURE__ */ (0,
|
|
38751
|
+
chainIcon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38097
38752
|
"img",
|
|
38098
38753
|
{
|
|
38099
38754
|
src: chainIcon,
|
|
@@ -38111,7 +38766,7 @@ function TokenPillButton({
|
|
|
38111
38766
|
}
|
|
38112
38767
|
)
|
|
38113
38768
|
] }),
|
|
38114
|
-
/* @__PURE__ */ (0,
|
|
38769
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38115
38770
|
"span",
|
|
38116
38771
|
{
|
|
38117
38772
|
style: {
|
|
@@ -38122,7 +38777,7 @@ function TokenPillButton({
|
|
|
38122
38777
|
children: token.symbol
|
|
38123
38778
|
}
|
|
38124
38779
|
),
|
|
38125
|
-
!disabled && /* @__PURE__ */ (0,
|
|
38780
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38126
38781
|
"svg",
|
|
38127
38782
|
{
|
|
38128
38783
|
style: {
|
|
@@ -38134,7 +38789,7 @@ function TokenPillButton({
|
|
|
38134
38789
|
fill: "none",
|
|
38135
38790
|
stroke: "currentColor",
|
|
38136
38791
|
strokeWidth: 2,
|
|
38137
|
-
children: /* @__PURE__ */ (0,
|
|
38792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38138
38793
|
"path",
|
|
38139
38794
|
{
|
|
38140
38795
|
strokeLinecap: "round",
|
|
@@ -38155,8 +38810,8 @@ function TokenIcon({
|
|
|
38155
38810
|
}) {
|
|
38156
38811
|
const imgSize = size === "lg" ? "2.75rem" : "2.5rem";
|
|
38157
38812
|
const badgeSize = size === "lg" ? "1.125rem" : "1rem";
|
|
38158
|
-
return /* @__PURE__ */ (0,
|
|
38159
|
-
/* @__PURE__ */ (0,
|
|
38813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
38814
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38160
38815
|
"img",
|
|
38161
38816
|
{
|
|
38162
38817
|
src: icon,
|
|
@@ -38164,7 +38819,7 @@ function TokenIcon({
|
|
|
38164
38819
|
style: { width: imgSize, height: imgSize, borderRadius: "9999px" }
|
|
38165
38820
|
}
|
|
38166
38821
|
),
|
|
38167
|
-
chainIcon && /* @__PURE__ */ (0,
|
|
38822
|
+
chainIcon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38168
38823
|
"img",
|
|
38169
38824
|
{
|
|
38170
38825
|
src: chainIcon,
|
|
@@ -38188,15 +38843,15 @@ function ReviewDetailRow({
|
|
|
38188
38843
|
value,
|
|
38189
38844
|
tooltip
|
|
38190
38845
|
}) {
|
|
38191
|
-
const iconRef = (0,
|
|
38192
|
-
const [tipPos, setTipPos] = (0,
|
|
38846
|
+
const iconRef = (0, import_react50.useRef)(null);
|
|
38847
|
+
const [tipPos, setTipPos] = (0, import_react50.useState)(null);
|
|
38193
38848
|
const handleMouseEnter = () => {
|
|
38194
38849
|
if (!tooltip || !iconRef.current) return;
|
|
38195
38850
|
const r = iconRef.current.getBoundingClientRect();
|
|
38196
38851
|
setTipPos({ x: r.left + r.width / 2, y: r.top - 8 });
|
|
38197
38852
|
};
|
|
38198
38853
|
const handleMouseLeave = () => setTipPos(null);
|
|
38199
|
-
return /* @__PURE__ */ (0,
|
|
38854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38200
38855
|
"div",
|
|
38201
38856
|
{
|
|
38202
38857
|
style: {
|
|
@@ -38205,7 +38860,7 @@ function ReviewDetailRow({
|
|
|
38205
38860
|
justifyContent: "space-between"
|
|
38206
38861
|
},
|
|
38207
38862
|
children: [
|
|
38208
|
-
/* @__PURE__ */ (0,
|
|
38863
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38209
38864
|
"span",
|
|
38210
38865
|
{
|
|
38211
38866
|
style: {
|
|
@@ -38216,14 +38871,14 @@ function ReviewDetailRow({
|
|
|
38216
38871
|
},
|
|
38217
38872
|
children: [
|
|
38218
38873
|
label,
|
|
38219
|
-
/* @__PURE__ */ (0,
|
|
38874
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38220
38875
|
"span",
|
|
38221
38876
|
{
|
|
38222
38877
|
ref: iconRef,
|
|
38223
38878
|
style: { display: "inline-flex", alignItems: "center" },
|
|
38224
38879
|
onMouseEnter: handleMouseEnter,
|
|
38225
38880
|
onMouseLeave: handleMouseLeave,
|
|
38226
|
-
children: /* @__PURE__ */ (0,
|
|
38881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38227
38882
|
"svg",
|
|
38228
38883
|
{
|
|
38229
38884
|
style: {
|
|
@@ -38239,8 +38894,8 @@ function ReviewDetailRow({
|
|
|
38239
38894
|
strokeLinecap: "round",
|
|
38240
38895
|
strokeLinejoin: "round",
|
|
38241
38896
|
children: [
|
|
38242
|
-
/* @__PURE__ */ (0,
|
|
38243
|
-
/* @__PURE__ */ (0,
|
|
38897
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
38898
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 16v-4M12 8h.01" })
|
|
38244
38899
|
]
|
|
38245
38900
|
}
|
|
38246
38901
|
)
|
|
@@ -38249,9 +38904,9 @@ function ReviewDetailRow({
|
|
|
38249
38904
|
]
|
|
38250
38905
|
}
|
|
38251
38906
|
),
|
|
38252
|
-
/* @__PURE__ */ (0,
|
|
38907
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value }),
|
|
38253
38908
|
tooltip && tipPos && typeof document !== "undefined" && import_react_dom.default.createPortal(
|
|
38254
|
-
/* @__PURE__ */ (0,
|
|
38909
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38255
38910
|
"span",
|
|
38256
38911
|
{
|
|
38257
38912
|
style: {
|
|
@@ -38280,7 +38935,7 @@ function ReviewDetailRow({
|
|
|
38280
38935
|
);
|
|
38281
38936
|
}
|
|
38282
38937
|
function GasIcon({ size = "0.875rem" }) {
|
|
38283
|
-
return /* @__PURE__ */ (0,
|
|
38938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38284
38939
|
"svg",
|
|
38285
38940
|
{
|
|
38286
38941
|
style: { width: size, height: size, flexShrink: 0 },
|
|
@@ -38291,16 +38946,16 @@ function GasIcon({ size = "0.875rem" }) {
|
|
|
38291
38946
|
strokeLinecap: "round",
|
|
38292
38947
|
strokeLinejoin: "round",
|
|
38293
38948
|
children: [
|
|
38294
|
-
/* @__PURE__ */ (0,
|
|
38295
|
-
/* @__PURE__ */ (0,
|
|
38296
|
-
/* @__PURE__ */ (0,
|
|
38297
|
-
/* @__PURE__ */ (0,
|
|
38949
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M3 22V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v15" }),
|
|
38950
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M3 11h11" }),
|
|
38951
|
+
/* @__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" }),
|
|
38952
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M19 22V12" })
|
|
38298
38953
|
]
|
|
38299
38954
|
}
|
|
38300
38955
|
);
|
|
38301
38956
|
}
|
|
38302
38957
|
function SponsoredBadge() {
|
|
38303
|
-
return /* @__PURE__ */ (0,
|
|
38958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38304
38959
|
"span",
|
|
38305
38960
|
{
|
|
38306
38961
|
style: {
|
|
@@ -38311,13 +38966,13 @@ function SponsoredBadge() {
|
|
|
38311
38966
|
fontWeight: fontWeight.medium
|
|
38312
38967
|
},
|
|
38313
38968
|
children: [
|
|
38314
|
-
/* @__PURE__ */ (0,
|
|
38969
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38315
38970
|
"svg",
|
|
38316
38971
|
{
|
|
38317
38972
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
38318
38973
|
viewBox: "0 0 24 24",
|
|
38319
38974
|
fill: "currentColor",
|
|
38320
|
-
children: /* @__PURE__ */ (0,
|
|
38975
|
+
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" })
|
|
38321
38976
|
}
|
|
38322
38977
|
),
|
|
38323
38978
|
"Sponsored"
|
|
@@ -38329,7 +38984,7 @@ function SuccessReceiptRow({
|
|
|
38329
38984
|
label,
|
|
38330
38985
|
value
|
|
38331
38986
|
}) {
|
|
38332
|
-
return /* @__PURE__ */ (0,
|
|
38987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38333
38988
|
"div",
|
|
38334
38989
|
{
|
|
38335
38990
|
style: {
|
|
@@ -38338,8 +38993,8 @@ function SuccessReceiptRow({
|
|
|
38338
38993
|
justifyContent: "space-between"
|
|
38339
38994
|
},
|
|
38340
38995
|
children: [
|
|
38341
|
-
/* @__PURE__ */ (0,
|
|
38342
|
-
/* @__PURE__ */ (0,
|
|
38996
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
38997
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { fontWeight: fontWeight.medium, color: colors.foreground }, children: value })
|
|
38343
38998
|
]
|
|
38344
38999
|
}
|
|
38345
39000
|
);
|
|
@@ -38353,7 +39008,7 @@ function ProcessingStepNode({
|
|
|
38353
39008
|
const nodeColor = done ? colors.green[500] : active ? `hsl(var(--tw-primary))` : colors.border;
|
|
38354
39009
|
const iconColor = done ? "#fff" : active ? `hsl(var(--tw-primary))` : colors.mutedForeground;
|
|
38355
39010
|
const nodeBg = done ? colors.green[500] : "transparent";
|
|
38356
|
-
const iconEl = icon === "send" ? /* @__PURE__ */ (0,
|
|
39011
|
+
const iconEl = icon === "send" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38357
39012
|
"svg",
|
|
38358
39013
|
{
|
|
38359
39014
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38363,9 +39018,9 @@ function ProcessingStepNode({
|
|
|
38363
39018
|
strokeWidth: 2,
|
|
38364
39019
|
strokeLinecap: "round",
|
|
38365
39020
|
strokeLinejoin: "round",
|
|
38366
|
-
children: /* @__PURE__ */ (0,
|
|
39021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
38367
39022
|
}
|
|
38368
|
-
) : icon === "plus" ? /* @__PURE__ */ (0,
|
|
39023
|
+
) : icon === "plus" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38369
39024
|
"svg",
|
|
38370
39025
|
{
|
|
38371
39026
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38375,9 +39030,9 @@ function ProcessingStepNode({
|
|
|
38375
39030
|
strokeWidth: 2,
|
|
38376
39031
|
strokeLinecap: "round",
|
|
38377
39032
|
strokeLinejoin: "round",
|
|
38378
|
-
children: /* @__PURE__ */ (0,
|
|
39033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M12 5v14M5 12h14" })
|
|
38379
39034
|
}
|
|
38380
|
-
) : /* @__PURE__ */ (0,
|
|
39035
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38381
39036
|
"svg",
|
|
38382
39037
|
{
|
|
38383
39038
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -38388,12 +39043,12 @@ function ProcessingStepNode({
|
|
|
38388
39043
|
strokeLinecap: "round",
|
|
38389
39044
|
strokeLinejoin: "round",
|
|
38390
39045
|
children: [
|
|
38391
|
-
/* @__PURE__ */ (0,
|
|
38392
|
-
/* @__PURE__ */ (0,
|
|
39046
|
+
/* @__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" }),
|
|
39047
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: "4", y1: "22", x2: "4", y2: "15" })
|
|
38393
39048
|
]
|
|
38394
39049
|
}
|
|
38395
39050
|
);
|
|
38396
|
-
const doneIcon = /* @__PURE__ */ (0,
|
|
39051
|
+
const doneIcon = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38397
39052
|
"svg",
|
|
38398
39053
|
{
|
|
38399
39054
|
style: { width: "0.875rem", height: "0.875rem", color: "#fff" },
|
|
@@ -38403,10 +39058,10 @@ function ProcessingStepNode({
|
|
|
38403
39058
|
strokeWidth: 3,
|
|
38404
39059
|
strokeLinecap: "round",
|
|
38405
39060
|
strokeLinejoin: "round",
|
|
38406
|
-
children: /* @__PURE__ */ (0,
|
|
39061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M20 6L9 17l-5-5" })
|
|
38407
39062
|
}
|
|
38408
39063
|
);
|
|
38409
|
-
return /* @__PURE__ */ (0,
|
|
39064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
38410
39065
|
"div",
|
|
38411
39066
|
{
|
|
38412
39067
|
style: {
|
|
@@ -38417,7 +39072,7 @@ function ProcessingStepNode({
|
|
|
38417
39072
|
maxWidth: "5rem"
|
|
38418
39073
|
},
|
|
38419
39074
|
children: [
|
|
38420
|
-
/* @__PURE__ */ (0,
|
|
39075
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38421
39076
|
"div",
|
|
38422
39077
|
{
|
|
38423
39078
|
style: {
|
|
@@ -38435,7 +39090,7 @@ function ProcessingStepNode({
|
|
|
38435
39090
|
children: done ? doneIcon : iconEl
|
|
38436
39091
|
}
|
|
38437
39092
|
),
|
|
38438
|
-
/* @__PURE__ */ (0,
|
|
39093
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38439
39094
|
"span",
|
|
38440
39095
|
{
|
|
38441
39096
|
style: {
|
|
@@ -38454,7 +39109,7 @@ function ProcessingStepNode({
|
|
|
38454
39109
|
);
|
|
38455
39110
|
}
|
|
38456
39111
|
function ProcessingStepLine({ done }) {
|
|
38457
|
-
return /* @__PURE__ */ (0,
|
|
39112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
38458
39113
|
"div",
|
|
38459
39114
|
{
|
|
38460
39115
|
style: {
|
|
@@ -38468,11 +39123,11 @@ function ProcessingStepLine({ done }) {
|
|
|
38468
39123
|
}
|
|
38469
39124
|
);
|
|
38470
39125
|
}
|
|
38471
|
-
var
|
|
39126
|
+
var import_react50, import_react_dom, import_jsx_runtime59, ConfettiEffect3, QUOTE_TTL, QUOTE_LOADING_MESSAGES, PERCENT_OPTIONS;
|
|
38472
39127
|
var init_SwapMode = __esm({
|
|
38473
39128
|
"src/modes/swap/SwapMode.tsx"() {
|
|
38474
39129
|
"use strict";
|
|
38475
|
-
|
|
39130
|
+
import_react50 = require("react");
|
|
38476
39131
|
import_react_dom = __toESM(require("react-dom"), 1);
|
|
38477
39132
|
init_styles();
|
|
38478
39133
|
init_utils2();
|
|
@@ -38492,10 +39147,10 @@ var init_SwapMode = __esm({
|
|
|
38492
39147
|
init_useSwapExecution();
|
|
38493
39148
|
init_useForex();
|
|
38494
39149
|
init_SwapTokenSelect();
|
|
38495
|
-
init_SwapWalletSelector();
|
|
38496
39150
|
init_currency();
|
|
38497
|
-
|
|
38498
|
-
|
|
39151
|
+
init_components2();
|
|
39152
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
39153
|
+
ConfettiEffect3 = (0, import_react50.lazy)(
|
|
38499
39154
|
() => Promise.resolve().then(() => (init_ConfettiEffect(), ConfettiEffect_exports))
|
|
38500
39155
|
);
|
|
38501
39156
|
QUOTE_TTL = 60;
|
|
@@ -38536,7 +39191,7 @@ function WidgetContent({
|
|
|
38536
39191
|
const { transactionHash, transactionStatus } = useDepositTransaction();
|
|
38537
39192
|
const { resolvedTheme, toggleTheme } = useDepositUi();
|
|
38538
39193
|
useWalletExternalDisconnect(() => setCurrentStep("home"));
|
|
38539
|
-
(0,
|
|
39194
|
+
(0, import_react51.useEffect)(() => {
|
|
38540
39195
|
const state = {
|
|
38541
39196
|
currentStep,
|
|
38542
39197
|
amount,
|
|
@@ -38556,9 +39211,9 @@ function WidgetContent({
|
|
|
38556
39211
|
transactionStatus,
|
|
38557
39212
|
onStateChange
|
|
38558
39213
|
]);
|
|
38559
|
-
return /* @__PURE__ */ (0,
|
|
38560
|
-
showThemeToggle && /* @__PURE__ */ (0,
|
|
38561
|
-
/* @__PURE__ */ (0,
|
|
39214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
|
|
39215
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
|
|
39216
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38562
39217
|
WidgetRouter,
|
|
38563
39218
|
{
|
|
38564
39219
|
currentStep,
|
|
@@ -38579,8 +39234,8 @@ function WidgetInner({
|
|
|
38579
39234
|
const { transactionStatus } = useDepositTransaction();
|
|
38580
39235
|
const { resolvedTheme } = useDepositUi();
|
|
38581
39236
|
const { status, revalidate, errors } = useTrustware();
|
|
38582
|
-
const [showConfirmDialog, setShowConfirmDialog] = (0,
|
|
38583
|
-
const handleCloseRequest = (0,
|
|
39237
|
+
const [showConfirmDialog, setShowConfirmDialog] = (0, import_react51.useState)(false);
|
|
39238
|
+
const handleCloseRequest = (0, import_react51.useCallback)(() => {
|
|
38584
39239
|
if (ACTIVE_TRANSACTION_STATUSES.includes(transactionStatus)) {
|
|
38585
39240
|
setShowConfirmDialog(true);
|
|
38586
39241
|
} else {
|
|
@@ -38591,32 +39246,32 @@ function WidgetInner({
|
|
|
38591
39246
|
onClose?.();
|
|
38592
39247
|
}
|
|
38593
39248
|
}, [transactionStatus, onClose, resetState]);
|
|
38594
|
-
(0,
|
|
39249
|
+
(0, import_react51.useEffect)(() => {
|
|
38595
39250
|
closeRequestRef.current = handleCloseRequest;
|
|
38596
39251
|
}, [handleCloseRequest, closeRequestRef]);
|
|
38597
|
-
const handleConfirmClose = (0,
|
|
39252
|
+
const handleConfirmClose = (0, import_react51.useCallback)(() => {
|
|
38598
39253
|
setShowConfirmDialog(false);
|
|
38599
39254
|
onClose?.();
|
|
38600
39255
|
}, [onClose]);
|
|
38601
|
-
const handleCancelClose = (0,
|
|
39256
|
+
const handleCancelClose = (0, import_react51.useCallback)(() => {
|
|
38602
39257
|
setShowConfirmDialog(false);
|
|
38603
39258
|
}, []);
|
|
38604
39259
|
const effectiveTheme = resolvedTheme;
|
|
38605
39260
|
const isRefreshing = status === "initializing";
|
|
38606
39261
|
const initBlocked = status === "error";
|
|
38607
|
-
const handleRefresh = (0,
|
|
39262
|
+
const handleRefresh = (0, import_react51.useCallback)(() => {
|
|
38608
39263
|
revalidate?.();
|
|
38609
39264
|
}, [revalidate]);
|
|
38610
|
-
return /* @__PURE__ */ (0,
|
|
38611
|
-
/* @__PURE__ */ (0,
|
|
38612
|
-
/* @__PURE__ */ (0,
|
|
39265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
39266
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(WidgetContainer, { theme: effectiveTheme, style, children: [
|
|
39267
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38613
39268
|
WidgetContent,
|
|
38614
39269
|
{
|
|
38615
39270
|
onStateChange,
|
|
38616
39271
|
showThemeToggle
|
|
38617
39272
|
}
|
|
38618
39273
|
),
|
|
38619
|
-
/* @__PURE__ */ (0,
|
|
39274
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38620
39275
|
InitErrorOverlay,
|
|
38621
39276
|
{
|
|
38622
39277
|
open: initBlocked,
|
|
@@ -38627,7 +39282,7 @@ function WidgetInner({
|
|
|
38627
39282
|
}
|
|
38628
39283
|
)
|
|
38629
39284
|
] }),
|
|
38630
|
-
/* @__PURE__ */ (0,
|
|
39285
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38631
39286
|
ConfirmCloseDialog,
|
|
38632
39287
|
{
|
|
38633
39288
|
open: showConfirmDialog,
|
|
@@ -38638,11 +39293,11 @@ function WidgetInner({
|
|
|
38638
39293
|
)
|
|
38639
39294
|
] });
|
|
38640
39295
|
}
|
|
38641
|
-
var
|
|
39296
|
+
var import_react51, import_jsx_runtime60, widgetContentContainerStyle, themeToggleContainerStyle, TrustwareWidgetV2;
|
|
38642
39297
|
var init_TrustwareWidgetV2 = __esm({
|
|
38643
39298
|
"src/widget/TrustwareWidgetV2.tsx"() {
|
|
38644
39299
|
"use strict";
|
|
38645
|
-
|
|
39300
|
+
import_react51 = require("react");
|
|
38646
39301
|
init_utils2();
|
|
38647
39302
|
init_styles();
|
|
38648
39303
|
init_DepositContext();
|
|
@@ -38655,7 +39310,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38655
39310
|
init_manager();
|
|
38656
39311
|
init_useTrustwareConfig();
|
|
38657
39312
|
init_swap();
|
|
38658
|
-
|
|
39313
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
38659
39314
|
widgetContentContainerStyle = {
|
|
38660
39315
|
position: "relative",
|
|
38661
39316
|
width: "100%",
|
|
@@ -38668,7 +39323,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38668
39323
|
right: spacing[3],
|
|
38669
39324
|
zIndex: 12
|
|
38670
39325
|
};
|
|
38671
|
-
TrustwareWidgetV2 = (0,
|
|
39326
|
+
TrustwareWidgetV2 = (0, import_react51.forwardRef)(function TrustwareWidgetV22({
|
|
38672
39327
|
theme,
|
|
38673
39328
|
style,
|
|
38674
39329
|
initialStep = "home",
|
|
@@ -38677,15 +39332,15 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38677
39332
|
onOpen,
|
|
38678
39333
|
showThemeToggle = true
|
|
38679
39334
|
}, ref) {
|
|
38680
|
-
const [isOpen, setIsOpen] = (0,
|
|
38681
|
-
const closeRequestRef = (0,
|
|
39335
|
+
const [isOpen, setIsOpen] = (0, import_react51.useState)(defaultOpen);
|
|
39336
|
+
const closeRequestRef = (0, import_react51.useRef)(null);
|
|
38682
39337
|
const config = useTrustwareConfig();
|
|
38683
39338
|
const effectiveInitialStep = initialStep;
|
|
38684
|
-
const open = (0,
|
|
39339
|
+
const open = (0, import_react51.useCallback)(() => {
|
|
38685
39340
|
setIsOpen(true);
|
|
38686
39341
|
onOpen?.();
|
|
38687
39342
|
}, [onOpen]);
|
|
38688
|
-
const close = (0,
|
|
39343
|
+
const close = (0, import_react51.useCallback)(() => {
|
|
38689
39344
|
if (closeRequestRef.current) {
|
|
38690
39345
|
closeRequestRef.current();
|
|
38691
39346
|
} else {
|
|
@@ -38693,11 +39348,11 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38693
39348
|
onClose?.();
|
|
38694
39349
|
}
|
|
38695
39350
|
}, [onClose]);
|
|
38696
|
-
const handleClose = (0,
|
|
39351
|
+
const handleClose = (0, import_react51.useCallback)(() => {
|
|
38697
39352
|
setIsOpen(false);
|
|
38698
39353
|
onClose?.();
|
|
38699
39354
|
}, [onClose]);
|
|
38700
|
-
(0,
|
|
39355
|
+
(0, import_react51.useImperativeHandle)(
|
|
38701
39356
|
ref,
|
|
38702
39357
|
() => ({
|
|
38703
39358
|
open,
|
|
@@ -38710,9 +39365,9 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
38710
39365
|
return null;
|
|
38711
39366
|
}
|
|
38712
39367
|
if (config.features.swapMode) {
|
|
38713
|
-
return /* @__PURE__ */ (0,
|
|
39368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SwapMode, { theme, style });
|
|
38714
39369
|
}
|
|
38715
|
-
return /* @__PURE__ */ (0,
|
|
39370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
38716
39371
|
WidgetInner,
|
|
38717
39372
|
{
|
|
38718
39373
|
theme,
|