mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Merge pull request #109 from cake-tech/CAKE-43-xmr_to-amount-entering
Cake 43 xmr to amount entering
This commit is contained in:
@@ -48,6 +48,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||
tradeState = ExchangeTradeStateInitial();
|
||||
_cryptoNumberFormat = NumberFormat()..maximumFractionDigits = 12;
|
||||
provider = providersForCurrentPair().first;
|
||||
isReceiveAmountEntered = false;
|
||||
loadLimits();
|
||||
}
|
||||
|
||||
@@ -92,6 +93,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
@observable
|
||||
bool isReceiveAddressEnabled;
|
||||
|
||||
bool isReceiveAmountEntered;
|
||||
|
||||
Limits limits;
|
||||
|
||||
NumberFormat _cryptoNumberFormat;
|
||||
@@ -138,7 +141,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
|
||||
provider
|
||||
.calculateAmount(
|
||||
from: depositCurrency, to: receiveCurrency, amount: _amount)
|
||||
from: depositCurrency, to: receiveCurrency, amount: _amount,
|
||||
isReceiveAmount: true)
|
||||
.then((amount) => _cryptoNumberFormat
|
||||
.format(amount)
|
||||
.toString()
|
||||
@@ -159,7 +163,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
final _amount = double.parse(amount);
|
||||
provider
|
||||
.calculateAmount(
|
||||
from: depositCurrency, to: receiveCurrency, amount: _amount)
|
||||
from: depositCurrency, to: receiveCurrency, amount: _amount,
|
||||
isReceiveAmount: false)
|
||||
.then((amount) => _cryptoNumberFormat
|
||||
.format(amount)
|
||||
.toString()
|
||||
@@ -191,8 +196,10 @@ abstract class ExchangeViewModelBase with Store {
|
||||
from: depositCurrency,
|
||||
to: receiveCurrency,
|
||||
amount: depositAmount,
|
||||
receiveAmount: receiveAmount,
|
||||
address: receiveAddress,
|
||||
refundAddress: depositAddress);
|
||||
refundAddress: depositAddress,
|
||||
isBTCRequest: isReceiveAmountEntered);
|
||||
amount = depositAmount;
|
||||
currency = depositCurrency;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user