From 787e9bff316b37449ed2172026dce42c036a0643 Mon Sep 17 00:00:00 2001 From: GiMa-Maya <128942712+GiMa-Maya@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:49:49 +0100 Subject: [PATCH] Update mayachain_exchange.provider.dart --- .../provider/mayachain_exchange.provider.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/exchange/provider/mayachain_exchange.provider.dart b/lib/exchange/provider/mayachain_exchange.provider.dart index 744a680c0..856ba1c89 100644 --- a/lib/exchange/provider/mayachain_exchange.provider.dart +++ b/lib/exchange/provider/mayachain_exchange.provider.dart @@ -29,12 +29,15 @@ class MayaChainExchangeProvider extends ExchangeProvider { static final isRefundAddressSupported = [CryptoCurrency.eth]; static const _baseNodeURL = 'https://mayanode.mayachain.info'; - static const _baseURL = 'https://midgard.mayachain.infp'; + static const _baseURL = 'https://midgard.mayachain.info'; static const _quotePath = '/mayachain/quote/swap'; static const _txInfoPath = '/mayachain/tx/status/'; static const _affiliateName = 'cakewallet'; // register a shorter one static const _affiliateBps = '175'; static const _nameLookUpPath = 'v2/mayaname/lookup/'; + static const _affiliateBps = '175'; + static const _toleranceBps = '100'; + static const _streamingInterval = '3'; final Box tradesStore; @@ -70,6 +73,8 @@ class MayaChainExchangeProvider extends ExchangeProvider { 'from_asset': _normalizeCurrency(from), 'to_asset': _normalizeCurrency(to), 'amount': _doubleToMayaChainString(amount), + 'streaming_interval': _streamingInterval, + 'tolerance_bps': _toleranceBps, 'affiliate': _affiliateName, 'affiliate_bps': _affiliateBps }; @@ -94,6 +99,8 @@ class MayaChainExchangeProvider extends ExchangeProvider { 'from_asset': _normalizeCurrency(from), 'to_asset': _normalizeCurrency(to), 'amount': _doubleToMayaChainString(1), + 'streaming_interval': _streamingInterval, + 'tolerance_bps': _toleranceBps, 'affiliate': _affiliateName, 'affiliate_bps': _affiliateBps }; @@ -110,10 +117,8 @@ class MayaChainExchangeProvider extends ExchangeProvider { required bool isFixedRateMode, required bool isSendAll, }) async { - String formattedToAddress = request.toAddress.startsWith('bitcoincash:') - ? request.toAddress.replaceFirst('bitcoincash:', '') - : request.toAddress; - + String formattedToAddress = request.toAddress; + final formattedFromAmount = double.parse(request.fromAmount); final params = { @@ -121,6 +126,8 @@ class MayaChainExchangeProvider extends ExchangeProvider { 'to_asset': _normalizeCurrency(request.toCurrency), 'amount': _doubleToMayaChainString(formattedFromAmount), 'destination': formattedToAddress, + 'streaming_interval': _streamingInterval, + 'tolerance_bps': _toleranceBps, 'affiliate': _affiliateName, 'affiliate_bps': _affiliateBps, 'refund_address':