mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
commit
4aedfc6b1c
6 changed files with 52 additions and 13 deletions
|
@ -24,9 +24,18 @@ class MBOrderStatus extends MBObject {
|
|||
final Decimal received;
|
||||
final Decimal confirmed;
|
||||
|
||||
Map<String, dynamic> 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();
|
||||
}
|
||||
|
|
|
@ -116,9 +116,16 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
|||
}
|
||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||
} on ArgumentError catch (_) {
|
||||
switch (statusString.toLowerCase()) {
|
||||
case "funds confirming":
|
||||
case "processing payment":
|
||||
return Assets.svg.txExchangePending(context);
|
||||
|
||||
case "completed":
|
||||
return Assets.svg.txExchange(context);
|
||||
|
||||
default:
|
||||
status = ChangeNowTransactionStatus.Failed;
|
||||
if (statusString == "Processing payment") {
|
||||
status = ChangeNowTransactionStatus.Sending;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -290,12 +290,22 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
|||
ChangeNowTransactionStatus? status;
|
||||
try {
|
||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||
statusString = "waiting";
|
||||
statusString = "Waiting";
|
||||
}
|
||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||
} on ArgumentError catch (_) {
|
||||
switch (statusString.toLowerCase()) {
|
||||
case "funds confirming":
|
||||
case "processing payment":
|
||||
return Assets.svg.txExchangePending(context);
|
||||
|
||||
case "completed":
|
||||
return Assets.svg.txExchange(context);
|
||||
|
||||
default:
|
||||
status = ChangeNowTransactionStatus.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case ChangeNowTransactionStatus.New:
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -1603,6 +1603,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
return const Color(0xFFD3A90F);
|
||||
case "Finished":
|
||||
case "finished":
|
||||
case "Completed":
|
||||
return accentColorGreen;
|
||||
case "Failed":
|
||||
case "failed":
|
||||
|
|
|
@ -25,12 +25,22 @@ class TradeCard extends ConsumerWidget {
|
|||
ChangeNowTransactionStatus? status;
|
||||
try {
|
||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||
statusString = "waiting";
|
||||
statusString = "Waiting";
|
||||
}
|
||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||
} on ArgumentError catch (_) {
|
||||
switch (statusString.toLowerCase()) {
|
||||
case "funds confirming":
|
||||
case "processing payment":
|
||||
return Assets.svg.txExchangePending(context);
|
||||
|
||||
case "completed":
|
||||
return Assets.svg.txExchange(context);
|
||||
|
||||
default:
|
||||
status = ChangeNowTransactionStatus.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case ChangeNowTransactionStatus.New:
|
||||
|
|
Loading…
Reference in a new issue