bigbuffet-rw/app/soapbox/features/crypto_donate/utils/block_explorer.ts

10 lines
337 B
TypeScript
Raw Normal View History

2022-03-25 14:39:26 -07:00
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);
};