@safe-global/safe-react-hooks
Version:
A collection of React Hooks that facilitates the interaction of React apps with Safe Smart Accounts
16 lines • 648 B
JavaScript
import { usePublicClientQuery } from '../../hooks/usePublicClientQuery.js';
import { QueryKey } from '../../constants.js';
/**
* Hook to get the connected Safe's threshold.
* @param params Parameters to customize the hook behavior.
* @param params.config SafeConfig to use instead of the one provided by `SafeProvider`.
* @returns Query result object containing the Safe's threshold.
*/
export function useThreshold(params = {}) {
return usePublicClientQuery({
...params,
querySafeClientFn: (safeClient) => safeClient.getThreshold(),
queryKey: [QueryKey.Threshold]
});
}
//# sourceMappingURL=useThreshold.js.map