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