mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
fix nwc validation
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Product>Nostr</Product>
|
<Product>Nostr</Product>
|
||||||
<Description>NIP5 addresses, Zap support, Nostr Wallet Connect Lightning support</Description>
|
<Description>NIP5 addresses, Zap support, Nostr Wallet Connect Lightning support</Description>
|
||||||
<Version>1.1.15</Version>
|
<Version>1.1.16</Version>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- Plugin development properties -->
|
<!-- Plugin development properties -->
|
||||||
|
|||||||
@@ -28,9 +28,19 @@ public class NostrWalletConnectLightningConnectionStringHandler : ILightningConn
|
|||||||
}
|
}
|
||||||
|
|
||||||
connectionString = connectionString.Replace("type=nwc;key=", "");
|
connectionString = connectionString.Replace("type=nwc;key=", "");
|
||||||
|
if (!connectionString.StartsWith(NIP47.UriScheme, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
error = $"Invalid nostr wallet connect uri (must start with {NIP47.UriScheme})";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
|
||||||
|
{
|
||||||
|
error = "Invalid nostr wallet connect uri";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Uri.TryCreate(connectionString, UriKind.Absolute, out var uri);
|
|
||||||
var connectParams = NIP47.ParseUri(uri);
|
var connectParams = NIP47.ParseUri(uri);
|
||||||
var cts = new CancellationTokenSource();
|
var cts = new CancellationTokenSource();
|
||||||
cts.CancelAfter(TimeSpan.FromSeconds(10));
|
cts.CancelAfter(TimeSpan.FromSeconds(10));
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<ul class="pb-2">
|
<ul class="pb-2">
|
||||||
<li>
|
<li>
|
||||||
<code><b>type=</b>nwc;<b>key=</b>b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c</code>
|
<code><b>type=</b>nwc;<b>key=</b>nostr+walletconnect:b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code><b>nostr+walletconnect:</b>b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c</code>
|
<code><b>nostr+walletconnect:</b>b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c</code>
|
||||||
|
|||||||
Reference in New Issue
Block a user