@@ -4448,6 +4448,23 @@ pub fn serve<T: BeaconChainTypes>(
4448
4448
} )
4449
4449
} ) ;
4450
4450
4451
+ // GET lighthouse/supply/{state_root}
4452
+ let get_lighthouse_supply = warp:: path ( "lighthouse" )
4453
+ . and ( warp:: path ( "supply" ) )
4454
+ . and ( warp:: path:: param :: < StateId > ( ) )
4455
+ . and ( warp:: path:: end ( ) )
4456
+ . and ( task_spawner_filter. clone ( ) )
4457
+ . and ( chain_filter. clone ( ) )
4458
+ . then ( |state_id : StateId , task_spawner : TaskSpawner < T :: EthSpec > , chain : Arc < BeaconChain < T > > | {
4459
+ task_spawner. blocking_json_task ( Priority :: P1 , move || {
4460
+ state_id
4461
+ . map_state_and_execution_optimistic_and_finalized ( & chain, |state, execution_optimistic, finalized| {
4462
+ Ok ( ( state. balances ( ) . iter ( ) . sum :: < u64 > ( ) , execution_optimistic, finalized) )
4463
+ } )
4464
+ . map ( api_types:: GenericResponse :: from)
4465
+ } )
4466
+ } ) ;
4467
+
4451
4468
// GET lighthouse/analysis/attestation_performance/{index}
4452
4469
let get_lighthouse_attestation_performance = warp:: path ( "lighthouse" )
4453
4470
. and ( warp:: path ( "analysis" ) )
@@ -4720,6 +4737,7 @@ pub fn serve<T: BeaconChainTypes>(
4720
4737
. uor ( get_lighthouse_staking)
4721
4738
. uor ( get_lighthouse_database_info)
4722
4739
. uor ( get_lighthouse_block_rewards)
4740
+ . uor ( get_lighthouse_supply)
4723
4741
. uor ( get_lighthouse_attestation_performance)
4724
4742
. uor ( get_beacon_light_client_optimistic_update)
4725
4743
. uor ( get_beacon_light_client_finality_update)
0 commit comments