mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
wip
This commit is contained in:
@@ -34,76 +34,125 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BTCPayServer.Plugins.Ticket
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BTCPayServer.Plugins.Wabisabi", "Plugins\BTCPayServer.Plugins.Wabisabi\BTCPayServer.Plugins.Wabisabi.csproj", "{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BTCPayServer.Plugins.AOPP", "Plugins\BTCPayServer.Plugins.AOPP\BTCPayServer.Plugins.AOPP.csproj", "{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BTCPayServer.Plugins.LSP", "Plugins\BTCPayServer.Plugins.LSP\BTCPayServer.Plugins.LSP.csproj", "{304E4860-8420-4D71-B95A-3E2F75BEE9F6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Altcoins-Debug|Any CPU = Altcoins-Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{D1D1116C-38F9-4EA3-AC65-A75FEA82E5C8}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{AD9635BB-C70E-4676-BB04-900D51B01666}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{8F158B88-0FEE-44FF-8552-7C0F17D5C508}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{DF85EFA4-0EF5-4A99-853F-E6F9C88E3F8C}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{2C5C4DF9-BA1F-4671-9F24-B22D7C9C3D21}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Debug|Any CPU.ActiveCfg = Altcoins-Release|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Debug|Any CPU.Build.0 = Altcoins-Release|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{D7E7309D-C4F4-496A-B2C8-BC5D3991B9C0}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{3F2E0BA0-9EA7-490F-894D-F9703F35B174}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{CCDE6E23-60B7-4B12-95AA-91CB40DBC3BD}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{6295533A-F941-40CA-B889-FE6C0432ED53}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{58863D86-3C78-4BEC-ACB6-2F82CC141210}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{B4E2ED08-4AD3-4648-8BDB-3107200460B9}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{71885A5E-1B00-4676-9566-D81AAE37406C}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{5E1BAA06-7828-47BC-89D6-19C2A78EA427}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{7AFC20EB-1696-47D7-8E57-822B05DD18F2}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Altcoins-Debug|Any CPU.ActiveCfg = Altcoins-Debug|Any CPU
|
||||
{0D438B7D-F996-4BF3-8F54-02CB9DF120D8}.Altcoins-Debug|Any CPU.Build.0 = Altcoins-Debug|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Altcoins-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A02B61F6-C1B6-404E-865D-5ADD6AEC3E76}.Altcoins-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Altcoins-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{304E4860-8420-4D71-B95A-3E2F75BEE9F6}.Altcoins-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B19C9F52-DC47-466D-8B5C-2D202B7B003F} = {9E04ECE9-E304-4FF2-9CBC-83256E6C6962}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
var plugins = Directory.GetDirectories("../../../../Plugins");
|
||||
Console.WriteLine(string.Join(',',plugins));
|
||||
var p = string.Join(';', plugins.Select(s => $"{Path.GetFullPath(s)}/bin/Debug/net6.0/{Path.GetFileName(s)}.dll" ));;
|
||||
var p = string.Join(';', plugins.Select(s => $"{Path.GetFullPath(s)}/bin/Altcoins-Debug/net6.0/{Path.GetFileName(s)}.dll" ));;
|
||||
var fileContents = $"{{ \"DEBUG_PLUGINS\": \"{p}\"}}";
|
||||
var content = JsonSerializer.Serialize(new
|
||||
{
|
||||
|
||||
@@ -1,16 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
<PropertyGroup>
|
||||
<Title>AOPP</Title>
|
||||
<Description>Allows you to support the AOPP protocol in invoices to allow customers to bypass stupid KYC rules.</Description>
|
||||
<Authors>Kukks</Authors>
|
||||
<Version>1.0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
<PropertyGroup>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
|
||||
<AssemblyVersion>1.0.1</AssemblyVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- This will make sure that referencing BTCPayServer doesn't put any artifact in the published directory -->
|
||||
<ItemDefinitionGroup>
|
||||
<ProjectReference>
|
||||
<Properties>StaticWebAssetsEnabled=false</Properties>
|
||||
<Private>false</Private>
|
||||
<ExcludeAssets>runtime;native;build;buildTransitive;contentFiles</ExcludeAssets>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<ProjectReference Include="..\..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\..\BTCPayServer.Common\BTCPayServer.Common.csproj" />
|
||||
<ProjectReference Include="..\..\submodules\btcpayserver\BTCPayServer\BTCPayServer.csproj" />
|
||||
<EmbeddedResource Include="Resources\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<ProjectReference Include="..\..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" />
|
||||
<EmbeddedResource Include="Resources\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NBitcoin.Secp256k1" Version="3.0.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,330 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Abstractions.Constants;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Abstractions.Extensions;
|
||||
using BTCPayServer.Client;
|
||||
using BTCPayServer.Client.Models;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Microsoft.VisualBasic;
|
||||
using NBitcoin;
|
||||
using NBitcoin.Crypto;
|
||||
using NBitcoin.DataEncoders;
|
||||
using NBitcoin.Secp256k1;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Key = NBitcoin.Key;
|
||||
|
||||
namespace BTCPayServer.Plugins.FujiOracle
|
||||
{
|
||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||
[Route("plugins/{storeId}/FujiOracle")]
|
||||
public class FujiOracleController : Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
private async Task<BTCPayServerClient> CreateClient(string storeId)
|
||||
{
|
||||
return await _btcPayServerClientFactory.Create(null, new[] {storeId}, new DefaultHttpContext()
|
||||
{
|
||||
Request =
|
||||
{
|
||||
Scheme = "https",
|
||||
Host = Request.Host,
|
||||
Path = Request.Path,
|
||||
PathBase = Request.PathBase
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly FujiOracleService _FujiOracleService;
|
||||
private readonly IBTCPayServerClientFactory _btcPayServerClientFactory;
|
||||
|
||||
public FujiOracleController(IHttpClientFactory httpClientFactory,
|
||||
FujiOracleService FujiOracleService,
|
||||
IBTCPayServerClientFactory btcPayServerClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_FujiOracleService = FujiOracleService;
|
||||
_btcPayServerClientFactory = btcPayServerClientFactory;
|
||||
}
|
||||
|
||||
[HttpGet("update")]
|
||||
public async Task<IActionResult> UpdateFujiOracleSettings(string storeId)
|
||||
{
|
||||
var
|
||||
FujiOracle = (await _FujiOracleService.GetFujiOracleForStore(storeId)) ?? new();
|
||||
|
||||
|
||||
return View(FujiOracle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost("update")]
|
||||
public async Task<IActionResult> UpdateFujiOracleSettings(string storeId,
|
||||
FujiOracleSettings vm,
|
||||
string command)
|
||||
{
|
||||
if (command == "generate")
|
||||
{
|
||||
ModelState.Clear();
|
||||
|
||||
if (ECPrivKey.TryCreate(new ReadOnlySpan<byte>(RandomNumberGenerator.GetBytes(32)), out var key))
|
||||
{
|
||||
vm.Key = key.ToHex();
|
||||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
if (command == "add-pair")
|
||||
{
|
||||
vm.Pairs ??= new List<string>();
|
||||
vm.Pairs.Add("");
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
if (command.StartsWith("remove-pair"))
|
||||
{
|
||||
var i = int.Parse(command.Substring(command.IndexOf(":", StringComparison.InvariantCultureIgnoreCase) +
|
||||
1));
|
||||
vm.Pairs.RemoveAt(i);
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
||||
var validPairsToQuery = "";
|
||||
for (var i = 0; i < vm.Pairs.Count; i++)
|
||||
{
|
||||
string vmPair = vm.Pairs[i];
|
||||
if (string.IsNullOrWhiteSpace(vmPair))
|
||||
{
|
||||
|
||||
ModelState.AddModelError($"{vm.Pairs}[{i}]",
|
||||
$"Remove invalid");
|
||||
continue;
|
||||
}
|
||||
|
||||
var split = vmPair.Split("_", StringSplitOptions.RemoveEmptyEntries);
|
||||
if (split.Length != 2)
|
||||
{
|
||||
ModelState.AddModelError($"{vm.Pairs}[{i}]",
|
||||
$"Invalid format, needs to be BTC_USD format");
|
||||
continue;
|
||||
}
|
||||
|
||||
validPairsToQuery += "," + vmPair;
|
||||
}
|
||||
|
||||
validPairsToQuery = validPairsToQuery.TrimStart(',');
|
||||
if (!string.IsNullOrEmpty(validPairsToQuery))
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = Request.GetAbsoluteUri(Url.Action("GetRates2",
|
||||
"BitpayRate", new {storeId, currencyPairs = validPairsToQuery}));
|
||||
var resp = JArray.Parse(await _httpClientFactory.CreateClient().GetStringAsync(url));
|
||||
|
||||
for (var i = 0; i < vm.Pairs.Count; i++)
|
||||
{
|
||||
|
||||
string vmPair = vm.Pairs[i];
|
||||
if (!resp.Any(token => token["currencyPair"].Value<string>() == vmPair))
|
||||
{
|
||||
ModelState.AddModelError($"{vm.Pairs}[{i}]",
|
||||
$"You store could not resolve pair {vmPair}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(vm.Key) && vm.Enabled)
|
||||
{
|
||||
|
||||
ModelState.AddModelError(nameof(vm.Enabled),
|
||||
$"Cannot enable without a key");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(vm.Key))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (HexEncoder.IsWellFormed(vm.Key))
|
||||
{
|
||||
ECPrivKey.Create(Encoders.Hex.DecodeData(vm.Key));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
ModelState.AddModelError(nameof(vm.Enabled),
|
||||
$"Key was invalid");
|
||||
}
|
||||
}
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
||||
switch (command?.ToLowerInvariant())
|
||||
{
|
||||
case "save":
|
||||
await _FujiOracleService.SetFujiOracleForStore(storeId, vm);
|
||||
TempData["SuccessMessage"] = "FujiOracle settings modified";
|
||||
return RedirectToAction(nameof(UpdateFujiOracleSettings), new {storeId});
|
||||
|
||||
default:
|
||||
return View(vm);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("")]
|
||||
public async Task<IActionResult> GetOracleInfo(string storeId)
|
||||
{
|
||||
var oracle = await _FujiOracleService.GetFujiOracleForStore(storeId);
|
||||
if (oracle is null || !oracle.Enabled || oracle.Key is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
publicKey = new Key(Encoders.Hex.DecodeData(oracle.Key)).PubKey.ToHex(),
|
||||
availableTickers = oracle.Pairs.ToArray()
|
||||
});
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpGet("{pair}")]
|
||||
public async Task<IActionResult> GetOracleAttestation(string storeId, string pair)
|
||||
{
|
||||
var oracle = await _FujiOracleService.GetFujiOracleForStore(storeId);
|
||||
if (oracle is null || !oracle.Enabled || oracle.Key is null || !oracle.Pairs.Contains(pair))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
var url = Request.GetAbsoluteUri(Url.Action("GetRates2",
|
||||
"BitpayRate", new {storeId, currencyPairs = pair}));
|
||||
var resp = JArray.Parse(await _httpClientFactory.CreateClient().GetStringAsync(url)).First();
|
||||
var ts = DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
var rate =(long)decimal.Truncate( resp["rate"].Value<decimal>());
|
||||
var messageBytes = BitConverter.GetBytes(ts).Concat(BitConverter.GetBytes(rate)).ToArray();
|
||||
using var sha256Hash = System.Security.Cryptography.SHA256.Create();
|
||||
var messageHash = sha256Hash.ComputeHash(messageBytes);
|
||||
var key = Extensions.ParseKey(oracle.Key);
|
||||
var buf = new byte[64];
|
||||
key.SignBIP340(messageHash).WriteToSpan(buf);
|
||||
var sig = buf.ToHex();
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
timestamp = ts.ToString(),
|
||||
lastPrice = rate.ToString(),
|
||||
attestation = new {
|
||||
signature= sig,
|
||||
message= messageBytes.ToHex(),
|
||||
messageHash= messageHash.ToHex()
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static ECPrivKey ParseKey(string key)
|
||||
{
|
||||
return ECPrivKey.Create(key.DecodHexData());
|
||||
}
|
||||
|
||||
public static byte[] DecodHexData(this string encoded)
|
||||
{
|
||||
if (encoded == null)
|
||||
throw new ArgumentNullException(nameof(encoded));
|
||||
if (encoded.Length % 2 == 1)
|
||||
throw new FormatException("Invalid Hex String");
|
||||
|
||||
var result = new byte[encoded.Length / 2];
|
||||
for (int i = 0, j = 0; i < encoded.Length; i += 2, j++)
|
||||
{
|
||||
var a = IsDigit(encoded[i]);
|
||||
var b = IsDigit(encoded[i + 1]);
|
||||
if (a == -1 || b == -1)
|
||||
throw new FormatException("Invalid Hex String");
|
||||
result[j] = (byte)(((uint)a << 4) | (uint)b);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int IsDigit(this char c)
|
||||
{
|
||||
if ('0' <= c && c <= '9')
|
||||
{
|
||||
return c - '0';
|
||||
}
|
||||
else if ('a' <= c && c <= 'f')
|
||||
{
|
||||
return c - 'a' + 10;
|
||||
}
|
||||
else if ('A' <= c && c <= 'F')
|
||||
{
|
||||
return c - 'A' + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ToHex(this byte[] bytes)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
foreach (var t in bytes)
|
||||
{
|
||||
builder.Append(t.ToHex());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
private static string ToHex(this byte b)
|
||||
{
|
||||
return b.ToString("x2");
|
||||
}
|
||||
|
||||
public static string ToHex(this Span<byte> bytes)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
foreach (var t in bytes)
|
||||
{
|
||||
builder.Append(t.ToHex());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
public static string ToHex(this ECPrivKey key)
|
||||
{
|
||||
Span<byte> output = new(new byte[32]);
|
||||
key.WriteToSpan(output);
|
||||
return output.ToHex();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Abstractions.Models;
|
||||
using BTCPayServer.Abstractions.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace BTCPayServer.Plugins.FujiOracle
|
||||
{
|
||||
public class FujiOraclePlugin : BaseBTCPayServerPlugin
|
||||
{
|
||||
public override string Identifier => "BTCPayServer.Plugins.FujiOracle";
|
||||
public override string Name => "Fuji Oracle";
|
||||
|
||||
|
||||
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
|
||||
{
|
||||
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.6.0.0" }
|
||||
};
|
||||
|
||||
public override string Description =>
|
||||
"Allows you to become an oracle for the fuji.money platform";
|
||||
|
||||
public override void Execute(IServiceCollection applicationBuilder)
|
||||
{
|
||||
applicationBuilder.AddSingleton<FujiOracleService>();
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("FujiOracle/StoreIntegrationFujiOracleOption",
|
||||
"store-integrations-list"));
|
||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("FujiOracle/FujiOracleNav",
|
||||
"store-integrations-nav"));
|
||||
base.Execute(applicationBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
|
||||
namespace BTCPayServer.Plugins.FujiOracle
|
||||
{
|
||||
public class FujiOracleService
|
||||
{
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
private readonly IStoreRepository _storeRepository;
|
||||
|
||||
public FujiOracleService(IMemoryCache memoryCache, IStoreRepository storeRepository)
|
||||
{
|
||||
_memoryCache = memoryCache;
|
||||
_storeRepository = storeRepository;
|
||||
}
|
||||
|
||||
public async Task<FujiOracleSettings> GetFujiOracleForStore(string storeId)
|
||||
{
|
||||
var k = $"{nameof(FujiOracleSettings)}_{storeId}";
|
||||
return await _memoryCache.GetOrCreateAsync(k, async _ =>
|
||||
{
|
||||
var res = await _storeRepository.GetSettingAsync<FujiOracleSettings>(storeId,
|
||||
nameof(FujiOracleSettings));
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
public async Task SetFujiOracleForStore(string storeId, FujiOracleSettings FujiOracleSettings)
|
||||
{
|
||||
var k = $"{nameof(FujiOracleSettings)}_{storeId}";
|
||||
|
||||
await _storeRepository.UpdateSetting(storeId, nameof(FujiOracleSettings), FujiOracleSettings);
|
||||
_memoryCache.Set(k, FujiOracleSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BTCPayServer.Plugins.FujiOracle
|
||||
{
|
||||
public class FujiOracleSettings
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string Key { get; set; }
|
||||
public List<string> Pairs { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
dotnet publish -c Altcoins-Release -o bin/publish/BTCPayServer.Plugins.FujiOracle
|
||||
dotnet run -p ../../BTCPayServer.PluginPacker bin/publish/BTCPayServer.Plugins.FujiOracle BTCPayServer.Plugins.FujiOracle ../packed
|
||||
@@ -1,55 +0,0 @@
|
||||
@using BTCPayServer.Abstractions.Extensions
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using BTCPayServer.Abstractions.Contracts
|
||||
@model BTCPayServer.Plugins.FujiOracle.FujiOracleSettings
|
||||
@inject IScopeProvider ScopeProvider
|
||||
@{
|
||||
var storeId = ScopeProvider.GetCurrentStoreId();
|
||||
Layout = "../Shared/_NavLayout.cshtml";
|
||||
ViewData["NavPartialName"] = "../UIStores/_Nav";
|
||||
ViewData.SetActivePage("Fuji Oracle", "Update Fuji Oracle Settings", null);
|
||||
|
||||
}
|
||||
|
||||
<h2 class="mt-1 mb-4">@ViewData["Title"]</h2>
|
||||
<div class="row">
|
||||
<div class="col-xl-8 col-xxl-constrain">
|
||||
<form method="post">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="Key" class="form-label" data-required>Key to sign with (in hex)</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input asp-for="Key" class="form-control"/>
|
||||
<button class="btn btn-outline-primary" type="submit" name="command" value="generate">Generate</button>
|
||||
</div>
|
||||
|
||||
<span asp-validation-for="Key" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label asp-for="Enabled" class="form-check-label"></label>
|
||||
<input asp-for="Enabled" type="checkbox" class="form-check-input"/>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="h4 w-100 d-flex justify-content-between">
|
||||
Pairs <button type="submit" value="add-pair" name="command" class="btn btn-outline-primary btn-sm">Add</button>
|
||||
</div>
|
||||
|
||||
@for (var index = 0; index < Model.Pairs.Count; index++)
|
||||
{
|
||||
<div class="input-group">
|
||||
<input class="form-control" asp-for="Pairs[index]" type="text" placeholder="BTC_USD"/>
|
||||
|
||||
<button type="submit" value="remove-pair:@index" name="command" class="btn btn-outline-danger">Remove</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-group mt-4">
|
||||
<input type="submit" value="Save" name="command" class="btn btn-primary"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
@inject IScopeProvider ScopeProvider
|
||||
@using BTCPayServer.Abstractions.Contracts
|
||||
@using BTCPayServer.Plugins.FujiOracle
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
var storeId = ScopeProvider.GetCurrentStoreId();
|
||||
var isActive = !string.IsNullOrEmpty(storeId) && ViewContext.RouteData.Values.TryGetValue("Controller", out var controller) && controller is not null &&
|
||||
nameof(FujiOracleController).StartsWith(controller?.ToString(), StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(storeId))
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a asp-area="" asp-controller="FujiOracle" asp-action="UpdateFujiOracleSettings" asp-route-storeId="@storeId" class="nav-link js-scroll-trigger @(isActive? "active": string.Empty)">
|
||||
<svg role="img" class="icon">
|
||||
</svg>
|
||||
<span>FujiOracle</span>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
|
||||
@using BTCPayServer.Abstractions.Contracts
|
||||
@using BTCPayServer.Plugins.FujiOracle
|
||||
@inject IScopeProvider ScopeProvider
|
||||
@inject FujiOracleService FujiOracleService
|
||||
@{
|
||||
var storeId = ScopeProvider.GetCurrentStoreId();
|
||||
|
||||
FujiOracleSettings settings = null;
|
||||
if (!string.IsNullOrEmpty(storeId))
|
||||
{
|
||||
try
|
||||
{
|
||||
settings = await FujiOracleService.GetFujiOracleForStore(storeId);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(storeId))
|
||||
{
|
||||
<li class="list-group-item bg-tile ">
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
|
||||
<strong class="me-3">
|
||||
Ticket Tailor
|
||||
</strong>
|
||||
<span title="" class="d-flex me-3">
|
||||
<span class="text-secondary">Sell tickets on Ticket Tailor using BTCPay Server</span>
|
||||
</span>
|
||||
</span>
|
||||
<span class="d-flex align-items-center fw-semibold">
|
||||
@if (settings?.Enabled is true)
|
||||
{
|
||||
<span class="d-flex align-items-center text-success">
|
||||
<span class="me-2 btcpay-status btcpay-status--enabled"></span>
|
||||
Active
|
||||
</span>
|
||||
<span class="text-light ms-3 me-2">|</span>
|
||||
<a lass="btn btn-link px-1 py-1 fw-semibold" asp-controller="FujiOracle" asp-action="UpdateFujiOracleSettings" asp-route-storeId="@storeId">
|
||||
Modify
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="d-flex align-items-center text-danger">
|
||||
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
|
||||
Disabled
|
||||
</span>
|
||||
<a class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="FujiOracle" asp-action="UpdateFujiOracleSettings" asp-route-storeId="@storeId">
|
||||
Setup
|
||||
</a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@using BTCPayServer.Abstractions.Services
|
||||
|
||||
@inject Safe Safe
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@@ -1,19 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
<PropertyGroup>
|
||||
<Title>LSP</Title>
|
||||
<Description>Allows you to become an LSP selling lightning channels with inbound liquidity</Description>
|
||||
<Authors>Kukks</Authors>
|
||||
<Version>1.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin development properties -->
|
||||
<PropertyGroup>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- This will make sure that referencing BTCPayServer doesn't put any artifact in the published directory -->
|
||||
<ItemDefinitionGroup>
|
||||
<ProjectReference>
|
||||
<Properties>StaticWebAssetsEnabled=false</Properties>
|
||||
<Private>false</Private>
|
||||
<ExcludeAssets>runtime;native;build;buildTransitive;contentFiles</ExcludeAssets>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<ProjectReference Include="..\..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\..\submodules\btcpayserver\BTCPayServer\BTCPayServer.csproj" />
|
||||
<EmbeddedResource Include="Resources\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LNURL" Version="0.0.22" />
|
||||
<Folder Include="Views\Shared" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,7 +3,29 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configurations>Debug;Release;Altcoins-Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Default similar to Debug/Release -->
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Altcoins-Release' ">
|
||||
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
|
||||
<Altcoins>true</Altcoins>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Altcoins-Debug'">
|
||||
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
|
||||
<Altcoins>true</Altcoins>
|
||||
</PropertyGroup>
|
||||
<!-- -->
|
||||
|
||||
<PropertyGroup Condition="( '$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Altcoins-Debug') And '$(RazorCompileOnBuild)' != 'true' And '$(DotNetWatchBuild)' != 'true' And '$(DesignTimeBuild)' != 'true'">
|
||||
<RazorCompileOnBuild>false</RazorCompileOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Altcoins)' == 'true'">
|
||||
<DefineConstants>$(DefineConstants);ALTCOINS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!-- Plugin specific properties -->
|
||||
<PropertyGroup>
|
||||
<Title>"Liquid+</Title>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
|
||||
<AssemblyVersion>1.0.2</AssemblyVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<ProjectReference Include="..\..\BTCPayServer.Abstractions\BTCPayServer.Abstractions.csproj" />
|
||||
<EmbeddedResource Include="Resources\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="Views\TestExtension\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,2 +0,0 @@
|
||||
dotnet publish -c Altcoins-Release -o bin/publish/BTCPayServer.Plugins.RockstarStylist
|
||||
dotnet run -p ../../BTCPayServer.PluginPacker bin/publish/BTCPayServer.Plugins.RockstarStylist BTCPayServer.Plugins.RockstarStylist ../packed
|
||||
@@ -1,37 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace BTCPayServer.Plugins.RockstarStylist
|
||||
{
|
||||
public class RockstarStyleProvider
|
||||
{
|
||||
private HttpClient _githubClient;
|
||||
|
||||
public RockstarStyleProvider(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_githubClient = httpClientFactory.CreateClient();
|
||||
_githubClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("btcpayserver", "1"));
|
||||
}
|
||||
|
||||
public async Task<RockstarStyle[]> Get()
|
||||
{
|
||||
var response = JArray.Parse(await _githubClient.GetStringAsync("https://api.github.com/repos/btcpayserver/BTCPayThemes/contents"));
|
||||
return response.Where(token => token.Value<string>("type") == "dir").Select(token => new RockstarStyle()
|
||||
{
|
||||
StyleName = token.Value<string>("name"),
|
||||
CssUrl = $"https://btcpayserver.github.io/BTCPayThemes/{token.Value<string>("name")}/btcpay-checkout.custom.css",
|
||||
PreviewUrl = $"https://btcpayserver.github.io/BTCPayThemes/{token.Value<string>("name")}"
|
||||
}).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public class RockstarStyle
|
||||
{
|
||||
public string StyleName { get; set; }
|
||||
public string CssUrl { get; set; }
|
||||
public string PreviewUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Abstractions.Models;
|
||||
using BTCPayServer.Abstractions.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace BTCPayServer.Plugins.RockstarStylist
|
||||
{
|
||||
public class RockstarStylistPlugin : BaseBTCPayServerPlugin
|
||||
{
|
||||
public override string Identifier { get; } = "BTCPayServer.Plugins.RockstarStylist";
|
||||
public override string Name { get; } = "Rockstar hairstylist";
|
||||
public override string Description { get; } = "Allows your checkout to get a rockstar approved makeover";
|
||||
|
||||
public override void Execute(IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<IUIExtension>(new UIExtension("InvoiceCheckoutThemeOptions",
|
||||
"invoice-checkout-theme-options"));
|
||||
services.AddSingleton<RockstarStyleProvider>();
|
||||
}
|
||||
|
||||
|
||||
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
|
||||
{
|
||||
new IBTCPayServerPlugin.PluginDependency() { Identifier = nameof(BTCPayServer), Condition = ">=1.4.6.0" }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
@using BTCPayServer.Plugins.RockstarStylist
|
||||
@using BTCPayServer.Security
|
||||
@using NBitcoin
|
||||
@inject ContentSecurityPolicies contentSecurityPolicies
|
||||
@inject RockstarStyleProvider RockstarStyleProvider
|
||||
@{
|
||||
var nonce = RandomUtils.GetUInt256().ToString().Substring(0, 32);
|
||||
contentSecurityPolicies.Add("script-src", $"'nonce-{nonce}'");
|
||||
var themes = await RockstarStyleProvider.Get();
|
||||
}
|
||||
@foreach (var theme in themes)
|
||||
{
|
||||
<div>
|
||||
<a href="#" class="set-theme-custom" data-theme="@theme.CssUrl">@theme.StyleName</a>
|
||||
(<a href="@theme.PreviewUrl" target="_blank">Preview</a>)
|
||||
</div>
|
||||
}
|
||||
|
||||
<script type="text/javascript" nonce="@nonce">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
delegate('click', '.set-theme-custom', e => {
|
||||
const data = e.target.closest('.set-theme-custom').getAttribute('data-theme');
|
||||
document.getElementById('CustomCSS').value = data;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -1 +0,0 @@
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@@ -3,6 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Configurations>Debug;Release;Altcoins-Debug</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Plugin specific properties -->
|
||||
|
||||
Submodule submodules/walletwasabi updated: 0fb49c8b61...1b41ca9372
Reference in New Issue
Block a user