-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.ts
185 lines (148 loc) · 3.84 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
// 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 Paper extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save Paper entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save Paper entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("Paper", id.toString(), this);
}
static load(id: string): Paper | null {
return store.get("Paper", id) as Paper | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get paperId(): string {
let value = this.get("paperId");
return value.toString();
}
set paperId(value: string) {
this.set("paperId", Value.fromString(value));
}
get owner(): Bytes {
let value = this.get("owner");
return value.toBytes();
}
set owner(value: Bytes) {
this.set("owner", Value.fromBytes(value));
}
get author(): string {
let value = this.get("author");
return value.toString();
}
set author(value: string) {
this.set("author", Value.fromString(value));
}
get tokenUri(): string {
let value = this.get("tokenUri");
return value.toString();
}
set tokenUri(value: string) {
this.set("tokenUri", Value.fromString(value));
}
get allowFunding(): string {
let value = this.get("allowFunding");
return value.toString();
}
set allowFunding(value: string) {
this.set("allowFunding", Value.fromString(value));
}
get fundAmount(): string {
let value = this.get("fundAmount");
return value.toString();
}
set fundAmount(value: string) {
this.set("fundAmount", Value.fromString(value));
}
get totalAmountFunded(): string {
let value = this.get("totalAmountFunded");
return value.toString();
}
set totalAmountFunded(value: string) {
this.set("totalAmountFunded", Value.fromString(value));
}
}
export class PaperFunding extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id !== null, "Cannot save PaperFunding entity without an ID");
assert(
id.kind == ValueKind.STRING,
"Cannot save PaperFunding entity with non-string ID. " +
'Considering using .toHex() to convert the "id" to a string.'
);
store.set("PaperFunding", id.toString(), this);
}
static load(id: string): PaperFunding | null {
return store.get("PaperFunding", id) as PaperFunding | null;
}
get id(): string {
let value = this.get("id");
return value.toString();
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get from(): Bytes {
let value = this.get("from");
return value.toBytes();
}
set from(value: Bytes) {
this.set("from", Value.fromBytes(value));
}
get to(): Bytes {
let value = this.get("to");
return value.toBytes();
}
set to(value: Bytes) {
this.set("to", Value.fromBytes(value));
}
get amount(): string {
let value = this.get("amount");
return value.toString();
}
set amount(value: string) {
this.set("amount", Value.fromString(value));
}
get paperid(): string {
let value = this.get("paperid");
return value.toString();
}
set paperid(value: string) {
this.set("paperid", Value.fromString(value));
}
get tokenUri(): string {
let value = this.get("tokenUri");
return value.toString();
}
set tokenUri(value: string) {
this.set("tokenUri", Value.fromString(value));
}
}