mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
GreenField: Generate Store OnChain Wallet (#2708)
* GreenField: Generate Store OnChain Wallet * Greenfield: Do not generate wallet if already configured
This commit is contained in:
@@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using NBitcoin;
|
||||
using NBXplorer.Models;
|
||||
using YamlDotNet.Core.Tokens;
|
||||
using InvoiceData = BTCPayServer.Client.Models.InvoiceData;
|
||||
using Language = BTCPayServer.Client.Models.Language;
|
||||
@@ -883,5 +884,21 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
{
|
||||
return Task.FromResult(GetFromActionResult(_storePaymentMethodsController.GetStorePaymentMethods(storeId, enabled)));
|
||||
}
|
||||
|
||||
public override async Task<OnChainPaymentMethodDataWithSensitiveData> GenerateOnChainWallet(string storeId, string cryptoCode, GenerateOnChainWalletRequest request,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetFromActionResult<OnChainPaymentMethodDataWithSensitiveData>(await _chainPaymentMethodsController.GenerateOnChainWallet(storeId, cryptoCode, new GenerateWalletRequest()
|
||||
{
|
||||
Passphrase = request.Passphrase,
|
||||
AccountNumber = request.AccountNumber,
|
||||
ExistingMnemonic = request.ExistingMnemonic?.ToString(),
|
||||
WordCount = request.WordCount,
|
||||
WordList = request.WordList,
|
||||
SavePrivateKeys = request.SavePrivateKeys,
|
||||
ScriptPubKeyType = request.ScriptPubKeyType,
|
||||
ImportKeysToRPC = request.ImportKeysToRPC
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user