get Expiration
Retrieves the expiration time of a domain or subdomain name.
Usage
val aptos = Aptos(AptosConfig(AptosSettings(network = Network.MAINNET)))
val resolution = aptos.getExpiration("greg.apt")
when (resolution) {
is Result.Ok -> {
val expirationTimestamp = resolution.value
println("'greg.apt' expires at timestamp: $expirationTimestamp")
}
is Result.Err -> {
println("Error retrieving expiration: ${resolution.error.message}")
}
}Content copied to clipboard
Return
A Result which is either Result.Ok containing the expiration timestamp as a Long, or Result.Err containing an AptosSdkError.
Parameters
name
The ANS name to query.