Avalanche SDK Client
    Preparing search index...

    Function publicKeyToXPAddress

    • Converts a public key to an XP address.

      Parameters

      • publicKey: string

        The public key to convert.

      • hrp: string

        The human readable prefix to use for the address.

      Returns string

      The XP address as a 0x prefixed string.

      import { publicKeyToXPAddress } from "@avalanche-sdk/client/accounts";

      const address = publicKeyToXPAddress("0xab....", "avax");
      console.log(address);