mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +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 received;
|
||||||
final Decimal confirmed;
|
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
|
@override
|
||||||
String toString() {
|
String toString() => toMap().toString();
|
||||||
// todo: full toString
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,9 +116,16 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
}
|
}
|
||||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||||
} on ArgumentError catch (_) {
|
} on ArgumentError catch (_) {
|
||||||
status = ChangeNowTransactionStatus.Failed;
|
switch (statusString.toLowerCase()) {
|
||||||
if (statusString == "Processing payment") {
|
case "funds confirming":
|
||||||
status = ChangeNowTransactionStatus.Sending;
|
case "processing payment":
|
||||||
|
return Assets.svg.txExchangePending(context);
|
||||||
|
|
||||||
|
case "completed":
|
||||||
|
return Assets.svg.txExchange(context);
|
||||||
|
|
||||||
|
default:
|
||||||
|
status = ChangeNowTransactionStatus.Failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -290,11 +290,21 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
||||||
ChangeNowTransactionStatus? status;
|
ChangeNowTransactionStatus? status;
|
||||||
try {
|
try {
|
||||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||||
statusString = "waiting";
|
statusString = "Waiting";
|
||||||
}
|
}
|
||||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||||
} on ArgumentError catch (_) {
|
} on ArgumentError catch (_) {
|
||||||
status = ChangeNowTransactionStatus.Failed;
|
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) {
|
switch (status) {
|
||||||
|
|
|
@ -349,8 +349,10 @@ class MajesticBankAPI {
|
||||||
|
|
||||||
return ExchangeResponse(value: status);
|
return ExchangeResponse(value: status);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logging.instance
|
Logging.instance.log(
|
||||||
.log("createOrder exception: $e\n$s", level: LogLevel.Error);
|
"trackOrder exception when trying to parse $json: $e\n$s",
|
||||||
|
level: LogLevel.Error,
|
||||||
|
);
|
||||||
return ExchangeResponse(
|
return ExchangeResponse(
|
||||||
exception: ExchangeException(
|
exception: ExchangeException(
|
||||||
e.toString(),
|
e.toString(),
|
||||||
|
|
|
@ -1603,6 +1603,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
return const Color(0xFFD3A90F);
|
return const Color(0xFFD3A90F);
|
||||||
case "Finished":
|
case "Finished":
|
||||||
case "finished":
|
case "finished":
|
||||||
|
case "Completed":
|
||||||
return accentColorGreen;
|
return accentColorGreen;
|
||||||
case "Failed":
|
case "Failed":
|
||||||
case "failed":
|
case "failed":
|
||||||
|
|
|
@ -25,11 +25,21 @@ class TradeCard extends ConsumerWidget {
|
||||||
ChangeNowTransactionStatus? status;
|
ChangeNowTransactionStatus? status;
|
||||||
try {
|
try {
|
||||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||||
statusString = "waiting";
|
statusString = "Waiting";
|
||||||
}
|
}
|
||||||
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
|
||||||
} on ArgumentError catch (_) {
|
} on ArgumentError catch (_) {
|
||||||
status = ChangeNowTransactionStatus.Failed;
|
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) {
|
switch (status) {
|
||||||
|
|
Loading…
Reference in a new issue