btcpayserver/BTCPayServer/Models/StoreViewModels/WalletSetupViewModel.cs
d11n 3c80621dac
Add payjoin option to hot wallet setup (#2450)
* Add payjoin option to hot wallet setup

Enables payjoin by default when creating a hot wallet and offers the user an opt-out.

Test fix

* Display PayJoin option only if it is available

* Test fixes

* Update hot wallet checks

* Test fix after rebase

* Use toggle buttons for enabling options
2021-06-18 10:25:17 +09:00

39 lines
1.2 KiB
C#

namespace BTCPayServer.Models.StoreViewModels
{
public enum WalletSetupMethod
{
ImportOptions,
Hardware,
File,
Xpub,
Scan,
Seed,
GenerateOptions,
HotWallet,
WatchOnly
}
public class WalletSetupViewModel : DerivationSchemeViewModel
{
public WalletSetupMethod? Method { get; set; }
public WalletSetupRequest SetupRequest { get; set; }
public string StoreId { get; set; }
public bool IsHotWallet { get; set; }
public string ViewName =>
Method switch
{
WalletSetupMethod.ImportOptions => "ImportWalletOptions",
WalletSetupMethod.Hardware => "ImportWallet/Hardware",
WalletSetupMethod.Xpub => "ImportWallet/Xpub",
WalletSetupMethod.File => "ImportWallet/File",
WalletSetupMethod.Scan => "ImportWallet/Scan",
WalletSetupMethod.Seed => "ImportWallet/Seed",
WalletSetupMethod.GenerateOptions => "GenerateWalletOptions",
WalletSetupMethod.HotWallet => "GenerateWallet",
WalletSetupMethod.WatchOnly => "GenerateWallet",
_ => "SetupWallet"
};
}
}