UNPKG

@macalinao/grill

Version:

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

36 lines 1.52 kB
import type { DataLoader } from "@macalinao/dataloader-es"; import type { Address, EncodedAccount } from "@solana/kit"; import type { GetExplorerLinkArgs } from "gill"; import type { SendTXFunction } from "../utils/types.js"; export type GetExplorerLinkFunction = (args?: GetExplorerLinkArgs) => string; /** * Context value interface for SolanaAccountProvider. * Provides access to a batch account loader for efficient Solana account fetching. */ export interface GrillContextValue { /** DataLoader instance for batching and caching Solana account requests */ accountLoader: DataLoader<Address, EncodedAccount | null>; refetchAccounts: (addresses: Address[]) => Promise<void>; /** * Function to send transactions with batching and confirmation */ sendTX: SendTXFunction; /** * Function to get explorer link for a transaction signature */ getExplorerLink: GetExplorerLinkFunction; } /** * React context for Solana account provider functionality. * Provides access to batch account loading capabilities throughout the component tree. */ export declare const GrillContext: React.Context<GrillContextValue | null>; /** * Hook to access the SolanaAccount context. * Must be used within a SolanaAccountProvider component tree. * * @returns The SolanaAccount context value containing the account loader * @throws Error if used outside of a SolanaAccountProvider */ export declare const useGrillContext: () => GrillContextValue; //# sourceMappingURL=grill-context.d.ts.map