Interface User

    • Method Detail

      • getId

        java.lang.String getId()
        Get user id.
        Returns:
        user id
      • getIntegratorId

        java.lang.String getIntegratorId()
        Get user integrator id.
        Returns:
        user integrator id
      • hasWallet

        boolean hasWallet()
        Check if user has wallet
        Returns:
        true if user has wallet
      • isFiatCustomer

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

        void makeFiatCustomer​(java.lang.String firstName,
                              java.lang.String middleName,
                              java.lang.String lastName,
                              java.lang.String dateOfBirth,
                              java.lang.String email,
                              java.lang.String phone,
                              Address address,
                              SuccessCallback callback)
        Make user fiat customer by providing user's personal details.
        Parameters:
        firstName - first name
        middleName - middle name or null
        lastName - last name
        dateOfBirth - date of birth in ISO 8601 format, e.g '2020-08-12'
        email - email
        phone - phone number
        address - home address
        callback - an interface to receive the result or error
      • createAccount

        void createAccount​(java.lang.String currencyCode,
                           AccountCallback callback)
        Create custody or fiat account for specified currency. When creating a fiat account, user must already be fiat customer.
        Parameters:
        currencyCode - country code, e.g. 'GBP', 'BTC', 'ETH'
        callback - an interface to receive the result or error
        See Also:
        Account
      • composeTransaction

        void composeTransaction​(java.lang.String fromAccountId,
                                java.lang.String toAccountId,
                                java.math.BigDecimal amount,
                                boolean sendMax,
                                ComposeTransactionCallback callback)
        Compose transaction between custody or fiat accounts in Zumo ecosystem. Refer to Send Transactions guide for usage details.

        On success ComposedTransaction is returned via callback.

        Parameters:
        fromAccountId - custody or fiat Account identifier
        toAccountId - custody or fiat Account identifier
        amount - amount in source account currency
        sendMax - send maximum possible funds to destination
        callback - an interface to receive the result or error
      • composeCustodyWithdrawTransaction

        void composeCustodyWithdrawTransaction​(java.lang.String fromAccountId,
                                               java.lang.String destination,
                                               java.math.BigDecimal amount,
                                               boolean sendMax,
                                               ComposeTransactionCallback callback)
        Compose custody withdraw transaction from custody account. Refer to Send Transactions guide for usage details.

        On success ComposedTransaction is returned via callback.

        Parameters:
        fromAccountId - custody Account identifier
        destination - destination address or non-custodial account identifier
        amount - amount in source account currency
        sendMax - send maximum possible funds to destination
        callback - an interface to receive the result or error
      • composeNominatedTransaction

        void composeNominatedTransaction​(java.lang.String fromAccountId,
                                         java.math.BigDecimal amount,
                                         boolean sendMax,
                                         ComposeTransactionCallback callback)
        Compose transaction from user fiat account to user's nominated account. Refer to Send Transactions guide for usage details.

        On success ComposedTransaction object is returned via callback.

        Parameters:
        fromAccountId - Account identifier
        amount - amount in source account currency
        sendMax - send maximum possible funds to destination
        callback - an interface to receive the result or error
      • submitTransaction

        void submitTransaction​(ComposedTransaction composedTransaction,
                               java.lang.String toAccountId,
                               java.lang.String metadata,
                               SubmitTransactionCallback callback)
        Submit a transaction. Refer to Send Transactions guide for usage details.

        On success Transaction object is returned via callback.

        Parameters:
        composedTransaction - Composed transaction retrieved as a result of one of the compose transaction methods
        toAccountId - Debit account id override, only applicable to direct custody deposits. In case no account id is specified senders custody account will be debited.
        metadata - Optional metadata (stringified JSON) that will be attached to transaction
        callback - An interface to receive the result or error
      • fetchTradingPairs

        void fetchTradingPairs​(StringifiedJsonCallback callback)
        Fetch trading pairs that are currently supported.

        On success stringified JSON containing supported pairs and other details is returned via callback.

      • composeExchange

        void composeExchange​(java.lang.String debitAccountId,
                             java.lang.String creditAccountId,
                             java.math.BigDecimal amount,
                             boolean sendMax,
                             ComposeExchangeCallback callback)
        Compose exchange. Refer to Make Exchanges guide for usage details.

        On success ComposedExchange is returned via callback.

        Parameters:
        debitAccountId - Account identifier
        creditAccountId - Account identifier
        amount - amount in deposit account currency
        sendMax - exchange maximum possible funds
        callback - an interface to receive the result or error
      • submitExchange

        void submitExchange​(ComposedExchange composedExchange,
                            SubmitExchangeCallback callback)
        Submit an exchange. Make Exchanges guide for usage details.

        On success Exchange object is returned via callback.

        Parameters:
        composedExchange - Composed exchange retrieved as the result of composeExchange method
        callback - An interface to receive the result or error
      • getNominatedAccountFiatProperties

        void getNominatedAccountFiatProperties​(java.lang.String accountId,
                                               AccountFiatPropertiesCallback callback)
        Get nominated account details for specified account if it exists. Refer to Create Fiat Account for explanation about nominated account.
        Parameters:
        accountId - Account id
        callback - an interface to receive the result or error
        See Also:
        AccountFiatProperties
      • fetchAuthenticationConfig

        void fetchAuthenticationConfig​(AuthenticationConfigCallback callback)
        Fetch Strong Customer Authentication (SCA) config.
        Parameters:
        callback - an interface to receive the result or error
      • createCard

        void createCard​(java.lang.String fiatAccountId,
                        java.lang.String cardType,
                        java.lang.String mobileNumber,
                        java.util.ArrayList<KbaAnswer> knowledgeBase,
                        CardCallback callback)
        Create card for a fiat account.

        At least one Knowled-Based Authentication (KBA) 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:
        fiatAccountId - fiat account id
        cardType - 'VIRTUAL' or 'PHYSICAL'
        mobileNumber - card holder mobile number, starting with a '+', followed by the country code and then the mobile number
        callback - an interface to receive the result or error
        knowledgeBase - list of KBA answers
        See Also:
        Card, CardType
      • setCardStatus

        void setCardStatus​(java.lang.String cardId,
                           java.lang.String cardStatus,
                           java.lang.String pan,
                           java.lang.String cvv2,
                           SuccessCallback callback)
        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 CVV2 fields. - To cancel a card, set card status to 'CANCELLED'. - To unblock a card, set card status to 'ACTIVE.'.
        Parameters:
        cardId - card id
        cardStatus - new card status
        pan - PAN when activating a physical card, null otherwise
        cvv2 - CVV2 when activating a physical card, null otherwise
        callback - an interface to receive the result or error
        See Also:
        CardStatus
      • revealCardDetails

        void revealCardDetails​(java.lang.String cardId,
                               CardDetailsCallback callback)
        Reveals sensitive card details.
        Parameters:
        cardId - card id
        callback - an interface to receive the result or error
        See Also:
        CardDetails
      • revealPin

        void revealPin​(java.lang.String cardId,
                       PinCallback callback)
        Reveal card PIN.
        Parameters:
        cardId - card id
        callback - an interface to receive the result or error
      • unblockPin

        void unblockPin​(java.lang.String cardId,
                        SuccessCallback callback)
        Unblock card PIN.
        Parameters:
        cardId - card id
        callback - an interface to receive the result or error
      • setAuthentication

        void setAuthentication​(java.lang.String cardId,
                               java.util.ArrayList<KbaAnswer> knowledgeBase,
                               SuccessCallback callback)
        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 - card id
        knowledgeBase - list of KBA answers
        callback - an interface to receive the result or error
      • createWallet

        void createWallet​(java.lang.String mnemonic,
                          java.lang.String password,
                          WalletCallback callback)
        Create user wallet seeded by provided mnemonic and encrypted with user's password.

        Mnemonic can be generated by generateMnemonic method in Utils class.

        Parameters:
        mnemonic - mnemonic seed phrase
        password - user provided password
        callback - an interface to receive the result or error
        See Also:
        Wallet
      • unlockWallet

        void unlockWallet​(java.lang.String password,
                          WalletCallback callback)
        Unlock user wallet with user's password.
        Parameters:
        password - user provided password
        callback - an interface to receive the result or error
        See Also:
        Wallet
      • revealMnemonic

        void revealMnemonic​(java.lang.String password,
                            MnemonicCallback callback)
        Reveal menmonic seed phrase used to seed user wallet.
        Parameters:
        password - user provided password
        callback - an interface to receive the result or error
      • isRecoveryMnemonic

        boolean isRecoveryMnemonic​(java.lang.String mnemonic)
        Check if mnemonic seed phrase corresponds to user's wallet. This is useful for validating seed phrase before trying to recover wallet.
        Parameters:
        mnemonic - mnemonic seed phrase
        Returns:
        true if mnemonic seed phrase corresponds to user's wallet
      • recoverWallet

        void recoverWallet​(java.lang.String mnemonic,
                           java.lang.String password,
                           WalletCallback callback)
        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 - mnemonic seed phrase corresponding to user's wallet
        password - user provided password
        callback - an interface to receive the result or error
      • getAccount

        Account getAccount​(java.lang.String currencyCode,
                           java.lang.String network,
                           java.lang.String type,
                           java.lang.String custodyType)
        Get account in specific currency, on specific network, with specific type.
        Parameters:
        currencyCode - currency code, e.g. 'BTC', 'ETH' or 'GBP'
        network - network type, e.g. 'MAINNET', 'TESTNET' or 'RINKEBY'
        type - account type, e.g. 'STANDARD', 'COMPATIBILITY' or 'SEGWIT'
        custodyType - custdoy type, i.e. 'CUSTODY' or 'NON-CUSTODY'
        Returns:
        account with selected parameters if it exists, null otherwise
        See Also:
        CurrencyCode, NetworkType, AccountType, CustodyType
      • getAccounts

        java.util.ArrayList<Account> getAccounts()
        Get all user accounts.
        Returns:
        all user accounts
      • addAccountDataListener

        void addAccountDataListener​(AccountDataListener listener)
        Listen to all account data changes.
        Parameters:
        listener - interface to listen to user changes
      • removeAccountDataListener

        void removeAccountDataListener​(AccountDataListener listener)
        Remove listener to account data changes.
        Parameters:
        listener - interface to listen to user changes