@safe-global/safe-react-hooks
Version:
A collection of React Hooks that facilitates the interaction of React apps with Safe Smart Accounts
17 lines (16 loc) • 877 B
TypeScript
import { type UseQueryResult } from '@tanstack/react-query';
import type { ConfigParam, SafeConfig, SafeClient } from '../types/index.js';
export type UsePublicClientQueryParams<T> = ConfigParam<SafeConfig> & {
querySafeClientFn: (safeClient: SafeClient) => Promise<T> | T;
queryKey: string[];
};
export type UsePublicClientQueryReturnType<T> = UseQueryResult<T>;
/**
* Hook for sending a custom query via the SafeClient.
* @param params Parameters to customize the hook behavior.
* @param params.config SafeConfig to use instead of the one provided by `SafeProvider`.
* @param params.querySafeClientFn Function to query the SafeClient.
* @param params.queryKey Key to identify the query.
* @returns Object containing the query result.
*/
export declare function usePublicClientQuery<T>(params: UsePublicClientQueryParams<T>): UsePublicClientQueryReturnType<T>;