bigbuffet-rw/app/soapbox/features/crypto-donate/utils/block-explorer.ts

10 lines
337 B
TypeScript
Raw Normal View History

2022-11-15 09:23:36 -08:00
import blockExplorers from './block-explorers.json';
2022-03-25 14:39:26 -07:00
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);
};