getLedgerEntries method
For reading the current value of ledger entries directly. Allows you to directly inspect the current state of a contract, a contract’s code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or simulateTransaction. To fetch contract wasm byte-code, use the ContractCode ledger entry key. See: https://developers.stellar.org/network/soroban-rpc/api-reference/methods/getLedgerEntries
Implementation
Future<GetLedgerEntriesResponse> getLedgerEntries(
List<String> base64EncodedKeys) async {
JsonRpcMethod getLedgerEntries =
JsonRpcMethod("getLedgerEntries", args: {'keys': base64EncodedKeys});
dio.Response response = await _dio.post(_serverUrl,
data: json.encode(getLedgerEntries),
options: dio.Options(headers: _headers));
if (enableLogging) {
print("getLedgerEntries response: $response");
}
return GetLedgerEntriesResponse.fromJson(response.data);
}