feat: C端查看存证改跳天河区块浏览器交易详情页
This commit is contained in:
@@ -80,13 +80,15 @@ export class BlockchainService {
|
||||
blockHash: null,
|
||||
blockHeight: null,
|
||||
chainName: '天河链',
|
||||
explorerUrl: attest.explorerUrl,
|
||||
// 「查看存证」跳天河区块浏览器交易详情页(规范展示);UDFS 裸 JSON 存证链接保留在 raw.proofUrl / feature 字段
|
||||
explorerUrl: provider.explorerTxUrl(pub.txHash),
|
||||
tokenId: pub.tokenId >= 0 ? pub.tokenId : null,
|
||||
contractAddress: pub.contractAddress,
|
||||
onchainAt: new Date(),
|
||||
raw: {
|
||||
...attest.raw,
|
||||
attestTxHash: attest.txHash,
|
||||
attestUrl: attest.explorerUrl,
|
||||
publishResponse: pub.raw,
|
||||
transactionStatus: 'submitted',
|
||||
transactionStatusNote: '存证已生效(upload);NFT 铸造交易已提交,等待接口 9 确认区块信息。',
|
||||
|
||||
@@ -89,6 +89,18 @@ export class TianheProvider implements AttestationProvider {
|
||||
return required(this.opts.baseUrl, 'Base URL').replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
// 天河区块浏览器域名:测试 test.explorer.tianhecloud.com / 生产 explorer.tianhecloud.com(由 API base 是否含 test. 判定)
|
||||
private explorerBase(): string {
|
||||
return this.baseUrl().includes('test.')
|
||||
? 'https://test.explorer.tianhecloud.com'
|
||||
: 'https://explorer.tianhecloud.com';
|
||||
}
|
||||
|
||||
// 交易详情页:客户凭 mint 交易哈希可查看状态/区块高度/追溯码(productId)/存证链接(feature),比裸 UDFS JSON 规范
|
||||
explorerTxUrl(txHash: string): string {
|
||||
return `${this.explorerBase()}/#/tiChain/transDetail?hash=${encodeURIComponent(txHash)}`;
|
||||
}
|
||||
|
||||
private credentials() {
|
||||
return {
|
||||
appId: required(this.opts.appId, 'App ID'),
|
||||
|
||||
Reference in New Issue
Block a user