mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +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),
|
ExchangePair(from: CryptoCurrency.btc, to: CryptoCurrency.xmr),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
final trades = Hive.box<Trade>(Trade.boxName);
|
||||||
|
|
||||||
static const apiUri = 'https://api.morphtoken.com';
|
static const apiUri = 'https://api.morphtoken.com';
|
||||||
static const _morphURISuffix = '/morph';
|
static const _morphURISuffix = '/morph';
|
||||||
static const _limitsURISuffix = '/limits';
|
static const _limitsURISuffix = '/limits';
|
||||||
|
@ -158,11 +160,10 @@ class MorphTokenExchangeProvider extends ExchangeProvider {
|
||||||
final to = CryptoCurrency.fromString(toCurrency);
|
final to = CryptoCurrency.fromString(toCurrency);
|
||||||
final inputAddress = responseJSON['input']['refund_address'] as String;
|
final inputAddress = responseJSON['input']['refund_address'] as String;
|
||||||
final status = responseJSON['state'] as String;
|
final status = responseJSON['state'] as String;
|
||||||
final state = TradeState.deserialize(raw: status);
|
final state = TradeState.deserialize(raw: status.toLowerCase());
|
||||||
|
|
||||||
String amount = "";
|
String amount = "";
|
||||||
final trades = Hive.box<Trade>(Trade.boxName).values;
|
for (final trade in trades.values) {
|
||||||
for (final trade in trades) {
|
|
||||||
if (trade.id == id) {
|
if (trade.id == id) {
|
||||||
amount = trade.amount;
|
amount = trade.amount;
|
||||||
break;
|
break;
|
||||||
|
@ -177,7 +178,6 @@ class MorphTokenExchangeProvider extends ExchangeProvider {
|
||||||
inputAddress: inputAddress,
|
inputAddress: inputAddress,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
state: state,
|
state: state,
|
||||||
extraId: null,
|
|
||||||
outputTransaction: null);
|
outputTransaction: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue