more conversions.

This commit is contained in:
fiatjaf
2025-04-15 00:00:03 -03:00
parent f9e4a5efa3
commit 376834cbf9
117 changed files with 450 additions and 1019 deletions
+8 -7
View File
@@ -4,22 +4,23 @@ import (
"context"
"fmt"
"fiatjaf.com/nostrlib/nip05"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip05"
)
func queryWellKnownNostrJson(ctx context.Context, fullname string) (pubkey string, relays []string, err error) {
func queryWellKnownNostrJson(ctx context.Context, fullname string) (pubkey nostr.PubKey, relays []string, err error) {
result, name, err := nip05.Fetch(ctx, fullname)
if err != nil {
return "", nil, err
return nostr.ZeroPK, nil, err
}
pubkey, ok := result.Names[name]
pubkeyh, ok := result.Names[name]
if !ok {
return "", nil, fmt.Errorf("no entry found for the '%s' name", name)
return nostr.ZeroPK, nil, fmt.Errorf("no entry found for the '%s' name", name)
}
relays, _ = result.NIP46[pubkey]
relays, _ = result.NIP46[pubkeyh]
if !ok {
return "", nil, fmt.Errorf("no bunker relays found for the '%s' name", name)
return nostr.ZeroPK, nil, fmt.Errorf("no bunker relays found for the '%s' name", name)
}
return pubkey, relays, nil