adapt to go-nostr's new methods that take just one filter (and paginator).

This commit is contained in:
fiatjaf
2025-02-13 23:09:56 -03:00
parent 95bed5d5a8
commit 17920d8aef
6 changed files with 31 additions and 90 deletions

View File

@@ -141,13 +141,11 @@ var bunker = &cli.Command{
// subscribe to relays
now := nostr.Now()
events := sys.Pool.SubMany(ctx, relayURLs, nostr.Filters{
{
Kinds: []int{nostr.KindNostrConnect},
Tags: nostr.TagMap{"p": []string{pubkey}},
Since: &now,
LimitZero: true,
},
events := sys.Pool.SubscribeMany(ctx, relayURLs, nostr.Filter{
Kinds: []int{nostr.KindNostrConnect},
Tags: nostr.TagMap{"p": []string{pubkey}},
Since: &now,
LimitZero: true,
})
signer := nip46.NewStaticKeySigner(sec)
@@ -227,4 +225,23 @@ var bunker = &cli.Command{
return nil
},
Commands: []*cli.Command{
{
Name: "connect",
Usage: "use the client-initiated NostrConnect flow of NIP46",
ArgsUsage: "<nostrconnect-uri>",
Action: func(ctx context.Context, c *cli.Command) error {
if c.Args().Len() != 1 {
return fmt.Errorf("must be called with a nostrconnect://... uri")
}
uri, err := url.Parse(c.Args().First())
if err != nil || uri.Scheme != "nostrconnect" || !nostr.IsValidPublicKey(uri.Host) {
return fmt.Errorf("invalid uri")
}
return nil
},
},
},
}