mirror of
https://github.com/lux-tel/websites.git
synced 2026-10-30 20:31:36 +00:00
18 lines
514 B
TypeScript
18 lines
514 B
TypeScript
'use client';
|
|
|
|
import { formatSENTBigInt, useSENTBalanceQuery } from '@session/contracts/hooks/SENT';
|
|
import { useMemo } from 'react';
|
|
import { useAccount } from 'wagmi';
|
|
|
|
export default function useSENTBalance() {
|
|
const { address } = useAccount();
|
|
const { balance: rawBalance, status, refetch } = useSENTBalanceQuery({ address });
|
|
|
|
const formattedBalance = useMemo(
|
|
() => (rawBalance ? formatSENTBigInt(rawBalance) : 0),
|
|
[rawBalance]
|
|
);
|
|
|
|
return { balance: formattedBalance, status, refetch };
|
|
}
|