Chain API
The Chain API is mainly used to get information needed to build and sign transactions.
This API is available through the ChainApi
class from the polkadart
package.
Sample usage
You will get the following output:
Methods
There are a few methods available in the ChainApi
class, you can find them below:
getBlockHash
Returns the BlockHash for the given block number. If no block number is provided, it will return the hash of the latest block at chain height.
getChainHeader
Get the latest block number or specific block number by BlockHash.