mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 06:47:50 +01:00
* Use library for Payjoin Sender * update payjoin sender to use new package and reduce code * fix using statements
32 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|