Class: Bytom::Message
- Inherits:
-
Object
- Object
- Bytom::Message
- Defined in:
- lib/bytom/api/message.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ Message
constructor
A new instance of Message.
-
#sign_message(address:, message:, password:) ⇒ Hash
Sign a message with the key password(decode encrypted private key) of an address.
-
#verify_message(address:, derived_xpub:, message:, signature:) ⇒ Object
Verify a signed message with derived pubkey of the address.
Constructor Details
#initialize(client) ⇒ Message
Returns a new instance of Message.
6 7 8 |
# File 'lib/bytom/api/message.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#sign_message(address:, message:, password:) ⇒ Hash
Sign a message with the key password(decode encrypted private key) of an address.
37 38 39 40 41 42 43 44 45 |
# File 'lib/bytom/api/message.rb', line 37 def (address:, message:, password:) params = { address: address, message: , password: password } p params client.make_request('/sign-message', 'post', params: params) end |
#verify_message(address:, derived_xpub:, message:, signature:) ⇒ Object
Verify a signed message with derived pubkey of the address.
18 19 20 21 22 23 24 25 26 |
# File 'lib/bytom/api/message.rb', line 18 def (address:, derived_xpub:, message:, signature:) params = { address: address, derived_xpub: derived_xpub, message: , signature: signature } client.make_request('/verify-message', 'post', params: params) end |