MCPcopy Create free account
hub / github.com/LevelUpWeb3/app / truncateAddress

Function truncateAddress

src/utils/format.ts:4–6  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

2import { formatUnits, parseUnits } from "ethers";
3
4export const truncateAddress = (address: string): string => {
5 return address ? `${address.slice(0, 6)}…${address.slice(38, 42)}` : "-";
6};
7
8export const truncateHash = (hash: string) => {
9 return hash ? `${hash.slice(0, 6)}…${hash.slice(-4)}` : "-";

Callers 2

profileStore.tsFile · 0.90
LinkedSocialItemFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected