nostr-gem/sig/nostr/signature.rbs
Wilson Silva 01010c763f
Allow the verification of signatures and events
Added the methods:
- Event#verify_signature
- Crypto#check_sig!
- Crypto#valid_sig?
- Crypto#sign_message

Fixed a primitive obsession by introducing a Signature class to ensure that signatures are valid Nostr signatures.
2024-03-15 19:13:33 +00:00

15 lines
206 B
Plaintext

module Nostr
class Signature < String
FORMAT: Regexp
LENGTH: int
def initialize: (String) -> void
private
attr_reader hex_value: String
def validate: (String) -> nil
end
end