UNPKG

@safe-global/safe-react-hooks

Version:

A collection of React Hooks that facilitates the interaction of React apps with Safe Smart Accounts

20 lines (19 loc) 1.3 kB
import { UseMutateAsyncFunction, UseMutateFunction, UseMutationResult } from '@tanstack/react-query'; import { SafeClientResult } from '@safe-global/sdk-starter-kit'; import { ConfigParam, SafeConfigWithSigner } from '../types/index.js'; export type UpdateThresholdVariables = { threshold: number; }; export type UseUpdateThresholdParams = ConfigParam<SafeConfigWithSigner>; export type UseUpdateThresholdReturnType = Omit<UseMutationResult<SafeClientResult, Error, UpdateThresholdVariables>, 'mutate' | 'mutateAsync'> & { updateThreshold: UseMutateFunction<SafeClientResult, Error, UpdateThresholdVariables, unknown>; updateThresholdAsync: UseMutateAsyncFunction<SafeClientResult, Error, UpdateThresholdVariables, unknown>; }; /** * Hook to update the threshold of the connected Safe. It sends or (if the current threshold is > 1) proposes * a transaction to update the threshold of the Safe account and returns the transaction result. * @param params Parameters to customize the hook behavior. * @param params.config SafeConfig to use instead of the one provided by `SafeProvider`. * @returns Object containing the mutation state and the function to update the threshold. */ export declare function useUpdateThreshold(params?: UseUpdateThresholdParams): UseUpdateThresholdReturnType;