Add relay message type enums
This commit is contained in:
parent
904fe46a9d
commit
0f9c0d3a3d
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added relay message type enums `Nostr::RelayMessageType`
|
||||||
|
|
||||||
### 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/)
|
||||||
|
@ -7,6 +7,7 @@ require_relative 'nostr/client_message_type'
|
|||||||
require_relative 'nostr/filter'
|
require_relative 'nostr/filter'
|
||||||
require_relative 'nostr/subscription'
|
require_relative 'nostr/subscription'
|
||||||
require_relative 'nostr/relay'
|
require_relative 'nostr/relay'
|
||||||
|
require_relative 'nostr/relay_message_type'
|
||||||
require_relative 'nostr/key_pair'
|
require_relative 'nostr/key_pair'
|
||||||
require_relative 'nostr/event_kind'
|
require_relative 'nostr/event_kind'
|
||||||
require_relative 'nostr/event'
|
require_relative 'nostr/event'
|
||||||
|
18
lib/nostr/relay_message_type.rb
Normal file
18
lib/nostr/relay_message_type.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Nostr
|
||||||
|
# Clients can send 4 types of messages, which must be JSON arrays
|
||||||
|
module RelayMessageType
|
||||||
|
# @return [String] Used to notify clients all stored events have been sent
|
||||||
|
EOSE = 'EOSE'
|
||||||
|
|
||||||
|
# @return [String] Used to send events requested to clients
|
||||||
|
EVENT = 'EVENT'
|
||||||
|
|
||||||
|
# @return [String] Used to send human-readable messages to clients
|
||||||
|
NOTICE = 'NOTICE'
|
||||||
|
|
||||||
|
# @return [String] Used to notify clients if an EVENT was successful
|
||||||
|
OK = 'OK'
|
||||||
|
end
|
||||||
|
end
|
8
sig/nostr/relay_message_type.rbs
Normal file
8
sig/nostr/relay_message_type.rbs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module Nostr
|
||||||
|
module RelayMessageType
|
||||||
|
EOSE: String
|
||||||
|
EVENT: String
|
||||||
|
NOTICE: String
|
||||||
|
OK: String
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user