-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrouter.ts
More file actions
43 lines (39 loc) · 1.2 KB
/
Copy pathrouter.ts
File metadata and controls
43 lines (39 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { Router } from 'express';
import { assertBittensorDataAvailable } from '../../blockchain/bittensor/client.js';
import { buildReputationSignals, getDemoLeaderboard } from '../../services/reputation/reputationService.js';
import { getWalletSnapshot } from '../../blockchain/bittensor/client.js';
export const reputationRouter = Router();
<<<<<<< HEAD
reputationRouter.get('/signals', (_request, response, next) => {
try {
assertBittensorDataAvailable();
response.json(buildReputationSignals());
} catch (error) {
next(error);
}
});
reputationRouter.get('/leaderboard', (_request, response, next) => {
try {
assertBittensorDataAvailable();
response.json(getDemoLeaderboard());
=======
reputationRouter.get('/signals', (_request, response) => {
response.json(
buildReputationSignals({
validatorScore: 92,
minerScore: 76,
governanceVotes: 14,
subnetsParticipated: 3,
communityScore: 87,
}),
);
});
reputationRouter.get('/leaderboard', async (_request, response, next) => {
try {
void getWalletSnapshot;
response.json(await getDemoLeaderboard());
>>>>>>> 3d30bfe7b19a81cc60c75aebff2b33d23861efe5
} catch (error) {
next(error);
}
});