import type { Account, Address, FetchAccountConfig, Simplify } from "gill"; import { type Token } from "gill/programs"; import type { GillUseRpcHook } from "./types.js"; type RpcConfig = Simplify>; type UseTokenAccountResponse = Simplify & { exists: true; }>; type TokenAccountInputWithDeclaredAta = { /** * Address of the {@link https://solana.com/docs/tokens#associated-token-account | Token Account} to get and decode */ ata: TAddress; }; type TokenAccountInputWithDerivedAtaDetails = { /** * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `mint` */ mint: Address; /** * Address of the {@link https://solana.com/docs/tokens#token-account | Token Account}'s `owner` */ owner: Address; /** * The {@link https://solana.com/docs/tokens#token-programs | Token Program} used to create the `mint` * * If no `tokenProgram` is provided, the hook will automatically fetch the * {@link https://solana.com/docs/tokens#mint-account | Mint account} to retrieve the correct Token Program address */ tokenProgram?: Address; }; type UseTokenAccountInput = GillUseRpcHook & (TokenAccountInputWithDeclaredAta | TokenAccountInputWithDerivedAtaDetails); /** * Get and parse an owner's {@link https://solana.com/docs/tokens#token-account | Token account} for a * {@link https://solana.com/docs/tokens#mint-account | Mint} and {@link https://solana.com/docs/tokens#token-programs | Token Program} */ export declare function useTokenAccount({ options, config, abortSignal, ...tokenAccountOptions }: UseTokenAccountInput): { account: UseTokenAccountResponse; error: unknown; isError: true; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: true; isSuccess: false; status: "error"; dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: unknown; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isPlaceholderData: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; } | { account: UseTokenAccountResponse; error: null; isError: false; isPending: false; isLoading: false; isLoadingError: false; isRefetchError: false; isSuccess: true; status: "success"; dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: unknown; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isPlaceholderData: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; } | { account: UseTokenAccountResponse; error: unknown; isError: true; isPending: false; isLoading: false; isLoadingError: true; isRefetchError: false; isSuccess: false; status: "error"; dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: unknown; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isPlaceholderData: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; } | { account: UseTokenAccountResponse; error: null; isError: false; isPending: true; isLoading: true; isLoadingError: false; isRefetchError: false; isSuccess: false; status: "pending"; dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: unknown; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isInitialLoading: boolean; isPaused: boolean; isPlaceholderData: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; } | { account: UseTokenAccountResponse; error: null; isError: false; isPending: true; isLoadingError: false; isRefetchError: false; isSuccess: false; status: "pending"; dataUpdatedAt: number; errorUpdatedAt: number; failureCount: number; failureReason: unknown; errorUpdateCount: number; isFetched: boolean; isFetchedAfterMount: boolean; isFetching: boolean; isLoading: boolean; isInitialLoading: boolean; isPaused: boolean; isPlaceholderData: boolean; isRefetching: boolean; isStale: boolean; refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise>; fetchStatus: import("@tanstack/react-query").FetchStatus; promise: Promise; }; export {}; //# sourceMappingURL=token-account.d.ts.map