Skip to content

Commit cf248d9

Browse files
authored
feat: batch minting models and api (#31)
* feat: batch minting models and api * feat: Batch Minting info * chore: cleanup MintInfo * chore: csharpier format * fix
1 parent df39a19 commit cf248d9

15 files changed

Lines changed: 324 additions & 162 deletions

DotNut.Nostr/NostrNip17PaymentRequestInterfaceHandler.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ public static void Register()
1818
public bool CanHandle(PaymentRequest request)
1919
{
2020
return request.Transports.Any(t =>
21-
t.Type == "nostr" &&
22-
t.Tags?.Any(tag => tag.Key == "n" && tag.Value.Any(v => v == "17")) == true);
21+
t.Type == "nostr"
22+
&& t.Tags?.Any(tag => tag.Key == "n" && tag.Value.Any(v => v == "17")) == true
23+
);
2324
}
2425

2526
public async Task SendPayment(
@@ -29,15 +30,18 @@ public async Task SendPayment(
2930
)
3031
{
3132
var nostrTransport = request.Transports.FirstOrDefault(t =>
32-
t.Type == "nostr" &&
33-
t.Tags?.Any(tag => tag.Key == "n" && tag.Value.Any(v => v == "17")) == true);
33+
t.Type == "nostr"
34+
&& t.Tags?.Any(tag => tag.Key == "n" && tag.Value.Any(v => v == "17")) == true
35+
);
3436
if (nostrTransport is null)
3537
{
3638
throw new InvalidOperationException("No NIP17 nostr transport found.");
3739
}
3840
var nprofileStr = nostrTransport.Target;
3941
var nprofile = (NIP19.NosteProfileNote)NIP19.FromNIP19Note(nprofileStr);
40-
using var client = new CompositeNostrClient(nprofile.Relays.Select(r => new Uri(r)).ToArray());
42+
using var client = new CompositeNostrClient(
43+
nprofile.Relays.Select(r => new Uri(r)).ToArray()
44+
);
4145
await client.Connect(cancellationToken);
4246
var ephemeralKey = ECPrivKey.Create(RandomNumberGenerator.GetBytes(32));
4347
var msg = new NostrEvent()

DotNut.Tests/Integration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public async Task SubscribeToMintMeltQuoteUpdates()
345345
gotPaid = true;
346346
await sub.CloseAsync();
347347
}
348-
348+
349349
break;
350350

351351
case WsMessage.Error error:
@@ -511,7 +511,6 @@ await Assert.ThrowsAsync<CashuProtocolException>(async () =>
511511
await wallet.Swap().FromInputs(proofs).ProcessAsync()
512512
);
513513

514-
515514
var swappedProofs = await wallet
516515
.Swap()
517516
.FromInputs(proofs)

0 commit comments

Comments
 (0)