diff options
| author | alex <alex@cloudware.io> | 2022-12-17 21:43:17 +0100 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2022-12-18 06:29:29 -0300 |
| commit | c840d75ce023f64918f57a519417e39f57f0f53b (patch) | |
| tree | 64b72281273a61e367a524f8be4336b289f9da9a | |
| parent | da6a7d0ee3dd492c87132caa7e4b005cd58b73b1 (diff) | |
nip-07: add the missing functions
as per conversation in t.me/nostr_protcol
getRelays, nip04.encrypt and nip04.decrypt - these are already implemented
by nos2x and getalby.
| -rw-r--r-- | 07.md | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -13,6 +13,9 @@ That object must define the following methods: | |||
| 13 | ``` | 13 | ``` |
| 14 | async window.nostr.getPublicKey(): string // returns a public key as hex | 14 | async window.nostr.getPublicKey(): string // returns a public key as hex |
| 15 | async window.nostr.signEvent(event: Event): Event // takes an event object and returns it with the `sig` | 15 | async window.nostr.signEvent(event: Event): Event // takes an event object and returns it with the `sig` |
| 16 | async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a map of relay urls to relay policies | ||
| 17 | async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext+iv as specified in nip-04 | ||
| 18 | async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext+iv as specified in nip-04 | ||
| 16 | ``` | 19 | ``` |
| 17 | 20 | ||
| 18 | ### Implementation | 21 | ### Implementation |