getBlockTransactionCountByNumber method Null safety

Future<EtherScanRpcResponseModel> getBlockTransactionCountByNumber (
  1. {required String? tag}
)

Returns the number of transactions in a block from a block matching the given block number

tag - Tag to look up

Example

var res = eth.getBlockTransactionCountByNumber(
    tag:'0x10FB78'
);

Implementation

Future<EtherScanRpcResponseModel> getBlockTransactionCountByNumber({
  required String? tag,
}) async {
  const module = 'proxy';
  const action = 'eth_getBlockTransactionCountByNumber';

  Map<String, dynamic>? query = {
    'tag': tag,
    'module': module,
    'action': action,
    'apiKey': apiKey,
  };
  return (await get(query)).fold(
    (l) => EtherScanRpcResponseModel.empty(),
    (r) => EtherScanRpcResponseModel.fromJson(r),
  );
}