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

Latest commit

 

History

History
25 lines (18 loc) · 465 Bytes

useShortAddress.md

File metadata and controls

25 lines (18 loc) · 465 Bytes

useShortAddress

React hook that shortens a wallet address string.

Usage

import { useShortAddress } from 'awesomealgo-hooks';

const Demo = () => {
  const shortAddress = useShortAddress('NRLA7VZ2YV6WOS2LBS3UK25DB463XRSNG63BYNQI6CSGGROFWVQ2EKBQSI');

  return (
    <div>
      shortened address: {shortAddress}
    </div>
  );
};

Call signature

function useShortAddress = (address: string, width: number = 6): string ;