Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename success rate label #2055

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/buy/buy_quote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extension RecommendationTitle on ProviderRecommendation {
case ProviderRecommendation.lowKyc:
return 'LOW KYC';
case ProviderRecommendation.successRate:
return 'SUCCESS RATE';
return 'HIGHEST SUCCESS RATE';
}
}
}
Expand Down Expand Up @@ -299,4 +299,7 @@ class Quote extends SelectableOption {
}
return null;
}

@override
String toString() => 'Quote(rate: $rate, feeAmount: $feeAmount, networkFee: $networkFee, transactionFee: $transactionFee, payout: $payout, paymentType: $paymentType, provider: $provider, quoteId: $quoteId, recommendations: $recommendations, isBuyAction: $isBuyAction, rampId: $rampId, rampName: $rampName, rampIconPath: $rampIconPath, limits: $limits)';
}
11 changes: 11 additions & 0 deletions lib/view_model/buy/buy_sell_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,17 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
return true;
}).toList();

final List<Quote> successRateQuotes = validQuotes.where((element) =>
element.provider is OnRamperBuyProvider &&
element.recommendations.contains(ProviderRecommendation.successRate)
).toList();

for (final quote in successRateQuotes) {
if (!uniqueProviderQuotes.contains(quote)) {
uniqueProviderQuotes.add(quote);
}
}

sortedRecommendedQuotes.addAll(uniqueProviderQuotes);

sortedQuotes = ObservableList.of(
Expand Down
Loading