-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.ts
85 lines (77 loc) · 2.05 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
export type EthAddress = string
export type AdjacencyMap = Record<number, Set<number>>
export type Pretrust = { i: number, v: number }[]
export type GlobalTrust = { i: number, v: number, username?: string, rank?: number }[]
export type LocalTrust = { i: number, j: number, v: number, date: Date }[]
export type ExtendedProfile = { }[]
export type Strategy = { strategy_id: number; pretrust: string; localtrust: string; alpha: number; };
export type GlobalRank = { i: number, v: number, username?: string, rank?: number,
following: number, followers: number,
likes: number, replies: number,
recasts: number, mentions: number
}[]
export type Entry = [ number, number ]
export type kvPair = {[k: string]: {[v: string]: number}}
export type FollowsLinksRecords = { followerFid: number, followingFid: number, id: number }[]
export type LocaltrustStrategy = () => Promise<LocalTrust>
export type AttributeMaps = () => Promise<kvPair>;
export type AttributeWithMax = {
map: kvPair;
max: number;
}
export type AttributesObject = {
likes: AttributeWithMax,
mentions: AttributeWithMax,
replies: AttributeWithMax,
recasts: AttributeWithMax,
}
export interface Follow {
followerFid: number,
followingFid: number,
createdAt: Date
}
export interface Like {
type: string,
fid: number,
castHash: string,
createdAt: Date
}
export interface Profile {
fid: number
address: string
username: string
displayName: string
avatarUrl: string
avatarVerified: boolean
followers: string
following: string
bio: string
referrer: string
registeredAt: Date
updatedAt: Date
customMetrics: object
youFollow?: boolean
followsYou?: boolean
}
export interface Cast {
hash: string,
threadHash: string,
authorFid: number,
address: string,
username: string,
text: string,
displayName: string,
publishedAt: string,
avatarUrl: string,
avatarVerified: boolean,
replyToData: any,
replyParentHash: number,
replyParentFid: number,
reactions: number,
recasts: number,
watches: number,
mentions: any[] | null,
recasters: any[] | null
recastedCastHash: string
isRecast: boolean
}