UNPKG

@smartinvoicexyz/hooks

Version:

Unified source for React hooks used across the Smart Invoice protocol.

21 lines (20 loc) 724 B
import { InvoiceDetails, UseToastReturn } from '@smartinvoicexyz/types'; import { UseFormReturn } from 'react-hook-form'; import { Hex } from 'viem'; import { SimulateContractErrorType, WriteContractErrorType } from './types'; export type FormLock = { description: string; document?: string; }; export declare const useLock: ({ invoice, localForm, onTxSuccess, toast, details, }: { invoice: InvoiceDetails; localForm: UseFormReturn<FormLock>; onTxSuccess?: () => void; toast: UseToastReturn; details?: Hex | null; }) => { writeAsync: () => Promise<Hex | undefined>; isLoading: boolean; prepareError: SimulateContractErrorType | null; writeError: WriteContractErrorType | null; };