getBlock method

Future<TronBlockInfo> getBlock()

Implementation

Future<TronBlockInfo> getBlock() async {
  final result =
      await postCall<JSON>("$baseURL/wallet/getnowblock", data: {});

  final blockId = result["blockID"] as String;
  final blockNumber = result["block_header"]["raw_data"]["number"] as int;

  return (blockId: blockId, blockNumber: blockNumber);
}