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.

integratorId

integratorId: string

User integrator identifier.

Methods

addAccountDataListener

composeCustodyWithdrawTransaction

  • composeCustodyWithdrawTransaction(fromAccountId: string, destination: string, amount: Decimal | null, sendMax?: boolean): Promise<ComposedTransaction>
  • Compose custody withdraw transaction from custody account. Refer to Send Transactions guide for usage details.

    Parameters

    • fromAccountId: string

      custody or fiat Account identifier

    • destination: string

      destination address or non-custodial account identifier

    • amount: Decimal | null

      amount in source account currency

    • Default value sendMax: boolean = false

      send maximum possible funds to destination (defaults to false)

    Returns Promise<ComposedTransaction>

composeExchange

  • composeExchange(debitAccountId: string, creditAccountId: string, debitAmount: Decimal | null, sendMax?: boolean): Promise<ComposedExchange>
  • Compose exchange asynchronously. Refer to Make Exchanges guide for usage details.

    Parameters

    • debitAccountId: string

      Account identifier

    • creditAccountId: string

      Account identifier

    • debitAmount: Decimal | null

      amount to be debited from debit account

    • Default value sendMax: boolean = false

      exchange maximum possible funds (defaults to false)

    Returns Promise<ComposedExchange>

composeNominatedTransaction

  • composeNominatedTransaction(fromAccountId: string, amount: Decimal | null, sendMax?: boolean): Promise<ComposedTransaction>
  • Compose transaction from user fiat account to user's nominated account. Refer to Send Transactions guide for usage details.

    Parameters

    • fromAccountId: string

      Account identifier

    • amount: Decimal | null

      amount in source account currency

    • Default value sendMax: boolean = false

      send maximum possible funds to destination (defaults to false)

    Returns Promise<ComposedTransaction>

composeTransaction

  • composeTransaction(fromAccountId: string, toAccountId: string, amount: Decimal | null, sendMax?: boolean): Promise<ComposedTransaction>
  • Compose transaction between custody or fiat accounts in Zumo ecosystem. Refer to Send Transactions guide for usage details.

    Parameters

    • fromAccountId: string

      custody or fiat Account identifier

    • toAccountId: string

      custody or fiat Account identifier

    • amount: Decimal | null

      amount in source account currency

    • Default value sendMax: boolean = false

      send maximum possible funds to destination (defaults to false)

    Returns Promise<ComposedTransaction>

createAccount

  • Create custody or fiat account for specified currency. When creating a fiat account, user must already be fiat customer.

    Parameters

    • currencyCode: CurrencyCode

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

    Returns Promise<Account>

createCard

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

    At least one Knowledge-Based Authentication (KBA) answers should be defined, answers are limited to 256 characters and cannot be null or empty and only one answer per question type should be provided.

    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

    • knowledgeBase: Array<KbaAnswer>

      list of KBA answers

    Returns Promise<void>

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>

fetchAuthenticationConfig

  • fetchAuthenticationConfig(): Promise<void>
  • Fetch Strong Customer Authentication (SCA) config.

    Returns Promise<void>

fetchTradingPairs

  • fetchTradingPairs(): Promise<void>
  • Fetch trading pairs that are currently supported.

    Returns Promise<void>

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'

    • custodyType: CustodyType

      custody type, e.g. 'CUSTODY' or 'NON-CUSTODY'

    Returns null | Account

getNominatedAccountFiatProperties

isFiatCustomer

  • isFiatCustomer(): boolean
  • Check if user is a registered fiat customer.

    Returns boolean

isRecoveryMnemonic

  • isRecoveryMnemonic(mnemonic: string): 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 boolean

makeFiatCustomer

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

    Parameters

    • 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<void>
  • Reveals sensitive card details.

    Parameters

    • cardId: string

      card identifier

    Returns Promise<void>

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<void>
  • Reveal card PIN.

    Parameters

    • cardId: string

      card identifier

    Returns Promise<void>

setAuthentication

  • setAuthentication(cardId: string, knowledgeBase: Array<KbaAnswer>): Promise<void>
  • Add KBA answers to a card without SCA.

    This endpoint is used to set Knowledge-Based Authentication (KBA) answers to a card without Strong Customer Authentication (SCA). Once it is set SCA flag on corresponding card is set to true.

    At least one answer should be defined, answers are limited to 256 characters and cannot be null or empty and only one answer per question type should be provided.

    Parameters

    • cardId: string

      card id

    • knowledgeBase: Array<KbaAnswer>

      list of KBA answers

    Returns Promise<void>

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>

submitExchange

submitTransaction

  • Submit a transaction asynchronously. Refer to Send Transactions guide for usage details.

    Parameters

    • composedTransaction: ComposedTransaction

      Composed transaction retrieved as a result of one of the compose transaction methods

    • Default value toAccountId: string | null = null

      Debit account id override, only applicable to direct custody deposits. In case no account id is specified senders custody account will be debited.

    • Default value metadata: any = null

      Optional metadata that will be attached to transaction

    Returns Promise<Transaction>

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
  • Property
  • Inherited property
  • Static property

Generated using TypeDoc