Compare commits

..

No commits in common. "5c7546b0d9a25ea7341765380fda8241b1671e6b" and "175d964b9fed45524cecfd63654d79ee19bc3d4a" have entirely different histories.

9 changed files with 16 additions and 32 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.2.10",
"version": "0.2.4",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -12,7 +12,7 @@ import {
import { styled } from '@mui/material/styles';
import CloseIcon from '@mui/icons-material/Close';
import LoopIcon from '@mui/icons-material/Loop';
import { ReactElement, useState, useEffect } from "react";
import { ReactElement, useState } from "react";
import { useNavigate, createSearchParams } from "react-router-dom";
import GhostStyledIcon from "../../Icon/GhostIcon";
@ -105,7 +105,7 @@ const WalletTotalValue = ({ address, tokens }) => {
);
};
function InitialWalletView({ isWalletOpen, address, chainId, onClose }) {
function InitialWalletView({ address, chainId, onClose }) {
const theme = useTheme();
const navigate = useNavigate();
const tokens = useWallet(chainId, address);
@ -122,12 +122,6 @@ function InitialWalletView({ isWalletOpen, address, chainId, onClose }) {
onClose();
}
useEffect(() => {
if (isWalletOpen) {
Object.values(tokens ?? {}).forEach(token => token.refetch());
}
}, [isWalletOpen, tokens])
return (
<Paper>
<Box sx={{ padding: theme.spacing(0, 3), display: "flex", flexDirection: "column", minHeight: "100vh" }}>

View File

@ -192,7 +192,6 @@ export const useWallet = (chainId, userAddress) => {
price: daiPrice,
icons: ["GDAI"],
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/gDAI.svg",
refetch: daiRefetch,
},
ftso: {
symbol: ftsoSymbol,
@ -201,7 +200,6 @@ export const useWallet = (chainId, userAddress) => {
price: ftsoPrice,
icons: ["FTSO"],
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/eGHST.svg",
refetch: ftsoRefetch,
},
stnk: {
symbol: stnkSymbol,
@ -210,7 +208,6 @@ export const useWallet = (chainId, userAddress) => {
price: stnkPrice,
icons: ["STNK"],
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/sGHST.svg",
refetch: stnkRefetch,
},
ghst: {
symbol: ghstSymbol,
@ -219,7 +216,6 @@ export const useWallet = (chainId, userAddress) => {
price: ghstPrice,
icons: ["GHST"],
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/GHST.svg",
refetch: ghstRefetch,
},
daiFtso: {
isPool: true,
@ -229,7 +225,6 @@ export const useWallet = (chainId, userAddress) => {
price: lpDaiFtsoPrice,
icons: ["GDAI", "FTSO"],
externalUrl: "https://ghostchain.io/wp-content/uploads/2025/03/uni-v2.svg",
refetch: lpDaiFtsoRefetch,
}
};

View File

@ -76,7 +76,7 @@ export function Wallet({ address, chainId, connect }) {
onOpen={openWallet}
onClose={closeWallet}
>
<InitialWalletView isWalletOpen={isWalletOpen} address={address} chainId={chainId} onClose={closeWallet} />
<InitialWalletView address={address} chainId={chainId} onClose={closeWallet} />
</StyledSwipeableDrawer>
</>
);

View File

@ -34,7 +34,6 @@ const BondConfirmModal = ({
spendAmountValue,
spendAmount,
receiveAmount,
sender,
handleSettingsOpen,
isOpen,
handleConfirmClose
@ -59,7 +58,6 @@ const BondConfirmModal = ({
spendAmountValue._value.toBigInt(),
maxPrice,
recipientAddress,
sender,
referral
);

View File

@ -20,7 +20,7 @@ import DataRow from "../../../components/DataRow/DataRow";
import Paper from "../../../components/Paper/Paper";
import { useCurrentIndex } from "../../../hooks/staking";
import { useBalance, useTokenSymbol } from "../../../hooks/tokens";
import { useBalance } from "../../../hooks/tokens";
const BondInputArea = ({
bond,
@ -35,7 +35,7 @@ const BondInputArea = ({
const { pathname } = useLocation();
const { currentIndex } = useCurrentIndex(chainId);
const { balance, refetch } = useBalance(chainId, bond.quoteToken.quoteTokenAddress, address);
const { balance } = useBalance(chainId, bond.quoteToken.quoteTokenAddress, address);
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
@ -60,7 +60,6 @@ const BondInputArea = ({
const handleConfirmClose = () => {
setAmount("");
setConfirmOpen(false);
refetch();
}
const setMax = () => {
@ -221,7 +220,6 @@ const BondInputArea = ({
receiveAmount={formatNumber(amountInBaseToken, formatDecimals)}
handleSettingsOpen={handleSettingsOpen}
isOpen={confirmOpen}
sender={address}
handleConfirmClose={() => handleConfirmClose()}
/>
</Box>

View File

@ -59,7 +59,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
const onSubmit = async (indexes) => {
const isFundsInWarmup = warmupInfo.deposit._value > 0n;
if (warmupExists && isFundsInWarmup && !isPreClaimConfirmed) {
if ((warmupExists && isFundsInWarmup) || !isPreClaimConfirmed) {
setIsWapmup(true);
} else {
setIsPending(true);
@ -69,7 +69,6 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
isPayoutGhst,
indexes
);
await notesRefetch();
setIsPending(false);
}
}
@ -118,7 +117,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
</Box>
<PrimaryButton
disabled={isPending || totalClaimableBalance._value === 0n}
disabled={totalClaimableBalance._value === 0n}
fullWidth
className=""
onClick={() => onSubmit(notes.filter((note) => secondsTo > note.matured).map(note => note.id))}
@ -167,7 +166,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
<Box mt="16px">
<TertiaryButton
fullWidth
disabled={isPending || secondsTo < note.matured}
disabled={secondsTo < note.matured}
onClick={() => onSubmit([note.id])}
>
Claim
@ -223,7 +222,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => {
<TableCell style={{ padding: "8px 0" }}>
<TertiaryButton
fullWidth
disabled={isPending || secondsTo < note.matured}
disabled={secondsTo < note.matured}
onClick={() => onSubmit([note.id])}
>
Claim

View File

@ -84,7 +84,7 @@ const StakeConfirmationModal = (props) => {
);
break;
case "UNSTAKE":
isRebase = props.upperToken === props.stnkSymbol;
isRebase = props.upperToken === stnkSymbol;
await unstake(
props.chainId,
props.address,

View File

@ -152,13 +152,13 @@ export const useLiveBonds = (chainId) => {
discount,
displayName: getBondNameDisplayName(chainId, bondName, quoteTokenAddress),
baseToken: {
name: baseTokenSymbol,
name: quoteTokenSymbol,
purchaseUrl: getTokenPurchaseLink(chainId, ""),
icons: ["FTSO"],
tokenAddress: getTokenAddress(chainId, "FTSO")
},
quoteToken: {
name: quoteTokenSymbol,
name: quoteTokenName,
purchaseUrl: getTokenPurchaseLink(chainId, quoteTokenAddress),
icons: getTokenIcons(chainId, quoteTokenAddress),
decimals: quoteTokenDecimals,
@ -258,10 +258,10 @@ export const useNotes = (chainId, address) => {
}
}) : [];
return { notes, refetch };
return { notes };
}
export const purchaseBond = async (chainId, bondId, amount, maxPrice, user, sender, referral) => {
export const purchaseBond = async (chainId, bondId, amount, maxPrice, user, referral) => {
const args = [
bondId,
amount,
@ -278,7 +278,7 @@ export const purchaseBond = async (chainId, bondId, amount, maxPrice, user, send
chainId,
"deposit",
args,
sender,
user,
messages
);
}