UNPKG

@macalinao/grill

Version:

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

21 lines 677 B
import { findAssociatedTokenPda } from "@solana-program/token"; import { createPdaHook } from "./create-pda-hook.js"; /** * Hook to compute the Associated Token Account (ATA) address for a given mint and owner * * @example * ```typescript * const { data: ataPda, isLoading } = useAssociatedTokenPda({ * mint: mintAddress, * owner: ownerAddress, * tokenProgram: TOKEN_PROGRAM_ADDRESS, * }); * * if (ataPda) { * const [ataAddress, bump] = ataPda; * console.log("ATA address:", ataAddress); * } * ``` */ export const useAssociatedTokenPda = createPdaHook(findAssociatedTokenPda, "associatedTokenPda"); //# sourceMappingURL=use-associated-token-pda.js.map