UNPKG

@macalinao/react-quarry

Version:

React hooks for Quarry

28 lines 836 B
import { createDecodedAccountHook, createDecodedAccountsHook, } from "@macalinao/grill"; import { getMinerDecoder } from "@macalinao/quarry"; /** * Hook to fetch and decode a Miner account. * A Miner represents a user's staking position in a Quarry, * tracking staked balance and accumulated rewards. * * @example * ```tsx * const { data: miner } = useMiner({ * address: minerAddress * }); * ``` */ export const useMiner = createDecodedAccountHook(getMinerDecoder()); /** * Hook to fetch and decode multiple Miner accounts in batch. * Uses DataLoader for efficient batching of multiple account fetches. * * @example * ```tsx * const { data: miners } = useMiners({ * addresses: minerAddresses * }); * ``` */ export const useMiners = createDecodedAccountsHook(getMinerDecoder()); //# sourceMappingURL=miner.js.map