Add relay message type enums

This commit is contained in:
Wilson Silva 2023-11-14 16:57:33 +07:00
parent 904fe46a9d
commit 0f9c0d3a3d
No known key found for this signature in database
GPG Key ID: 65135F94E23F82C8
4 changed files with 31 additions and 0 deletions

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Added
- Added relay message type enums `Nostr::RelayMessageType`
### Changed
- Set the gem's homepage to [`https://nostr-ruby.com/`](https://nostr-ruby.com/)

View File

@ -7,6 +7,7 @@ require_relative 'nostr/client_message_type'
require_relative 'nostr/filter'
require_relative 'nostr/subscription'
require_relative 'nostr/relay'
require_relative 'nostr/relay_message_type'
require_relative 'nostr/key_pair'
require_relative 'nostr/event_kind'
require_relative 'nostr/event'

View 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

View File

@ -0,0 +1,8 @@
module Nostr
module RelayMessageType
EOSE: String
EVENT: String
NOTICE: String
OK: String
end
end