btcpayserver/BTCPayServer/Payments/PayJoin/PayJoinExtensions.cs
Andrew Camilleri bec888da19
Payjoin label fixes (#3986)
* Payjoin label fixes

* When a payjoin label was applied, coin selection filter would not work
* When a payjoin happened with a receive address wallet, the payjoin label was not applied
* Coin selection shows when a utxo is currently reserved for a payjoin. Applies both to UI and to GF API

* remove reserved label

* Update BTCPayServer/Payments/PayJoin/PayJoinEndpointController.cs
2022-07-23 20:26:13 +09:00

26 lines
1.1 KiB
C#

using BTCPayServer.BIP78.Sender;
using BTCPayServer.HostedServices;
using BTCPayServer.Payments.PayJoin.Sender;
using BTCPayServer.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace BTCPayServer.Payments.PayJoin
{
public static class PayJoinExtensions
{
public static void AddPayJoinServices(this IServiceCollection services)
{
services.AddSingleton<DelayedTransactionBroadcaster>();
services.AddSingleton<IHostedService, HostedServices.DelayedTransactionBroadcasterHostedService>();
services.AddSingleton<UTXOLocker>();
services.AddSingleton<IUTXOLocker>(provider => provider.GetRequiredService<UTXOLocker>());
services.AddSingleton<IPayjoinServerCommunicator, PayjoinServerCommunicator>();
services.AddSingleton<PayjoinClient>();
services.AddTransient<Socks5HttpClientHandler>();
services.AddHttpClient(PayjoinServerCommunicator.PayjoinOnionNamedClient)
.ConfigurePrimaryHttpMessageHandler<Socks5HttpClientHandler>();
}
}
}