Module: HelloBlock::Transaction

Extended by:
Transaction
Included in:
Transaction
Defined in:
lib/helloblock/transaction.rb

Defined Under Namespace

Modules: Batch

Constant Summary collapse

RESOURCE =
"/transactions"

Instance Method Summary collapse

Instance Method Details

#get(tx_hash) ⇒ Object



6
7
8
9
# File 'lib/helloblock/transaction.rb', line 6

def get(tx_hash)
  res = HelloBlock::Request.get("#{RESOURCE}/#{tx_hash}")
  res["transaction"]
end

#get_latest(queries = {}) ⇒ Object



11
12
13
14
# File 'lib/helloblock/transaction.rb', line 11

def get_latest(queries = {})
  res = HelloBlock::Request.get("#{RESOURCE}/latest")
  res["transactions"]
end

#propagate(body = {}) ⇒ Object



16
17
18
19
# File 'lib/helloblock/transaction.rb', line 16

def propagate(body = {})
  res = HelloBlock::Request.post("#{RESOURCE}", body: body)
  res["transaction"]
end