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

    Class PublicKey

    PublicKey representation that has type and bytes of the key.

    Hierarchy

    • Enum
      • PublicKey
    Index
    ed25519Key?: ED25519PublicKey
    enum: string
    mlDsa65Key?: MLDSA65PublicKey
    secp256k1Key?: SECP256K1PublicKey
    • get keyPair(): | ED25519PublicKey
      | SECP256K1PublicKey
      | MLDSA65PublicKey
      | undefined

      Returns ED25519PublicKey | SECP256K1PublicKey | MLDSA65PublicKey | undefined

    • Returns a string representation of the public key.

      Returns string

      The string representation of the public key.

    • Verifies a message signature using the public key.

      Parameters

      • message: Uint8Array

        The message to be verified.

      • signature: Uint8Array

        The signature to be verified.

      Returns boolean

      true if the signature is valid, otherwise false.

    • Creates a PublicKey instance from an encoded key string.

      Parameters

      • encodedKey: string

        The encoded key string.

      Returns PublicKey

      The PublicKey instance created from the encoded key string.