mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
23 lines
950 B
C#
23 lines
950 B
C#
using BTCPayServer.Abstractions.Contracts;
|
|
using BTCPayServer.Abstractions.Models;
|
|
using BTCPayServer.Abstractions.Services;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace BTCPayServer.Plugins.DynamicRateLimits;
|
|
|
|
public class DynamicRateLimitsPlugin : BaseBTCPayServerPlugin
|
|
{
|
|
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
|
|
{
|
|
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.8.0" }
|
|
};
|
|
public override void Execute(IServiceCollection applicationBuilder)
|
|
{
|
|
applicationBuilder.AddSingleton<DynamicRateLimitsService>();
|
|
applicationBuilder.AddSingleton<IHostedService>(provider => provider.GetRequiredService<DynamicRateLimitsService>());
|
|
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("DynamicRateLimitsPlugin/Nav",
|
|
"server-nav"));
|
|
base.Execute(applicationBuilder);
|
|
}
|
|
} |