-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
116 lines (115 loc) · 2.75 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
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
"""
Base Account type
"""
type Account @entity {
"Id is address of account"
id: ID!
"Balance of account"
balance: BigInt!
"List of transfers where account is sender"
transfersFrom: [Transfer!]! @derivedFrom(field: "from")
"List of transfers where account is reciever"
transfersTo: [Transfer!]! @derivedFrom(field: "to")
"List of transfers where account sends tokens of another account (via approve)"
delegatedTransfes: [Transfer!]! @derivedFrom(field: "caller")
"List of deposit transactions (ETH to WETH swaps)"
deposits: [Deposit!]! @derivedFrom(field: "account")
"List of withdrawal transactions (WETH to ETH swaps)"
withdrawals: [Withdrawal!]! @derivedFrom(field: "account")
"List of allowances approved by account"
allowancesFrom: [Allowance!]! @derivedFrom(field: "from")
"List of allowances to this account"
allowancesTo: [Allowance!]! @derivedFrom(field: "to")
"List of approve transaction made by account"
approvesFrom: [Approve!]! @derivedFrom(field: "from")
"List of approve transaction for this account"
approvesTo: [Approve!]! @derivedFrom(field: "to")
allowancesFromList: [Bytes!]
}
"""
Records containing all alowances
"""
type Allowance @entity {
"From Address + To Address"
id: ID!
"Owner of balance"
from: Account!
"Allowance owner"
to: Account!
"Amount of remain tokens"
value: BigInt!
}
"""
Describes approve transaction
"""
type Approve @entity {
"Transaction hash + Event log index"
id: ID!
"Owner of balance"
from: Account!
"Allowance owner"
to: Account!
"Amount of tokens to approve"
value: BigInt!
"Block number"
block: BigInt!
"Tiestamp of transaction"
timestamp: BigInt!
}
"""
Singleton. Global status record
"""
type Status @entity {
"Always is 0"
id: ID!
"Amount of WETH tokens (equals to contract balance of ETH)"
totalSupply: BigInt!
"Total WETH transfer volume"
transferVolume: BigInt!
}
"""
Describes transfer transaction
"""
type Transfer @entity {
"Transaction hash + Event log index"
id: ID!
from: Account!
to: Account!
value: BigInt!
"If transfer made by transferFrom caller is author of transaction"
caller: Account
"Block number"
block: BigInt!
"Tiestamp of transaction"
timestamp: BigInt!
}
"""
Describes deposit transaction
"""
type Deposit @entity {
"Transaction hash + Event log index"
id: ID!
"Who deposited"
account: Account!
"Amount of deposited ETH"
value: BigInt!
"Block number"
block: BigInt!
"Tiestamp of transaction"
timestamp: BigInt!
}
"""
Describes withdrawal transsaction
"""
type Withdrawal @entity {
"Transaction hash + Event log index"
id: ID!
"Who withdrawed"
account: Account!
"Amount of withdrawed WETH"
value: BigInt!
"Block number"
block: BigInt!
"Tiestamp of transaction"
timestamp: BigInt!
}