btcpayserver/BTCPayServer/Payments/PayJoin/Sender/PayjoinWallet.cs
Andrew Camilleri 49ae62b02e
Use library for Payjoin Sender (#2158)
* Use library for Payjoin Sender

* update payjoin sender to use new package and reduce code

* fix using statements
2021-03-01 22:44:53 +09:00

32 lines
1.2 KiB
C#

using BTCPayServer.BIP78.Sender;
using NBitcoin;
namespace BTCPayServer.Payments.PayJoin.Sender
{
public class PayjoinWallet : IPayjoinWallet
{
private readonly DerivationSchemeSettings _derivationSchemeSettings;
public PayjoinWallet(DerivationSchemeSettings derivationSchemeSettings)
{
_derivationSchemeSettings = derivationSchemeSettings;
}
public IHDScriptPubKey Derive(KeyPath keyPath)
{
return ((IHDScriptPubKey)_derivationSchemeSettings.AccountDerivation).Derive(keyPath);
}
public bool CanDeriveHardenedPath()
{
return _derivationSchemeSettings.AccountDerivation.CanDeriveHardenedPath();
}
public Script ScriptPubKey => ((IHDScriptPubKey)_derivationSchemeSettings.AccountDerivation).ScriptPubKey;
public ScriptPubKeyType ScriptPubKeyType => _derivationSchemeSettings.AccountDerivation.ScriptPubKeyType();
public RootedKeyPath RootedKeyPath =>
_derivationSchemeSettings.GetSigningAccountKeySettings().GetRootedKeyPath();
public IHDKey AccountKey => _derivationSchemeSettings.GetSigningAccountKeySettings().AccountKey;
}
}