mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-27 16:44:53 +01:00
33 lines
1.2 KiB
C#
33 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;
|
||
|
}
|
||
|
}
|