diff --git a/components/DepositModal.tsx b/components/DepositModal.tsx index 3d60f47..d86e012 100644 --- a/components/DepositModal.tsx +++ b/components/DepositModal.tsx @@ -3,6 +3,7 @@ import { nativeToUi, sleep, } from '@blockworks-foundation/mango-client/lib/utils' +import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions' import Modal from './Modal' import Input from './Input' import AccountSelect from './AccountSelect' @@ -43,10 +44,9 @@ const DepositModal = ({ isOpen, onClose }) => { const getBalanceForAccount = (account) => { const mintAddress = account?.account.mint.toString() const balance = nativeToUi( - account?.account?.amount, + (account?.account.mint.equals(WRAPPED_SOL_MINT)) ? Math.max(account?.account?.amount - (0.05 * 1e9), 0) : account?.account?.amount, mintDecimals[getTokenIndex(mintAddress)] ) - return balance.toString() } diff --git a/components/FeeDiscountsTable.tsx b/components/FeeDiscountsTable.tsx deleted file mode 100644 index 9116760..0000000 --- a/components/FeeDiscountsTable.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { useCallback, useState } from 'react' -import { percentFormat } from '../utils/index' -import useSrmAccount from '../hooks/useSrmAccount' -import useMangoStore from '../stores/useMangoStore' -import Button from './Button' -import DepositSrmModal from './DepositSrmModal' -import WithdrawSrmModal from './WithdrawSrmModal' -import { SRM_DECIMALS } from '@project-serum/serum/lib/token-instructions' - -const FeeDiscountsTable = () => { - const [showDeposit, setShowDeposit] = useState(false) - const [showWithdraw, setShowWithdraw] = useState(false) - const { totalSrm, rates } = useSrmAccount() - const connected = useMangoStore((s) => s.wallet.connected) - const contributedSrm = useMangoStore((s) => s.wallet.contributedSrm) - - const handleCloseDeposit = useCallback(() => { - setShowDeposit(false) - }, []) - - const handleCloseWithdraw = useCallback(() => { - setShowWithdraw(false) - }, []) - - return ( -