Remove id/pubkey prefix documentation

Removed from the protocol in https://github.com/nostr-protocol/nips/pull/703
This commit is contained in:
Wilson Silva 2023-11-14 16:02:28 +07:00
parent 4f13b22e51
commit 30eafa1203
No known key found for this signature in database
GPG Key ID: 65135F94E23F82C8
3 changed files with 7 additions and 22 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed ### Changed
- Set the gem's homepage to [`https://nostr-ruby.com/`](https://nostr-ruby.com/) - Set the gem's homepage to [`https://nostr-ruby.com/`](https://nostr-ruby.com/)
- Updated the filter's documentation to reflect the removal of prefix matching
## [0.4.0] - 2023-02-25 ## [0.4.0] - 2023-02-25

View File

@ -2,7 +2,7 @@
## Filtering by id ## Filtering by id
You can filter events by their ids or prefixes: You can filter events by their ids:
```ruby ```ruby
filter = Nostr::Filter.new( filter = Nostr::Filter.new(
@ -10,10 +10,6 @@ filter = Nostr::Filter.new(
# matches events with these exact IDs # matches events with these exact IDs
'8535d5e2d7b9dc07567f676fbe70428133c9884857e1915f5b1cc6514c2fdff8', '8535d5e2d7b9dc07567f676fbe70428133c9884857e1915f5b1cc6514c2fdff8',
'461544014d87c9eaf3e76e021240007dff2c7afb356319f99c741b45749bf82f', '461544014d87c9eaf3e76e021240007dff2c7afb356319f99c741b45749bf82f',
# and match events whose id start with '76fbe'
'76fbe',
# and match events whose id start with 'b'
'b',
] ]
) )
subscription = client.subscribe(filter: filter) subscription = client.subscribe(filter: filter)
@ -21,7 +17,7 @@ subscription = client.subscribe(filter: filter)
## Filtering by author ## Filtering by author
You can filter events by their author's pubkey or prefix: You can filter events by their author's pubkey:
```ruby ```ruby
filter = Nostr::Filter.new( filter = Nostr::Filter.new(
@ -29,10 +25,6 @@ filter = Nostr::Filter.new(
# matches events whose (authors) pubkey match these exact IDs # matches events whose (authors) pubkey match these exact IDs
'b698043170d580f8ae5bad4ac80b1fdb508e957f0bbffe97f2a8915fa8b34070', 'b698043170d580f8ae5bad4ac80b1fdb508e957f0bbffe97f2a8915fa8b34070',
'51f853ff4894b062950e46ebed8c1c7015160f8173994414a96dd286f65f0f49', '51f853ff4894b062950e46ebed8c1c7015160f8173994414a96dd286f65f0f49',
# and match events whose (authors) pubkey start with 'db508e957'
'db508e957',
# and match events whose (authors) pubkey start with 'f'
'f',
] ]
) )
subscription = client.subscribe(filter: filter) subscription = client.subscribe(filter: filter)
@ -64,10 +56,6 @@ filter = Nostr::Filter.new(
# matches events that reference other events whose ids match these exact IDs # matches events that reference other events whose ids match these exact IDs
'f111593a72cc52a7f0978de5ecf29b4653d0cf539f1fa50d2168fc1dc8280e52', 'f111593a72cc52a7f0978de5ecf29b4653d0cf539f1fa50d2168fc1dc8280e52',
'f1f9b0996d4ff1bf75e79e4cc8577c89eb633e68415c7faf74cf17a07bf80bd8', 'f1f9b0996d4ff1bf75e79e4cc8577c89eb633e68415c7faf74cf17a07bf80bd8',
# and match events that reference other events whose id starts with '76fbe'
'76fbe',
# and match events that reference other events whose id starts with 'b'
'b',
] ]
) )
subscription = client.subscribe(filter: filter) subscription = client.subscribe(filter: filter)
@ -83,10 +71,6 @@ filter = Nostr::Filter.new(
# matches events that reference other pubkeys that match these exact IDs # matches events that reference other pubkeys that match these exact IDs
'b698043170d580f8ae5bad4ac80b1fdb508e957f0bbffe97f2a8915fa8b34070', 'b698043170d580f8ae5bad4ac80b1fdb508e957f0bbffe97f2a8915fa8b34070',
'51f853ff4894b062950e46ebed8c1c7015160f8173994414a96dd286f65f0f49', '51f853ff4894b062950e46ebed8c1c7015160f8173994414a96dd286f65f0f49',
# and match events that reference other pubkeys that start with 'db508e957'
'db508e957',
# and match events that reference other pubkeys that start with 'f'
'f',
] ]
) )
subscription = client.subscribe(filter: filter) subscription = client.subscribe(filter: filter)

View File

@ -3,7 +3,7 @@
module Nostr module Nostr
# A filter determines what events will be sent in a subscription. # A filter determines what events will be sent in a subscription.
class Filter class Filter
# A list of event ids or prefixes # A list of event ids
# #
# @api public # @api public
# #
@ -14,7 +14,7 @@ module Nostr
# #
attr_reader :ids attr_reader :ids
# A list of pubkeys or prefixes, the pubkey of an event must be one of these # A list of pubkeys, the pubkey of an event must be one of these
# #
# @api public # @api public
# #
@ -107,8 +107,8 @@ module Nostr
# ) # )
# #
# @param kwargs [Hash] # @param kwargs [Hash]
# @option kwargs [Array<String>, nil] ids A list of event ids or prefixes # @option kwargs [Array<String>, nil] ids A list of event ids
# @option kwargs [Array<String>, nil] authors A list of pubkeys or prefixes, the pubkey of an event must be one # @option kwargs [Array<String>, nil] authors A list of pubkeys, the pubkey of an event must be one
# of these # of these
# @option kwargs [Array<Integer>, nil] kinds A list of a kind numbers # @option kwargs [Array<Integer>, nil] kinds A list of a kind numbers
# @option kwargs [Array<String>, nil] e A list of event ids that are referenced in an "e" tag # @option kwargs [Array<String>, nil] e A list of event ids that are referenced in an "e" tag