Use better default than coingecko when creating a new store (#4416)

* Use better default than coingecko when creating a new store

* Improve recommended exchange UX

* Add btcturk for TRY

* Fix recommendation

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
Nicolas Dorier
2022-12-14 13:33:27 +09:00
committed by GitHub
parent dea019ebdc
commit 18ba0148ae
9 changed files with 38 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ namespace BTCPayServer.Controllers
var vm = new CreateStoreViewModel
{
DefaultCurrency = StoreBlob.StandardDefaultCurrency,
Exchanges = GetExchangesSelectList(CoinGeckoRateProvider.CoinGeckoName)
Exchanges = GetExchangesSelectList(null)
};
return View(vm);
@@ -99,7 +99,9 @@ namespace BTCPayServer.Controllers
var exchanges = _rateFactory.RateProviderFactory
.GetSupportedExchanges()
.Where(r => !string.IsNullOrWhiteSpace(r.Name))
.OrderBy(s => s.Id, StringComparer.OrdinalIgnoreCase);
.OrderBy(s => s.Id, StringComparer.OrdinalIgnoreCase)
.ToList();
exchanges.Insert(0, new AvailableRateProvider(null, "Recommended", ""));
var chosen = exchanges.FirstOrDefault(f => f.Id == selected) ?? exchanges.First();
return new SelectList(exchanges, nameof(chosen.Id), nameof(chosen.Name), chosen.Id);
}