From f6683278604be0334f86222afbcd2de82bfe1dee Mon Sep 17 00:00:00 2001 From: GiMa-Maya <128942712+GiMa-Maya@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:26:06 +0100 Subject: [PATCH] Update exchange_view_model.dart --- lib/view_model/exchange/exchange_view_model.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/view_model/exchange/exchange_view_model.dart b/lib/view_model/exchange/exchange_view_model.dart index d29b7df6b..7b2ffdb54 100644 --- a/lib/view_model/exchange/exchange_view_model.dart +++ b/lib/view_model/exchange/exchange_view_model.dart @@ -32,6 +32,7 @@ import 'package:cake_wallet/exchange/limits_state.dart'; import 'package:cake_wallet/exchange/provider/changenow_exchange_provider.dart'; import 'package:cake_wallet/exchange/provider/exchange_provider.dart'; import 'package:cake_wallet/exchange/provider/exolix_exchange_provider.dart'; +import 'package:cake_wallet/exchange/provider/mayachain_exchange.provider.dart'; import 'package:cake_wallet/exchange/provider/quantex_exchange_provider.dart'; import 'package:cake_wallet/exchange/provider/sideshift_exchange_provider.dart'; import 'package:cake_wallet/exchange/provider/simpleswap_exchange_provider.dart'; @@ -170,6 +171,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with SideShiftExchangeProvider(), SimpleSwapExchangeProvider(), ThorChainExchangeProvider(tradesStore: trades), + MayaChainExchangeProvider(tradesStore: trades), if (FeatureFlag.isExolixEnabled) ExolixExchangeProvider(), QuantexExchangeProvider(), LetsExchangeExchangeProvider(), @@ -580,7 +582,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with } tradesStore.setTrade(trade); - if (trade.provider != ExchangeProviderDescription.thorChain) await trades.add(trade); + if (trade.provider != ExchangeProviderDescription.thorChain && trade.provider != ExchangeProviderDescription.mayaChain) await trades.add(trade); tradeState = TradeIsCreatedSuccessfully(trade: trade); /// return after the first successful trade @@ -846,7 +848,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with int get receiveMaxDigits => receiveCurrency.decimals; Future isCanCreateTrade(Trade trade) async { - if (trade.provider == ExchangeProviderDescription.thorChain) { + if (trade.provider == ExchangeProviderDescription.thorChain || trade.provider == ExchangeProviderDescription.mayaChain) { final payoutAddress = trade.payoutAddress ?? ''; final fromWalletAddress = trade.fromWalletAddress ?? ''; final tapRootPattern = RegExp(P2trAddress.regex.pattern);