mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Register rate providers in DI, so it can be accessed by plugins (#4551)
This commit is contained in:
@@ -57,7 +57,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie + "," + AuthenticationSchemes.Greenfield)]
|
||||
public ActionResult<List<RateSource>> GetRateSources()
|
||||
{
|
||||
return Ok(_rateProviderFactory.RateProviderFactory.GetSupportedExchanges().Select(provider =>
|
||||
return Ok(_rateProviderFactory.RateProviderFactory.AvailableRateProviders.Select(provider =>
|
||||
new RateSource() { Id = provider.Id, Name = provider.DisplayName }));
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ $"The preferredSource is required if you aren't using custom scripts");
|
||||
|
||||
configuration.PreferredSource = _rateProviderFactory
|
||||
.RateProviderFactory
|
||||
.GetSupportedExchanges()
|
||||
.AvailableRateProviders
|
||||
.FirstOrDefault(s =>
|
||||
s.Id.Equals(configuration.PreferredSource,
|
||||
StringComparison.InvariantCultureIgnoreCase))?.Id;
|
||||
|
||||
Reference in New Issue
Block a user