mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 09:19:24 +01:00
Pluginify on chain wallet setup (#4999)
* Pluginify on chain wallet setup This PR fixes a few logical points in the wallet setup flow to allow more extensive plugin flexibility; It also fixes an issue when building plugins that requires an Altcoin config profile. Here is an example showcasing the Liquid+ plugin using this to enforce that it is a hot wallet (a requirement it has) and that import to RPC is always set, and a new option that is used to configure the wallet further https://i.imgur.com/pDPQ73v.gif * Update BTCPayServer/Controllers/UIStoresController.Onchain.cs * update nbx
This commit is contained in:
parent
3d2554fbe1
commit
3818468932
6 changed files with 16 additions and 4 deletions
|
@ -12,6 +12,8 @@
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<RepositoryUrl>https://github.com/btcpayserver/btcpayserver</RepositoryUrl>
|
<RepositoryUrl>https://github.com/btcpayserver/btcpayserver</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
|
<Configurations>Debug;Release;Altcoins-Debug;Altcoins-Release</Configurations>
|
||||||
|
<Platforms>AnyCPU</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version Condition=" '$(Version)' == '' ">1.7.2</Version>
|
<Version Condition=" '$(Version)' == '' ">1.7.2</Version>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="NBXplorer.Client" Version="4.2.3" />
|
<PackageReference Include="NBXplorer.Client" Version="4.2.5" />
|
||||||
<PackageReference Include="NicolasDorier.StandardConfiguration" Version="2.0.1" />
|
<PackageReference Include="NicolasDorier.StandardConfiguration" Version="2.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Altcoins)' != 'true'">
|
<ItemGroup Condition="'$(Altcoins)' != 'true'">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -250,7 +251,7 @@ namespace BTCPayServer.Controllers
|
||||||
CryptoCode = cryptoCode,
|
CryptoCode = cryptoCode,
|
||||||
Method = method,
|
Method = method,
|
||||||
SetupRequest = request,
|
SetupRequest = request,
|
||||||
Confirmation = string.IsNullOrEmpty(request.ExistingMnemonic),
|
Confirmation = !isImport,
|
||||||
Network = network,
|
Network = network,
|
||||||
Source = isImport ? "SeedImported" : "NBXplorerGenerated",
|
Source = isImport ? "SeedImported" : "NBXplorerGenerated",
|
||||||
IsHotWallet = isImport ? request.SavePrivateKeys : method == WalletSetupMethod.HotWallet,
|
IsHotWallet = isImport ? request.SavePrivateKeys : method == WalletSetupMethod.HotWallet,
|
||||||
|
@ -311,7 +312,7 @@ namespace BTCPayServer.Controllers
|
||||||
|
|
||||||
var result = await UpdateWallet(vm);
|
var result = await UpdateWallet(vm);
|
||||||
|
|
||||||
if (!ModelState.IsValid || !(result is RedirectToActionResult))
|
if (!ModelState.IsValid || result is not RedirectToActionResult)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
if (!isImport)
|
if (!isImport)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
using NBXplorer.Models;
|
using NBXplorer.Models;
|
||||||
|
|
||||||
namespace BTCPayServer.Models.StoreViewModels
|
namespace BTCPayServer.Models.StoreViewModels
|
||||||
|
|
|
@ -140,7 +140,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (Model.AdditionalOptions is not null)
|
||||||
|
{
|
||||||
|
@foreach (var dictKeys in Model.AdditionalOptions)
|
||||||
|
{
|
||||||
|
<input type="hidden" asp-for="AdditionalOptions[dictKeys.Key]" />
|
||||||
|
}
|
||||||
|
}
|
||||||
<button type="submit" class="btn btn-primary" id="Continue">@(isImport ? "Continue" : "Create")</button>
|
<button type="submit" class="btn btn-primary" id="Continue">@(isImport ? "Continue" : "Create")</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -19,3 +19,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@RenderBody()
|
@RenderBody()
|
||||||
|
|
||||||
|
<vc:ui-extension-point location="onchain-wallet-setup-post-body" model="@Model"/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue