Skip to content

Commit

Permalink
fix recent history link for zkevm (#1312)
Browse files Browse the repository at this point in the history
* fix recent history link for zkevm

* remove useless console.log

* remove XCM txs in getZkEVMTxHistories function

* refactor castTransferHistory function
  • Loading branch information
gtg7784 authored Jun 12, 2024
1 parent 890c8a5 commit c784228
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/modules/information/recent-history/transfer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};

Expand Down

0 comments on commit c784228

Please sign in to comment.