[mining] send pool unique id in /pools API
This commit is contained in:
		
							parent
							
								
									f8faccd502
								
							
						
					
					
						commit
						d236d89717
					
				@ -107,6 +107,7 @@ class Mining {
 | 
			
		||||
        slug: poolInfo.slug,
 | 
			
		||||
        avgMatchRate: poolInfo.avgMatchRate !== null ? Math.round(100 * poolInfo.avgMatchRate) / 100 : null,
 | 
			
		||||
        avgFeeDelta: poolInfo.avgFeeDelta,
 | 
			
		||||
        poolUniqueId: poolInfo.poolUniqueId
 | 
			
		||||
      };
 | 
			
		||||
      poolsStats.push(poolStat);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,7 @@ export interface PoolInfo {
 | 
			
		||||
  slug: string;
 | 
			
		||||
  avgMatchRate: number | null;
 | 
			
		||||
  avgFeeDelta: number | null;
 | 
			
		||||
  poolUniqueId: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface PoolStats extends PoolInfo {
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,8 @@ class PoolsRepository {
 | 
			
		||||
          pools.link AS link,
 | 
			
		||||
          slug,
 | 
			
		||||
          AVG(blocks_audits.match_rate) AS avgMatchRate,
 | 
			
		||||
          AVG((CAST(blocks.fees as SIGNED) - CAST(blocks_audits.expected_fees as SIGNED)) / NULLIF(CAST(blocks_audits.expected_fees as SIGNED), 0)) AS avgFeeDelta
 | 
			
		||||
          AVG((CAST(blocks.fees as SIGNED) - CAST(blocks_audits.expected_fees as SIGNED)) / NULLIF(CAST(blocks_audits.expected_fees as SIGNED), 0)) AS avgFeeDelta,
 | 
			
		||||
          unique_id as poolUniqueId
 | 
			
		||||
      FROM blocks
 | 
			
		||||
      JOIN pools on pools.id = pool_id
 | 
			
		||||
      LEFT JOIN blocks_audits ON blocks_audits.height = blocks.height
 | 
			
		||||
 | 
			
		||||
@ -111,6 +111,7 @@ export interface PoolInfo {
 | 
			
		||||
  regexes: string; // JSON array
 | 
			
		||||
  addresses: string; // JSON array
 | 
			
		||||
  emptyBlocks: number;
 | 
			
		||||
  poolUniqueId: number;
 | 
			
		||||
}
 | 
			
		||||
export interface PoolStat {
 | 
			
		||||
  pool: PoolInfo;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user