bigbuffet-rw/app/soapbox/features/crypto_donate/utils/block_explorer.ts
2022-03-25 16:39:26 -05:00

9 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);
};