mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Cw 537 integrate thor chain swaps (#1280)
* thorChain btc to eth swap * eth to btc swap * update the UI * update localization * Update thorchain_exchange.provider.dart * minor fixes * minor fix * fix min amount bug * revert amount_converter changes * fetching thorChain traid info * resolve evm related merge conflicts * minor fix * Fix eth transaction hash for Thorchain Integration * add new status endpoint and refund address for eth * Adjust affiliate fee * Fix conflicts with main * review comments + transaction filter item * taproot addresses check * added 10 outputs check * Update thorchain_exchange.provider.dart * minor fixes * update thorchain title * fix fetching rate for thorchain * Revert "fix fetching rate for thorchain" This reverts commit 3aa1386ecfbca14271bf01a73b424de19c4fd484. * fix thorchain exchange rate --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -3,18 +3,20 @@ import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart';
|
||||
import 'package:cw_core/wallet_base.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part'trade_filter_store.g.dart';
|
||||
part 'trade_filter_store.g.dart';
|
||||
|
||||
class TradeFilterStore = TradeFilterStoreBase with _$TradeFilterStore;
|
||||
|
||||
abstract class TradeFilterStoreBase with Store {
|
||||
TradeFilterStoreBase() : displayXMRTO = true,
|
||||
TradeFilterStoreBase()
|
||||
: displayXMRTO = true,
|
||||
displayChangeNow = true,
|
||||
displaySideShift = true,
|
||||
displayMorphToken = true,
|
||||
displaySimpleSwap = true,
|
||||
displayTrocador = true,
|
||||
displayExolix = true;
|
||||
displayExolix = true,
|
||||
displayThorChain = true;
|
||||
|
||||
@observable
|
||||
bool displayXMRTO;
|
||||
@@ -37,8 +39,17 @@ abstract class TradeFilterStoreBase with Store {
|
||||
@observable
|
||||
bool displayExolix;
|
||||
|
||||
@observable
|
||||
bool displayThorChain;
|
||||
|
||||
@computed
|
||||
bool get displayAllTrades => displayChangeNow && displaySideShift && displaySimpleSwap && displayTrocador && displayExolix;
|
||||
bool get displayAllTrades =>
|
||||
displayChangeNow &&
|
||||
displaySideShift &&
|
||||
displaySimpleSwap &&
|
||||
displayTrocador &&
|
||||
displayExolix &&
|
||||
displayThorChain;
|
||||
|
||||
@action
|
||||
void toggleDisplayExchange(ExchangeProviderDescription provider) {
|
||||
@@ -64,6 +75,9 @@ abstract class TradeFilterStoreBase with Store {
|
||||
case ExchangeProviderDescription.exolix:
|
||||
displayExolix = !displayExolix;
|
||||
break;
|
||||
case ExchangeProviderDescription.thorChain:
|
||||
displayThorChain = !displayThorChain;
|
||||
break;
|
||||
case ExchangeProviderDescription.all:
|
||||
if (displayAllTrades) {
|
||||
displayChangeNow = false;
|
||||
@@ -73,6 +87,7 @@ abstract class TradeFilterStoreBase with Store {
|
||||
displaySimpleSwap = false;
|
||||
displayTrocador = false;
|
||||
displayExolix = false;
|
||||
displayThorChain = false;
|
||||
} else {
|
||||
displayChangeNow = true;
|
||||
displaySideShift = true;
|
||||
@@ -81,6 +96,7 @@ abstract class TradeFilterStoreBase with Store {
|
||||
displaySimpleSwap = true;
|
||||
displayTrocador = true;
|
||||
displayExolix = true;
|
||||
displayThorChain = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -96,16 +112,13 @@ abstract class TradeFilterStoreBase with Store {
|
||||
? _trades
|
||||
.where((item) =>
|
||||
(displayXMRTO && item.trade.provider == ExchangeProviderDescription.xmrto) ||
|
||||
(displaySideShift &&
|
||||
item.trade.provider == ExchangeProviderDescription.sideShift) ||
|
||||
(displayChangeNow &&
|
||||
item.trade.provider == ExchangeProviderDescription.changeNow) ||
|
||||
(displayMorphToken &&
|
||||
item.trade.provider == ExchangeProviderDescription.morphToken) ||
|
||||
(displaySimpleSwap &&
|
||||
item.trade.provider == ExchangeProviderDescription.simpleSwap) ||
|
||||
(displaySideShift && item.trade.provider == ExchangeProviderDescription.sideShift) ||
|
||||
(displayChangeNow && item.trade.provider == ExchangeProviderDescription.changeNow) ||
|
||||
(displayMorphToken && item.trade.provider == ExchangeProviderDescription.morphToken) ||
|
||||
(displaySimpleSwap && item.trade.provider == ExchangeProviderDescription.simpleSwap) ||
|
||||
(displayTrocador && item.trade.provider == ExchangeProviderDescription.trocador) ||
|
||||
(displayExolix && item.trade.provider == ExchangeProviderDescription.exolix))
|
||||
(displayExolix && item.trade.provider == ExchangeProviderDescription.exolix) ||
|
||||
(displayThorChain && item.trade.provider == ExchangeProviderDescription.thorChain))
|
||||
.toList()
|
||||
: _trades;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user