-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathschema.ts
234 lines (195 loc) · 5.31 KB
/
schema.ts
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import {
TypedMap,
Entity,
Value,
ValueKind,
store,
Address,
Bytes,
BigInt,
BigDecimal
} from "@graphprotocol/graph-ts";
export class UserAddress extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save UserAddress entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save UserAddress entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("UserAddress", id.toString(), this);
}
static load(id: string): UserAddress | null {
return store.get("UserAddress", id) as UserAddress | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get cryptopunks(): Array<string> | null {
let value = this.get("cryptopunks");
if (value === null || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toStringArray();
}
}
set cryptopunks(value: Array<string> | null) {
if (value === null) {
this.unset("cryptopunks");
} else {
this.set("cryptopunks", Value.fromStringArray(value as Array<string>));
}
}
}
export class TenancyDates extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save TenancyDates entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save TenancyDates entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("TenancyDates", id.toString(), this);
}
static load(id: string): TenancyDates | null {
return store.get("TenancyDates", id) as TenancyDates | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get start(): i32 {
let value = this.get("start");
return value.toI32();
}
set start(value: i32) {
this.set("start", Value.fromI32(value));
}
get end(): i32 {
let value = this.get("end");
return value.toI32();
}
set end(value: i32) {
this.set("end", Value.fromI32(value));
}
}
export class Cryptopunk extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save Cryptopunk entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save Cryptopunk entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("Cryptopunk", id.toString(), this);
}
static load(id: string): Cryptopunk | null {
return store.get("Cryptopunk", id) as Cryptopunk | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get owner(): string {
let value = this.get("owner");
return value.toString();
}
set owner(value: string) {
this.set("owner", Value.fromString(value));
}
get provenance(): Array<string> | null {
let value = this.get("provenance");
if (value === null || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toStringArray();
}
}
set provenance(value: Array<string> | null) {
if (value === null) {
this.unset("provenance");
} else {
this.set("provenance", Value.fromStringArray(value as Array<string>));
}
}
}
export class Provenance extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save Provenance entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save Provenance entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("Provenance", id.toString(), this);
}
static load(id: string): Provenance | null {
return store.get("Provenance", id) as Provenance | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get cryptopunk(): string {
let value = this.get("cryptopunk");
return value.toString();
}
set cryptopunk(value: string) {
this.set("cryptopunk", Value.fromString(value));
}
get tenant(): string {
let value = this.get("tenant");
return value.toString();
}
set tenant(value: string) {
this.set("tenant", Value.fromString(value));
}
get minSalePriceInWei(): string {
let value = this.get("minSalePriceInWei");
return value.toString();
}
set minSalePriceInWei(value: string) {
this.set("minSalePriceInWei", Value.fromString(value));
}
get tenancyDates(): string {
let value = this.get("tenancyDates");
return value.toString();
}
set tenancyDates(value: string) {
this.set("tenancyDates", Value.fromString(value));
}
}