getUserWallets method
Returns current m4e authenticated user Wallets
from m4e when
connected to the internet or local cache (if exist) on no-internet-connectivity
Throws M4eAuthException if no m4e user is authenticated
Throws M4eCacheException if no Wallets
are returned from cache on no-internet connectivity
Throws M4eServerException if request fails. This could be as a result of a
Request timeout
, Socket Exception
or General server error
Implementation
Future<List<M4eWallet>> getUserWallets(UniqueId userId) async {
if ((await _connectionChecker.hasConnection) ?? false) {
try {
final _wallets = await _walletApi.fetchUserWallets(userId);
return _wallets;
} catch (e) {
rethrow;
}
}
throw M4eExceptionMessages.kNoInternetConnectionException;
}