Avalanche SDK Client
    Preparing search index...

    Function privateKeyToXPAddress

    • Converts a private key to an XP address.

      Parameters

      • privateKey: string

        The private 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 { privateKeyToXPAddress } from "@avalanche-sdk/client/accounts";

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