forked from valve-finance/erc20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
62 lines (58 loc) · 1.18 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
"""
Asset stores all high level variables for a Token asset
"""
type Asset @entity {
"Token address"
id: ID!
"Name of the Token"
name: String!
"Token symbol"
symbol: String!
"Token decimals"
decimals: Int!
}
"""
User is a single ethereum address and related information
"""
type User @entity {
"User wallet address"
id: ID!
"Number of tokens"
tokenCount: BigInt!
"User tokens"
tokens: [UserToken!]! @derivedFrom(field: "owner")
}
"""
UserToken is the token info for a user
"""
type UserToken @entity {
"User+Token"
id: ID!
"Token balance of the user"
balance: BigDecimal!
"Approved token to use"
token: Asset!
"Relation to user"
owner: User!
"Number of approvals"
approvalCount: BigInt!
"Array of approvals for user"
approvals: [UserApproval!]! @derivedFrom(field: "userToken")
}
"""
Approvals of tokens and related information
"""
type UserApproval @entity {
"Owner address + Spender address"
id: ID!
"Relation to user token"
userToken: UserToken!
"Relation to user"
owner: User!
"Spender of approval"
spender: Bytes!
"Value of approvals"
value: BigDecimal!
"Approved token to use"
token: Asset!
}