ZKUser
@interface ZKUser : NSObject
Class containing user management methods. Obtain class instance by calling auth on ZumoKit instance.
If sign in is succesful AuthCompletionBlock will be called with ZKUser instance, otherwise completion block is called with error
argument which provides more error information. See Handling Errors for details.
−addAccountListener:listener:
- (void)addAccountListener:(nonnull NSString *)accountId
listener:(nullable id<ZKAccountListener>)listener;
Attach listener called when there is a change to account and account's transaction data.
−addListener:
- (void)addListener:(nullable id<ZKUserListener>)listener;
Attach listener called when there is a change to any user data.
−addTransactionListener:listener:
- (void)addTransactionListener:(nonnull NSString *)transactionId
listener:(nullable id<ZKTransactionListener>)listener;
Attach listener called when there is a change to transaction data.
−createWallet:password:completion:
- (void)createWallet:(nonnull NSString *)mnemonic
password:(nonnull NSString *)password
completion:(_Nonnull WalletCompletionBlock)completionHandler;
Create user wallet seeded by provided mnemonic and encrypted with user's password.
−getAccount:network:type
- (nullable ZKAccount *)getAccount:(nonnull NSString *)symbol
network:(ZKNetworkType)network
type:(ZKAccountType)type;
Select specific user account.
−getAccountTransactions:
- (nonnull NSArray<ZKTransaction *> *)getAccountTransactions:(nonnull NSString *)accountId;
Get all transactions for specific account.
−getAccounts
- (nonnull NSArray<ZKAccount *> *)getAccounts;
Get all user accounts.
−getId
- (BOOL)isEqual:(id)other;
Get user id.
−getTransactions
- (nonnull NSArray<ZKTransaction *> *)getTransactions;
Get all user transactions.
−hasWallet
- (BOOL)hasWallet;
Returns YES if user has wallet on file.
−isActiveUser
- (BOOL)isActiveUser;
Returns YES 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
- (BOOL)isRecoveryMnemonic:(nonnull NSString *)mnemonic;
Returns YES if provided mnemonic corrresponds to user's wallet mnemonic phrase.
−recoverWallet:password:completion:
- (void)recoverWallet:(nonnull NSString *)mnemonic
password:(nonnull NSString *)password
completion:(_Nonnull WalletCompletionBlock)completionHandler;
Recover user wallet with user provided backup mnemonic and new password.
−removeListener:
- (void)removeListener:(nullable id<ZKUserListener>)listener;
Remove ZKUserListener .
−removeAccountListener:
- (void)removeAccountListener:(nullable id<ZKAccountListener>)listener;
Remove ZKAccountListener .
−removeTransactionListener:
- (void)removeTransactionListener:(nullable id<ZKTransactionListener>)listener;
Remove ZKTransactionListener.
−revealMnemonic:completion:
- (void)revealMnemonic:(nonnull NSString *)password
completion:(_Nonnull MnemonicCompletionBlock)completionHandler;
Reveals mnemonic phrase if provided password is correct.
−unlockWallet:completion:
- (void)unlockWallet:(nonnull NSString *)password
completion:(_Nonnull WalletCompletionBlock)completionHandler;
Unlocks wallet if provided password is correct.