UNPKG

@smartinvoicexyz/hooks

Version:

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

24 lines (23 loc) 858 B
import { FormInvoice, UseToastReturn } from '@smartinvoicexyz/types'; import { UseFormReturn } from 'react-hook-form'; import { Hex } from 'viem'; import { SimulateContractErrorType, WriteContractErrorType } from './types'; interface UseInvoiceCreate { invoiceForm: UseFormReturn<Partial<FormInvoice>>; toast: UseToastReturn; networkConfig?: { resolver: Hex; token: Hex; tokenDecimals: number; }; onTxSuccess?: (result: Hex) => void; enabled?: boolean; details?: `0x${string}` | null; } export declare const useInvoiceCreate: ({ invoiceForm, toast, onTxSuccess, networkConfig, details, enabled, }: UseInvoiceCreate) => { writeAsync: () => Promise<Hex | undefined>; isLoading: boolean; prepareError: SimulateContractErrorType | null; writeError: WriteContractErrorType | null; }; export {};