Disable cold wallet creation by default

This commit is contained in:
nicolas.dorier
2025-03-13 19:23:23 +09:00
parent 517dd7d85b
commit c3c6473e35
12 changed files with 127 additions and 92 deletions

View File

@@ -1,3 +1,6 @@
using System;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
namespace BTCPayServer.Models.StoreViewModels
{
public enum WalletSetupMethod
@@ -34,5 +37,21 @@ namespace BTCPayServer.Models.StoreViewModels
WalletSetupMethod.WatchOnly => "GenerateWallet",
_ => "SetupWallet"
};
internal void SetPermission(WalletCreationPermissions perm)
{
this.CanCreateNewColdWallet = perm.CanCreateColdWallet;
this.CanUseHotWallet = perm.CanCreateHotWallet;
this.CanUseRPCImport = perm.CanRPCImport;
}
public void SetViewData(ViewDataDictionary ViewData)
{
ViewData.Add(nameof(CanUseHotWallet), CanUseHotWallet);
ViewData.Add(nameof(CanCreateNewColdWallet), CanCreateNewColdWallet);
ViewData.Add(nameof(CanUseRPCImport), CanUseRPCImport);
ViewData.Add(nameof(SupportSegwit), SupportSegwit);
ViewData.Add(nameof(SupportTaproot), SupportTaproot);
ViewData.Add(nameof(Method), Method);
}
}
}