@macalinao/grill
Version:
Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications
25 lines • 886 B
TypeScript
import type { TokenAmount } from "@macalinao/token-utils";
import type { Address } from "@solana/kit";
export interface UseTokenBalanceOptions {
/** The address of the token account */
address: Address | null | undefined;
/** The mint address of the token (optional, will be fetched from token account) */
mint?: Address | null | undefined;
}
/**
* Hook that fetches a token account and its token info to return a TokenAmount.
* This combines useTokenAccount and useTokenInfo to provide the complete balance information.
*
* @example
* ```typescript
* const balance = useTokenBalance({
* address: tokenAccountAddress,
* });
*
* if (balance) {
* console.log("Balance:", formatTokenAmount(balance));
* }
* ```
*/
export declare function useTokenBalance(options: UseTokenBalanceOptions): TokenAmount | null;
//# sourceMappingURL=use-token-balance.d.ts.map