Skip to content

Commit

Permalink
Update the documentation of the subscription id
Browse files Browse the repository at this point in the history
Match the changes introduced in  nostr-protocol/nips#299
  • Loading branch information
wilsonsilva committed Nov 14, 2023
1 parent 30eafa1 commit be4c3e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- 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
- Updated the subscription's id documentation to reflect the changes in the protocol definition

## [0.4.0] - 2023-02-25

Expand Down
3 changes: 2 additions & 1 deletion lib/nostr/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def connect(relay)
# @example Subscribing to all events created after a certain time
# subscription = client.subscribe(filter: Nostr::Filter.new(since: 1230981305))
#
# @param subscription_id [String] The subscription id. A random string.
# @param subscription_id [String] The subscription id. An arbitrary, non-empty string of max length 64
# chars used to represent a subscription.
# @param filter [Filter] A set of attributes that represent the events that the client is interested in.
#
# @return [Subscription] The subscription object
Expand Down
4 changes: 2 additions & 2 deletions lib/nostr/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Nostr
# A subscription the result of a request to receive events from a relay
class Subscription
# A random string that should be used to represent a subscription
# An arbitrary, non-empty string of max length 64 chars used to represent a subscription
#
# @api public
#
Expand Down Expand Up @@ -41,7 +41,7 @@ class Subscription
# @example Subscribing to all events created after a certain time
# subscription = Nostr::Subscription.new(filter: Nostr::Filter.new(since: 1230981305))
#
# @param id [String] A random string that should be used to represent a subscription
# @param id [String] An arbitrary, non-empty string of max length 64 chars used to represent a subscription
# @param filter [Filter] An object that determines what events will be sent in that subscription
#
def initialize(filter:, id: SecureRandom.hex)
Expand Down

0 comments on commit be4c3e0

Please sign in to comment.