An Secp256k1 Keypair used for signing transactions.

Hierarchy (view full)

Constructors

Methods

  • The Bech32 secret key string for this Secp256k1 keypair

    Returns string

  • Return the signature for the provided data.

    Parameters

    • data: Uint8Array

    Returns Promise<Uint8Array>

  • Signs provided personal message by calling signWithIntent() with a PersonalMessage provided as intent scope

    Parameters

    • bytes: Uint8Array

    Returns Promise<{
        bytes: string;
        signature: string;
    }>

  • Signs provided transaction by calling signWithIntent() with a TransactionData provided as intent scope

    Parameters

    • bytes: Uint8Array

    Returns Promise<SignatureWithBytes>

  • Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing, it ensures that a signed message is tied to a specific purpose and domain separator is provided

    Parameters

    Returns Promise<SignatureWithBytes>

  • Returns string

  • Derive Secp256k1 keypair from mnemonics and path. The mnemonics must be normalized and validated against the english wordlist.

    If path is none, it will default to m/54'/784'/0'/0/0, otherwise the path must be compliant to BIP-32 in form m/54'/784'/{account_index}'/{change_index}/{address_index}.

    Parameters

    • mnemonics: string
    • Optional path: string

    Returns Secp256k1Keypair

  • Create a keypair from a raw secret key byte array.

    This method should only be used to recreate a keypair from a previously generated secret key. Generating keypairs from a random seed should be done with the Keypair.fromSeed method.

    Parameters

    • secretKey: Uint8Array

      secret key byte array

    • Optional options: {
          skipValidation?: boolean;
      }
      • Optional skipValidation?: boolean

    Returns Secp256k1Keypair

    Throws

    error if the provided secret key is invalid and validation is not skipped.

  • Generate a keypair from a 32 byte seed.

    Parameters

    • seed: Uint8Array

      seed byte array

    Returns Secp256k1Keypair