• Convert a private key to a single-sig C32 Stacks address.

    Parameters

    • privateKey: PrivateKey

      The private key to convert.

    • Optional network: StacksNetwork | "mainnet" | "testnet" | "devnet" | "mocknet"

    Returns string

    The address string.

    Example

    import { Address } from '@stacks/transactions';

    const address = Address.fromPrivateKey('73a2f291df5a8ce3ceb668a25ac7af45639513af7596d710ddf59f64f484fd2801');
    // 'SP10J81WVGVB3M4PHQN4Q4G0R8586TBJH948RESDR'

    const address = Address.fromPrivateKey('73a2f291df5a8ce3ceb668a25ac7af45639513af7596d710ddf59f64f484fd2801', 'testnet');
    // 'ST10J81WVGVB3M4PHQN4Q4G0R8586TBJH94CGRESQ'

Generated using TypeDoc