header method

Future<String?> header(
  1. String blockHash
)

Get the header of a pinned block.

Parameters:

  • blockHash: The hash of the pinned block.

Returns the SCALE-encoded header as a hex string, or null if the block is not pinned.

Implementation

Future<String?> header(String blockHash) async {
  _ensureActive();
  final response = await _provider.send('chainHead_v1_header', [followSubscriptionId, blockHash]);

  if (response.error != null) {
    throw Exception(response.error.toString());
  }

  return response.result as String?;
}