Class User.CppProxy

  • All Implemented Interfaces:
    User
    Enclosing interface:
    User

    public static final class User.CppProxy
    extends java.lang.Object
    implements User
    • Method Detail

      • _djinni_private_destroy

        public void _djinni_private_destroy()
      • getId

        public java.lang.String getId()
        Description copied from interface: User
        Get user id.
        Specified by:
        getId in interface User
        Returns:
        user id
      • getIntegratorId

        public java.lang.String getIntegratorId()
        Description copied from interface: User
        Get user integrator id.
        Specified by:
        getIntegratorId in interface User
        Returns:
        user integrator id
      • hasWallet

        public boolean hasWallet()
        Description copied from interface: User
        Check if user has wallet
        Specified by:
        hasWallet in interface User
        Returns:
        true if user has wallet
      • isFiatCustomer

        public boolean isFiatCustomer()
        Description copied from interface: User
        Check if user is a registered fiat customer.
        Specified by:
        isFiatCustomer in interface User
        Returns:
        true if user is a registered fiat customer.
      • makeFiatCustomer

        public 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)
        Description copied from interface: User
        Make user fiat customer by providing user's personal details.
        Specified by:
        makeFiatCustomer in interface User
        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

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

        public void composeTransaction​(java.lang.String fromAccountId,
                                       java.lang.String toAccountId,
                                       java.math.BigDecimal amount,
                                       boolean sendMax,
                                       ComposeTransactionCallback callback)
        Description copied from interface: User
        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.

        Specified by:
        composeTransaction in interface User
        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

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

        On success ComposedTransaction is returned via callback.

        Specified by:
        composeCustodyWithdrawTransaction in interface User
        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

        public void composeNominatedTransaction​(java.lang.String fromAccountId,
                                                java.math.BigDecimal amount,
                                                boolean sendMax,
                                                ComposeTransactionCallback callback)
        Description copied from interface: User
        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.

        Specified by:
        composeNominatedTransaction in interface User
        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

        public void submitTransaction​(ComposedTransaction composedTransaction,
                                      java.lang.String toAccountId,
                                      java.lang.String metadata,
                                      SubmitTransactionCallback callback)
        Description copied from interface: User
        Submit a transaction. Refer to Send Transactions guide for usage details.

        On success Transaction object is returned via callback.

        Specified by:
        submitTransaction in interface User
        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

        public void fetchTradingPairs​(StringifiedJsonCallback callback)
        Description copied from interface: User
        Fetch trading pairs that are currently supported.

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

        Specified by:
        fetchTradingPairs in interface User
      • composeExchange

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

        On success ComposedExchange is returned via callback.

        Specified by:
        composeExchange in interface User
        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

        public void submitExchange​(ComposedExchange composedExchange,
                                   SubmitExchangeCallback callback)
        Description copied from interface: User
        Submit an exchange. Make Exchanges guide for usage details.

        On success Exchange object is returned via callback.

        Specified by:
        submitExchange in interface User
        Parameters:
        composedExchange - Composed exchange retrieved as the result of composeExchange method
        callback - An interface to receive the result or error
      • fetchAuthenticationConfig

        public void fetchAuthenticationConfig​(AuthenticationConfigCallback callback)
        Description copied from interface: User
        Fetch Strong Customer Authentication (SCA) config.
        Specified by:
        fetchAuthenticationConfig in interface User
        Parameters:
        callback - an interface to receive the result or error
      • createCard

        public void createCard​(java.lang.String fiatAccountId,
                               java.lang.String cardType,
                               java.lang.String mobileNumber,
                               java.util.ArrayList<KbaAnswer> knowledgeBase,
                               CardCallback callback)
        Description copied from interface: User
        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.

        Specified by:
        createCard in interface User
        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
        knowledgeBase - list of KBA answers
        callback - an interface to receive the result or error
        See Also:
        Card, CardType
      • setCardStatus

        public void setCardStatus​(java.lang.String cardId,
                                  java.lang.String cardStatus,
                                  java.lang.String pan,
                                  java.lang.String cvv2,
                                  SuccessCallback callback)
        Description copied from interface: User
        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.'.
        Specified by:
        setCardStatus in interface User
        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

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

        public void revealPin​(java.lang.String cardId,
                              PinCallback callback)
        Description copied from interface: User
        Reveal card PIN.
        Specified by:
        revealPin in interface User
        Parameters:
        cardId - card id
        callback - an interface to receive the result or error
      • unblockPin

        public void unblockPin​(java.lang.String cardId,
                               SuccessCallback callback)
        Description copied from interface: User
        Unblock card PIN.
        Specified by:
        unblockPin in interface User
        Parameters:
        cardId - card id
        callback - an interface to receive the result or error
      • setAuthentication

        public void setAuthentication​(java.lang.String cardId,
                                      java.util.ArrayList<KbaAnswer> knowledgeBase,
                                      SuccessCallback callback)
        Description copied from interface: User
        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.

        Specified by:
        setAuthentication in interface User
        Parameters:
        cardId - card id
        knowledgeBase - list of KBA answers
        callback - an interface to receive the result or error
      • createWallet

        public void createWallet​(java.lang.String mnemonic,
                                 java.lang.String password,
                                 WalletCallback callback)
        Description copied from interface: User
        Create user wallet seeded by provided mnemonic and encrypted with user's password.

        Mnemonic can be generated by generateMnemonic method in Utils class.

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

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

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

        public boolean isRecoveryMnemonic​(java.lang.String mnemonic)
        Description copied from interface: User
        Check if mnemonic seed phrase corresponds to user's wallet. This is useful for validating seed phrase before trying to recover wallet.
        Specified by:
        isRecoveryMnemonic in interface User
        Parameters:
        mnemonic - mnemonic seed phrase
        Returns:
        true if mnemonic seed phrase corresponds to user's wallet
      • recoverWallet

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

        public Account getAccount​(java.lang.String currencyCode,
                                  java.lang.String network,
                                  java.lang.String type,
                                  java.lang.String custodyType)
        Description copied from interface: User
        Get account in specific currency, on specific network, with specific type.
        Specified by:
        getAccount in interface User
        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

        public java.util.ArrayList<Account> getAccounts()
        Description copied from interface: User
        Get all user accounts.
        Specified by:
        getAccounts in interface User
        Returns:
        all user accounts
      • addAccountDataListener

        public void addAccountDataListener​(AccountDataListener listener)
        Description copied from interface: User
        Listen to all account data changes.
        Specified by:
        addAccountDataListener in interface User
        Parameters:
        listener - interface to listen to user changes
      • removeAccountDataListener

        public void removeAccountDataListener​(AccountDataListener listener)
        Description copied from interface: User
        Remove listener to account data changes.
        Specified by:
        removeAccountDataListener in interface User
        Parameters:
        listener - interface to listen to user changes