API for interacting with blocks.
Methods
-
<inner> getBlock(params)
-
Returns the detail block by block height or block hash.
Parameters:
Name Type Description params
Object Properties
Name Type Description block_hash
String hash of block.
block_height
Integer height of block.
Returns:
- Type
- Promise.<BlockInfo>
-
<inner> getBlockCount()
-
Returns the current block height for blockchain.
Returns:
Promise resolved on success with block_count returned.
- Type
- Promise.<Object>
-
<inner> getBlockHash()
-
Returns the current block hash for blockchain.
Returns:
Requested info of specified Bytom Core with block_hash returned.
- Type
- Promise.<Object>
-
<inner> getBlockHeader(params)
-
Returns the detail block header by block height or block hash.
Parameters:
Name Type Description params
Object Properties
Name Type Description block_hash
String hash of block.
block_height
Integer height of block.
Returns:
- Type
- Promise.<Object>
-
<inner> getDifficulty(params)
-
Returns the block difficulty by block height or block hash.
Parameters:
Name Type Description params
Object Properties
Name Type Description block_hash
String hash of block.
block_height
Integer height of block.
Returns:
- Type
- Promise.<Object>
-
<inner> getHashRate(params)
-
Returns the block hash rate by block height or block hash, it returns the current block hash rate when request is empty.
Parameters:
Name Type Description params
Object Properties
Name Type Description block_hash
String hash of block.
block_height
Integer height of block.
Returns:
- Type
- Promise.<Object>