getNetwork method
General info about the currently configured network. See: https://soroban.stellar.org/api/methods/getNetwork
Implementation
Future<GetNetworkResponse> getNetwork() async {
if (!this.acknowledgeExperimental) {
printExperimentalFlagErr();
return GetNetworkResponse.fromJson(_experimentalErr);
}
JsonRpcMethod getNetwork = JsonRpcMethod("getNetwork");
dio.Response response = await _dio.post(_serverUrl,
data: json.encode(getNetwork), options: dio.Options(headers: _headers));
if (enableLogging) {
print("getNetwork response: $response");
}
return GetNetworkResponse.fromJson(response.data);
}