Class: CronosExplorer::Blocks
- Inherits:
-
Object
- Object
- CronosExplorer::Blocks
- Defined in:
- lib/cronos_explorer/blocks.rb
Constant Summary collapse
- DEFAULT_HASH =
{ module: 'block' }.freeze
Class Method Summary collapse
-
.eth_block_number ⇒ Object
Mimics Ethereum JSON RPC’s eth_blockNumber.
-
.getblockreward(blockno) ⇒ Object
Get block reward by block number.
Class Method Details
.eth_block_number ⇒ Object
Mimics Ethereum JSON RPC’s eth_blockNumber. Returns the lastest block number
9 10 11 12 13 |
# File 'lib/cronos_explorer/blocks.rb', line 9 def eth_block_number hash = DEFAULT_HASH.merge(action: 'eth_block_number') Request.get hash end |
.getblockreward(blockno) ⇒ Object
Get block reward by block number.
16 17 18 19 20 |
# File 'lib/cronos_explorer/blocks.rb', line 16 def getblockreward(blockno) hash = DEFAULT_HASH.merge(action: 'getblockreward', blockno: blockno) Request.get hash end |