@@ -82,10 +82,12 @@ export class StakingRewardsService {
8282
8383 public async getHodlerData ( ) : Promise < {
8484 locksData : { [ key : string ] : string [ ] } ,
85- stakingData : { [ key : string ] : { [ key : string ] : string } }
85+ stakingData : { [ key : string ] : { [ key : string ] : string } } ,
86+ locksCount : { [ key : string ] : { [ key : string ] : number } }
8687 } > {
8788 const locksData = { }
8889 const stakingData = { }
90+ const locksCount = { }
8991
9092 const keys = await this . hodlerContract . getHodlerKeys ( )
9193 for ( const key of keys ) {
@@ -100,6 +102,10 @@ export class StakingRewardsService {
100102 if ( ! locksData [ lock . fingerprint ] . includes ( operatorAddress ) ) {
101103 locksData [ lock . fingerprint ] . push ( operatorAddress )
102104 }
105+ if ( ! locksCount [ operatorAddress ] ) {
106+ locksCount [ operatorAddress ] = { }
107+ }
108+ locksCount [ operatorAddress ] [ lock . fingerprint ] = ( locksCount [ operatorAddress ] [ lock . fingerprint ] || 0 ) + 1
103109 } )
104110
105111 const stakes : { operator : string , amount : string } [ ] = await this . hodlerContract . getStakes ( hodlerAddress )
@@ -116,7 +122,7 @@ export class StakingRewardsService {
116122 }
117123 this . logger . log ( `Fetched staking data for ${ Object . keys ( stakingData ) . length } operators` )
118124
119- return { stakingData, locksData }
125+ return { stakingData, locksData, locksCount }
120126 }
121127
122128 public async getLastSnapshot ( ) : Promise < RoundSnapshot | undefined > {
0 commit comments