@evefrontier/dapp-kit - v0.0.1
    Preparing search index...

    Function abbreviateAddress

    • Abbreviate a Sui address or hex string for display.

      Shortens long addresses to show only the beginning and end characters with ellipsis in the middle.

      Parameters

      • Optionalstring: string

        The address or hex string to abbreviate

      • precision: number = 5

        Number of characters to show on each end (default: 5)

      • expanded: boolean = false

        If true, returns the full string without abbreviation

      Returns string

      The abbreviated string (e.g., "0x123...abc")

      abbreviateAddress("0x1234567890abcdef1234567890abcdef"); // "0x123...cdef"
      abbreviateAddress("0x1234567890abcdef", 3); // "0x1...def"
      abbreviateAddress("0x1234567890abcdef", 5, true); // Full address