getStorageHash method

Future<BlockHash?> getStorageHash(
  1. StorageKey key, {
  2. BlockHash? at,
})

Returns the hash of a storage entry at a block's state.

Implementation

Future<BlockHash?> getStorageHash(StorageKey key, {BlockHash? at}) async {
  final List<String> params = ['0x${hex.encode(key)}'];
  if (at != null) {
    params.add('0x${hex.encode(at)}');
  }
  final response = await _provider.send('state_getStorageHash', params);
  final data = response.result as String?;
  return data == null
      ? null
      : Uint8List.fromList(hex.decode(data.substring(2)));
}