diff options
| author | Zack Wynne <zack.wynne33@gmail.com> | 2023-01-27 03:11:27 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 08:11:27 -0300 |
| commit | 95fa5a4a5f15b54a0e98edccf480ca5b03896f99 (patch) | |
| tree | afcd69374b8ca63a25d41097ff7064b50f5232ac /26.md | |
| parent | 5901fe0b87f8d7ec56bf91a065111f0c3d3b0405 (diff) | |
NIP-26: adding section documenting valid fields and operators for conditions string (#194)
Diffstat (limited to '26.md')
| -rw-r--r-- | 26.md | 20 |
1 files changed, 20 insertions, 0 deletions
| @@ -31,6 +31,26 @@ The **delegation token** should be a 64-byte Schnorr signature of the sha256 has | |||
| 31 | nostr:delegation:<pubkey of publisher (delegatee)>:<conditions query string> | 31 | nostr:delegation:<pubkey of publisher (delegatee)>:<conditions query string> |
| 32 | ``` | 32 | ``` |
| 33 | 33 | ||
| 34 | ##### Conditions Query String | ||
| 35 | |||
| 36 | The following fields and operators are supported in the above query string: | ||
| 37 | |||
| 38 | *Fields*: | ||
| 39 | 1. `kind` | ||
| 40 | - *Operators*: | ||
| 41 | - `=${KIND_NUMBER}` - delegator may only sign events of this kind | ||
| 42 | 2. `created_at` | ||
| 43 | - *Operators*: | ||
| 44 | - `<${TIMESTAMP}` - delegator may only sign events created ***before*** the specified timestamp | ||
| 45 | - `>${TIMESTAMP}` - delegator may only sign events created ***after*** the specified timestamp | ||
| 46 | |||
| 47 | In order to create a single condition, you must use a supported field and operator. Multiple conditions can be used in a single query string, including on the same field. Conditions must be combined with `&`. | ||
| 48 | |||
| 49 | For example, the following condition strings are valid: | ||
| 50 | |||
| 51 | - `kind=1&created_at<1675721813` | ||
| 52 | - `kind=0&kind=1&created_at>1675721813` | ||
| 53 | - `kind=1&created_at>1674777689&created_at<1675721813` | ||
| 34 | 54 | ||
| 35 | #### Example | 55 | #### Example |
| 36 | 56 | ||