From 4b79bc67c471f77061d62704538e5fdd6ac28ae8 Mon Sep 17 00:00:00 2001 From: "Nostr.Band" <124499563+nostrband@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:01:37 +0100 Subject: [PATCH] Add optional_requested_permissions This is implemented in nsec.app, nostr.band, Coracle and Nostrudel, so maybe it's time to update the NIP. --- 46.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/46.md b/46.md index eb964942..8ba65d96 100644 --- a/46.md +++ b/46.md @@ -120,7 +120,7 @@ Each of the following are methods that the client sends to the remote signer. | Command | Params | Result | | ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- | -| `connect` | `[, ]` | "ack" | +| `connect` | `[, , ]` | "ack" | | `sign_event` | `[]` | `json_stringified()` | | `ping` | `[]` | "pong" | | `get_relays` | `[]` | `json_stringified({: {read: , write: }})` | @@ -130,6 +130,10 @@ Each of the following are methods that the client sends to the remote signer. | `nip44_encrypt` | `[, ]` | `` | | `nip44_decrypt` | `[, ]` | `` | +### Requested permissions + +The `connect` method may be provided with `optional_requested_permissions` for user convenience. The permissions are a comma-separated list of `method[:params]`, i.e. `nip04_encrypt,sign_event:4` meaning permissions to call `nip04_encrypt` and to call `sign_event` with `kind:4`. Optional parameter for `sign_event` is the kind number, parameters for other methods are to be defined later. + ## Response Events `kind:24133` ```json @@ -185,7 +189,7 @@ Each of the following are methods that the client sends to the remote signer. | Command | Params | Result | | ---------------- | ------------------------------------------ | ------------------------------------ | -| `create_account` | `[<username>, <domain>, <optional_email>]` | `<newly_created_remote_user_pubkey>` | +| `create_account` | `[<username>, <domain>, <optional_email>, <optional_requested_permissions>]` | `<newly_created_remote_user_pubkey>` | ## Appendix