Added mining/pool/:poolId and mining/pool/:poolId/:interval APIs

This commit is contained in:
nymkappa
2022-02-08 18:28:53 +09:00
parent c900fdbf4f
commit 6f18a5f1b6
5 changed files with 94 additions and 15 deletions

View File

@@ -41,6 +41,23 @@ class PoolsRepository {
return <PoolInfo[]>rows;
}
/**
* Get mining pool statistics for one pool
*/
public async $getPool(poolId: number) : Promise<object> {
const query = `
SELECT *
FROM pools
WHERE pools.id = ${poolId}
`;
const connection = await DB.pool.getConnection();
const [rows] = await connection.query(query);
connection.release();
return rows[0];
}
}
export default new PoolsRepository();