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 3aa1386ecf.

* fix thorchain exchange rate

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
Serhii 2024-03-28 14:41:11 +02:00 committed by GitHub
parent b9e803f3bd
commit cdf081edfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 534 additions and 102 deletions

View file

@ -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;
}