Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Keys

This module allows you to manage your local tendermint keystore (wallets) for iris.

NOTE: You need to implement the KeyDAO Interface first.

since

v0.17

Hierarchy

  • Keys

Index

Methods

add

  • add(name: string, password: string, type?: PubkeyType): { address: string; mnemonic: string }
  • Create a new key

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • password: string

      Password for encrypting the keystore

    • Default value type: PubkeyType = types.PubkeyType.secp256k1

      Pubkey Type

    Returns { address: string; mnemonic: string }

    Bech32 address and mnemonic

    • address: string
    • mnemonic: string

delete

  • delete(name: string, password: string): void
  • Delete a key

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • password: string

      Password of the key

    Returns void

export

  • export(name: string, keyPassword: string, keystorePassword: string, iterations?: undefined | number): string
  • Export keystore of a key

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • keyPassword: string

      Password of the key

    • keystorePassword: string

      Password for encrypting the keystore

    • Optional iterations: undefined | number

    Returns string

    Keystore json

import

  • import(name: string, password: string, keystore: string | Keystore, type?: PubkeyType): string
  • Import a key from keystore

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • password: string

      Password of the keystore

    • keystore: string | Keystore

      Keystore json or object

    • Default value type: PubkeyType = types.PubkeyType.secp256k1

      Pubkey Type

    Returns string

    Bech32 address

importPrivateKey

  • importPrivateKey(name: string, password: string, privateKey: string, type?: PubkeyType): string
  • Import a PrivateKey

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • password: string

      Password of the keystore

    • privateKey: string

      privateKey hex

    • Default value type: PubkeyType = types.PubkeyType.secp256k1

      Pubkey Type

    Returns string

    Bech32 address

recover

  • recover(name: string, password: string, mnemonic: string, type?: PubkeyType, index?: number, derive?: boolean, saltPassword?: string): string
  • Recover a key

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    • password: string

      Password for encrypting the keystore

    • mnemonic: string

      Mnemonic of the key

    • Default value type: PubkeyType = types.PubkeyType.secp256k1

      Pubkey Type

    • Default value index: number = 0

      The bip44 address index (default: 0)

    • Default value derive: boolean = true

      Derive a private key using the default HD path (default: true)

    • Default value saltPassword: string = ""

      A passphrase for generating the salt, according to bip39

    Returns string

    Bech32 address

show

  • show(name: string): string
  • Gets address of a key

    since

    v0.17

    Parameters

    • name: string

      Name of the key

    Returns string

    Bech32 address

Generated using TypeDoc