Files
ncd-fe/src/features/crypto-donate/utils/block-explorer.ts
2023-09-18 16:08:54 -05:00

10 lines
337 B
TypeScript

import blockExplorers from './block-explorers.json';
type BlockExplorers = Record<string, string | null>;
export const getExplorerUrl = (ticker: string, address: string): string | null => {
const template = (blockExplorers as BlockExplorers)[ticker];
if (!template) return null;
return template.replace('{address}', address);
};