From c7842288fcb968a69d5d83372cc8f5fba7d3a21f Mon Sep 17 00:00:00 2001 From: Taegeon Alan Go Date: Wed, 12 Jun 2024 19:12:06 +0900 Subject: [PATCH] fix recent history link for zkevm (#1312) * fix recent history link for zkevm * remove useless console.log * remove XCM txs in getZkEVMTxHistories function * refactor castTransferHistory function --- .../information/recent-history/transfer/index.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/information/recent-history/transfer/index.ts b/src/modules/information/recent-history/transfer/index.ts index 68102f499..c5359a046 100644 --- a/src/modules/information/recent-history/transfer/index.ts +++ b/src/modules/information/recent-history/transfer/index.ts @@ -69,9 +69,16 @@ export const castTransferHistory = ({ const timestamp = String(tx.timestamp); const txType = HistoryTxType.Transfer; const note = `To ${getShortenAddress(to)}`; - const networkIdx = localStorage.getItem(NETWORK_IDX); - const subscan = providerEndpoints[Number(networkIdx)].subscan; - const explorerUrl = `${subscan}/extrinsic/${hash}`; + const networkIdx = Number(localStorage.getItem(NETWORK_IDX)); + let explorerUrl: string = ''; + + if (networkIdx === endpointKey.ASTAR_ZKEVM || networkIdx === endpointKey.ZKYOTO) { + const blockscount = providerEndpoints[networkIdx].blockscout; + explorerUrl = `${blockscount}/tx/${hash}`; + } else { + const subscan = providerEndpoints[networkIdx].subscan; + explorerUrl = `${subscan}/extrinsic/${hash}`; + } return { timestamp, txType, amount, symbol, note, explorerUrl }; };