mirror of
https://github.com/nostr-protocol/nips.git
synced 2026-10-05 18:58:44 +00:00
Reformat and describe nip 86 methods (#2481)
This commit is contained in:
@@ -28,93 +28,208 @@ Then it should return a response in the format
|
|||||||
|
|
||||||
This is the list of **methods** that may be supported:
|
This is the list of **methods** that may be supported:
|
||||||
|
|
||||||
* `supportedmethods`:
|
### `supportedmethods`
|
||||||
- params: `[]`
|
|
||||||
- result: `["<method-name>", "<method-name>", ...]` (an array with the names of all the other supported methods)
|
Lists the methods supported by the relay. May be customized to match permissions assigned to the authenticated user.
|
||||||
* `banpubkey`:
|
|
||||||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
- params: `[]`
|
||||||
- result: `true` (a boolean always set to `true`)
|
- result: `["<method-name>", "<method-name>", ...]` (an array with the names of all the other supported methods)
|
||||||
* `unbanpubkey`:
|
|
||||||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
### `banpubkey`
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `listbannedpubkeys`:
|
Bans a pubkey from the relay. Should automatically remove the pubkey from the allow list.
|
||||||
- params: `[]`
|
|
||||||
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
||||||
* `allowpubkey`:
|
- result: `true` (a boolean always set to `true`)
|
||||||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
|
||||||
- result: `true` (a boolean always set to `true`)
|
### `unbanpubkey`
|
||||||
* `unallowpubkey`:
|
|
||||||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
Removes a pubkey from the relay's ban list. Should not automatically add the pubkey to the allow list.
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `listallowedpubkeys`:
|
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
||||||
- params: `[]`
|
- result: `true` (a boolean always set to `true`)
|
||||||
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
|
||||||
* `createrole`:
|
### `listbannedpubkeys`
|
||||||
- params: `[id, label, description, color, order]`
|
|
||||||
- result: `true` (boolean true)
|
Lists pubkeys banned from the relay.
|
||||||
* `editrole`:
|
|
||||||
- params: `[id, label, description, color, order]`
|
- params: `[]`
|
||||||
- result: `true` (boolean true)
|
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
||||||
* `deleterole`:
|
|
||||||
- params: `[id]`
|
### `allowpubkey`
|
||||||
- result: `true` (boolean true)
|
|
||||||
* `assignrole`:
|
Adds a pubkey to the relay's allow list. Should automatically remove the pubkey from the ban list.
|
||||||
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
|
||||||
- result: `true` (a boolean always set to `true`)
|
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
||||||
* `unassignrole`:
|
- result: `true` (a boolean always set to `true`)
|
||||||
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
|
||||||
- result: `true` (a boolean always set to `true`)
|
### `unallowpubkey`
|
||||||
* `listeventsneedingmoderation`:
|
|
||||||
- params: `[]`
|
Removes a pubkey from the relay's allow list. Should not automatically add the pubkey to the ban list.
|
||||||
- result: `[{"id": "<32-byte-hex>", "reason": "<optional-reason>"}]`, an array of objects
|
|
||||||
* `allowevent`:
|
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]`
|
||||||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]`
|
- result: `true` (a boolean always set to `true`)
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `unallowevent`:
|
### `listallowedpubkeys`
|
||||||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]`
|
|
||||||
- result: `true` (a boolean always set to `true`)
|
Lists pubkeys on the relay's allow list.
|
||||||
* `banevent`:
|
|
||||||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]`
|
- params: `[]`
|
||||||
- result: `true` (a boolean always set to `true`)
|
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
||||||
* `unbanevent`:
|
|
||||||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]`
|
### `createrole`
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `listbannedevents`:
|
Creates a new role.
|
||||||
- params: `[]`
|
|
||||||
- result: `[{"id": "<32-byte hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
- params: `[id, label, description, color, order]`
|
||||||
* `listallowedevents`:
|
- result: `true` (boolean true)
|
||||||
- params: `[]`
|
|
||||||
- result: `[{"id": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
### `editrole`
|
||||||
* `changerelayname`:
|
|
||||||
- params: `["<new-name>"]`
|
Updates an existing role.
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `changerelaydescription`:
|
- params: `[id, label, description, color, order]`
|
||||||
- params: `["<new-description>"]`
|
- result: `true` (boolean true)
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `changerelayicon`:
|
### `deleterole`
|
||||||
- params: `["<new-icon-url>"]`
|
|
||||||
- result: `true` (a boolean always set to `true`)
|
Deletes a role.
|
||||||
* `allowkind`:
|
|
||||||
- params: `[<kind-number>]`
|
- params: `[id]`
|
||||||
- result: `true` (a boolean always set to `true`)
|
- result: `true` (boolean true)
|
||||||
* `disallowkind`:
|
|
||||||
- params: `[<kind-number>]`
|
### `assignrole`
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `listallowedkinds`:
|
Assigns a role to a pubkey.
|
||||||
- params: `[]`
|
|
||||||
- result: `[<kind-number>, ...]`, an array of numbers
|
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
||||||
* `listdisallowedkinds`:
|
- result: `true` (a boolean always set to `true`)
|
||||||
- params: `[]`
|
|
||||||
- result: `[<kind-number>, ...]`, an array of numbers
|
### `unassignrole`
|
||||||
* `blockip`:
|
|
||||||
- params: `["<ip-address>", "<optional-reason>"]`
|
Removes a role from a pubkey.
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `unblockip`:
|
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
||||||
- params: `["<ip-address>"]`
|
- result: `true` (a boolean always set to `true`)
|
||||||
- result: `true` (a boolean always set to `true`)
|
|
||||||
* `listblockedips`:
|
### `listeventsneedingmoderation`
|
||||||
- params: `[]`
|
|
||||||
- result: `[{"ip": "<ip-address>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
Lists events awaiting moderation.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[{"id": "<32-byte-hex>", "reason": "<optional-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>", "<optional-reason>"]`
|
||||||
|
- 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>", "<optional-reason>"]`
|
||||||
|
- 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>", "<optional-reason>"]`
|
||||||
|
- 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>", "<optional-reason>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `listbannedevents`
|
||||||
|
|
||||||
|
Lists events banned from the relay.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[{"id": "<32-byte hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
||||||
|
|
||||||
|
### `listallowedevents`
|
||||||
|
|
||||||
|
Lists events on the relay's allow list.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[{"id": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
||||||
|
|
||||||
|
### `changerelayname`
|
||||||
|
|
||||||
|
Changes the relay's name.
|
||||||
|
|
||||||
|
- params: `["<new-name>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `changerelaydescription`
|
||||||
|
|
||||||
|
Changes the relay's description.
|
||||||
|
|
||||||
|
- params: `["<new-description>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `changerelayicon`
|
||||||
|
|
||||||
|
Changes the relay's icon.
|
||||||
|
|
||||||
|
- params: `["<new-icon-url>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `allowkind`
|
||||||
|
|
||||||
|
Adds an event kind to the relay's allow list.
|
||||||
|
|
||||||
|
- params: `[<kind-number>]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `disallowkind`
|
||||||
|
|
||||||
|
Disallows an event kind.
|
||||||
|
|
||||||
|
- params: `[<kind-number>]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `listallowedkinds`
|
||||||
|
|
||||||
|
Lists event kinds on the relay's allow list.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[<kind-number>, ...]`, an array of numbers
|
||||||
|
|
||||||
|
### `listdisallowedkinds`
|
||||||
|
|
||||||
|
Lists event kinds the relay disallows.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[<kind-number>, ...]`, an array of numbers
|
||||||
|
|
||||||
|
### `blockip`
|
||||||
|
|
||||||
|
Adds an IP address to the relay's block list.
|
||||||
|
|
||||||
|
- params: `["<ip-address>", "<optional-reason>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `unblockip`
|
||||||
|
|
||||||
|
Removes an IP address from the relay's block list.
|
||||||
|
|
||||||
|
- params: `["<ip-address>"]`
|
||||||
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `listblockedips`
|
||||||
|
|
||||||
|
Lists IP addresses blocked by the relay.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[{"ip": "<ip-address>", "reason": "<optional-reason>"}, ...]`, an array of objects
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user