diff --git a/docs/src/inscriptions/recursion.md b/docs/src/inscriptions/recursion.md index ea901eda9b..e20a2ac20a 100644 --- a/docs/src/inscriptions/recursion.md +++ b/docs/src/inscriptions/recursion.md @@ -78,6 +78,9 @@ Examples - `/r/blockinfo/0`: +Note: `feerate_percentiles` are feerates at the 10th, 25th, 50th, 75th, and 90th +percentile in sats/vB. + ```json { "average_fee": 0, @@ -87,6 +90,7 @@ Examples "confirmations": 0, "difficulty": 0.0, "hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "feerate_percentiles": [0, 0, 0, 0, 0], "height": 0, "max_fee": 0, "max_fee_rate": 0, diff --git a/src/api.rs b/src/api.rs index 9efdf1e48d..177cf92bf6 100644 --- a/src/api.rs +++ b/src/api.rs @@ -50,6 +50,7 @@ pub struct BlockInfo { pub confirmations: i32, pub difficulty: f64, pub hash: BlockHash, + pub feerate_percentiles: [u64; 5], pub height: u32, pub max_fee: u64, pub max_fee_rate: u64, diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index e6e168f2a1..6178cedbe7 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -1296,6 +1296,13 @@ impl Server { confirmations: info.confirmations, difficulty: info.difficulty, hash, + feerate_percentiles: [ + stats.fee_rate_percentiles.fr_10th.to_sat(), + stats.fee_rate_percentiles.fr_25th.to_sat(), + stats.fee_rate_percentiles.fr_50th.to_sat(), + stats.fee_rate_percentiles.fr_75th.to_sat(), + stats.fee_rate_percentiles.fr_90th.to_sat(), + ], height: info.height.try_into().unwrap(), max_fee: stats.max_fee.to_sat(), max_fee_rate: stats.max_fee_rate.to_sat(), @@ -6421,6 +6428,7 @@ next hash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" .parse() .unwrap(), + feerate_percentiles: [0, 0, 0, 0, 0], height: 0, max_fee: 0, max_fee_rate: 0, @@ -6460,6 +6468,7 @@ next hash: "56d05060a0280d0712d113f25321158747310ece87ea9e299bde06cf385b8d85" .parse() .unwrap(), + feerate_percentiles: [0, 0, 0, 0, 0], height: 1, max_fee: 0, max_fee_rate: 0,