FeeEstimate

data class FeeEstimate(val estimates: Map<Int, BlockTarget>, val timestamp: Instant)(source)

Represents a complete fee estimate with predictions for various block targets and confidence levels.

This class contains fee rate estimates organized by confirmation target (in blocks) and confidence level (as a probability between 0.0 and 1.0).

Example usage:

// Get fee rate for confirming within 6 blocks with 95% confidence
val feeRate = feeEstimate.getFeeRate(targetBlocks = 6, probability = 0.95)

// Get all estimates for confirming within 6 blocks
val sixBlockTarget = feeEstimate.getEstimatesForTarget(6)

// Print a formatted table of all estimates
println(feeEstimate)

Constructors

Link copied to clipboard
constructor(estimates: Map<Int, BlockTarget>, timestamp: Instant)

Properties

Link copied to clipboard

Map of block targets to their respective BlockTarget estimates

Link copied to clipboard

When this estimate was calculated

Functions

Link copied to clipboard

Returns all available block targets in ascending order.

Link copied to clipboard

Returns all available confidence levels in ascending order.

Link copied to clipboard

Gets all fee rate estimates for a specific target block count.

Link copied to clipboard
fun getFeeRate(targetBlocks: Int, probability: Double): Double?

Gets the recommended fee rate for a specific target block count and confidence level.

Link copied to clipboard
fun getNearestBlockTarget(targetBlocks: Int): Int?

Gets the nearest available block target to the requested target.

Link copied to clipboard
open override fun toString(): String

Returns a formatted string representation of the fee estimates as a table.