getWalletBalance method

Future<M4eBalance> getWalletBalance (M4eUniqueId walletId)

Returns wallet balance for specified wallet-id

Throws M4eServerException if request fails.

Throws [ServerException] with NO_INTERNET_CONNECTION error code device is not connected to the internet

Implementation

Future<M4eBalance> getWalletBalance(M4eUniqueId walletId) async {
  if ((await _connectionChecker.hasConnection) ?? false) {
    try {
      final _balance = await _walletApi.getWalletBalance(walletId);

      return _balance;
    } catch (e) {
      rethrow;
    }
  }

  throw M4eExceptionMessages.kNoInternetConnectionException;
}