Switch supported_nips to strings

This commit is contained in:
Jon Staab
2026-02-09 14:40:37 -08:00
parent e17995d427
commit 43de47addb
6 changed files with 30 additions and 30 deletions

View File

@@ -155,14 +155,14 @@ func (rl *Relay) StartExpirationManager(
}
go rl.expirationManager.start(rl.ctx)
rl.Info.AddSupportedNIP(40)
rl.Info.AddSupportedNIP("40")
}
func (rl *Relay) DisableExpirationManager() {
rl.expirationManager.stop()
rl.expirationManager = nil
idx := slices.Index(rl.Info.SupportedNIPs, 40)
idx := slices.Index(rl.Info.SupportedNIPs, "40")
if idx != -1 {
rl.Info.SupportedNIPs[idx] = rl.Info.SupportedNIPs[len(rl.Info.SupportedNIPs)-1]
rl.Info.SupportedNIPs = rl.Info.SupportedNIPs[0 : len(rl.Info.SupportedNIPs)-1]

View File

@@ -31,7 +31,7 @@ func New(rl *khatru.Relay, repositoryDir string) *GraspServer {
},
}
rl.Info.AddSupportedNIP(34)
rl.Info.AddSupportedNIP("34")
rl.Info.SupportedGrasps = append(rl.Info.SupportedGrasps, "GRASP-01")
base := rl.Router()

View File

@@ -12,13 +12,13 @@ func (rl *Relay) HandleNIP11(w http.ResponseWriter, r *http.Request) {
info := *rl.Info
if nil != rl.DeleteEvent {
info.AddSupportedNIP(9)
info.AddSupportedNIP("9")
}
if nil != rl.Count {
info.AddSupportedNIP(45)
info.AddSupportedNIP("45")
}
if rl.Negentropy {
info.AddSupportedNIP(77)
info.AddSupportedNIP("77")
}
// resolve relative icon and banner URLs against base URL

View File

@@ -30,7 +30,7 @@ func NewRelay() *Relay {
Info: &nip11.RelayInformationDocument{
Software: "https://pkg.go.dev/fiatjaf.com/nostr/khatru",
Version: "n/a",
SupportedNIPs: []any{1, 11, 42, 70, 86},
SupportedNIPs: []string{"1", "11", "42", "70", "86"},
},
upgrader: websocket.Upgrader{