Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Key

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

constructor

  • 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

Optional publicKey

publicKey?: PublicKey

Accessors

accAddress

  • get accAddress(): string
  • Terra account address. terra- prefixed.

    Returns string

valAddress

  • get valAddress(): string
  • Terra validator address. terravaloper- prefixed.

    Returns string

Methods

createSignature

createSignatureAmino

  • 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

    Returns Promise<SignatureV2>

Abstract sign

  • sign(payload: Buffer): 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

    Returns Promise<Buffer>

signTx

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

    Parameters

    Returns Promise<Tx>