UNPKG

@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) 1.1 kB
import { UseMutateAsyncFunction, UseMutateFunction, UseMutationResult } from '@tanstack/react-query'; import { SafeClientResult } from '@safe-global/sdk-starter-kit'; import { ConfigParam, SafeConfigWithSigner, SafeClient } from '../../types/index.js'; export type AddOwnerVariables = Parameters<SafeClient['createAddOwnerTransaction']>[0]; export type UseAddOwnerParams = ConfigParam<SafeConfigWithSigner>; export type UseAddOwnerReturnType = Omit<UseMutationResult<SafeClientResult, Error, AddOwnerVariables>, 'mutate' | 'mutateAsync'> & { addOwner: UseMutateFunction<SafeClientResult, Error, AddOwnerVariables, unknown>; addOwnerAsync: UseMutateAsyncFunction<SafeClientResult, Error, AddOwnerVariables, unknown>; }; /** * Hook to add an owner to the connected Safe. * @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 add an owner. */ export declare function useAddOwner(params?: UseAddOwnerParams): UseAddOwnerReturnType;