diff --git a/.eslintrc.json b/.eslintrc.json index 6dd5286..ad00946 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -25,9 +25,11 @@ "react/display-name": 0, "react/prop-types": 0, "@typescript-eslint/explicit-function-return-type": 0, + "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/explicit-member-accessibility": 0, "@typescript-eslint/indent": 0, "@typescript-eslint/member-delimiter-style": 0, + "@typescript-eslint/ban-ts-comment": 0, "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-var-requires": 0, "@typescript-eslint/no-use-before-define": 0, @@ -36,12 +38,6 @@ { "argsIgnorePattern": "^_" } - ], - "no-console": [ - 2, - { - "allow": ["warn", "error"] - } ] } } diff --git a/components/Balances.tsx b/components/Balances.tsx deleted file mode 100644 index f84c842..0000000 --- a/components/Balances.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import BN from 'bn.js' -import useWalletStore from '../stores/useWalletStore' - -const Balances = () => { - const { tokenAccounts, mints } = useWalletStore((state) => state) - - function fixedPointToNumber(value: BN, decimals: number) { - const divisor = new BN(10).pow(new BN(decimals)) - const quotient = value.div(divisor) - const remainder = value.mod(divisor) - return quotient.toNumber() + remainder.toNumber() / divisor.toNumber() - } - - function calculateBalance(a) { - const mint = mints[a.account?.mint?.toBase58()] - return mint ? fixedPointToNumber(a.account.amount, mint.decimals) : 0 - } - - const displayedBalances = tokenAccounts - .map((a) => ({ id: a.publicKey.toBase58(), balance: calculateBalance(a) })) - .sort((a, b) => (a.id > b.id ? 1 : -1)) - - return ( -