get Chain Id
Retrieves the chain ID of the network.
Usage
val resolution = aptos.getChainId()
when (resolution) {
is Result.Ok -> {
val chainId = resolution.value
println("Network Chain ID: $chainId")
}
is Result.Err -> {
println("Error retrieving chain ID: ${resolution.error.message}")
}
}Content copied to clipboard
Return
A Result which is either Result.Ok containing the chain ID as a Long, or Result.Err containing an AptosSdkError.