nip-07 events

add events system in window.nostr
This commit is contained in:
Pavan Joshi 2023-08-08 14:03:09 +05:30 committed by GitHub
parent 33fcb7c9bc
commit aa3ac102cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
07.md
View File

@ -20,6 +20,8 @@ Aside from these two basic above, the following functions can also be implemente
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04
window.nostr.on(eventName: "accountChanged", listener: () => void): void //subscribes to the event for the specified eventName
window.nostr.off(eventName: "accountChanged", listener: () => void): void // unsubscribes from the event for the specified eventName
```
### Implementation