Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LayaStorage

LayaStorage

Storage class to save zilliqa private key on Laya platform.

Hierarchy

  • LayaStorage

Index

Constructors

constructor

  • constructor

    Instantiates a LayaStorage instance with providing wallet prefix

    Parameters

    • Default value walletPrefix: string = LayaStorage.WALLET_PREFIX

    Returns LayaStorage

Properties

Private storage

storage: any

Private walletPrefix

walletPrefix: string

Static Private KEY_PASSWORD_HASH

KEY_PASSWORD_HASH: string = "password_hash"

Static Private KEY_SALT

KEY_SALT: string = "salt"

Static Private WALLET_PREFIX

WALLET_PREFIX: string = "zilliqa_laya_wallet_"

Methods

Private getOrCreateSalt

  • getOrCreateSalt(): string
  • getOrCreateSalt

    Get password salt. If not exist, create it.

    Returns string

    Password salt

loadAccounts

  • loadAccounts

    Loads all accounts that saved in local storage

    Parameters

    • node: string

    Returns IZilliqaAccount[]

    Account list

saveAccounts

  • saveAccounts

    Saves account list to local storage

    Parameters

    Returns boolean

    Successful saved or not

setPasswordHash

  • setPasswordHash(password: string): void
  • setPasswordHash

    Save hashed password in local storage

    Parameters

    • password: string

    Returns void

validatePassword

  • validatePassword(password: string): boolean
  • validatePassword

    Validates providing password

    Parameters

    • password: string

    Returns boolean

    Whether equals to saved password

Generated using TypeDoc