-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
45 lines (40 loc) · 1.02 KB
/
schema.graphql
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
type Referral @entity {
id: Bytes! # tx hash
referee: Bytes! # address
referrer: Bytes! # address
passport: Bytes! # address
amount: BigInt!
}
type Account @entity {
id: String! # passport contract address + wallet address
claimedCount: Int!
claimedAmount: BigInt!
unclaimedCount: Int!
unclaimedAmount: BigInt!
totalCount: Int! # unclaimed + claimed
totalAmount: BigInt! # unclaimed + claimed
}
# To easily map data between events
type Transaction @entity {
id: Bytes! # tx hash
sender: Bytes! # address
referrer: Bytes # address
passport: Bytes! # address
referred: Boolean
reservationCount: Int
}
type Reservation @entity {
id: String! # passport address + payment id
count: Int!
}
type Escrow @entity {
id: Bytes! # address
passport: Bytes! # address
}
# Convenient counters for each passports
# Record with address zero for id is counters for entire chain
type Statistic @entity {
id: Bytes! # passport address / address zero
totalReferralAmount: BigInt!
totalReferralCount: Int!
}