coreVersionFromApis method

int? coreVersionFromApis(
  1. List<ApiVersion> apis
)

There exists multiple versions of `RuntimeVersion` and they are versioned using the Core runtime api:

  • Core version < 3 is a runtime version without a transaction version and state version.
  • Core version 3 is a runtime version without a state version.
  • Core version 4 is the latest runtime version.

Implementation

int? coreVersionFromApis(List<ApiVersion> apis) {
  apis = apis.where((api) => api.id == coreId).toList();
  return apis.isNotEmpty ? apis.first.version : null;
}