Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (25 loc) · 688 Bytes

useExplorerUrl.md

File metadata and controls

32 lines (25 loc) · 688 Bytes

useExplorerUrl

React hook that generates an explorer URL based on the given chain, input, type, and explorer type.

Usage

import { useExplorerUrl } from 'LIBRARY_NAME';
import { ExplorerUrlType, ChainType, ExplorerType } from 'PATH_TO_MISC_ENUMS';

const Demo = () => {
  const explorerUrl = useExplorerUrl(
    ChainType.MainNet,
    'ADDRESS_OR_TX_ID',
    ExplorerUrlType.Transaction,
    ExplorerType.AlgoScan,
  );

  return <div>Explorer URL: {explorerUrl}</div>;
};

Call signature

function useExplorerUrl = (
  chain: ChainType,
  input: string | number,
  type: ExplorerUrlType,
  explorerType: ExplorerType = ExplorerType.AlgoScan,
): string;