import type { GenError } from './GenError.js' import type { GenResult } from './GenResult.js' import type { ContractResult } from '@tevm/actions-types' import type { Abi } from 'abitype' import type { Chain, ContractFunctionName, WaitForTransactionReceiptReturnType, WriteContractErrorType, WriteContractReturnType, } from 'viem' // TODO move this to actions-types if it becomes a real action /** * @experimental * The result of an optimistic write */ export type OptimisticResult< TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName, TChain extends Chain | undefined, > = | GenResult, 'OPTIMISTIC_RESULT'> // TODO type this error better | GenError | GenResult | GenError | GenResult, 'RECEIPT'> | GenError // TODO emit a finalized result when app considers risk of reorg to be 0 // | GenResult // TODO emit a reorg event