Class: Radiator::SSC::Blockchain
- Inherits:
-
BaseSteemSmartContractRPC
- Object
- BaseSteemSmartContractRPC
- Radiator::SSC::Blockchain
- Defined in:
- lib/radiator/ssc/blockchain.rb
Overview
The “blockchain” endpoint
Direct Known Subclasses
Constant Summary
Constants inherited from BaseSteemSmartContractRPC
Radiator::SSC::BaseSteemSmartContractRPC::POST_HEADERS
Instance Method Summary collapse
-
#block_info(block_num) ⇒ Object
Example using the defaults, backed by Steem Engine:.
-
#initialize(options = {}) ⇒ Blockchain
constructor
A new instance of Blockchain.
-
#latest_block_info ⇒ Object
Example using the defaults, backed by Steem Engine:.
-
#transaction_info(trx_id) ⇒ Object
Example using the defaults, backed by Steem Engine:.
Methods inherited from BaseSteemSmartContractRPC
Constructor Details
#initialize(options = {}) ⇒ Blockchain
Returns a new instance of Blockchain.
9 10 11 12 |
# File 'lib/radiator/ssc/blockchain.rb', line 9 def initialize( = {}) super @url = [:url] || "#{@root_url}/blockchain" end |
Instance Method Details
#block_info(block_num) ⇒ Object
Example using the defaults, backed by Steem Engine:
rpc = Radiator::SSC::Blockchain.new
rpc.block_info(1)
31 32 33 |
# File 'lib/radiator/ssc/blockchain.rb', line 31 def block_info(block_num) request(method: 'getBlockInfo', params: {blockNumber: block_num}) end |
#latest_block_info ⇒ Object
Example using the defaults, backed by Steem Engine:
rpc = Radiator::SSC::Blockchain.new
rpc.latest_block_info
20 21 22 |
# File 'lib/radiator/ssc/blockchain.rb', line 20 def latest_block_info request(method: 'getLatestBlockInfo') end |
#transaction_info(trx_id) ⇒ Object
Example using the defaults, backed by Steem Engine:
rpc = Radiator::SSC::Blockchain.new
rpc.transaction_info('9d288aab2eb66064dc0d4492cb281512386e2293')
42 43 44 |
# File 'lib/radiator/ssc/blockchain.rb', line 42 def transaction_info(trx_id) request(method: 'getTransactionInfo', params: {txid: trx_id}) end |