Options
All
  • Public
  • Public/Protected
  • All
Menu

User class provides methods for managing user wallet and accounts.

User instance can be obtained via ZumoKit.getUser method.

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

Hierarchy

  • User

Index

Properties

hasWallet

hasWallet: boolean

Indicator if user has wallet.

id

id: string

Identifier.

Methods

createFiatAccount

  • Create fiat account on specified network and currency code. User must already be Modulr 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 ZKUtility.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 Promise<Account>

getAccountTransactions

  • getAccountTransactions(accountId: string): Promise<Array<Transaction>>

getAccounts

  • getAccounts(): Promise<Array<Account>>

getNominatedAccountFiatPoperties

getTransactions

isModulrCustomer

  • isModulrCustomer(network: Network): Promise<boolean>
  • Check if user is a Modulr 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>

makeModulrCustomer

  • Make user Modulr 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>

revealMnemonic

  • revealMnemonic(password: string): Promise<string>
  • Reveal menmonic 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
  • Private property
  • Private method
  • Property
  • Inherited property
  • Static property

Generated using TypeDoc