@macalinao/react-quarry
Version:
React hooks for Quarry
28 lines • 880 B
JavaScript
import { createDecodedAccountHook, createDecodedAccountsHook, } from "@macalinao/grill";
import { getOperatorDecoder } from "@macalinao/quarry";
/**
* Hook to fetch and decode an Operator account.
* An Operator has delegated permissions to manage Quarry operations
* on behalf of the Rewarder authority.
*
* @example
* ```tsx
* const { data: operator } = useOperator({
* address: operatorAddress
* });
* ```
*/
export const useOperator = createDecodedAccountHook(getOperatorDecoder());
/**
* Hook to fetch and decode multiple Operator accounts in batch.
* Uses DataLoader for efficient batching of multiple account fetches.
*
* @example
* ```tsx
* const { data: operators } = useOperators({
* addresses: [operator1, operator2]
* });
* ```
*/
export const useOperators = createDecodedAccountsHook(getOperatorDecoder());
//# sourceMappingURL=operator.js.map