@smartinvoicexyz/hooks
Version:
Unified source for React hooks used across the Smart Invoice protocol.
24 lines (23 loc) • 821 B
TypeScript
import { InvoiceDetails, UseToastReturn } from '@smartinvoicexyz/types';
import { UseFormReturn } from 'react-hook-form';
import { Hex } from 'viem';
import { SimulateContractErrorType, WriteContractErrorType } from './types';
export type FormResolve = {
description: string;
document?: string;
clientAward: number;
providerAward: number;
resolverAward: number;
};
export declare const useResolve: ({ invoice, localForm, onTxSuccess, toast, details, }: {
invoice: Partial<InvoiceDetails>;
localForm: UseFormReturn<FormResolve>;
onTxSuccess: () => void;
toast?: UseToastReturn;
details?: Hex | null;
}) => {
writeAsync: () => Promise<Hex | undefined>;
isLoading: boolean;
prepareError: SimulateContractErrorType | null;
writeError: WriteContractErrorType | null;
};