getHeight static method

Future<int?> getHeight({
  1. RpcConfig? config,
})

getHeight RPC returns the latest block height.

Implementation

static Future<int?> getHeight({RpcConfig? config}) async {
  try {
    return await _methodChannel.invokeMethod('getHeight', {
      'seedRpc': config?.seedRPCServerAddr?.isNotEmpty == true
          ? config?.seedRPCServerAddr
          : [DEFAULT_SEED_RPC_SERVER],
    });
  } catch (e) {
    rethrow;
  }
}