more conversions.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user