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.14 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 SwapOwnerVariables = Parameters<SafeClient['createSwapOwnerTransaction']>[0]; export type UseSwapOwnerParams = ConfigParam<SafeConfigWithSigner>; export type UseSwapOwnerReturnType = Omit<UseMutationResult<SafeClientResult, Error, SwapOwnerVariables>, 'mutate' | 'mutateAsync'> & { swapOwner: UseMutateFunction<SafeClientResult, Error, SwapOwnerVariables, unknown>; swapOwnerAsync: UseMutateAsyncFunction<SafeClientResult, Error, SwapOwnerVariables, unknown>; }; /** * Hook to swap an owner of the connected Safe with another address. * @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 swap an owner. */ export declare function useSwapOwner(params?: UseSwapOwnerParams): UseSwapOwnerReturnType;