diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2022-12-18 06:35:30 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2022-12-18 06:35:30 -0300 |
| commit | 745297e8c4cbb742f9252cfdd654844d1cad4040 (patch) | |
| tree | 6413b94e69247bd539ead4d39ef12add19a7e095 | |
| parent | c840d75ce023f64918f57a519417e39f57f0f53b (diff) | |
add blockcore to nip-07 and mark extra methods as optional.
| -rw-r--r-- | 07.md | 11 |
1 files changed, 8 insertions, 3 deletions
| @@ -13,12 +13,17 @@ 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 | 16 | ``` |
| 17 | async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext+iv as specified in nip-04 | 17 | |
| 18 | async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext+iv as specified in nip-04 | 18 | Aside from these two basic above, the following functions can also be implemented optionally: |
| 19 | ``` | ||
| 20 | async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies | ||
| 21 | async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 | ||
| 22 | async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 | ||
| 19 | ``` | 23 | ``` |
| 20 | 24 | ||
| 21 | ### Implementation | 25 | ### Implementation |
| 22 | 26 | ||
| 23 | - [nos2x](https://github.com/fiatjaf/nos2x) is available as a Chromium extension that provides such capabilities. | 27 | - [nos2x](https://github.com/fiatjaf/nos2x) is available as a Chromium extension that provides such capabilities. |
| 24 | - [Alby](https://getalby.com) is a Bitcoin extension that also provides a compatible `window.nostr`. | 28 | - [Alby](https://getalby.com) is a Bitcoin extension that also provides a compatible `window.nostr`. |
| 29 | - [Blockcore](https://www.blockcore.net/wallet) | ||