-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.ts
68 lines (58 loc) · 1.42 KB
/
types.ts
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { StatusConfigType } from "./app/config";
export type GameConfig = {
teams: Team[];
points_config: { points_per_lagging_node: number; points_per_unreachable_node: number, core_version: Record<string, number> };
config: { blocks_behind_before_considered_lagging: number };
fork_observer_api: string;
};
export type Team = {
name: string;
nodes: string[];
};
export type ForkObserverData = {
header_infos: HeaderInfoData[];
nodes: NodeData[];
latestTipHeight: number;
events?: EVENT[];
};
export type NodeData = {
id: number;
name: string;
description: string;
implementation: string;
tips: { hash: string; status: string; height: number }[];
last_changed_timestamp: number;
version: string;
reachable: boolean;
};
export type NodeDataWithStatus = NodeData & {status: StatusConfigType, score: number};
export type HeaderInfoData = {
id: number;
prev_id: number;
height: number;
hash: string;
version: number;
prev_blockhash: string;
merkle_root: string;
time: number;
bits: number;
nonce: number;
miner: string;
};
export type AwardedTeamPoints = Record<string, number>;
type EventType = StatusConfigType | "style-points";
export type EVENT = {
message: string;
date: string;
type?: EventType;
meta?: string[];
}
export type InternalData = {
points: AwardedTeamPoints;
events: EVENT[];
}
export type StylePoints = {
name: string;
score: number;
reason?: string;
}