getGasPriceEstimation

Retrieves a gas price estimation from the network.

This is useful for setting a gas unit price that is likely to be accepted in a reasonable amount of time.

Usage

val resolution = aptos.getGasPriceEstimation()
when (resolution) {
is Result.Ok -> {
val gasInfo = resolution.value
println("Standard gas unit price: ${gasInfo.gasEstimate}")
}
is Result.Err -> {
println("Error estimating gas price: ${resolution.error.message}")
}
}

Return

A Result containing GasEstimation data or an AptosSdkError.