@@ -270,6 +270,57 @@ pub struct GetBlockStatsResult {
270
270
pub utxo_size_inc : i32 ,
271
271
}
272
272
273
+ #[ derive( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
274
+ pub struct GetBlockStatsResultPartial {
275
+ #[ serde( rename = "avgfee" ) ]
276
+ pub avg_fee : Option < u32 > ,
277
+ #[ serde( rename = "avgfeerate" ) ]
278
+ pub avg_fee_rate : Option < u32 > ,
279
+ #[ serde( rename = "avgtxsize" ) ]
280
+ pub avg_tx_size : Option < u32 > ,
281
+ #[ serde( rename = "blockhash" ) ]
282
+ pub block_hash : Option < bitcoin:: BlockHash > ,
283
+ #[ serde( rename = "feerate_percentiles" ) ]
284
+ pub fee_rate_percentiles : Option < FeeRatePercentiles > ,
285
+ pub height : Option < u64 > ,
286
+ pub ins : Option < usize > ,
287
+ #[ serde( rename = "maxfee" ) ]
288
+ pub max_fee : Option < u64 > ,
289
+ #[ serde( rename = "maxfeerate" ) ]
290
+ pub max_fee_rate : Option < u32 > ,
291
+ #[ serde( rename = "maxtxsize" ) ]
292
+ pub max_tx_size : Option < u32 > ,
293
+ #[ serde( rename = "medianfee" ) ]
294
+ pub median_fee : Option < u32 > ,
295
+ #[ serde( rename = "mediantime" ) ]
296
+ pub median_time : Option < u32 > ,
297
+ #[ serde( rename = "mediantxsize" ) ]
298
+ pub median_tx_size : Option < u32 > ,
299
+ #[ serde( rename = "minfee" ) ]
300
+ pub min_fee : Option < u32 > ,
301
+ #[ serde( rename = "minfeerate" ) ]
302
+ pub min_fee_rate : Option < u32 > ,
303
+ #[ serde( rename = "mintxsize" ) ]
304
+ pub min_tx_size : Option < u32 > ,
305
+ pub outs : Option < usize > ,
306
+ pub subsidy : Option < u32 > ,
307
+ #[ serde( rename = "swtotal_size" ) ]
308
+ pub sw_total_size : Option < usize > ,
309
+ #[ serde( rename = "swtotal_weight" ) ]
310
+ pub sw_total_weight : Option < usize > ,
311
+ #[ serde( rename = "swtxs" ) ]
312
+ pub sw_txs : Option < usize > ,
313
+ pub time : Option < u32 > ,
314
+ pub total_out : Option < usize > ,
315
+ pub total_size : Option < usize > ,
316
+ pub total_weight : Option < usize > ,
317
+ #[ serde( rename = "totalfee" ) ]
318
+ pub total_fee : Option < u64 > ,
319
+ pub txs : Option < usize > ,
320
+ pub utxo_increase : Option < i32 > ,
321
+ pub utxo_size_inc : Option < i32 > ,
322
+ }
323
+
273
324
#[ derive( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
274
325
pub struct FeeRatePercentiles {
275
326
pub fr_10th : u32 ,
@@ -279,6 +330,74 @@ pub struct FeeRatePercentiles {
279
330
pub fr_90th : u32 ,
280
331
}
281
332
333
+ pub enum BlockStatsFields {
334
+ AverageFee ,
335
+ AverageFeeRate ,
336
+ AverageTxSize ,
337
+ BlockHash ,
338
+ FeeRatePercentiles ,
339
+ Height ,
340
+ Ins ,
341
+ MaxFee ,
342
+ MaxFeeRate ,
343
+ MaxTxSize ,
344
+ MedianFee ,
345
+ MedianTime ,
346
+ MedianTxSize ,
347
+ MinFee ,
348
+ MinFeeRate ,
349
+ MinTxSize ,
350
+ Outs ,
351
+ Subsidy ,
352
+ SegWitTotalSize ,
353
+ SegWitTotalWeight ,
354
+ SegWitTxs ,
355
+ Time ,
356
+ TotalOut ,
357
+ TotalSize ,
358
+ TotalWeight ,
359
+ TotalFee ,
360
+ Txs ,
361
+ UtxoIncrease ,
362
+ UtxoSizeIncrease ,
363
+ }
364
+
365
+ impl BlockStatsFields {
366
+ pub fn get_rpc_keyword ( & self ) -> & str {
367
+ match * self {
368
+ BlockStatsFields :: AverageFee => "avgfee" ,
369
+ BlockStatsFields :: AverageFeeRate => "avgfeerate" ,
370
+ BlockStatsFields :: AverageTxSize => "avgtxsize" ,
371
+ BlockStatsFields :: BlockHash => "blockhash" ,
372
+ BlockStatsFields :: FeeRatePercentiles => "feerate_percentiles" ,
373
+ BlockStatsFields :: Height => "height" ,
374
+ BlockStatsFields :: Ins => "ins" ,
375
+ BlockStatsFields :: MaxFee => "maxfee" ,
376
+ BlockStatsFields :: MaxFeeRate => "maxfeerate" ,
377
+ BlockStatsFields :: MaxTxSize => "maxtxsize" ,
378
+ BlockStatsFields :: MedianFee => "medianfee" ,
379
+ BlockStatsFields :: MedianTime => "mediantime" ,
380
+ BlockStatsFields :: MedianTxSize => "mediantxsize" ,
381
+ BlockStatsFields :: MinFee => "minfee" ,
382
+ BlockStatsFields :: MinFeeRate => "minfeerate" ,
383
+ BlockStatsFields :: MinTxSize => "minfeerate" ,
384
+ BlockStatsFields :: Outs => "outs" ,
385
+ BlockStatsFields :: Subsidy => "subsidy" ,
386
+ BlockStatsFields :: SegWitTotalSize => "swtotal_size" ,
387
+ BlockStatsFields :: SegWitTotalWeight => "swtotal_weight" ,
388
+ BlockStatsFields :: SegWitTxs => "swtxs" ,
389
+ BlockStatsFields :: Time => "time" ,
390
+ BlockStatsFields :: TotalOut => "total_out" ,
391
+ BlockStatsFields :: TotalSize => "total_size" ,
392
+ BlockStatsFields :: TotalWeight => "total_weight" ,
393
+ BlockStatsFields :: TotalFee => "totalfee" ,
394
+ BlockStatsFields :: Txs => "txs" ,
395
+ BlockStatsFields :: UtxoIncrease => "utxo_increase" ,
396
+ BlockStatsFields :: UtxoSizeIncrease => "utxo_size_inc" ,
397
+ }
398
+ }
399
+ }
400
+
282
401
#[ derive( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
283
402
#[ serde( rename_all = "camelCase" ) ]
284
403
pub struct GetMiningInfoResult {
0 commit comments