Interface IUser

A user instance to manage HD wallet and legacy wallets with detailed information. A user serialized value is secured by a secured password which is given by user. We should never store user's password but its encrypted one to do extra actions.

Hierarchy

  • IUser

Implemented by

Methods

  • Decrypt the given value by user's password

    Parameters

    • value: string

    Returns Promise<string>

  • Deserialize the serialized and encrypted value

    Parameters

    • value: string

    Returns Promise<void>

  • Encrypt the given value by user's password. Everytime we call this method, a new salt will be generated and update directly to the current user instance. The caller must also store it in order to re-use later.

    Parameters

    • value: string

    Returns Promise<string>

  • Get the HD wallet account for the given reference key (path)

    Parameters

    • refKey: string

      account ref key (path)

    Returns Promise<IWallet<IHDKey>>

  • Check if we set the HD wallet already

    Returns boolean

  • Check if we have any legacy wallets

    Returns boolean

  • Remove an account from HD wallet

    Parameters

    • index: number

    Returns void

  • Remove a wallet from user

    Parameters

    • id: string

      could be id or uid of from wallet info

    Returns void

  • Serialize the user information to a store-able string which is secured by user's password. Everytime we call this method, a new salt will be generated and update directly to the current user instance. The caller must also store it in order to re-use later.

    Returns Promise<string>

  • Set the HD wallet information

    Parameters

    • key: Uint8Array

      the master key, either keyPhrase (12-24 words) or seed of keyPhrase

    • type: EncryptionType

      the encryption type

    Returns Promise<void>

  • Set wallet information

    Parameters

    • id: string

      coule be id or uid from wallet info in case of updating, otherwise it must be an id (private key of legacy wallet or path of hd wallet)

    • name: string

    Returns void

  • Update password to serialize user's information

    Parameters

    • newPassword: string

    Returns Promise<void>

Generated using TypeDoc