Add createwallet rpc call
MODIFY
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
@@ -39,6 +39,17 @@ namespace WalletWasabi.Gui.Rpc
}).ToArray();
}
+ [JsonRpcMethod("createwallet")]
+ public object CreateWallet(string walletName, string password)
+ {
+ var walletGenerator = new WalletGenerator(Global.WalletsDir, Global.Network);
+ walletGenerator.TermsAccepted = true; // Global.WalletService is {};
+ walletGenerator.TipHeight = Global.BitcoinStore.SmartHeaderChain.TipHeight;
+ var (keyManager, mnemonic) = walletGenerator.GenerateWallet(walletName, password);
+ keyManager.ToFile();
+ return mnemonic.ToString();
+ }
+
[JsonRpcMethod("getwalletinfo")]
public object WalletInfo()
{

MODIFY
WalletWasabi/Blockchain/Keys/WalletGenerator.cs
WalletWasabi/Blockchain/Keys/WalletGenerator.cs
@@ -7,7 +7,7 @@ using WalletWasabi.Models;
namespace WalletWasabi.Blockchain.Keys
{
- internal class WalletGenerator
+ public class WalletGenerator
{
public string WalletsDir { get; private set; }
public Network Network { get; private set; }

Add createwallet rpc call