do not show STNK token on the UI
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
6156549754
commit
6213504ef3
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.6.12",
|
||||
"version": "0.6.13",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -27,7 +27,6 @@ import {
|
||||
useNativePrice,
|
||||
useReservePrice,
|
||||
useFtsoPrice,
|
||||
useStnkPrice,
|
||||
useGhstPrice
|
||||
} from "../../../hooks/prices";
|
||||
import { useLpValuation } from "../../../hooks/treasury";
|
||||
@ -178,11 +177,6 @@ export const useWallet = (chainId, userAddress) => {
|
||||
refetch: ftsoRefetch,
|
||||
contractAddress: ftsoAddress,
|
||||
} = useBalance(chainId, "FTSO", userAddress);
|
||||
const {
|
||||
balance: stnkBalance,
|
||||
refetch: stnkRefetch,
|
||||
contractAddress: stnkAddress,
|
||||
} = useBalance(chainId, "STNK", userAddress);
|
||||
const {
|
||||
balance: ghstBalance,
|
||||
refetch: ghstRefetch,
|
||||
@ -200,7 +194,6 @@ export const useWallet = (chainId, userAddress) => {
|
||||
const nativePrice = useNativePrice(chainId);
|
||||
const reservePrice = useReservePrice(chainId);
|
||||
const ftsoPrice = useFtsoPrice(chainId);
|
||||
const stnkPrice = useStnkPrice(chainId);
|
||||
const ghstPrice = useGhstPrice(chainId);
|
||||
const lpReserveFtsoPrice = useLpValuation(chainId, "RESERVE_FTSO", 1000000000000000000n);
|
||||
|
||||
@ -209,7 +202,6 @@ export const useWallet = (chainId, userAddress) => {
|
||||
const nativeSymbol = config?.getClient()?.chain?.nativeCurrency?.symbol;
|
||||
const { symbol: reserveSymbol } = useTokenSymbol(chainId, "RESERVE");
|
||||
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||
const { symbol: stnkSymbol } = useTokenSymbol(chainId, "STNK");
|
||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||
const { symbol: lpReserveFtsoSymbol } = useTokenSymbol(chainId, "RESERVE_FTSO");
|
||||
|
||||
@ -256,15 +248,6 @@ export const useWallet = (chainId, userAddress) => {
|
||||
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/eGHST.svg",
|
||||
refetch: ftsoRefetch,
|
||||
},
|
||||
stnk: {
|
||||
symbol: stnkSymbol,
|
||||
address: stnkAddress,
|
||||
balance: stnkBalance,
|
||||
price: stnkPrice,
|
||||
icons: ["STNK"],
|
||||
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/sGHST.svg",
|
||||
refetch: stnkRefetch,
|
||||
},
|
||||
ghst: {
|
||||
symbol: ghstSymbol,
|
||||
address: ghstAddress,
|
||||
@ -299,7 +282,7 @@ export const useWallet = (chainId, userAddress) => {
|
||||
|
||||
export const Tokens = ({ address, tokens, onClose }) => {
|
||||
const [expanded, setExpanded] = useState(null);
|
||||
const alwaysShowTokens = [tokens.native, tokens.reserve, tokens.ftso, tokens.stnk, tokens.ghst, tokens.reserveFtso];
|
||||
const alwaysShowTokens = [tokens.native, tokens.reserve, tokens.ftso, tokens.ghst, tokens.reserveFtso];
|
||||
|
||||
const tokenProps = (token) => ({
|
||||
...token,
|
||||
|
||||
@ -26,10 +26,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
|
||||
const [isPending, setIsPending] = useState(false);
|
||||
const [isWarmup, setIsWapmup] = useState(false);
|
||||
const [isPreClaimConfirmed, setPreClaimConfirmed] = useState(false);
|
||||
const [isPayoutGhst, setIsPayoutGhst] = useState(localStorage.getItem("bond-isGhstPayout")
|
||||
? localStorage.getItem("bond-isGhstPayout") === "true"
|
||||
: true
|
||||
);
|
||||
const [isPayoutGhst, _] = useState(true);
|
||||
|
||||
const { epoch } = useEpoch(chainId);
|
||||
const { warmupExists } = useWarmupLength(chainId);
|
||||
@ -39,7 +36,6 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
|
||||
const { notes, refetch: notesRefetch } = useNotes(chainId, address);
|
||||
|
||||
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||
const { symbol: stnkSymbol } = useTokenSymbol(chainId, "STNK");
|
||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||
|
||||
if (!notes || notes.length === 0) return null;
|
||||
@ -52,11 +48,6 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
|
||||
18
|
||||
);
|
||||
|
||||
const setIsPayoutGhstInner = (value) => {
|
||||
setIsPayoutGhst(value);
|
||||
localStorage.setItem("bond-isGhstPayout", value);
|
||||
}
|
||||
|
||||
const onSubmit = async (indexes) => {
|
||||
const isFundsInWarmup = warmupInfo.deposit._value > 0n;
|
||||
if (warmupExists && isFundsInWarmup && !isPreClaimConfirmed) {
|
||||
@ -94,24 +85,6 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
|
||||
</Box>
|
||||
}
|
||||
>
|
||||
<Box display="flex" flexDirection="column" alignItems="center">
|
||||
<Typography variant="h4" align="center" color="textSecondary">
|
||||
Payout Options
|
||||
</Typography>
|
||||
<Tabs
|
||||
centered
|
||||
textColor="primary"
|
||||
indicatorColor="primary"
|
||||
value={isPayoutGhst ? 1 : 0}
|
||||
aria-label="Payout token tabs"
|
||||
onChange={(_, view) => setIsPayoutGhstInner(view === 1)}
|
||||
TabIndicatorProps={{ style: { display: "none" } }}
|
||||
>
|
||||
<Tab aria-label="payout-stnk-button" label={stnkSymbol} style={{ fontSize: "1rem" }} />
|
||||
<Tab aria-label="payout-ghst-button" label={ghstSymbol} style={{ fontSize: "1rem" }} />
|
||||
</Tabs>
|
||||
</Box>
|
||||
|
||||
<Box display="flex" justifyContent="center">
|
||||
<Box display="flex" flexDirection="column" alignItems="center" mt="24px" width={isSmallScreen ? "100%" : "50%"}>
|
||||
<Typography variant="h5" align="center" color="textSecondary" style={{ fontSize: "1.2rem" }}>
|
||||
|
||||
@ -24,7 +24,6 @@ import { isNetworkLegacy } from "../../constants";
|
||||
import {
|
||||
RESERVE_ADDRESSES,
|
||||
FTSO_ADDRESSES,
|
||||
STNK_ADDRESSES,
|
||||
GHST_ADDRESSES,
|
||||
EMPTY_ADDRESS
|
||||
} from "../../constants/addresses";
|
||||
@ -48,12 +47,10 @@ const TokenModal = ({ chainId, account, chainSymbol, listOpen, setListOpen, setT
|
||||
const { balance: nativeBalance } = useBalance(chainId, chainSymbol, account);
|
||||
const { balance: reserveBalance } = useBalance(chainId, "RESERVE", account);
|
||||
const { balance: ftsoBalance } = useBalance(chainId, "FTSO", account);
|
||||
const { balance: stnkBalance } = useBalance(chainId, "STNK", account);
|
||||
const { balance: ghstBalance } = useBalance(chainId, "GHST", account);
|
||||
|
||||
const { symbol: reserveSymbol } = useTokenSymbol(chainId, "RESERVE");
|
||||
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||
const { symbol: stnkSymbol } = useTokenSymbol(chainId, "STNK");
|
||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||
|
||||
const searchToken = useMemo(() => {
|
||||
@ -85,12 +82,6 @@ const TokenModal = ({ chainId, account, chainSymbol, listOpen, setListOpen, setT
|
||||
balance: ftsoBalance,
|
||||
address: FTSO_ADDRESSES[chainId]
|
||||
},
|
||||
{
|
||||
name: stnkSymbol,
|
||||
icons: ["STNK"],
|
||||
balance: stnkBalance,
|
||||
address: STNK_ADDRESSES[chainId]
|
||||
},
|
||||
{
|
||||
name: ghstSymbol,
|
||||
icons: ["GHST"],
|
||||
@ -98,7 +89,7 @@ const TokenModal = ({ chainId, account, chainSymbol, listOpen, setListOpen, setT
|
||||
address: GHST_ADDRESSES[chainId]
|
||||
}
|
||||
]
|
||||
}, [reserveSymbol, ftsoSymbol, stnkSymbol, ghstSymbol, reserveBalance, ftsoBalance, stnkBalance, ghstBalance]);
|
||||
}, [reserveSymbol, ftsoSymbol, ghstSymbol, reserveBalance, ftsoBalance, ghstBalance]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isAddress(userInput)) {
|
||||
|
||||
@ -19,7 +19,6 @@ const Stake = ({ chainId, address, isOpened, closeModal, connect }) => {
|
||||
const [settingsModalOpen, setSettingsModalOpen] = useState(false);
|
||||
|
||||
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||
const { symbol: stnkSymbol } = useTokenSymbol(chainId, "STNK");
|
||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||
|
||||
const [upperToken, setUpperToken] = useState(ftsoSymbol);
|
||||
@ -31,28 +30,16 @@ const Stake = ({ chainId, address, isOpened, closeModal, connect }) => {
|
||||
|
||||
useEffect(() => {
|
||||
switch (true) {
|
||||
case (upperToken === ftsoSymbol && bottomToken === stnkSymbol):
|
||||
setAction("STAKE")
|
||||
break;
|
||||
case (upperToken === ftsoSymbol && bottomToken === ghstSymbol):
|
||||
setAction("STAKE")
|
||||
break;
|
||||
case (upperToken === stnkSymbol && bottomToken === ftsoSymbol):
|
||||
setAction("UNSTAKE")
|
||||
break;
|
||||
case (upperToken === ghstSymbol && bottomToken === ftsoSymbol):
|
||||
setAction("UNSTAKE")
|
||||
break;
|
||||
case (upperToken === stnkSymbol && bottomToken === ghstSymbol):
|
||||
setAction("WRAP")
|
||||
break;
|
||||
case (upperToken === ghstSymbol && bottomToken === stnkSymbol):
|
||||
setAction("UNWRAP")
|
||||
break;
|
||||
default:
|
||||
setAction("STAKE")
|
||||
}
|
||||
}, [upperToken, bottomToken])
|
||||
}, [ftsoSymbol, ghstSymbol, upperToken, bottomToken])
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@ -21,7 +21,6 @@ import InfoTooltip from "../../../components/Tooltip/InfoTooltip";
|
||||
import Paper from "../../../components/Paper/Paper";
|
||||
import Token from "../../../components/Token/Token";
|
||||
import { PrimaryButton, SecondaryButton } from "../../../components/Button";
|
||||
import { Tab, Tabs } from "../../../components/Tabs/Tabs";
|
||||
|
||||
import { DecimalBigNumber } from "../../../helpers/DecimalBigNumber";
|
||||
import { prettifySecondsInDays } from "../../../helpers/timeUtil";
|
||||
@ -52,10 +51,7 @@ export const ClaimsArea = ({ chainId, address, epoch }) => {
|
||||
const isSmallScreen = useMediaQuery("(max-width: 745px)");
|
||||
|
||||
const [confirmationModalOpen, setConfirmationModalOpen] = useState(false);
|
||||
const [isPayoutGhst, setIsPayoutGhst] = useState(localStorage.getItem("stake-isGhstPayout")
|
||||
? localStorage.getItem("stake-isGhstPayout")
|
||||
: false
|
||||
);
|
||||
const [isPayoutGhst, _] = useState(true);
|
||||
|
||||
const { warmupInfo: claim, refetch: claimRefetch } = useWarmupInfo(chainId, address);
|
||||
const { currentIndex, refetch: currentIndexRefetch } = useCurrentIndex(chainId);
|
||||
@ -73,11 +69,6 @@ export const ClaimsArea = ({ chainId, address, epoch }) => {
|
||||
|
||||
if (claim.shares === 0n) return <></>;
|
||||
|
||||
const setIsPayoutGhstInner = (value) => {
|
||||
setIsPayoutGhst(value);
|
||||
localStorage.setItem("bond-isGhstPayout", value);
|
||||
}
|
||||
|
||||
const warmupTooltip = `Your claim earns rebases during warmup. You can emergency withdraw, but this forfeits the rebases`;
|
||||
|
||||
return (
|
||||
@ -106,18 +97,6 @@ export const ClaimsArea = ({ chainId, address, epoch }) => {
|
||||
flexDirection={isSmallScreen ? "column" : "row"}
|
||||
>
|
||||
<Typography variant="h6">Your active {isPayoutGhst ? ghstSymbol : stnkSymbol} claim</Typography>
|
||||
<Tabs
|
||||
centered
|
||||
textColor="primary"
|
||||
indicatorColor="primary"
|
||||
value={isPayoutGhst ? 1 : 0}
|
||||
aria-label="Claim token tabs"
|
||||
onChange={(_, view) => setIsPayoutGhstInner(view === 1)}
|
||||
TabIndicatorProps={{ style: { display: "none" } }}
|
||||
>
|
||||
<Tab aria-label="payout-stnk-button" label={stnkSymbol} style={{ fontSize: "1rem" }} />
|
||||
<Tab aria-label="payout-ghst-button" label={ghstSymbol} style={{ fontSize: "1rem" }} />
|
||||
</Tabs>
|
||||
</Box>
|
||||
}
|
||||
tooltip={warmupTooltip}
|
||||
|
||||
@ -11,7 +11,6 @@ import { isNetworkLegacy } from "../../../constants"
|
||||
import { useBalance, useTokenSymbol } from "../../../hooks/tokens";
|
||||
import {
|
||||
useFtsoPrice,
|
||||
useStnkPrice,
|
||||
useGhstPrice,
|
||||
useReservePrice,
|
||||
useNativePrice,
|
||||
@ -88,18 +87,15 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
|
||||
const nativePrice = useNativePrice(chainId);
|
||||
const ftsoPrice = useFtsoPrice(chainId);
|
||||
const stnkPrice = useStnkPrice(chainId);
|
||||
const ghstPrice = useGhstPrice(chainId);
|
||||
const reservePrice = useReservePrice(chainId);
|
||||
|
||||
const { symbol: reserveSymbol } = useTokenSymbol(chainId, "RESERVE");
|
||||
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||
const { symbol: stnkSymbol } = useTokenSymbol(chainId, "STNK");
|
||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||
|
||||
const { data: nativeBalance } = useBalanceNative({ address });
|
||||
const { balance: ftsoBalance, contractAddress: ftsoAddress } = useBalance(chainId, "FTSO", address);
|
||||
const { balance: stnkBalance, contractAddress: stnkAddress } = useBalance(chainId, "STNK", address);
|
||||
const { balance: ghstBalance, contractAddress: ghstAddress } = useBalance(chainId, "GHST", address);
|
||||
const { balance: reserveBalance, contractAddress: reserveAddress } = useBalance(chainId, "RESERVE", address);
|
||||
|
||||
@ -119,19 +115,6 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
price={ftsoPrice}
|
||||
description={`${ftsoSymbol} is the native token of the ghostDAO protocol, fully backed by stablecoin reserves held in the ghostDAO treasury.`}
|
||||
/>
|
||||
<TokenTab
|
||||
isMobileScreen={isMobileScreen}
|
||||
tokenUrl="/dex/uniswap"
|
||||
tokenUrlParams={createSearchParams({
|
||||
from: `${reserveAddress}`,
|
||||
to: `${stnkAddress}`,
|
||||
})}
|
||||
theme={theme}
|
||||
tokenName={stnkSymbol}
|
||||
balance={stnkBalance}
|
||||
price={stnkPrice}
|
||||
description={`${stnkSymbol} is a receipt for staked ${ftsoSymbol}, growing with staking rewards. When unstaked, it’s burned for ${ftsoSymbol} at a 1:1 ratio.`}
|
||||
/>
|
||||
<TokenTab
|
||||
isMobileScreen={isMobileScreen}
|
||||
tokenUrl="/dex/uniswap"
|
||||
@ -145,6 +128,17 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
price={ghstPrice}
|
||||
description={`${ghstSymbol} is the governance token enabling pure Web3 cross-chain magic. 1 ${ghstSymbol} = 1 ${ftsoSymbol} x Current Index.`}
|
||||
/>
|
||||
{!isNetworkLegacy(chainId) && (
|
||||
<TokenTab
|
||||
isMobileScreen={isMobileScreen}
|
||||
tokenUrl={"https://ghostchain.io/faucet/"}
|
||||
theme={theme}
|
||||
tokenName={nativeSymbol}
|
||||
balance={new DecimalBigNumber(nativeBalance?.value ?? 0n, 18)}
|
||||
price={reservePrice}
|
||||
description={`${nativeSymbol} is the native currency of the ${networkName} Network, functioning as the backing asset for the ghostDAO.`}
|
||||
/>
|
||||
)}
|
||||
<TokenTab
|
||||
isMobileScreen={isMobileScreen}
|
||||
tokenUrl="/dex/uniswap"
|
||||
@ -162,19 +156,6 @@ const TokenInfo = ({ chainId, isMobileScreen }) => {
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
{!isNetworkLegacy(chainId) && (
|
||||
<Box width="100%" mt="25px">
|
||||
<TokenTab
|
||||
isMobileScreen={true}
|
||||
tokenUrl={"https://ghostchain.io/faucet/"}
|
||||
theme={theme}
|
||||
tokenName={nativeSymbol}
|
||||
balance={new DecimalBigNumber(nativeBalance?.value ?? 0n, 18)}
|
||||
price={reservePrice}
|
||||
description={`${nativeSymbol} is the native currency of the ${networkName} Network, functioning as the backing asset for the ghostDAO.`}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user