Class: Razrbit::Explorer

Inherits:
HTTP
  • Object
show all
Defined in:
lib/razrbit/explorer.rb

Instance Attribute Summary

Attributes inherited from HTTP

#app_id, #app_secret

Instance Method Summary collapse

Methods inherited from HTTP

#initialize

Constructor Details

This class inherits a constructor from Razrbit::HTTP

Instance Method Details

#address(address: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/razrbit/explorer.rb', line 25

def address(address: nil)
  uri = create_uri 'explorer/address'

  form_data = {
    'address' => address
  }

  post(uri, form_data)
end

#address_unspent_outputs(address: nil) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/razrbit/explorer.rb', line 35

def address_unspent_outputs(address: nil)
  uri = create_uri 'explorer/addressUnspentOutputs'

  form_data = {
    'address' => address
  }

  post(uri, form_data)
end

#block(block_hash: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/razrbit/explorer.rb', line 5

def block(block_hash: nil)
  uri = create_uri 'explorer/block'

  form_data = {
    'blockHash' => block_hash
  }

  post(uri, form_data)
end

#transaction(transaction_hash: nil) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/razrbit/explorer.rb', line 15

def transaction(transaction_hash: nil)
  uri = create_uri 'explorer/transaction'

  form_data = {
    'transactionHash' => transaction_hash
  }

  post(uri, form_data)
end