All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.provenance.client.common.gas.prices.CachedGasPrices.kt Maven / Gradle / Ivy

The newest version!
package io.provenance.client.common.gas.prices

import io.provenance.caching.cached
import kotlin.time.Duration

/**
 * Cache the gas prices for a determined period of time
 */
fun cachedGasPrice(gasPrices: GasPrices, duration: Duration) : GasPrices {
    val cached = cached(duration) { gasPrices() }
    return gasPrices { cached.get() }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy