getMinedBlocks method Null safety

Future<EtherScanMintedBlocksModel> getMinedBlocks (
  1. {required String address}
)

Get a list of blocks that a specific account has mineds

Example

var txlist = eth.getMinedBlocks(
  address:'0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b'
);

address - Transaction hash

Implementation

Future<EtherScanMintedBlocksModel> getMinedBlocks({
  required String address,
}) async {
  const module = 'account';
  const action = 'getminedblocks';

  final query = {
    'module': module,
    'action': action,
    'address': address,
    'apiKey': apiKey,
  };

  return (await get(query)).fold(
    (l) => EtherScanMintedBlocksModel.empty(),
    (r) => EtherScanMintedBlocksModel.fromJson(r),
  );
}