synapsecns/sanguine

View on GitHub
packages/synapse-interface/utils/shortenAddress.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const shortenAddress = (address: string | undefined, chars = 4) => {
  if (address) {
    const start = address.slice(0, chars)
    const end = address.slice(-chars)
    return `${start}...${end}`
  } else {
    return ''
  }
}