Make sideshift extend prism in a better way

This commit is contained in:
Kukks
2023-07-18 11:23:06 +02:00
parent 8bab2d7660
commit ae50cba71e
10 changed files with 160 additions and 113 deletions

View File

@@ -0,0 +1,17 @@
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Contracts;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Plugins.SideShift;
public class PrismDestinationValidate : IPluginHookFilter
{
public string Hook => "prism-destination-validate";
public async Task<object> Execute(object args)
{
if (args is not string args1 || !args1.StartsWith("sideshift:")) return args;
var json = JObject.Parse(args1.Substring("sideshift:".Length)).ToObject<PrismSideshiftDestination>();
return json.Valid();
}
}