@safe-global/safe-react-hooks
Version:
A collection of React Hooks that facilitates the interaction of React apps with Safe Smart Accounts
23 lines (22 loc) • 1.15 kB
TypeScript
import { waitForTransactionReceipt as waitForTransactionReceiptWagmi } from 'wagmi/actions';
import { ConfigParam, SafeConfig } from '../types/index.js';
type WaitForTransactionIndexedParams = {
ethereumTxHash?: string;
safeTxHash?: string;
};
export type UseWaitForTransactionParams = ConfigParam<SafeConfig> & {
pollingInterval?: number;
};
export type UseWaitForTransactionReturnType = {
waitForTransactionReceipt: (ethereumTxHash: string) => ReturnType<typeof waitForTransactionReceiptWagmi>;
waitForTransactionIndexed: (params: WaitForTransactionIndexedParams) => Promise<void>;
};
/**
* Hook to wait for a transaction to be executed or indexed by the Transaction Service.
* @param params Parameters to customize the hook behavior.
* @param params.config SafeConfig to use instead of the one provided by `SafeProvider`.
* @param params.pollingInterval Interval in milliseconds to poll the Transaction Service.
* @returns Object containing functions to synchronously wait for transactions.
*/
export declare function useWaitForTransaction(params?: UseWaitForTransactionParams): UseWaitForTransactionReturnType;
export {};