From 182a13e3be61e0e11edd1ecd5f1fa176e0aadab8 Mon Sep 17 00:00:00 2001 From: hodlbod Date: Wed, 23 Sep 2026 11:21:17 -0700 Subject: [PATCH] Reformat and describe nip 86 methods (#2481) --- 86.md | 289 ++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 202 insertions(+), 87 deletions(-) diff --git a/86.md b/86.md index 48af8e5a..460c58fe 100644 --- a/86.md +++ b/86.md @@ -28,93 +28,208 @@ Then it should return a response in the format This is the list of **methods** that may be supported: -* `supportedmethods`: - - params: `[]` - - result: `["", "", ...]` (an array with the names of all the other supported methods) -* `banpubkey`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `unbanpubkey`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `listbannedpubkeys`: - - params: `[]` - - result: `[{"pubkey": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects -* `allowpubkey`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `unallowpubkey`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `listallowedpubkeys`: - - params: `[]` - - result: `[{"pubkey": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects -* `createrole`: - - params: `[id, label, description, color, order]` - - result: `true` (boolean true) -* `editrole`: - - params: `[id, label, description, color, order]` - - result: `true` (boolean true) -* `deleterole`: - - params: `[id]` - - result: `true` (boolean true) -* `assignrole`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `unassignrole`: - - params: `["<32-byte-hex-public-key>", ""]` - - result: `true` (a boolean always set to `true`) -* `listeventsneedingmoderation`: - - params: `[]` - - result: `[{"id": "<32-byte-hex>", "reason": ""}]`, an array of objects -* `allowevent`: - - params: `["<32-byte-hex-event-id>", ""]` - - result: `true` (a boolean always set to `true`) -* `unallowevent`: - - params: `["<32-byte-hex-event-id>", ""]` - - result: `true` (a boolean always set to `true`) -* `banevent`: - - params: `["<32-byte-hex-event-id>", ""]` - - result: `true` (a boolean always set to `true`) -* `unbanevent`: - - params: `["<32-byte-hex-event-id>", ""]` - - result: `true` (a boolean always set to `true`) -* `listbannedevents`: - - params: `[]` - - result: `[{"id": "<32-byte hex>", "reason": ""}, ...]`, an array of objects -* `listallowedevents`: - - params: `[]` - - result: `[{"id": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects -* `changerelayname`: - - params: `[""]` - - result: `true` (a boolean always set to `true`) -* `changerelaydescription`: - - params: `[""]` - - result: `true` (a boolean always set to `true`) -* `changerelayicon`: - - params: `[""]` - - result: `true` (a boolean always set to `true`) -* `allowkind`: - - params: `[]` - - result: `true` (a boolean always set to `true`) -* `disallowkind`: - - params: `[]` - - result: `true` (a boolean always set to `true`) -* `listallowedkinds`: - - params: `[]` - - result: `[, ...]`, an array of numbers -* `listdisallowedkinds`: - - params: `[]` - - result: `[, ...]`, an array of numbers -* `blockip`: - - params: `["", ""]` - - result: `true` (a boolean always set to `true`) -* `unblockip`: - - params: `[""]` - - result: `true` (a boolean always set to `true`) -* `listblockedips`: - - params: `[]` - - result: `[{"ip": "", "reason": ""}, ...]`, an array of objects +### `supportedmethods` + +Lists the methods supported by the relay. May be customized to match permissions assigned to the authenticated user. + +- params: `[]` +- result: `["", "", ...]` (an array with the names of all the other supported methods) + +### `banpubkey` + +Bans a pubkey from the relay. Should automatically remove the pubkey from the allow list. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `unbanpubkey` + +Removes a pubkey from the relay's ban list. Should not automatically add the pubkey to the allow list. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `listbannedpubkeys` + +Lists pubkeys banned from the relay. + +- params: `[]` +- result: `[{"pubkey": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects + +### `allowpubkey` + +Adds a pubkey to the relay's allow list. Should automatically remove the pubkey from the ban list. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `unallowpubkey` + +Removes a pubkey from the relay's allow list. Should not automatically add the pubkey to the ban list. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `listallowedpubkeys` + +Lists pubkeys on the relay's allow list. + +- params: `[]` +- result: `[{"pubkey": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects + +### `createrole` + +Creates a new role. + +- params: `[id, label, description, color, order]` +- result: `true` (boolean true) + +### `editrole` + +Updates an existing role. + +- params: `[id, label, description, color, order]` +- result: `true` (boolean true) + +### `deleterole` + +Deletes a role. + +- params: `[id]` +- result: `true` (boolean true) + +### `assignrole` + +Assigns a role to a pubkey. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `unassignrole` + +Removes a role from a pubkey. + +- params: `["<32-byte-hex-public-key>", ""]` +- result: `true` (a boolean always set to `true`) + +### `listeventsneedingmoderation` + +Lists events awaiting moderation. + +- params: `[]` +- result: `[{"id": "<32-byte-hex>", "reason": ""}]`, an array of objects + +### `allowevent` + +Adds an event to the relay's allow list. Should automatically remove the event from the ban list. + +- params: `["<32-byte-hex-event-id>", ""]` +- result: `true` (a boolean always set to `true`) + +### `unallowevent` + +Removes an event from the relay's allow list. Should not automatically add the event to the ban list. + +- params: `["<32-byte-hex-event-id>", ""]` +- result: `true` (a boolean always set to `true`) + +### `banevent` + +Bans an event from the relay. Should automatically remove the event from the allow list. + +- params: `["<32-byte-hex-event-id>", ""]` +- result: `true` (a boolean always set to `true`) + +### `unbanevent` + +Removes an event from the relay's ban list. Should not automatically add the event to the allow list. + +- params: `["<32-byte-hex-event-id>", ""]` +- result: `true` (a boolean always set to `true`) + +### `listbannedevents` + +Lists events banned from the relay. + +- params: `[]` +- result: `[{"id": "<32-byte hex>", "reason": ""}, ...]`, an array of objects + +### `listallowedevents` + +Lists events on the relay's allow list. + +- params: `[]` +- result: `[{"id": "<32-byte-hex>", "reason": ""}, ...]`, an array of objects + +### `changerelayname` + +Changes the relay's name. + +- params: `[""]` +- result: `true` (a boolean always set to `true`) + +### `changerelaydescription` + +Changes the relay's description. + +- params: `[""]` +- result: `true` (a boolean always set to `true`) + +### `changerelayicon` + +Changes the relay's icon. + +- params: `[""]` +- result: `true` (a boolean always set to `true`) + +### `allowkind` + +Adds an event kind to the relay's allow list. + +- params: `[]` +- result: `true` (a boolean always set to `true`) + +### `disallowkind` + +Disallows an event kind. + +- params: `[]` +- result: `true` (a boolean always set to `true`) + +### `listallowedkinds` + +Lists event kinds on the relay's allow list. + +- params: `[]` +- result: `[, ...]`, an array of numbers + +### `listdisallowedkinds` + +Lists event kinds the relay disallows. + +- params: `[]` +- result: `[, ...]`, an array of numbers + +### `blockip` + +Adds an IP address to the relay's block list. + +- params: `["", ""]` +- result: `true` (a boolean always set to `true`) + +### `unblockip` + +Removes an IP address from the relay's block list. + +- params: `[""]` +- result: `true` (a boolean always set to `true`) + +### `listblockedips` + +Lists IP addresses blocked by the relay. + +- params: `[]` +- result: `[{"ip": "", "reason": ""}, ...]`, an array of objects ### Authorization