@@ -4457,6 +4457,23 @@ pub fn serve<T: BeaconChainTypes>(
4457
4457
} ,
4458
4458
) ;
4459
4459
4460
+ // GET lighthouse/supply/{state_root}
4461
+ let get_lighthouse_supply = warp:: path ( "lighthouse" )
4462
+ . and ( warp:: path ( "supply" ) )
4463
+ . and ( warp:: path:: param :: < StateId > ( ) )
4464
+ . and ( warp:: path:: end ( ) )
4465
+ . and ( task_spawner_filter. clone ( ) )
4466
+ . and ( chain_filter. clone ( ) )
4467
+ . then ( |state_id : StateId , task_spawner : TaskSpawner < T :: EthSpec > , chain : Arc < BeaconChain < T > > | {
4468
+ task_spawner. blocking_json_task ( Priority :: P1 , move || {
4469
+ state_id
4470
+ . map_state_and_execution_optimistic_and_finalized ( & chain, |state, execution_optimistic, finalized| {
4471
+ Ok ( ( state. balances ( ) . iter ( ) . sum :: < u64 > ( ) , execution_optimistic, finalized) )
4472
+ } )
4473
+ . map ( api_types:: GenericResponse :: from)
4474
+ } )
4475
+ } ) ;
4476
+
4460
4477
// GET lighthouse/analysis/attestation_performance/{index}
4461
4478
let get_lighthouse_attestation_performance = warp:: path ( "lighthouse" )
4462
4479
. and ( warp:: path ( "analysis" ) )
@@ -4725,6 +4742,7 @@ pub fn serve<T: BeaconChainTypes>(
4725
4742
. uor ( get_lighthouse_staking)
4726
4743
. uor ( get_lighthouse_database_info)
4727
4744
. uor ( get_lighthouse_block_rewards)
4745
+ . uor ( get_lighthouse_supply)
4728
4746
. uor ( get_lighthouse_attestation_performance)
4729
4747
. uor ( get_beacon_light_client_optimistic_update)
4730
4748
. uor ( get_beacon_light_client_finality_update)
0 commit comments