-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathadapters.ts
169 lines (167 loc) · 3.51 KB
/
adapters.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
export type Exports = {
timestampFrom: number;
sources: string[];
vestingSchedule: Allocation;
comments: string | undefined;
cap: number | Function | undefined;
};
export type Contracts = { [tag: string]: string };
export type Allocation = {
insiders: SubAllocation[];
community: SubAllocation[];
};
export type SubAllocation = {
name: string;
total: number;
from?: number;
until?: number;
schedule: any;
};
export type AdapterResult = {
type: "cliff" | "linear" | "step";
start?: number | string;
end?: number | string;
amount: number;
steps?: number;
cliff?: number;
stepDuration?: number | string;
receiver?: string;
token?: string;
confirmed?: boolean;
dateFormat?: string;
};
export type RawResult = {
timestamp: number;
change: number;
continuousEnd: number | undefined;
};
export type StepAdapterResult = {
start: number;
stepDuration: number;
steps: number;
amount: number;
type: "step";
dateFormat?: string;
};
export type CliffAdapterResult = {
type: "cliff";
start: number;
amount: number;
dateFormat?: string;
};
export type LinearAdapterResult = {
type: "linear";
start: number;
end: number;
amount: number;
dateFormat?: string;
};
export type ChartData = {
timestamps: number[];
unlocked: number[];
isContinuous: boolean;
apiData?: ApiChartData[];
};
export type ApiChartData = {
timestamp: number;
unlocked: number;
label?: string;
};
export type TransposedApiChartData = {
label: string;
data: any;
};
export type ChartYAxisData = {
start: number;
increment: number;
data: number[];
end: number;
};
export type Protocol = {
[section: string]: any;
documented?: Documented;
meta: Metadata;
categories: { [key in SectionType]?: string[] | undefined };
};
export type Documented = {
replaces: string[];
[section: string]: any;
};
export type IncompleteSection = {
key: string;
allocation: number | undefined;
lastRecord: any;
};
export type SectionType =
| "publicSale"
| "insiders"
| "airdrop"
| "farming"
| "noncirculating"
| "liquidity";
export type RawSection = {
section: string;
results: RawResult[] | RawResult[][];
};
export type ChartConfig = {
steps: number;
timestamps: number[];
unlocked: number[];
workingQuantity: number;
workingTimestamp: number;
roundedStart: number;
roundedEnd: number;
apiData: ApiChartData[];
incompleteSection?: IncompleteSection;
protocol: string;
};
export type ChartSection = {
data: ChartData;
section: string;
};
export type Dataset = {
label: string;
data: number[];
borderColor: string;
backgroundColor: string;
fill: boolean;
};
export type SectionData = {
rawSections: RawSection[];
documented: RawSection[];
startTime: number;
endTime: number;
metadata: Metadata;
categories: Categories;
};
export type Categories = {
[category: string]: string[];
};
export type Metadata = {
sources: string[];
token: string;
events?: Event[];
notes?: string[];
protocolIds: string[];
incompleteSections?: IncompleteSection[];
total?: number
};
export type FuturesData = {
openInterest: number;
fundingRate: number;
success?: boolean;
ratelimited?: boolean;
};
export type Event = {
description: string;
timestamp: number;
noOfTokens: number[];
};
export type TimeSeriesChainData = {
[block: string]: {
timestamp: number;
result?: any;
};
};
export type Allocations = { [category: string]: number };
export type EmissionBreakdown = Record<string, { emission24h: number; emission7d: number; emission30d: number }>;