User
public interface User
Class containing user management methods. Obtain class instance by calling auth on ZumoKit instance.
If sign in succesful AuthCallback's onSuccess handler will be called with User instance, otherwise onError is called with error details. See Handling Errors for details.
Public Method Summary
Type | Method |
---|---|
void | addAccountListener(String accountId, AccountListener listener) Attach listener called when there is a change to account and account's transaction data. |
void | addListener(UserListener listener) Attach listener called when there is a change to any user data. |
void | addTransactionListener(String transactionId, TransactionListener listener) Attach listener called when there is a change to transaction data. |
void | createWallet(String mnemonic, String password, WalletCallback callback) Create user wallet seeded by provided mnemonic and encrypted with user's password. |
Account | getAccount(String symbol, NetworkType network, AccountType type) Select specific user account. |
ArrayList<Transaction> | getAccountTransactions(String accountId) Get all transactions for specific account. |
ArrayList<Account> | getAccounts() Get all user accounts. |
String | getId() Get user id. |
ArrayList<Transaction> | getTransactions() Get all user transactions. |
boolean | hasWallet() Returns true if user has wallet on file. |
boolean | isActiveUser() Returns true if this is currently active user. |
boolean | isRecoveryMnemonic(String mnemonic) Returns true if provided mnemonic corrresponds to user's wallet mnemonic phrase. |
void | recoverWallet(String mnemonic, String password, WalletCallback callback) Recover user wallet with user provided backup mnemonic and new password. |
void | removeListener(UserListener listener) Remove UserListener. |
void | removeAccountListener(AccountListener listener) Remove AccountListener. |
void | removeTransactionListener(TransactionListener listener) Remove TransactionListener.. |
void | revealMnemonic(String password, MnemonicCallback callback) Reveals mnemonic phrase if provided password is correct. |
void | unlockWallet(String password, WalletCallback callback) Unlocks wallet if provided password is correct. |
Public Methods
addAccountListener
void addAccountListener(String accountId, AccountListener listener)
Attach listener called when there is a change to account and account's transaction data.
addListener
void addListener(UserListener listener)
Attach listener called when there is a change to any user data.
addTransactionListener
void addTransactionListener(String transactionId, TransactionListener listener)
Attach listener called when there is a change to transaction data.
createWallet
void createWallet(String mnemonic, String password, WalletCallback callback)
Create user wallet seeded by provided mnemonic and encrypted with user's password.
getAccount
Account getAccount(String symbol, NetworkType network, AccountType type)
Select specific user account.
getAccountTransactions
ArrayList<Transaction> getAccountTransactions(String accountId)
Get all transactions for specific account.
getAccounts
ArrayList<Account> getAccounts()
Get all user accounts.
getId
String getId()
Get user id.
getTransactions
ArrayList<Transaction> getTransactions()
Get all user transactions.
hasWallet
boolean hasWallet()
Returns true if user has wallet on file.
isActiveUser
boolean isActiveUser()
Returns true if this instance is currently active user.
Active user is the user which was last authenticated. Only one user per ZumoKit instance can be active at any given time.
isRecoveryMnemonic
boolean isRecoveryMnemonic(String mnemonic)
Returns true if provided mnemonic corrresponds to user's wallet mnemonic phrase.
recoverWallet
void recoverWallet(String mnemonic, String password, WalletCallback callback)
Recover user wallet with user provided backup mnemonic and new password.
removeListener
void removeListener(UserListener listener)
Remove UserListener .
removeAccountListener
void removeAccountListener(AccountListener listener)
Remove AccountListener .
removeTransactionListener
void removeTransactionListener(TransactionListener listener)
Remove TransactionListener.
revealMnemonic
void revealMnemonic(String password, MnemonicCallback callback)
Reveals mnemonic phrase if provided password is correct.
unlockWallet
void unlockWallet(String password, WalletCallback callback)
Unlocks wallet if provided password is correct.