import { useEffect, useState } from "react";
export function useGetBalance(token, fetchBalance) {
    const [balance, setBalance] = useState("");
    const [loading, setLoading] = useState(false);
    useEffect(()=>{
        if (loading) return;
        setLoading(true);
        fetchBalance(token.address, token.decimals).then((balance)=>{
            setBalance(balance);
        }, (error)=>{}).finally(()=>{
            setLoading(false);
        });
    }, [
        token
    ]);
    return {
        balance,
        loading
    };
}

//# sourceMappingURL=useGetBalance.js.map