CW-674: Enhance Exchange Flow - Add estimated receive amount and amount currency to Confirm Sending Details Page (#1547)

* fix: Improve exchange flow by adding a timeout to the call to fetch rate from providers

* fix: Adjust time limit for fetching rate to 7 seconds and add timelimit to fetching limits

* fix: Make fetch limits a Future.wait

* feat: Add currency for amount and estimated receive amount to confirm sending page for exchange

* fix: Remove unneeded code

* fix: Modify receive amount to reflect value coming from the individual exchange providers if available and ensure receiveAmount is calculated based on selected exchange provider's rate
This commit is contained in:
David Adegoke 2024-07-23 01:20:55 +01:00 committed by GitHub
parent 1b109ac702
commit 5c9f176d18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 174 additions and 122 deletions

View file

@ -172,20 +172,23 @@ class ExolixExchangeProvider extends ExchangeProvider {
final extraId = responseJSON['depositExtraId'] as String?;
final payoutAddress = responseJSON['withdrawalAddress'] as String;
final amount = responseJSON['amount'].toString();
final receiveAmount = responseJSON['amountTo']?.toString();
return Trade(
id: id,
from: request.fromCurrency,
to: request.toCurrency,
provider: description,
inputAddress: inputAddress,
refundAddress: refundAddress,
extraId: extraId,
createdAt: DateTime.now(),
amount: amount,
state: TradeState.created,
payoutAddress: payoutAddress,
isSendAll: isSendAll);
id: id,
from: request.fromCurrency,
to: request.toCurrency,
provider: description,
inputAddress: inputAddress,
refundAddress: refundAddress,
extraId: extraId,
createdAt: DateTime.now(),
amount: amount,
receiveAmount:receiveAmount ?? request.toAmount,
state: TradeState.created,
payoutAddress: payoutAddress,
isSendAll: isSendAll,
);
}
@override