nostr 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90770e269f0c966f76013797314b9e3b4b0743fa57f5b84f2460371b413bc5f1
4
- data.tar.gz: 7a4a908a6c1b086781d26dc6f45c289a85859e12e1e854451a0e9f8e75f5fa06
3
+ metadata.gz: 371ed11c0474fd944cc55a054d553945623f7439f67c55f3eadc564805d2fb11
4
+ data.tar.gz: f7fbe86119bd7816e7066ea3603263dee7327b06daeb4b92f9e90977f52ef8ae
5
5
  SHA512:
6
- metadata.gz: 35a4401f078587bed79d6063f4051cca3f8dc170c074c552a202fee7872b75668eb8204a5f6db09f810ed0c5bb84026438d7e942f48a4825d63ba64552d032c7
7
- data.tar.gz: b9400efc3228dea17e23e40803e2e7b94ce9966e6a729fcf5ea0b79ffcea07b7e51f7fd9703d01af1d287ffdaf85b6b8d49d325813b8e32518a0be240537e86e
6
+ metadata.gz: fa602354304ce9e77377b80cab60146f51ac8943b1399070a87ce81a5e44582f0a23b50f1736fafd9d7d0f13042b8b7292b9d29684077ad878e2439ddf7970ef
7
+ data.tar.gz: 83fc3d535a1e35438522779ef7dc3e101b4fea3a3f9874db9457b4f6c61d74469ded6ba973923d731789d3c50d7aa66b1c0770d62451794d45b52720c7928ebf
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.0] - 2023-02-15
8
+
9
+ ### Added
10
+
11
+ - Client compliance wth [NIP-02](https://github.com/nostr-protocol/nips/blob/master/02.md) (manage contact lists)
12
+
7
13
  ## [0.2.0] - 2023-01-12
8
14
 
9
15
  ### Added
@@ -14,5 +20,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
14
20
 
15
21
  - Initial release
16
22
 
23
+ [0.3.0]: https://github.com/wilsonsilva/nostr/compare/v0.2.0...v0.3.0
17
24
  [0.2.0]: https://github.com/wilsonsilva/nostr/compare/v0.1.0...v0.2.0
18
25
  [0.1.0]: https://github.com/wilsonsilva/nostr/compare/7fded5...v0.1.0
data/README.md CHANGED
@@ -27,7 +27,6 @@ All examples below assume that the gem has been required.
27
27
  require 'nostr'
28
28
  ```
29
29
 
30
-
31
30
  ### Generating a keypair
32
31
 
33
32
  ```ruby
@@ -55,7 +54,7 @@ You may instantiate multiple Clients and multiple Relays.
55
54
 
56
55
  ```ruby
57
56
  client = Nostr::Client.new
58
- relay = Nostr::Relay.new(url: 'wss://relay.damus.io', name: 'Damus')
57
+ relay = Nostr::Relay.new(url: 'wss://relay.damus.io', name: 'Damus')
59
58
 
60
59
  client.connect(relay)
61
60
  ```
@@ -82,14 +81,28 @@ end
82
81
  # > Network error: wss://rsslay.fiatjaf.com: Unable to verify the server certificate for 'rsslay.fiatjaf.com'
83
82
  ```
84
83
 
85
- The `:message` event is fired whenwhen data is received through a WebSocket.
84
+ The `:message` event is fired when data is received through a WebSocket.
86
85
 
87
86
  ```ruby
88
87
  client.on :message do |message|
89
88
  puts message
90
89
  end
91
90
 
92
- # > Network error: wss://rsslay.fiatjaf.com: Unable to verify the server certificate for 'rsslay.fiatjaf.com'
91
+ # [
92
+ # "EVENT",
93
+ # "d34107357089bfc9882146d3bfab0386",
94
+ # {
95
+ # "content":"",
96
+ # "created_at":1676456512,
97
+ # "id":"18f63550da74454c5df7caa2a349edc5b2a6175ea4c5367fa4b4212781e5b310",
98
+ # "kind":3,
99
+ # "pubkey":"117a121fa41dc2caa0b3d6c5b9f42f90d114f1301d39f9ee96b646ebfee75e36",
100
+ # "sig":"d171420bd62cf981e8f86f2dd8f8f86737ea2bbe2d98da88db092991d125535860d982139a3c4be39886188613a9912ef380be017686a0a8b74231dc6e0b03cb",
101
+ # "tags":[
102
+ # ["p","1cc821cc2d47191b15fcfc0f73afed39a86ac6fb34fbfa7993ee3e0f0186ef7c"]
103
+ # ]
104
+ # }
105
+ # ]
93
106
  ```
94
107
 
95
108
  The `:close` event is fired when a connection with a WebSocket is closed.
@@ -179,10 +192,38 @@ event = user.create_event(
179
192
  client.publish(event)
180
193
  ```
181
194
 
195
+ ### Creating/updating your contact list
196
+
197
+ Every new contact list that gets published overwrites the past ones, so it should contain all entries.
198
+
199
+ ```ruby
200
+ # Creating a contact list event with 2 contacts
201
+ update_contacts_event = user.create_event(
202
+ kind: Nostr::EventKind::CONTACT_LIST,
203
+ tags: [
204
+ [
205
+ "p", # mandatory
206
+ "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245", # public key of the user to add to the contacts
207
+ "wss://alicerelay.com/", # can be an empty string or can be omitted
208
+ "alice" # can be an empty string or can be omitted
209
+ ],
210
+ [
211
+ "p", # mandatory
212
+ "3efdaebb1d8923ebd99c9e7ace3b4194ab45512e2be79c1b7d68d9243e0d2681", # public key of the user to add to the contacts
213
+ "wss://bobrelay.com/nostr", # can be an empty string or can be omitted
214
+ "bob" # can be an empty string or can be omitted
215
+ ],
216
+ ],
217
+ )
218
+
219
+ # Send it to the Relay
220
+ client.publish(update_contacts_event)
221
+ ```
222
+
182
223
  ## NIPS
183
224
 
184
225
  - [x] [NIP-01 - Client](https://github.com/nostr-protocol/nips/blob/master/01.md)
185
- - [ ] [NIP-01 - Relay](https://github.com/nostr-protocol/nips/blob/master/01.md)
226
+ - [x] [NIP-02 - Client](https://github.com/nostr-protocol/nips/blob/master/02.md)
186
227
 
187
228
  ## Development
188
229
 
@@ -200,17 +241,34 @@ The health and maintainability of the codebase is ensured through a set of
200
241
  Rake tasks to test, lint and audit the gem for security vulnerabilities and documentation:
201
242
 
202
243
  ```
203
- rake bundle:audit # Checks for vulnerable versions of gems
204
- rake qa # Test, lint and perform security and documentation audits
205
- rake rubocop # Lint the codebase with RuboCop
206
- rake rubocop:auto_correct # Auto-correct RuboCop offenses
207
- rake spec # Run RSpec code examples
208
- rake verify_measurements # Verify that yardstick coverage is at least 100%
209
- rake yard # Generate YARD Documentation
210
- rake yard:junk # Check the junk in your YARD Documentation
211
- rake yardstick_measure # Measure docs in lib/**/*.rb with yardstick
244
+ rake build # Build nostr.gem into the pkg directory
245
+ rake build:checksum # Generate SHA512 checksum if nostr.gem into the checksums directory
246
+ rake bundle:audit:check # Checks the Gemfile.lock for insecure dependencies
247
+ rake bundle:audit:update # Updates the bundler-audit vulnerability database
248
+ rake clean # Remove any temporary products
249
+ rake clobber # Remove any generated files
250
+ rake coverage # Run spec with coverage
251
+ rake install # Build and install nostr.gem into system gems
252
+ rake install:local # Build and install nostr.gem into system gems without network access
253
+ rake qa # Test, lint and perform security and documentation audits
254
+ rake release[remote] # Create a tag, build and push nostr.gem to rubygems.org
255
+ rake rubocop # Run RuboCop
256
+ rake rubocop:autocorrect # Autocorrect RuboCop offenses (only when it's safe)
257
+ rake rubocop:autocorrect_all # Autocorrect RuboCop offenses (safe and unsafe)
258
+ rake spec # Run RSpec code examples
259
+ rake verify_measurements # Verify that yardstick coverage is at least 100%
260
+ rake yard # Generate YARD Documentation
261
+ rake yard:junk # Check the junk in your YARD Documentation
262
+ rake yardstick_measure # Measure docs in lib/**/*.rb with yardstick
212
263
  ```
213
264
 
265
+ ### Type checking
266
+
267
+ This gem leverages [RBS](https://github.com/ruby/rbs), a language to describe the structure of Ruby programs. It is
268
+ used to provide type checking and autocompletion in your editor. Run `bundle exec typeprof FILENAME` to generate
269
+ an RBS definition for the given Ruby file. And validate all definitions using [Steep](https://github.com/soutaro/steep)
270
+ with the command `bundle exec steep check`.
271
+
214
272
  ## Contributing
215
273
 
216
274
  Bug reports and pull requests are welcome on GitHub at https://github.com/wilsonsilva/nostr.
data/Steepfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ target :lib do
4
+ signature 'sig'
5
+
6
+ check 'lib'
7
+
8
+ # Core libraries
9
+ library 'digest'
10
+ library 'securerandom'
11
+
12
+ # Gems
13
+ library 'json'
14
+ end
@@ -25,7 +25,7 @@ module Nostr
25
25
  #
26
26
  attr_reader :created_at
27
27
 
28
- # The kind of the event. An integer from 0 to 2
28
+ # The kind of the event. An integer from 0 to 3
29
29
  #
30
30
  # @api public
31
31
  #
@@ -76,7 +76,7 @@ module Nostr
76
76
  #
77
77
  # @param pubkey [String] 32-bytes hex-encoded public key of the event creator.
78
78
  # @param created_at [Integer] Date of the creation of the vent. A UNIX timestamp, in seconds.
79
- # @param kind [Integer] The kind of the event. An integer from 0 to 2.
79
+ # @param kind [Integer] The kind of the event. An integer from 0 to 3.
80
80
  # @param tags [Array<Array>] An array of tags. Each tag is an array of strings.
81
81
  # @param content [String] Arbitrary string.
82
82
  #
@@ -24,5 +24,12 @@ module Nostr
24
24
  # @return [Integer]
25
25
  #
26
26
  RECOMMEND_SERVER = 2
27
+
28
+ # A special event with kind 3, meaning "contact list" is defined as having a list of p tags, one for each of
29
+ # the followed/known profiles one is following.
30
+ #
31
+ # @return [Integer]
32
+ #
33
+ CONTACT_LIST = 3
27
34
  end
28
35
  end
data/lib/nostr/user.rb CHANGED
@@ -50,7 +50,7 @@ module Nostr
50
50
  # @param event_attributes [Hash]
51
51
  # @option event_attributes [String] :pubkey 32-bytes hex-encoded public key of the event creator.
52
52
  # @option event_attributes [Integer] :created_at Date of the creation of the vent. A UNIX timestamp, in seconds.
53
- # @option event_attributes [Integer] :kind The kind of the event. An integer from 0 to 2.
53
+ # @option event_attributes [Integer] :kind The kind of the event. An integer from 0 to 3.
54
54
  # @option event_attributes [Array<Array>] :tags An array of tags. Each tag is an array of strings.
55
55
  # @option event_attributes [String] :content Arbitrary string.
56
56
  #
data/lib/nostr/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nostr
4
4
  # The version of the gem
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
data/nostr.gemspec CHANGED
@@ -50,12 +50,15 @@ Gem::Specification.new do |spec|
50
50
  spec.add_development_dependency 'puma', '~> 5.6'
51
51
  spec.add_development_dependency 'rack', '~> 3.0'
52
52
  spec.add_development_dependency 'rake', '~> 13.0'
53
+ spec.add_development_dependency 'rbs', '~> 2.8'
53
54
  spec.add_development_dependency 'rspec', '~> 3.12'
54
55
  spec.add_development_dependency 'rubocop', '~> 1.42'
55
56
  spec.add_development_dependency 'rubocop-rake', '~> 0.6'
56
57
  spec.add_development_dependency 'rubocop-rspec', '2.16'
57
58
  spec.add_development_dependency 'simplecov', '= 0.17'
58
59
  spec.add_development_dependency 'simplecov-console', '~> 0.9'
60
+ spec.add_development_dependency 'steep', '~> 1.3'
61
+ spec.add_development_dependency 'typeprof', '~> 0.21'
59
62
  spec.add_development_dependency 'yard', '~> 0.9'
60
63
  spec.add_development_dependency 'yard-junk', '~> 0.0.9'
61
64
  spec.add_development_dependency 'yardstick', '~> 0.9'
@@ -0,0 +1,20 @@
1
+ module Nostr
2
+ class Client
3
+ include EventEmitter
4
+
5
+ def initialize: -> void
6
+ def connect: (Relay relay) -> Thread
7
+ def subscribe: (?subscription_id: String, ?filter: Filter) -> Subscription
8
+ def unsubscribe: (String subscription_id) -> untyped
9
+ def publish: (Event event) -> untyped
10
+
11
+ private
12
+
13
+ attr_reader subscriptions: Hash[String, Subscription]
14
+ attr_reader parent_to_child_channel: untyped
15
+ attr_reader child_to_parent_channel: untyped
16
+
17
+ def execute_within_an_em_thread: { -> untyped } -> Thread
18
+ def initialize_channels: -> untyped
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ module Nostr
2
+ module ClientMessageType
3
+ EVENT: String
4
+ REQ: String
5
+ CLOSE: String
6
+ end
7
+ end
@@ -0,0 +1,24 @@
1
+ module Nostr
2
+ class Event < EventFragment
3
+ attr_reader id: String
4
+ attr_reader sig: String
5
+
6
+ def initialize: (id: String, sig: String,
7
+ created_at: Integer,
8
+ kind: Integer,
9
+ tags: Array[String],
10
+ content: String,
11
+ ) -> void
12
+
13
+ def to_h: -> {
14
+ id: String,
15
+ pubkey: String,
16
+ created_at: Integer,
17
+ kind: Integer,
18
+ tags: Array[String],
19
+ content: String,
20
+ sig: String
21
+ }
22
+ def ==: (Event other) -> bool
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ module Nostr
2
+ class EventFragment
3
+ attr_reader pubkey: String
4
+ attr_reader created_at: Integer
5
+ attr_reader kind: Integer
6
+ attr_reader tags: Array[String]
7
+ attr_reader content: String
8
+
9
+ def initialize: (pubkey: String, kind: Integer, content: String, ?created_at: Integer, ?tags: Array[String]) -> void
10
+ def serialize: -> [Integer, String, Integer, Integer, Array[String], String]
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module Nostr
2
+ module EventKind
3
+ SET_METADATA: Integer
4
+ TEXT_NOTE: Integer
5
+ RECOMMEND_SERVER: Integer
6
+ CONTACT_LIST: Integer
7
+ end
8
+ end
@@ -0,0 +1,25 @@
1
+ module Nostr
2
+ class Filter
3
+ attr_reader ids: Array[String]
4
+ attr_reader authors: Array[String]
5
+ attr_reader kinds: Array[Integer]
6
+ attr_reader e: String
7
+ attr_reader p: String
8
+ attr_reader since: Integer
9
+ attr_reader until: Integer
10
+ attr_reader limit: Integer
11
+
12
+ def initialize: (**untyped) -> void
13
+ def to_h: -> {
14
+ ids: Array[String],
15
+ authors: Array[String],
16
+ kinds: Array[Integer],
17
+ e: String,
18
+ p: String,
19
+ since: Integer,
20
+ until: Integer,
21
+ limit: Integer
22
+ }
23
+ def ==: (Filter other) -> bool
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ # Classes
2
+ module Nostr
3
+ class KeyPair
4
+ attr_reader private_key: String
5
+ attr_reader public_key: String
6
+
7
+ def initialize: (private_key: String, public_key: String) -> void
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # Classes
2
+ module Nostr
3
+ class Keygen
4
+ def initialize: -> void
5
+ def generate_key_pair: -> KeyPair
6
+ def generate_private_key: -> String
7
+ def extract_public_key: (String private_key) -> String
8
+
9
+ private
10
+
11
+ attr_reader group: untyped
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ # Classes
2
+ module Nostr
3
+ class Relay
4
+ attr_reader url: String
5
+ attr_reader name: String
6
+
7
+ def initialize: (url: String, name: String) -> void
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Nostr
2
+ class Subscription
3
+ attr_reader id: String
4
+ attr_reader filter: Filter
5
+
6
+ def initialize: (filter: Filter, ?id: String) -> void
7
+ def ==: (Subscription other) -> bool
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ # Classes
2
+ module Nostr
3
+ class User
4
+ attr_reader keypair: KeyPair
5
+
6
+ def initialize: (?keypair: KeyPair | nil, ?keygen: Keygen) -> void
7
+ def create_event: (
8
+ {
9
+ id: String,
10
+ pubkey: String,
11
+ created_at: Integer,
12
+ kind: Integer,
13
+ tags: Array[String],
14
+ content: String,
15
+ created_at: Integer,
16
+ sig: String
17
+ }
18
+ ) -> Event
19
+
20
+ private
21
+
22
+ def sign: (String event_sha256) -> String
23
+ end
24
+ end
@@ -0,0 +1,6 @@
1
+ # Added only to satisfy the Steep requirements. Not 100% reliable.
2
+ module ECDSA
3
+ class Group
4
+ Secp256k1: Group
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ # Added only to satisfy the Steep requirements. Not 100% reliable.
2
+ module EventEmitter
3
+ def add_listener: (untyped `type`, ?{once: true} params) -> Integer
4
+ alias on add_listener
5
+
6
+ def remove_listener: (untyped id_or_type) -> Array[untyped]?
7
+ def emit: (untyped `type`, *untyped data) -> Array[untyped]
8
+ def once: (untyped `type`) -> Integer
9
+ end
@@ -0,0 +1,18 @@
1
+ # Added only to satisfy the Steep requirements. Not 100% reliable.
2
+ module EventMachine
3
+ class Channel
4
+ @subs: Hash[untyped, untyped]
5
+ @uid: Integer
6
+
7
+ def initialize: -> void
8
+ def num_subscribers: -> Integer
9
+ def subscribe: (*untyped a) ?{ -> untyped } -> Integer
10
+ def unsubscribe: (untyped name) -> untyped
11
+ def push: (*untyped items) -> untyped
12
+ alias << push
13
+ def pop: (*untyped a) -> untyped
14
+
15
+ private
16
+ def gen_id: -> Integer
17
+ end
18
+ end
@@ -0,0 +1,69 @@
1
+ # Added only to satisfy the Steep requirements. Not 100% reliable.
2
+ module EventMachine
3
+ ERRNOS: Hash[untyped, untyped]
4
+ P: untyped
5
+ self.@next_tick_mutex: Thread::Mutex
6
+ self.@reactor_running: bool
7
+ self.@next_tick_queue: Array[^-> untyped]
8
+ self.@tails: Array[nil]
9
+ self.@resultqueue: (Array[untyped] | Thread::Queue)?
10
+ self.@threadqueue: Thread::Queue?
11
+ self.@threadpool: Array[untyped]?
12
+ self.@all_threads_spawned: bool
13
+ self.@reactor_pid: Integer
14
+ self.@conns: Hash[untyped, untyped]
15
+ self.@acceptors: Hash[untyped, Array[(Array[untyped] | Integer)?]]
16
+ self.@timers: Hash[untyped, Integer | ^-> untyped | false]
17
+ self.@wrapped_exception: Exception?
18
+ self.@reactor_thread: Thread?
19
+ self.@threadpool_size: bot
20
+ self.@error_handler: bot
21
+
22
+ def self.run: (?untyped blk, ?nil tail) ?{ -> untyped } -> nil
23
+ def self.run_block: -> nil
24
+ def self.reactor_thread?: -> bool
25
+ def self.schedule: (*untyped a) -> nil
26
+ def self.fork_reactor: -> Integer?
27
+ def self.cleanup_machine: -> Array[untyped]
28
+ def self.add_shutdown_hook: -> Array[nil]
29
+ def self.add_timer: (*Integer | ^-> untyped args) ?{ -> untyped } -> nil
30
+ def self.add_periodic_timer: (*untyped args) -> untyped
31
+ def self.cancel_timer: (untyped timer_or_sig) -> false?
32
+ def self.stop_event_loop: -> untyped
33
+ def self.start_server: (untyped server, ?nil port, ?nil handler, *untyped args) -> untyped
34
+ def self.attach_server: (untyped sock, ?nil handler, *untyped args) -> untyped
35
+ def self.stop_server: (untyped signature) -> untyped
36
+ def self.start_unix_domain_server: (untyped filename, *untyped args) -> untyped
37
+ def self.connect: (untyped server, ?nil port, ?nil handler, *untyped args) -> untyped
38
+ def self.bind_connect: (nil bind_addr, nil bind_port, untyped server, ?nil port, ?nil handler, *untyped args) -> untyped
39
+ def self.watch: (untyped io, ?nil handler, *untyped args) -> untyped
40
+ def self.attach: (untyped io, ?nil handler, *untyped args) -> untyped
41
+ def self.attach_io: (untyped io, bool watch_mode, ?nil handler, *untyped args) -> untyped
42
+ def self.reconnect: (untyped server, untyped port, untyped handler) -> untyped
43
+ def self.connect_unix_domain: (untyped socketname, *untyped args) -> untyped
44
+ def self.open_datagram_socket: (untyped address, untyped port, ?nil handler, *untyped args) -> untyped
45
+ def self.set_quantum: (untyped mills) -> untyped
46
+ def self.set_max_timers: (untyped ct) -> untyped
47
+ def self.get_max_timers: -> untyped
48
+ def self.connection_count: -> untyped
49
+ def self.run_deferred_callbacks: -> Integer
50
+ def self.defer: (?nil op, ?nil callback, ?nil errback) -> untyped
51
+ def self.spawn_threadpool: -> true
52
+ def self.defers_finished?: -> bool
53
+ def self.next_tick: (?nil pr) { -> nil } -> nil
54
+ def self.set_effective_user: (untyped username) -> untyped
55
+ def self.set_descriptor_table_size: (?nil n_descriptors) -> untyped
56
+ def self.popen: (untyped cmd, ?nil handler, *untyped args) -> untyped
57
+ def self.reactor_running?: -> bool
58
+ def self.open_keyboard: (?nil handler, *untyped args) -> untyped
59
+ def self.watch_file: (untyped filename, ?nil handler, *untyped args) -> untyped
60
+ def self.watch_process: (untyped pid, ?nil handler, *untyped args) -> untyped
61
+ def self.error_handler: (?nil cb) -> nil
62
+ def self.enable_proxy: (untyped from, untyped to, ?Integer bufsize, ?Integer length) -> untyped
63
+ def self.disable_proxy: (untyped from) -> untyped
64
+ def self.heartbeat_interval: -> untyped
65
+ def self.heartbeat_interval=: (untyped time) -> untyped
66
+ def self.event_callback: (untyped conn_binding, untyped opcode, untyped data) -> Integer?
67
+ def self._open_file_for_writing: (untyped filename, ?nil handler) -> untyped
68
+ def self.klass_from_handler: (?untyped klass, ?Integer? handler, *nil args) -> Integer
69
+ end
@@ -0,0 +1,4 @@
1
+ # Added only to satisfy the Steep requirements. Not 100% reliable.
2
+ module Schnorr
3
+ def self.sign: (String message, String private_key, ?String aux_rand) -> untyped
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nostr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilson Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bech32
@@ -262,6 +262,20 @@ dependencies:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
264
  version: '13.0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: rbs
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '2.8'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '2.8'
265
279
  - !ruby/object:Gem::Dependency
266
280
  name: rspec
267
281
  requirement: !ruby/object:Gem::Requirement
@@ -346,6 +360,34 @@ dependencies:
346
360
  - - "~>"
347
361
  - !ruby/object:Gem::Version
348
362
  version: '0.9'
363
+ - !ruby/object:Gem::Dependency
364
+ name: steep
365
+ requirement: !ruby/object:Gem::Requirement
366
+ requirements:
367
+ - - "~>"
368
+ - !ruby/object:Gem::Version
369
+ version: '1.3'
370
+ type: :development
371
+ prerelease: false
372
+ version_requirements: !ruby/object:Gem::Requirement
373
+ requirements:
374
+ - - "~>"
375
+ - !ruby/object:Gem::Version
376
+ version: '1.3'
377
+ - !ruby/object:Gem::Dependency
378
+ name: typeprof
379
+ requirement: !ruby/object:Gem::Requirement
380
+ requirements:
381
+ - - "~>"
382
+ - !ruby/object:Gem::Version
383
+ version: '0.21'
384
+ type: :development
385
+ prerelease: false
386
+ version_requirements: !ruby/object:Gem::Requirement
387
+ requirements:
388
+ - - "~>"
389
+ - !ruby/object:Gem::Version
390
+ version: '0.21'
349
391
  - !ruby/object:Gem::Dependency
350
392
  name: yard
351
393
  requirement: !ruby/object:Gem::Requirement
@@ -409,6 +451,7 @@ files:
409
451
  - LICENSE.txt
410
452
  - README.md
411
453
  - Rakefile
454
+ - Steepfile
412
455
  - lib/nostr.rb
413
456
  - lib/nostr/client.rb
414
457
  - lib/nostr/client_message_type.rb
@@ -424,6 +467,22 @@ files:
424
467
  - lib/nostr/version.rb
425
468
  - nostr.gemspec
426
469
  - sig/nostr.rbs
470
+ - sig/nostr/client.rbs
471
+ - sig/nostr/client_message_type.rbs
472
+ - sig/nostr/event.rbs
473
+ - sig/nostr/event_fragment.rbs
474
+ - sig/nostr/event_kind.rbs
475
+ - sig/nostr/filter.rbs
476
+ - sig/nostr/key_pair.rbs
477
+ - sig/nostr/keygen.rbs
478
+ - sig/nostr/relay.rbs
479
+ - sig/nostr/subscription.rbs
480
+ - sig/nostr/user.rbs
481
+ - sig/vendor/ecsda/group/secp256k1.rbs
482
+ - sig/vendor/event_emitter.rbs
483
+ - sig/vendor/event_machine.rbs
484
+ - sig/vendor/event_machine/channel.rbs
485
+ - sig/vendor/schnorr.rbs
427
486
  homepage: https://github.com/wilsonsilva/nostr
428
487
  licenses:
429
488
  - MIT
@@ -447,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
447
506
  - !ruby/object:Gem::Version
448
507
  version: '0'
449
508
  requirements: []
450
- rubygems_version: 3.4.1
509
+ rubygems_version: 3.4.4
451
510
  signing_key:
452
511
  specification_version: 4
453
512
  summary: Client and relay implementation of the Nostr protocol.