@macalinao/grill
Version:
Modern Solana development kit for React applications with automatic account batching, caching, and transaction notifications
17 lines • 764 B
TypeScript
import type { Account, Address, Decoder } from "@solana/kit";
import type { UseQueryResult } from "@tanstack/react-query";
/**
* A hook for fetching and decoding accounts.
*/
export type UseDecodedAccountHook<TData extends object> = (args: {
address: Address | null | undefined;
}) => UseQueryResult<Account<TData> | null> & {
address: Address | null | undefined;
};
/**
* Generic helper to create a hook for fetching and decoding accounts
* @param decoder - The decoder to use for the account data
* @returns A hook function that fetches and decodes the account
*/
export declare function createDecodedAccountHook<TData extends object>(decoder: Decoder<TData>): UseDecodedAccountHook<TData>;
//# sourceMappingURL=create-decoded-account-hook.d.ts.map