From 40ca565d54c3bf66b10f4a3460162624cbd2a7ff Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 Mar 2023 14:46:53 -0600 Subject: [PATCH] mb order status util and extra logging --- .../exchange/majestic_bank/mb_order_status.dart | 17 +++++++++++++---- .../majestic_bank/majestic_bank_api.dart | 6 ++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/models/exchange/majestic_bank/mb_order_status.dart b/lib/models/exchange/majestic_bank/mb_order_status.dart index 5496aa5e2..030fe1ddf 100644 --- a/lib/models/exchange/majestic_bank/mb_order_status.dart +++ b/lib/models/exchange/majestic_bank/mb_order_status.dart @@ -24,9 +24,18 @@ class MBOrderStatus extends MBObject { final Decimal received; final Decimal confirmed; + Map toMap() => { + "orderId": orderId, + "status": status, + "fromCurrency": fromCurrency, + "fromAmount": fromAmount, + "receiveCurrency": receiveCurrency, + "receiveAmount": receiveAmount, + "address": address, + "received": received, + "confirmed": confirmed, + }; + @override - String toString() { - // todo: full toString - return status; - } + String toString() => toMap().toString(); } diff --git a/lib/services/exchange/majestic_bank/majestic_bank_api.dart b/lib/services/exchange/majestic_bank/majestic_bank_api.dart index 1aa2394c9..e2445e2e1 100644 --- a/lib/services/exchange/majestic_bank/majestic_bank_api.dart +++ b/lib/services/exchange/majestic_bank/majestic_bank_api.dart @@ -349,8 +349,10 @@ class MajesticBankAPI { return ExchangeResponse(value: status); } catch (e, s) { - Logging.instance - .log("createOrder exception: $e\n$s", level: LogLevel.Error); + Logging.instance.log( + "trackOrder exception when trying to parse $json: $e\n$s", + level: LogLevel.Error, + ); return ExchangeResponse( exception: ExchangeException( e.toString(),