import { TransactionRequest } from '@/domain/aggregates/transaction-request'; import { ChainType, TxHash } from '@/domain/value-objects'; export const TRANSACTION_REQUEST_REPOSITORY = Symbol('TRANSACTION_REQUEST_REPOSITORY'); export interface ITransactionRequestRepository { /** * 保存交易请求 */ save(request: TransactionRequest): Promise; /** * 根据ID查找 */ findById(id: bigint): Promise; /** * 根据交易哈希查找 */ findByTxHash(txHash: TxHash): Promise; /** * 根据来源查找 */ findBySource(sourceService: string, sourceOrderId: string): Promise; /** * 查找待处理的请求 */ findPending(chainType: ChainType): Promise; /** * 查找已广播待确认的请求 */ findBroadcasted(chainType: ChainType): Promise; /** * 查找失败可重试的请求 */ findRetryable(chainType: ChainType, maxRetries: number): Promise; }