From c72ff66c0c0d39cdfdf8fa0417fef5cf7b22af46 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 28 Aug 2026 20:10:02 -0300 Subject: [PATCH] update nostrlib. --- blossom.go | 2 +- fetch.go | 20 +++++++++----------- go.mod | 2 +- go.sum | 4 ++-- nsite.go | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/blossom.go b/blossom.go index d6b8a6c..53d8374 100644 --- a/blossom.go +++ b/blossom.go @@ -10,7 +10,7 @@ import ( "unsafe" "fiatjaf.com/nostr/keyer" - "fiatjaf.com/nostr/nipb0/blossom" + "fiatjaf.com/nostr/nipb7/blossom" "github.com/urfave/cli/v3" ) diff --git a/fetch.go b/fetch.go index 1750b96..e29c276 100644 --- a/fetch.go +++ b/fetch.go @@ -43,7 +43,7 @@ var fetch = &cli.Command{ } for code := range getStdinLinesOrArguments(c.Args()) { - filter := nostr.Filter{} + var filter nostr.Filter var authorHint nostr.PubKey relays := c.StringSlice("relay") authoritativeFilter := false @@ -75,7 +75,7 @@ var fetch = &cli.Command{ } authorHint = pp.PublicKey relays = append(relays, pp.Relays...) - filter.Authors = append(filter.Authors, pp.PublicKey) + filter = pp.AsFilter() } else { prefix, value, err := nip19.Decode(code) if err != nil { @@ -88,30 +88,28 @@ var fetch = &cli.Command{ } switch prefix { - case "nevent": + case "nevent", "note": v := value.(nostr.EventPointer) - filter.IDs = append(filter.IDs, v.ID) + filter = v.AsFilter() if v.Author != nostr.ZeroPK { authorHint = v.Author } relays = append(relays, v.Relays...) - case "note": - filter.IDs = append(filter.IDs, value.(nostr.EventPointer).ID) case "naddr": v := value.(nostr.EntityPointer) - filter.Kinds = []nostr.Kind{v.Kind} - filter.Tags = nostr.TagMap{"d": []string{v.Identifier}} - filter.Authors = append(filter.Authors, v.PublicKey) + filter = v.AsFilter() authorHint = v.PublicKey relays = append(relays, v.Relays...) case "nprofile": v := value.(nostr.ProfilePointer) - filter.Authors = append(filter.Authors, v.PublicKey) + filter = v.AsFilter() authorHint = v.PublicKey relays = append(relays, v.Relays...) case "npub": v := value.(nostr.PubKey) - filter.Authors = append(filter.Authors, v) + filter = nostr.Filter{ + Authors: []nostr.PubKey{v}, + } authorHint = v default: return fmt.Errorf("unexpected prefix %s", prefix) diff --git a/go.mod b/go.mod index 01e0d4e..455021f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/fiatjaf/nak go 1.25 require ( - fiatjaf.com/nostr v0.0.0-20260817145252-a362ffffb6a8 + fiatjaf.com/nostr v0.0.0-20260827104008-28e324b57f7e github.com/AlecAivazis/survey/v2 v2.3.7 github.com/bep/debounce v1.2.1 github.com/btcsuite/btcd/btcec/v2 v2.3.6 diff --git a/go.sum b/go.sum index 0738182..b355a97 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ fiatjaf.com/lib v0.3.7 h1:mXZOn7NrUcjSdy4oNvwQyAmes7Ueb+Zr5hjqMIe2dxI= fiatjaf.com/lib v0.3.7/go.mod h1:UlHaZvPHj25PtKLh9GjZkUHRmQ2xZ8Jkoa4VRaLeeQ8= -fiatjaf.com/nostr v0.0.0-20260817145252-a362ffffb6a8 h1:Tn8o48TpGeYB5sHMJG0lCDK2w5/Gs2bGpbyR9fkLQ30= -fiatjaf.com/nostr v0.0.0-20260817145252-a362ffffb6a8/go.mod h1:b1EIUDnd133Ie8Pg8O/biaKdFyCMz28aD4n64g1GqvM= +fiatjaf.com/nostr v0.0.0-20260827104008-28e324b57f7e h1:BuWR1BP/CBzM+ZbLoUKuV6KlktlDZEyD9N/pdxqJJyE= +fiatjaf.com/nostr v0.0.0-20260827104008-28e324b57f7e/go.mod h1:b1EIUDnd133Ie8Pg8O/biaKdFyCMz28aD4n64g1GqvM= github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/FastFilter/xorfilter v0.2.1 h1:lbdeLG9BdpquK64ZsleBS8B4xO/QW1IM0gMzF7KaBKc= diff --git a/nsite.go b/nsite.go index de44b23..b6e19df 100644 --- a/nsite.go +++ b/nsite.go @@ -13,7 +13,7 @@ import ( "fiatjaf.com/nostr/keyer" "fiatjaf.com/nostr/nip19" "fiatjaf.com/nostr/nip5a" - "fiatjaf.com/nostr/nipb0/blossom" + "fiatjaf.com/nostr/nipb7/blossom" "github.com/fatih/color" "github.com/urfave/cli/v3" )