Class: Nem::Endpoint::Transaction
- Defined in:
- lib/nem/endpoint/transaction.rb
Instance Method Summary collapse
- #announce(req) ⇒ Nem::Model::NemAnnounceResult
- #find(hash) ⇒ Nem::Model::Transaction (also: #get)
- #prepare_announce(req) ⇒ Nem::Model::NemAnnounceResult
Methods inherited from Base
#current_node, #initialize, #next_node!, #request, #request!
Constructor Details
This class inherits a constructor from Nem::Endpoint::Base
Instance Method Details
#announce(req) ⇒ Nem::Model::NemAnnounceResult
18 19 20 21 22 23 24 25 |
# File 'lib/nem/endpoint/transaction.rb', line 18 def announce(req) request!(:post, '/transaction/announce', req.respond_to?(:to_entity) ? req.to_entity : req.to_hash ) do |res| Nem::Model::NemAnnounceResult.new_from_nem_announce_result(res) end end |
#find(hash) ⇒ Nem::Model::Transaction Also known as: get
6 7 8 9 10 11 12 13 |
# File 'lib/nem/endpoint/transaction.rb', line 6 def find(hash) request!(:get, '/transaction/get', hash: hash ) do |res| Nem::Model::Transaction.(res) end end |
#prepare_announce(req) ⇒ Nem::Model::NemAnnounceResult
28 29 30 31 32 33 34 35 |
# File 'lib/nem/endpoint/transaction.rb', line 28 def prepare_announce(req) request!(:post, '/transaction/prepare-announce', req.to_entity(:prepare) ) do |res| Nem::Model::NemAnnounceResult.new_from_nem_announce_result(res) end end |