UNPKG

@macalinao/grill

Version:

Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications

28 lines 953 B
import type { TokenAmount } from "@macalinao/token-utils"; import type { Address } from "@solana/kit"; export interface UseATABalanceOptions { /** The mint address of the token */ mint: Address | null | undefined; /** The owner address of the token account */ owner: Address | null | undefined; /** The token program address (defaults to TOKEN_PROGRAM_ADDRESS) */ tokenProgram?: Address; } /** * Hook that fetches an Associated Token Account balance as a TokenAmount. * This combines useAssociatedTokenAccount and useTokenInfo to provide the complete balance information. * * @example * ```typescript * const balance = useATABalance({ * mint: mintAddress, * owner: walletAddress, * }); * * if (balance) { * console.log("Balance:", formatTokenAmount(balance)); * } * ``` */ export declare function useATABalance(options: UseATABalanceOptions): TokenAmount | null; //# sourceMappingURL=use-ata-balance.d.ts.map