diff --git a/src/components/dapp/WalletButton.tsx b/src/components/dapp/WalletButton.tsx index 85e4a423..8349d055 100644 --- a/src/components/dapp/WalletButton.tsx +++ b/src/components/dapp/WalletButton.tsx @@ -16,36 +16,27 @@ import WalletConnectors from "./WalletConnectors"; export type WalletButton = ButtonProps; export default function WalletButton(props: ButtonProps) { - const { - address, - disconnect, - connected, - connector, - chainId, - switchChain, - chains, - } = useWalletContext(); + const { address, disconnect, connected, connector, chainId, switchChain, chains } = useWalletContext(); const chainOptions = useMemo(() => { if (!chains) return []; - return chains.reduce((obj, chain) => { - obj[chain.id] = ( - - - {chain.name} - - ); - return obj; - }, {} as { [chainId: number]: ReactNode }); + return chains.reduce( + (obj, chain) => { + obj[chain.id] = ( + + + {chain.name} + + ); + return obj; + }, + {} as { [chainId: number]: ReactNode }, + ); }, [chains]); if (!connected) return ( - } - > + }> @@ -54,10 +45,7 @@ export default function WalletButton(props: ButtonProps) { return ( <> - switchChain(+c)]} options={chainOptions} /> {/* TODO: Show the account icon by default if there is no ENS icon */} - + {address} - @@ -97,8 +78,7 @@ export default function WalletButton(props: ButtonProps) { - } - > + }> diff --git a/src/utils/formatter.service.ts b/src/utils/formatter.service.ts index 5cded40f..e0c536b9 100644 --- a/src/utils/formatter.service.ts +++ b/src/utils/formatter.service.ts @@ -16,9 +16,7 @@ export class FormatterService { toNumber(value: bigint | string, decimals = 18): number { const bi = BigInt(value); - const fractionalPart = - Number.parseFloat((bi % BigInt(10 ** decimals)).toString()) / - 10 ** decimals; + const fractionalPart = Number.parseFloat((bi % BigInt(10 ** decimals)).toString()) / 10 ** decimals; let integerPart = bi / BigInt(10 ** decimals); // trim the integer part if it's too large to avoid potential overflows