@arkade-os/sdk Documentation - v0.3.11
    Preparing search index...

    Class SingleKey

    In-memory single key implementation for Bitcoin transaction signing.

    // Create from hex string
    const key = SingleKey.fromHex('your_private_key_hex');

    // Create from raw bytes
    const key = SingleKey.fromPrivateKey(privateKeyBytes);

    // Create random key
    const randomKey = SingleKey.fromRandomBytes();

    // Sign a transaction
    const signedTx = await key.sign(transaction);

    Implements

    Index

    Methods

    • Parameters

      • message: Uint8Array
      • signatureType: "schnorr" | "ecdsa" = "schnorr"

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Export the private key as a hex string.

      Returns string

      The private key as a hex string