get Ledger Info
Retrieves the latest ledger information from a fullnode.
Usage
val resolution = aptos.getLedgerInfo()
when (resolution) {
is Result.Ok -> {
val ledgerInfo = resolution.value
println("Current ledger version: ${ledgerInfo.ledgerVersion}")
}
is Result.Err -> {
println("Error retrieving ledger info: ${resolution.error.message}")
}
}Content copied to clipboard
Return
A Result which is either Result.Ok containing the LedgerInfo, or Result.Err containing an AptosSdkError.