Relay managment

This commit is contained in:
2023-01-09 12:40:10 +00:00
parent 276a4cbcd1
commit fd7e00c8d4
10 changed files with 201 additions and 12 deletions

View File

@ -89,6 +89,16 @@ export default function useEventPublisher() {
ev.Tags.push(new Tag(["p", evRef.PubKey], 1));
return await signEvent(ev);
},
saveRelays: async () => {
let ev = Event.ForPubKey(pubKey);
ev.Kind = EventKind.ContactList;
ev.Content = JSON.stringify(relays);
for (let pk of follows) {
ev.Tags.push(new Tag(["p", pk]));
}
return await signEvent(ev);
},
addFollow: async (pkAdd) => {
let ev = Event.ForPubKey(pubKey);
ev.Kind = EventKind.ContactList;