mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-07-09 07:39:54 +02:00
support relays in nip05.
This commit is contained in:
@ -4,18 +4,10 @@ import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
)
|
||||
|
||||
type ProfilePointer struct {
|
||||
PublicKey string
|
||||
Relays []string
|
||||
}
|
||||
|
||||
type EventPointer struct {
|
||||
ID string
|
||||
Relays []string
|
||||
}
|
||||
|
||||
func Decode(bech32string string) (prefix string, value any, err error) {
|
||||
prefix, bits5, err := decode(bech32string)
|
||||
if err != nil {
|
||||
@ -35,7 +27,7 @@ func Decode(bech32string string) (prefix string, value any, err error) {
|
||||
|
||||
return prefix, hex.EncodeToString(data[0:32]), nil
|
||||
case "nprofile":
|
||||
var result ProfilePointer
|
||||
var result nostr.ProfilePointer
|
||||
curr := 0
|
||||
for {
|
||||
t, v := readTLVEntry(data[curr:])
|
||||
@ -60,7 +52,7 @@ func Decode(bech32string string) (prefix string, value any, err error) {
|
||||
curr = curr + 2 + len(v)
|
||||
}
|
||||
case "nevent":
|
||||
var result EventPointer
|
||||
var result nostr.EventPointer
|
||||
curr := 0
|
||||
for {
|
||||
t, v := readTLVEntry(data[curr:])
|
||||
|
Reference in New Issue
Block a user