Skip to content

Commit

Permalink
docs(rpc): fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanabaroa authored Sep 6, 2024
1 parent 8957af2 commit 9fae693
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions src/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ new Subscription(subscriptionId).on('message', console.log)
# JSON-RPC Pubsub Websocket API
- [`method: commentUpdateSubscribe, params: [cid: string]`](#commentupdate)
- [`method: subplebbitUpdateSubscribe, params: [address: string]`](#subplebbitupdate)
- [`method: commentUpdateSubscribe, params: [cid: string]`](#commentupdatesubscribe)
- [`method: subplebbitUpdateSubscribe, params: [address: string]`](#subplebbitupdatesubscribe)
- [`method: publishComment, params: [comment]`](#publishcomment)
- `method: publishVote, params: [vote]`
- `method: publishCommentEdit, params: [commentEdit]`
- `method: publishChallengeAnswers, params: [subscriptionId: number, challengeAnswers: string[]]`
- `method: startSubplebbit, params: [address: string]`
- `method: subplebbitsSubscribe, params: []`
- `method: settingsSubscribe, params: []`
- [`method: subplebbitsSubscribe, params: []`](#subplebbitssubscribe)
- [`method: settingsSubscribe, params: []`](#settingssubscribe)
- [`method: unsubscribe, params: [subscriptionId: number]`](#unsubscribe)
## commentUpdateSubscribe
Expand Down Expand Up @@ -354,35 +354,50 @@ The notification format is the same as seen in the plebbit-js [Comment Events](h
}
```
## unsubscribe
Unsubscribe from notifications
### Parameters:
## subplebbitsSubscribe
| Name | Type | Description |
| ---- | ---- | ----------- |
| subscriptionId | `number` | id of the account subscription to cancel |
Subscribe to the subplebbits list managed by the plebbit rpc to receive notifications when they change
### Result:
`<bool>` - unsubscribe success message
`<number>` - Subscription id \(needed to unsubscribe\)
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "unsubscribe",
"params": [23784]
"method": "subplebbitsSubscribe",
"params": []
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
{ "jsonrpc": "2.0", "result": 23784, "id": 1 }
```
#### Notification Format:
The notification format is the same as seen in the plebbit-js [Plebbit Events](https://github.com/plebbit/plebbit-js#plebbit-events)
`subplebbitschange` event:
```json
{
"jsonrpc": "2.0",
"method": "subplebbitsSubscribe",
"params": {
"result": [
"memes.eth",
"news.eth"
]
"event": "subplebbitschange",
"subscription": 23784
}
}
```
## settingsSubscribe
Expand Down Expand Up @@ -433,48 +448,33 @@ The notification format is the same as seen in the plebbit-js [Plebbit Events](h
}
```
## subplebbitsSubscribe
## unsubscribe
Subscribe to the subplebbits list managed by the plebbit rpc to receive notifications when they change
Unsubscribe from notifications
### Parameters:
| Name | Type | Description |
| ---- | ---- | ----------- |
| subscriptionId | `number` | id of the account subscription to cancel |
### Result:
`<number>` - Subscription id \(needed to unsubscribe\)
`<bool>` - unsubscribe success message
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "subplebbitsSubscribe",
"params": []
"method": "unsubscribe",
"params": [23784]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 23784, "id": 1 }
```
#### Notification Format:
The notification format is the same as seen in the plebbit-js [Plebbit Events](https://github.com/plebbit/plebbit-js#plebbit-events)
`subplebbitschange` event:
```json
{
"jsonrpc": "2.0",
"method": "subplebbitsSubscribe",
"params": {
"result": [
"memes.eth",
"news.eth"
]
"event": "subplebbitschange",
"subscription": 23784
}
}
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```

0 comments on commit 9fae693

Please sign in to comment.