-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
62 lines (54 loc) · 1.44 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
type Account @entity {
id: ID! # user account(Polkadot address)
userAddress: String! # EVM address
claimTxs: [ClaimTx]! @derivedFrom(field: "account")
claims: [Claim]! @derivedFrom(field: "account")
tokenClaimed: [AccountTokenClaimed]! @derivedFrom(field: "account")
}
type AccountTokenClaimed @entity {
id: ID! #account-token
account: Account!
token: String!
amount: BigInt!
}
type DailyTokenClaimed @entity {
id: ID! #account-token
dailyStats: DistributorDailyStat!
token: String!
amount: BigInt!
}
type Distributor @entity {
id: ID! # contract address
dailyStats: [DistributorDailyStat]! @derivedFrom(field: "distributor")
}
type DistributorDailyStat @entity {
id: ID! # contractAddress-timestamp
distributor: Distributor!
startOfDay: Date!
txs: [ClaimTx]! @derivedFrom(field: "dailyStats")
claims: [Claim]! @derivedFrom(field: "dailyStats")
totalClaimed: [DailyTokenClaimed]! @derivedFrom(field: "dailyStats")
}
type ClaimTx @entity {
id: ID! # txHash
distributor: Distributor!
dailyStats: DistributorDailyStat!
account: Account!
block: Block!
claims: [Claim]! @derivedFrom(field: "claimTx")
}
type Claim @entity {
id: ID! # txHash-logIndex
claimTx: ClaimTx!
dailyStats: DistributorDailyStat!
logIndex: Int!
account: Account!
token: String!
amount: BigInt!
}
type Block @entity {
id: ID! # block number
hash: String
timestamp: Date
claimTxs: [ClaimTx]! @derivedFrom(field: "block")
}