Implement NIP-04: Encrypted Direct Messages
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
module Nostr
|
||||
class Crypto
|
||||
BN_BASE: Integer
|
||||
CIPHER_CURVE: String
|
||||
CIPHER_ALGORITHM: String
|
||||
|
||||
def encrypt_text: (String, String, String) -> String
|
||||
def decrypt_text: (String, String, String) -> String
|
||||
def sign_event: (Event, String) -> Event
|
||||
|
||||
private
|
||||
|
||||
def compute_shared_key: (String, String) -> String
|
||||
def hash_event:(Event) -> String
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,5 +4,6 @@ module Nostr
|
||||
TEXT_NOTE: Integer
|
||||
RECOMMEND_SERVER: Integer
|
||||
CONTACT_LIST: Integer
|
||||
ENCRYPTED_DIRECT_MESSAGE: Integer
|
||||
end
|
||||
end
|
||||
|
||||
12
sig/nostr/events/encrypted_direct_message.rbs
Normal file
12
sig/nostr/events/encrypted_direct_message.rbs
Normal file
@@ -0,0 +1,12 @@
|
||||
module Nostr
|
||||
module Events
|
||||
class EncryptedDirectMessage < Event
|
||||
def initialize: (
|
||||
plain_text: String,
|
||||
sender_private_key: String,
|
||||
recipient_public_key: String,
|
||||
?previous_direct_message: String|nil
|
||||
) -> void
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user