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

    Parameters

    • publicKey: PublicKey

      The public key to convert.

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

    Returns string

    The address string.

    Example

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

    const address = Address.fromPublicKey('0316e35d38b52d4886e40065e4952a49535ce914e02294be58e252d1998f129b19');
    // 'SP10J81WVGVB3M4PHQN4Q4G0R8586TBJH948RESDR'

    const address = Address.fromPublicKey('0316e35d38b52d4886e40065e4952a49535ce914e02294be58e252d1998f129b19', 'testnet');
    // 'ST10J81WVGVB3M4PHQN4Q4G0R8586TBJH94CGRESQ'

Generated using TypeDoc