fix fetching rate for thorchain

This commit is contained in:
Serhii 2024-03-20 18:00:49 +02:00
parent c1f3253ba3
commit 3aa1386ecf
2 changed files with 1 additions and 3 deletions

View file

@ -68,7 +68,7 @@ class ThorChainExchangeProvider extends ExchangeProvider {
required bool isFixedRateMode, required bool isFixedRateMode,
required bool isReceiveAmount}) async { required bool isReceiveAmount}) async {
try { try {
if (amount == 0) return 0.0; amount = 1;
final params = { final params = {
'from_asset': _normalizeCurrency(from), 'from_asset': _normalizeCurrency(from),

View file

@ -302,8 +302,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
state = IsExecutingState(); state = IsExecutingState();
pendingTransaction = await wallet.createTransaction(_credentials()); pendingTransaction = await wallet.createTransaction(_credentials());
if (provider is ThorChainExchangeProvider) { if (provider is ThorChainExchangeProvider) {
print('Output count: ${pendingTransaction?.outputCount}');
print('provider is ThorChainExchangeProvider and pendingTransaction is ${provider.runtimeType}');
final outputCount = pendingTransaction?.outputCount ?? 0; final outputCount = pendingTransaction?.outputCount ?? 0;
if (outputCount > 10) throw Exception("ThorChain does not support more than 10 outputs"); if (outputCount > 10) throw Exception("ThorChain does not support more than 10 outputs");
} }