getLatestLedger method
For finding out the current latest known ledger. See: https://developers.stellar.org/network/soroban-rpc/api-reference/methods/getLatestLedger
Implementation
Future<GetLatestLedgerResponse> getLatestLedger() async {
JsonRpcMethod getLatestLedger = JsonRpcMethod("getLatestLedger");
dio.Response response = await _dio.post(_serverUrl,
data: json.encode(getLatestLedger),
options: dio.Options(headers: _headers));
if (enableLogging) {
print("getLatestLedger response: $response");
}
return GetLatestLedgerResponse.fromJson(response.data);
}