mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CWA-169 | got hive box as dependency for MorphTokenExchangeProvider class, removed extraId from Trade
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user