mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
CWA-169 | got hive box as dependency for MorphTokenExchangeProvider class, removed extraId from Trade
This commit is contained in:
parent
4ce032f183
commit
22cf5ca08b
1 changed files with 4 additions and 4 deletions
|
@ -55,6 +55,8 @@ class MorphTokenExchangeProvider extends ExchangeProvider {
|
|||
ExchangePair(from: CryptoCurrency.btc, to: CryptoCurrency.xmr),
|
||||
]);
|
||||
|
||||
final trades = Hive.box<Trade>(Trade.boxName);
|
||||
|
||||
static const apiUri = 'https://api.morphtoken.com';
|
||||
static const _morphURISuffix = '/morph';
|
||||
static const _limitsURISuffix = '/limits';
|
||||
|
@ -158,11 +160,10 @@ class MorphTokenExchangeProvider extends ExchangeProvider {
|
|||
final to = CryptoCurrency.fromString(toCurrency);
|
||||
final inputAddress = responseJSON['input']['refund_address'] as String;
|
||||
final status = responseJSON['state'] as String;
|
||||
final state = TradeState.deserialize(raw: status);
|
||||
final state = TradeState.deserialize(raw: status.toLowerCase());
|
||||
|
||||
String amount = "";
|
||||
final trades = Hive.box<Trade>(Trade.boxName).values;
|
||||
for (final trade in trades) {
|
||||
for (final trade in trades.values) {
|
||||
if (trade.id == id) {
|
||||
amount = trade.amount;
|
||||
break;
|
||||
|
@ -177,7 +178,6 @@ class MorphTokenExchangeProvider extends ExchangeProvider {
|
|||
inputAddress: inputAddress,
|
||||
amount: amount,
|
||||
state: state,
|
||||
extraId: null,
|
||||
outputTransaction: null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue