Data structure that contains a secret and public keys.

Constructors

Properties

privateKey: string

Get the [PrivateKey] of this [Keypair].

publicKey: string

Get the [PublicKey] of this [Keypair].

xOnlyPublicKey: any

Get the XOnlyPublicKey of this [Keypair].

Methods

  • Returns void

  • Get the [Address] of this Keypair's [PublicKey]. Receives a [NetworkType] to determine the prefix of the address. JavaScript: let address = keypair.toAddress(NetworkType.MAINNET);.

    Parameters

    Returns Address

  • Get ECDSA [Address] of this Keypair's [PublicKey]. Receives a [NetworkType] to determine the prefix of the address. JavaScript: let address = keypair.toAddress(NetworkType.MAINNET);.

    Parameters

    Returns Address

    • Return copy of self without private attributes.

    Returns Object

  • Return stringified version of self.

    Returns string

  • Create a new [Keypair] from a [PrivateKey]. JavaScript: let privkey = new PrivateKey(hexString); let keypair = privkey.toKeypair();.

    Parameters

    Returns Keypair

  • Create a new random [Keypair]. JavaScript: let keypair = Keypair::random();.

    Returns Keypair

Generated using TypeDoc