Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Key Abstract

Abstract key interface that provides transaction signing features and Bech32 address and public key derivation from a public key. This allows you to create custom key solutions, such as for various hardware wallets, by implementing signing and calling super with the raw public key from within your subclass. See MnemonicKey for an implementation of a basic mnemonic-based key.

Hierarchy

Index

Constructors

  • Called to derive the relevant account and validator addresses and public keys from the raw compressed public key in bytes.

    Parameters

    • Optional publicKey: PublicKey

      raw compressed bytes public key

    Returns Key

Properties

publicKey?: PublicKey

Methods

  • accAddress(prefix: string): string
  • Account address.

    Parameters

    • prefix: string

    Returns string

  • Signs a [[StdSignMsg]] with the method supplied by the child class. only used Amino sign

    Parameters

    • tx: SignDoc

      sign-message of the transaction to sign

    • Optional isClassic: boolean

    Returns Promise<SignatureV2>

  • sign(payload: Buffer, isEthereum?: boolean): Promise<Buffer>
  • You will need to supply sign, which produces a signature for an arbitrary bytes payload with the ECDSA curve secp256pk1.

    Parameters

    • payload: Buffer

      the data to be signed

    • Optional isEthereum: boolean

    Returns Promise<Buffer>

  • Signs a Tx and adds the signature to a generated StdTx that is ready to be broadcasted.

    Parameters

    Returns Promise<Tx>

  • valAddress(prefix: string): string
  • Validator address.

    Parameters

    • prefix: string

    Returns string