Options
All
  • Public
  • Public/Protected
  • All
Menu

User instance, obtained via ZumoKit.signIn method, provides methods for managing user wallet and accounts.

Refer to Manage User Wallet, Create Fiat Account, View User Accounts and Get Account 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

createCard

  • createCard(fiatAccountId: string, cardType: CardType, mobileNumber: string): Promise<Card>
  • Create card for a fiat account.

    Parameters

    • fiatAccountId: string

      fiat account identifier

    • cardType: CardType

      'VIRTUAL' or 'PHYSICAL'

    • mobileNumber: string

      card holder mobile number, starting with a '+', followed by the country code and then the mobile number, or null

    Returns Promise<Card>

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

  • makeFiatCustomer(network: Network, firstName: string, middleName: string | null, lastName: string, dateOfBirth: string, email: string, phone: string, address: Address): Promise<void>
  • Make user fiat customer on specified network by providing user's personal details.

    Parameters

    • network: Network

      'MAINNET' or 'TESTNET'

    • firstName: string

      first name

    • middleName: string | null

      middle name or null

    • lastName: string

      last name

    • dateOfBirth: string

      date of birth in ISO 8601 format, e.g '2020-08-12'

    • email: string

      email

    • phone: string

      phone number

    • address: Address

      home address

    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

revealCardDetails

  • revealCardDetails(cardId: string): Promise<CardDetails>

revealMnemonic

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

    Parameters

    • password: string

      user provided password

    Returns Promise<string>

revealPin

  • revealPin(cardId: string): Promise<number>
  • Reveal card PIN.

    Parameters

    • cardId: string

      card identifier

    Returns Promise<number>

setCardStatus

  • setCardStatus(cardId: string, cardStatus: CardStatus, pan?: string | null, cvv2?: string | null): Promise<void>
  • Set card status to 'ACTIVE', 'BLOCKED' or 'CANCELLED'.

    • To block card, set card status to 'BLOCKED'.
    • To activate a physical card, set card status to 'ACTIVE' and provide PAN and CVC2 fields.
    • To cancel a card, set card status to 'CANCELLED'.
    • To unblock a card, set card status to 'ACTIVE.'.

    Parameters

    • cardId: string

      card identifier

    • cardStatus: CardStatus

      new card status

    • Default value pan: string | null = null

      PAN when activating a physical card, null otherwise (defaults to null)

    • Default value cvv2: string | null = null

      CVV2 when activating a physical card, null otherwise (defaults to null)

    Returns Promise<void>

unblockPin

  • unblockPin(cardId: string): Promise<void>
  • Unblock card PIN.

    Parameters

    • cardId: string

      card identifier

    Returns Promise<void>

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