@@ -51,10 +51,9 @@ export function txExplorerUrl(blockchain: Blockchain, txId: string): string | un
5151 const txPath = TxPaths [ blockchain ] ;
5252 if ( ! baseUrl || ! txPath ) return undefined ;
5353
54- // ICP token txIds have format "canisterId:blockIndex" — extract block index only
54+ // ICP token txIds have format "canisterId:blockIndex"
5555 if ( blockchain === Blockchain . INTERNET_COMPUTER && txId . includes ( ':' ) ) {
56- const blockIndex = txId . split ( ':' ) [ 1 ] ;
57- return `${ baseUrl } /${ txPath } /${ blockIndex } ` ;
56+ return icpTokenTxUrl ( baseUrl , txPath , txId ) ;
5857 }
5958
6059 return `${ baseUrl } /${ txPath } /${ txId } ` ;
@@ -73,6 +72,20 @@ export function addressExplorerUrl(blockchain: Blockchain, address: string): str
7372
7473// --- HELPERS --- //
7574
75+ // ICP token canister ID to dashboard path mapping
76+ const IcpTokenDashboardPaths : Record < string , string > = {
77+ 'mxzaz-hqaaa-aaaar-qaada-cai' : 'bitcoin' , // ckBTC
78+ } ;
79+
80+ function icpTokenTxUrl ( baseUrl : string , txPath : string , txId : string ) : string | undefined {
81+ const [ canisterId , blockIndex ] = txId . split ( ':' ) ;
82+
83+ const tokenPath = IcpTokenDashboardPaths [ canisterId ] ;
84+ if ( ! tokenPath ) return undefined ;
85+
86+ return `${ baseUrl } /${ tokenPath } /${ txPath } /${ blockIndex } ` ;
87+ }
88+
7689const BlockchainExplorerUrls : { [ b in Blockchain ] : string } = {
7790 [ Blockchain . DEFICHAIN ] : 'https://defiscan.live' ,
7891 [ Blockchain . BITCOIN ] : 'https://mempool.space' ,
0 commit comments