• Generates a Krist address from a password. This will also apply the given wallet format to the password to convert it to a private key, before passing it to the address algorithm.

    Returns

    A tuple containing the generated address and the private key with the wallet format applied.

    Example

    Get just the address:

    const [address] = await calculateAddress("myPassword");
    

    Example

    Get both the address and the private key:

    const [address, privatekey] = await calculateAddress("myPassword");
    

    Example

    Get an address, using a different wallet format:

    // The "api" format is just the raw password with no additional security
    const [address] = await calculateAddress("myPassword", undefined, "api");

    Parameters

    • password: string

      The password to calculate the address for.

    • Optional username: string

      The username to calculate the address for, if the wallet format requires one. This is usually not required.

    • walletFormat: KristWalletFormatName = "kristwallet"

      The wallet format to apply to the password to convert it into a private key, defaults to "kristwallet".

    • addressPrefix: string = "k"

      The address prefix to use, defaults to "k".

    • sha256Fn: Sha256Fn = sha256

    Returns Promise<[string, string]>

Generated using TypeDoc