UNPKG

@macalinao/grill

Version:

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

24 lines 1.16 kB
import type { UseQueryResult } from "@tanstack/react-query"; import type { Account, Address, Decoder, FetchAccountConfig, Simplify } from "gill"; import type { GillUseRpcHook } from "./types.js"; type RpcConfig = Simplify<Omit<FetchAccountConfig, "abortSignal">>; type UseAccountInput<TConfig extends RpcConfig = RpcConfig, TDecodedData extends object = Uint8Array> = GillUseRpcHook<TConfig> & { /** * Address of the account to get the balance of. */ address: Address | null | undefined; /** * Account decoder that can decode the account's `data` byte array value. * * Note: if not provided, the account will be returned as a `Uint8Array`. */ decoder?: Decoder<TDecodedData>; }; /** * Get the account info for an address. Concurrent queries are batched using a DataLoader. */ export declare function useAccount<TConfig extends RpcConfig = RpcConfig, TDecodedData extends object = Uint8Array>({ options, address, decoder, }: UseAccountInput<TConfig, TDecodedData>): UseQueryResult<Account<TDecodedData> | null> & { address: Address | null | undefined; }; export {}; //# sourceMappingURL=use-account.d.ts.map