feat: 接入天河链延时确认

This commit is contained in:
Nixevol
2026-07-06 19:30:31 +08:00
parent e6caed498f
commit 628a5a4465
14 changed files with 243 additions and 12 deletions
+13 -1
View File
@@ -61,7 +61,19 @@ export class AttestationService {
if (!proof) throw new BusinessException(ErrorCode.NOT_FOUND, '存证记录不存在', 404);
await this.prisma.blockchainProof.update({
where: { id: proofId },
data: { status: ProofStatus.PENDING, onchainAt: null },
data: {
status: ProofStatus.PENDING,
txHash: null,
blockHash: null,
blockHeight: null,
chainName: null,
explorerUrl: null,
onchainAt: null,
rawResponse: {
...(proof.rawResponse && typeof proof.rawResponse === 'object' ? (proof.rawResponse as object) : {}),
retriedAt: new Date().toISOString(),
},
},
});
await this.queue.add('onchain', { proofId });
return { success: true };