mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 12:29:31 +00:00
CAKE-278 | added expireAt to Trade() for exchange with fixed rate
This commit is contained in:
parent
fb6e7de166
commit
ae96213aad
1 changed files with 28 additions and 10 deletions
|
@ -153,7 +153,24 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
|
||||||
final state = TradeState.deserialize(raw: status);
|
final state = TradeState.deserialize(raw: status);
|
||||||
final extraId = responseJSON['payinExtraId'] as String;
|
final extraId = responseJSON['payinExtraId'] as String;
|
||||||
final outputTransaction = responseJSON['payoutHash'] as String;
|
final outputTransaction = responseJSON['payoutHash'] as String;
|
||||||
|
final expiredAtRaw = responseJSON['validUntil'] as String;
|
||||||
|
final expiredAt = expiredAtRaw != null
|
||||||
|
? DateTime.parse(expiredAtRaw).toLocal()
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (expiredAt != null) {
|
||||||
|
return Trade(
|
||||||
|
id: id,
|
||||||
|
from: from,
|
||||||
|
to: to,
|
||||||
|
provider: description,
|
||||||
|
inputAddress: inputAddress,
|
||||||
|
amount: expectedSendAmount,
|
||||||
|
state: state,
|
||||||
|
extraId: extraId,
|
||||||
|
expiredAt: expiredAt,
|
||||||
|
outputTransaction: outputTransaction);
|
||||||
|
} else {
|
||||||
return Trade(
|
return Trade(
|
||||||
id: id,
|
id: id,
|
||||||
from: from,
|
from: from,
|
||||||
|
@ -165,6 +182,7 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
|
||||||
extraId: extraId,
|
extraId: extraId,
|
||||||
outputTransaction: outputTransaction);
|
outputTransaction: outputTransaction);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<double> calculateAmount(
|
Future<double> calculateAmount(
|
||||||
|
|
Loading…
Reference in a new issue