block method
Get a block by hash or height
hashOrHeight can be:
- Block hash as hex string (64 characters)
- Block height as integer (as string)
Implementation
Future<Block> block(String hashOrHeight) async {
if (hashOrHeight.isEmpty) {
throw ValidationException('Hash or height cannot be empty');
}
final data = await _proxyInterface.get('/block/$hashOrHeight');
final block = pb.Block.fromBuffer(data);
return Block.fromProto(block);
}