2021-12-31 08:59:02 +01:00
|
|
|
using BTCPayServer.BIP78.Sender;
|
2020-03-29 17:28:22 +02:00
|
|
|
using BTCPayServer.HostedServices;
|
2021-03-01 14:44:53 +01:00
|
|
|
using BTCPayServer.Payments.PayJoin.Sender;
|
2020-03-29 17:28:22 +02:00
|
|
|
using BTCPayServer.Services;
|
2020-01-06 13:57:32 +01:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2020-03-29 17:28:22 +02:00
|
|
|
using Microsoft.Extensions.Hosting;
|
2020-01-06 13:57:32 +01:00
|
|
|
|
|
|
|
namespace BTCPayServer.Payments.PayJoin
|
|
|
|
{
|
|
|
|
public static class PayJoinExtensions
|
|
|
|
{
|
2020-03-29 17:28:22 +02:00
|
|
|
public static void AddPayJoinServices(this IServiceCollection services)
|
2020-01-06 13:57:32 +01:00
|
|
|
{
|
2020-03-29 17:28:22 +02:00
|
|
|
services.AddSingleton<DelayedTransactionBroadcaster>();
|
|
|
|
services.AddSingleton<IHostedService, HostedServices.DelayedTransactionBroadcasterHostedService>();
|
2022-07-23 13:26:13 +02:00
|
|
|
services.AddSingleton<UTXOLocker>();
|
|
|
|
services.AddSingleton<IUTXOLocker>(provider => provider.GetRequiredService<UTXOLocker>());
|
2021-03-01 14:44:53 +01:00
|
|
|
services.AddSingleton<IPayjoinServerCommunicator, PayjoinServerCommunicator>();
|
2020-03-29 17:28:22 +02:00
|
|
|
services.AddSingleton<PayjoinClient>();
|
2020-04-09 10:38:55 +02:00
|
|
|
services.AddTransient<Socks5HttpClientHandler>();
|
2021-03-01 14:44:53 +01:00
|
|
|
services.AddHttpClient(PayjoinServerCommunicator.PayjoinOnionNamedClient)
|
2020-11-13 06:01:51 +01:00
|
|
|
.ConfigurePrimaryHttpMessageHandler<Socks5HttpClientHandler>();
|
2020-01-06 13:57:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|