[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,
|
slug: poolInfo.slug,
|
||||||
avgMatchRate: poolInfo.avgMatchRate !== null ? Math.round(100 * poolInfo.avgMatchRate) / 100 : null,
|
avgMatchRate: poolInfo.avgMatchRate !== null ? Math.round(100 * poolInfo.avgMatchRate) / 100 : null,
|
||||||
avgFeeDelta: poolInfo.avgFeeDelta,
|
avgFeeDelta: poolInfo.avgFeeDelta,
|
||||||
|
poolUniqueId: poolInfo.poolUniqueId
|
||||||
};
|
};
|
||||||
poolsStats.push(poolStat);
|
poolsStats.push(poolStat);
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,7 @@ export interface PoolInfo {
|
|||||||
slug: string;
|
slug: string;
|
||||||
avgMatchRate: number | null;
|
avgMatchRate: number | null;
|
||||||
avgFeeDelta: number | null;
|
avgFeeDelta: number | null;
|
||||||
|
poolUniqueId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PoolStats extends PoolInfo {
|
export interface PoolStats extends PoolInfo {
|
||||||
|
@ -40,7 +40,8 @@ class PoolsRepository {
|
|||||||
pools.link AS link,
|
pools.link AS link,
|
||||||
slug,
|
slug,
|
||||||
AVG(blocks_audits.match_rate) AS avgMatchRate,
|
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
|
FROM blocks
|
||||||
JOIN pools on pools.id = pool_id
|
JOIN pools on pools.id = pool_id
|
||||||
LEFT JOIN blocks_audits ON blocks_audits.height = blocks.height
|
LEFT JOIN blocks_audits ON blocks_audits.height = blocks.height
|
||||||
|
@ -111,6 +111,7 @@ export interface PoolInfo {
|
|||||||
regexes: string; // JSON array
|
regexes: string; // JSON array
|
||||||
addresses: string; // JSON array
|
addresses: string; // JSON array
|
||||||
emptyBlocks: number;
|
emptyBlocks: number;
|
||||||
|
poolUniqueId: number;
|
||||||
}
|
}
|
||||||
export interface PoolStat {
|
export interface PoolStat {
|
||||||
pool: PoolInfo;
|
pool: PoolInfo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user