import { UseQueryOptions } from "@tanstack/react-query"; import { MezoChainToken } from "../lib/contracts"; export declare const BALANCE_OF_ABI: readonly [{ readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "balanceOf"; readonly outputs: readonly [{ readonly internalType: "uint256"; readonly name: ""; readonly type: "uint256"; }]; readonly stateMutability: "view"; readonly type: "function"; }]; type UseMezoChainTokensBalancesOptions = { tokens?: T; queryOptions?: Omit>, "queryKey" | "queryFn" | "select" | "enabled">; }; export type TokenBalance = { decimals: number; formatted: string; symbol: string; value: bigint; usd: { value: bigint; formatted: string; }; }; /** * Hook to get the balance of a list of Mezo tokens for the current account * @param options.tokens The list of tokens to get the balance for. It will * fallback to all tokens if not provided. * @param options.queryOptions The query options to pass to the * `useReadContracts` * @returns Tanstack's `useQuery` returnings with balance of tokens for the * current account in form of typesafe object with token names as keys * and balances as values. * @example * const mezoTokensBalance = useTokensBalances({ * tokens: ["mT", "mxSolvBTC"], * }) * // Assuming the status is "success" * console.log(mezoTokensBalance.data.mT) // Eg. { value: 0n ... } * console.log(Object.keys(mezoTokensBalance.data)) // ["mT", "mxSolvBTC"] */ export declare function useTokensBalances(options?: UseMezoChainTokensBalancesOptions): import("@tanstack/react-query").UseQueryResult, Error>; /** * Hook for invalidating current user's token balances. Can be used to * invalidate the balances manually, which forces the data to be re-fetched. * @returns Function `invalidateTokenBalances` that invalidates token balances * @example * const { invalidateTokenBalances } = useInvalidateTokensBalances() * (...) * await invalidateTokenBalances() */ export declare function useInvalidateTokensBalances(): { invalidateTokensBalances: () => Promise; }; /** * Hook for resetting current user's token balances. Can be used to reset the * balances manually, which forces the data to be re-fetched. * @returns Function `resetTokenBalances` that invalidates token balances * @example * const { resetTokenBalances } = useResetTokensBalances() * (...) * await resetTokenBalances() */ export declare function useResetTokensBalances(): { resetTokenBalances: () => Promise; }; export {}; //# sourceMappingURL=useTokensBalances.d.ts.map