// @note: not used anywhere, can remove
import { useConfig } from "@hooks/useConfig";
import { useQuery } from "@tanstack/react-query";
import { bungeeApiFetcher } from "@utils/fetcher";

export const useTokenBalances = (userAddress?: string) => {
	const { baseUrl, apiKey } = useConfig();
	// biome-ignore format:
	const query = `${baseUrl}/balances?userAddress=${userAddress}`;

	const { data, error } = useQuery({
		queryKey: ["bungee-all-token-balance", query, apiKey, userAddress],
		queryFn: () => bungeeApiFetcher(query, apiKey),
		enabled: !!userAddress,
		refetchOnWindowFocus: false,
	});

	return data?.result;
};
