feat: 用独立页面展示存证详情并按天河链版式绘制证书
This commit is contained in:
+23
-1
@@ -50,6 +50,28 @@ export interface TraceCertificateRecord {
|
||||
txHash: string;
|
||||
author: string;
|
||||
createdAt: string | null;
|
||||
environment?: 'test' | 'production';
|
||||
}
|
||||
export interface ChainDetailLog {
|
||||
address: string;
|
||||
name: string;
|
||||
data: string;
|
||||
topics: string[];
|
||||
}
|
||||
export interface ChainDetail {
|
||||
gasUsed: string;
|
||||
fromAddress: string;
|
||||
toAddress: string;
|
||||
timeStamp: string | null;
|
||||
blockHeight: string | null;
|
||||
method: string;
|
||||
methodId: string;
|
||||
inputs: Array<{ name: string; type: string; data: string }>;
|
||||
logs: ChainDetailLog[];
|
||||
action: { fromAddress: string; toAddress: string; contractAddress: string; tokenId: string } | null;
|
||||
}
|
||||
export function fetchChainDetail(shortCode: string): Promise<{ complete: boolean; detail: ChainDetail | null }> {
|
||||
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/chain-detail`, {}, { timeout: 30_000 }) as unknown as Promise<{ complete: boolean; detail: ChainDetail | null }>;
|
||||
}
|
||||
export interface TraceCertificateResult {
|
||||
status: 'NONE' | 'PENDING' | 'SUBMITTING' | 'CHECKING' | 'WAITING' | 'READY' | 'UNKNOWN' | 'FAILED';
|
||||
@@ -57,7 +79,7 @@ export interface TraceCertificateResult {
|
||||
certificate: TraceCertificateRecord | null;
|
||||
}
|
||||
export function requestTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
||||
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/certificate`, {}) as unknown as Promise<TraceCertificateResult>;
|
||||
return instance.post(`/public/trace/${encodeURIComponent(shortCode)}/certificate`, {}, { timeout: 90_000 }) as unknown as Promise<TraceCertificateResult>;
|
||||
}
|
||||
export function fetchTraceCertificate(shortCode: string): Promise<TraceCertificateResult> {
|
||||
return instance.get(`/public/trace/${encodeURIComponent(shortCode)}/certificate`) as unknown as Promise<TraceCertificateResult>;
|
||||
|
||||
Reference in New Issue
Block a user