update nostrlib.

This commit is contained in:
fiatjaf
2026-08-28 20:10:02 -03:00
parent cf94b8fbd3
commit c72ff66c0c
5 changed files with 14 additions and 16 deletions

View File

@@ -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"
)

View File

@@ -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)

2
go.mod
View File

@@ -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

4
go.sum
View File

@@ -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=

View File

@@ -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"
)