near-api-js - v7.5.3
    Preparing search index...

    This class provides key pair functionality for secp256k1 curve: generating key pairs, encoding key pairs, signing and verifying. nearcore expects secp256k1 public keys to be 64 bytes at all times, even when string encoded the secp256k1 library returns 65 byte keys (including a 1 byte header that indicates how the pubkey was encoded). We'll force the secp256k1 library to always encode uncompressed keys with the corresponding 0x04 header byte, then manually insert/remove that byte as needed.

    Hierarchy (View Summary)

    Index
    extendedSecretKey: string
    publicKey: PublicKey
    secretKey: string
    • Signs a digest using NEAR's secp256k1 signature format.

      Parameters

      • message: Uint8Array

        32-byte message digest; this method does not hash it again.

      Returns Signature

      The public key and 65 raw signature bytes ordered as compact r/s followed by the recovery ID.