UNPKG

@safe-global/safe-react-hooks

Version:

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

22 lines (21 loc) 1.1 kB
import { Hash } from 'viem'; import { UseTransactionReturnType as UseTransactionReturnTypeWagmi } from 'wagmi'; import type { ConfigParam, SafeConfig } from '../types/index.js'; import { UseSafeTransactionReturnType } from './useSafeTransaction.js'; export type UseTransactionParams = (ConfigParam<SafeConfig> & { safeTxHash: Hash; }) | { ethereumTxHash: Hash; }; export type UseTransactionReturnType<Params extends UseTransactionParams> = Params extends { safeTxHash: Hash; } ? UseSafeTransactionReturnType : UseTransactionReturnTypeWagmi; /** * Hook to get the status of a specific transaction. * @param params Parameters to customize the hook behavior. * @param params.config SafeConfig to use instead of the one provided by `SafeProvider`. * @param params.safeTxHash Hash of Safe transaction to be fetched. * @param params.ethereumTxHash Hash of Ethereum transaction to be fetched. * @returns Query result object containing the transaction object. */ export declare function useTransaction<Params extends UseTransactionParams>(params: Params): UseTransactionReturnType<Params>;