-
Notifications
You must be signed in to change notification settings - Fork 9
/
schema.graphql
189 lines (175 loc) · 3.76 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
type _Schema_
@fulltext(
name: "carbonOffsetSearch"
language: en
algorithm: rank
include: [
{
entity: "CarbonOffset"
fields: [{ name: "methodologyCategory" }, { name: "region" }, { name: "country" }, { name: "vintageYear" }]
}
]
)
type CarbonOffset @entity {
id: ID!
name: String!
tokenAddress: String!
bridge: String!
registry: String!
totalBridged: BigDecimal!
totalRetired: BigDecimal!
currentSupply: BigDecimal!
vintage: String!
vintageYear: String!
projectID: String!
standard: String!
methodology: String!
methodologyCategory: String!
country: String!
region: String!
storageMethod: String!
method: String!
emissionType: String!
category: String!
isCorsiaCompliant: Boolean
coBenefits: String!
correspAdjustment: String!
additionalCertification: String!
klimaRanking: BigInt!
bridges: [Bridge!] @derivedFrom(field: "offset")
retirements: [Retire!] @derivedFrom(field: "offset")
balanceBCT: BigDecimal!
balanceNCT: BigDecimal!
balanceUBO: BigDecimal!
balanceNBO: BigDecimal!
lastUpdate: BigInt!
}
type Bridge @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
offset: CarbonOffset!
value: BigDecimal!
bridger: String!
}
"""
CrosschainBridge entity tracks pool bridges across different blockchains
Currently used by Toucan
"""
type CrosschainBridge @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
pool: String!
value: BigDecimal!
bridger: String!
direction: BridgeDirection!
}
enum BridgeDirection {
Sent
Received
}
type Deposit @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
offset: CarbonOffset!
pool: String!
value: BigDecimal!
depositor: String!
}
type Redeem @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
offset: CarbonOffset!
pool: String!
value: BigDecimal!
redeemer: String!
}
type Retire @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
offset: CarbonOffset!
value: BigDecimal!
beneficiary: String!
retiree: String!
}
type Transaction @entity {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!
blockHash: Bytes!
from: Bytes!
to: Bytes
value: BigInt!
# gasUsed: BigInt!
gasPrice: BigInt!
}
type KlimaRetire @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
index: BigInt!
offset: CarbonOffset!
pool: String!
token: String!
amount: BigDecimal!
feeAmount: BigDecimal!
retiringAddress: String!
beneficiary: String!
beneficiaryAddress: String!
retirementMessage: String!
specific: Boolean!
certificateTokenID: BigInt
}
type DailyKlimaRetirement @entity {
id: ID!
timestamp: BigInt!
pool: String!
token: String!
offset: CarbonOffset!
amount: BigDecimal!
feeAmount: BigDecimal!
}
type CarbonMetric @entity {
id: ID!
timestamp: BigInt!
bctSupply: BigDecimal!
nctSupply: BigDecimal!
mco2Supply: BigDecimal!
uboSupply: BigDecimal!
nboSupply: BigDecimal!
bctRedeemed: BigDecimal!
nctRedeemed: BigDecimal!
uboRedeemed: BigDecimal!
nboRedeemed: BigDecimal!
totalCarbonSupply: BigDecimal!
bctCrosschainSupply: BigDecimal!
nctCrosschainSupply: BigDecimal!
totalCrosschainSupply: BigDecimal!
tco2Retired: BigDecimal!
mco2Retired: BigDecimal!
c3tRetired: BigDecimal!
totalRetirements: BigDecimal!
bctKlimaRetired: BigDecimal!
nctKlimaRetired: BigDecimal!
mco2KlimaRetired: BigDecimal!
uboKlimaRetired: BigDecimal!
nboKlimaRetired: BigDecimal!
totalKlimaRetirements: BigDecimal!
}
type ToucanCertificate @entity {
id: ID!
timestamp: BigInt!
transaction: Transaction!
klimaRetire: KlimaRetire
tokenID: BigInt!
}
# Subgraph Versioning
type SubgraphVersion @entity(immutable: true) {
id: ID!
schemaVersion: String!
publishedVersion: String!
}