Options
All
  • Public
  • Public/Protected
  • All
Menu

User instance provides methods for managing user wallet and accounts.

User instance can be obtained via ZumoKit.signIn method.

See Manage User Wallet, Create Fiat Account and View User Data guides for usage details.

Hierarchy

  • User

Index

Properties

accounts

accounts: Array<Account>

User accounts.

hasWallet

hasWallet: boolean

Indicator if user has wallet.

id

id: string

User identifier.

Methods

addAccountDataListener

createFiatAccount

  • Create fiat account on specified network and currency code. User must already be fiat customer on specified network.

    Parameters

    • network: Network

      'MAINNET' or 'TESTNET'

    • currencyCode: CurrencyCode

      country code in ISO 4217 format, e.g. 'GBP'

    Returns Promise<Account>

createWallet

  • createWallet(mnemonic: string, password: string): Promise<Wallet>
  • Create user wallet seeded by provided mnemonic and encrypted with user's password.

    Mnemonic can be generated by Utils.generateMnemonic utility method.

    Parameters

    • mnemonic: string

      mnemonic seed phrase

    • password: string

      user provided password

    Returns Promise<Wallet>

getAccount

  • Get account in specific currency, on specific network, with specific type.

    Parameters

    • currencyCode: CurrencyCode

      currency code, e.g. 'BTC', 'ETH' or 'GBP'

    • network: Network

      network type, e.g. 'MAINNET', 'TESTNET' or 'RINKEBY'

    • type: AccountType

      account type, e.g. 'STANDARD', 'COMPATIBILITY' or 'SEGWIT'

    Returns undefined | Account

getNominatedAccountFiatProperties

isFiatCustomer

  • isFiatCustomer(network: Network): Promise<boolean>
  • Check if user is a fiat customer on 'MAINNET' or 'TESTNET' network.

    Parameters

    • network: Network

      'MAINNET' or 'TESTNET'

    Returns Promise<boolean>

isRecoveryMnemonic

  • isRecoveryMnemonic(mnemonic: string): Promise<boolean>
  • Check if mnemonic seed phrase corresponds to user's wallet. This is useful for validating seed phrase before trying to recover wallet.

    Parameters

    • mnemonic: string

      mnemonic seed phrase

    Returns Promise<boolean>

makeFiatCustomer

  • Make user fiat customer on specified network by providing user's personal details.

    Parameters

    Returns Promise<void>

recoverWallet

  • recoverWallet(mnemonic: string, password: string): Promise<Wallet>
  • Recover user wallet with mnemonic seed phrase corresponding to user's wallet. This can be used if user forgets his password or wants to change his wallet password.

    Parameters

    • mnemonic: string

      mnemonic seed phrase corresponding to user's wallet

    • password: string

      user provided password

    Returns Promise<Wallet>

removeAccountDataListener

revealMnemonic

  • revealMnemonic(password: string): Promise<string>
  • Reveal mnemonic seed phrase used to seed user wallet.

    Parameters

    • password: string

      user provided password

    Returns Promise<string>

unlockWallet

  • unlockWallet(password: string): Promise<Wallet>
  • Unlock user wallet with user's password.

    Parameters

    • password: string

      user provided password

    Returns Promise<Wallet>

Legend

  • Property
  • Method
  • Inherited property
  • Static property

Generated using TypeDoc