Module: QuorumSdk::Node::Announce
- Included in:
- QuorumSdk::Node
- Defined in:
- lib/quorum_sdk/node/announce.rb
Overview
Announce module
Instance Method Summary collapse
- #announce(**kwargs) ⇒ Object
- #announced_producers(group_id: nil) ⇒ Object
- #announced_users(group_id: nil, pubkey: nil) ⇒ Object
Instance Method Details
#announce(**kwargs) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/quorum_sdk/node/announce.rb', line 7 def announce(**kwargs) group_id = kwargs[:group_id] || @group_id raise ArgumentError, 'group_id must be provided' if group_id.blank? payload = { data: { Action: kwargs[:action], AnnouncerSignature: kwargs[:announce_signature], EncryptPubkey: kwargs[:encrypt_pubkey], GroupId: group_id, Memo: kwargs[:memo], OwnerPubkey: kwargs[:owner_pubkey], OwnerSignature: kwargs[:owner_signature], Result: kwargs[:result], SignPubkey: kwargs[:sign_pubkey], TimeStamp: kwargs[:timestamp], Type: kwargs[:type] } } path = "/api/v1/node/#{group_id}/announce" client.post(path, **payload).body end |
#announced_producers(group_id: nil) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/quorum_sdk/node/announce.rb', line 31 def announced_producers(group_id: nil) group_id ||= @group_id raise ArgumentError, 'group_id must be provided' if group_id.blank? path = "/api/v1/node/#{group_id}/announced/producer" client.get(path).body end |
#announced_users(group_id: nil, pubkey: nil) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/quorum_sdk/node/announce.rb', line 39 def announced_users(group_id: nil, pubkey: nil) group_id ||= @group_id raise ArgumentError, 'group_id must be provided' if group_id.blank? params = { pubkey: }.compact path = "/api/v1/node/#{group_id}/announced/user" client.get(path, **params).body end |