Interface User
-
- All Known Implementing Classes:
User.CppProxy
public interface User
User class provides methods for managing user wallet and accounts.User instance can be obtained via
getUser
method onZumoKit
instance.See Manage User Wallet, Create Fiat Account and View User Data guides for usage details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
User.CppProxy
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAccountDataListener(AccountDataListener listener)
Listen to all account data changes.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.void
composeExchange(java.lang.String debitAccountId, java.lang.String creditAccountId, java.math.BigDecimal amount, boolean sendMax, ComposeExchangeCallback callback)
Compose exchange.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.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.void
createAccount(java.lang.String currencyCode, AccountCallback callback)
Create custody or fiat account for specified currency.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.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.void
fetchAuthenticationConfig(AuthenticationConfigCallback callback)
Fetch Strong Customer Authentication (SCA) config.void
fetchTradingPairs(StringifiedJsonCallback callback)
Fetch trading pairs that are currently supported.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.java.util.ArrayList<Account>
getAccounts()
Get all user accounts.java.lang.String
getId()
Get user id.java.lang.String
getIntegratorId()
Get user integrator id.void
getNominatedAccountFiatProperties(java.lang.String accountId, AccountFiatPropertiesCallback callback)
Get nominated account details for specified account if it exists.boolean
hasWallet()
Check if user has walletboolean
isFiatCustomer()
Check if user is a registered fiat customer.boolean
isRecoveryMnemonic(java.lang.String mnemonic)
Check if mnemonic seed phrase corresponds to user's wallet.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.void
recoverWallet(java.lang.String mnemonic, java.lang.String password, WalletCallback callback)
Recover user wallet with mnemonic seed phrase corresponding to user's wallet.void
removeAccountDataListener(AccountDataListener listener)
Remove listener to account data changes.void
revealCardDetails(java.lang.String cardId, CardDetailsCallback callback)
Reveals sensitive card details.void
revealMnemonic(java.lang.String password, MnemonicCallback callback)
Reveal menmonic seed phrase used to seed user wallet.void
revealPin(java.lang.String cardId, PinCallback callback)
Reveal card PIN.void
setAuthentication(java.lang.String cardId, java.util.ArrayList<KbaAnswer> knowledgeBase, SuccessCallback callback)
Add KBA answers to a card without SCA.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'.void
submitExchange(ComposedExchange composedExchange, SubmitExchangeCallback callback)
Submit an exchange.void
submitTransaction(ComposedTransaction composedTransaction, java.lang.String toAccountId, java.lang.String metadata, SubmitTransactionCallback callback)
Submit a transaction.void
unblockPin(java.lang.String cardId, SuccessCallback callback)
Unblock card PIN.void
unlockWallet(java.lang.String password, WalletCallback callback)
Unlock user wallet with user's password.
-
-
-
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 namemiddleName
- middle name or nulllastName
- last namedateOfBirth
- date of birth in ISO 8601 format, e.g '2020-08-12'email
- emailphone
- phone numberaddress
- home addresscallback
- 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.
-
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
- custodyAccount
identifierdestination
- destination address or non-custodial account identifieramount
- amount in source account currencysendMax
- send maximum possible funds to destinationcallback
- 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
identifieramount
- amount in source account currencysendMax
- send maximum possible funds to destinationcallback
- 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 methodstoAccountId
- 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 transactioncallback
- 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.
-
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 ofcomposeExchange
methodcallback
- 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
idcallback
- 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 idcardType
- 'VIRTUAL' or 'PHYSICAL'mobileNumber
- card holder mobile number, starting with a '+', followed by the country code and then the mobile numbercallback
- an interface to receive the result or errorknowledgeBase
- 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 idcardStatus
- new card statuspan
- PAN when activating a physical card, null otherwisecvv2
- CVV2 when activating a physical card, null otherwisecallback
- 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 idcallback
- 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 idcallback
- an interface to receive the result or error
-
unblockPin
void unblockPin(java.lang.String cardId, SuccessCallback callback)
Unblock card PIN.- Parameters:
cardId
- card idcallback
- 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 idknowledgeBase
- list of KBA answerscallback
- 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 inUtils
class.- Parameters:
mnemonic
- mnemonic seed phrasepassword
- user provided passwordcallback
- 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 passwordcallback
- 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 passwordcallback
- 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 walletpassword
- user provided passwordcallback
- 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
-
-