@gitmyabi/dec 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/contracts/{Decentr_json.d.ts → DarkEnergyCrystals.d.ts} +393 -231
- package/contracts/{Decentr_json.js → DarkEnergyCrystals.js} +375 -251
- package/contracts/{Decentr_json.ts → DarkEnergyCrystals.ts} +454 -263
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +4 -4
|
@@ -2,163 +2,144 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* DarkEnergyCrystals ABI
|
|
6
6
|
*
|
|
7
7
|
* This ABI is typed using viem's type system for full type safety.
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
9
|
+
export const DarkEnergyCrystalsAbi = [
|
|
10
10
|
{
|
|
11
|
-
"
|
|
11
|
+
"constant": true,
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"name": "name",
|
|
14
|
+
"outputs": [
|
|
12
15
|
{
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"type": "address"
|
|
16
|
+
"name": "",
|
|
17
|
+
"type": "string"
|
|
16
18
|
}
|
|
17
19
|
],
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
+
"payable": false,
|
|
21
|
+
"stateMutability": "view",
|
|
22
|
+
"type": "function"
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
|
-
"
|
|
25
|
+
"constant": false,
|
|
23
26
|
"inputs": [
|
|
24
27
|
{
|
|
25
|
-
"indexed": true,
|
|
26
|
-
"internalType": "address",
|
|
27
|
-
"name": "owner",
|
|
28
|
-
"type": "address"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"indexed": true,
|
|
32
|
-
"internalType": "address",
|
|
33
28
|
"name": "spender",
|
|
34
29
|
"type": "address"
|
|
35
30
|
},
|
|
36
31
|
{
|
|
37
|
-
"
|
|
38
|
-
"internalType": "uint256",
|
|
39
|
-
"name": "value",
|
|
32
|
+
"name": "amount",
|
|
40
33
|
"type": "uint256"
|
|
41
34
|
}
|
|
42
35
|
],
|
|
43
|
-
"name": "
|
|
44
|
-
"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"anonymous": false,
|
|
48
|
-
"inputs": [
|
|
36
|
+
"name": "approve",
|
|
37
|
+
"outputs": [
|
|
49
38
|
{
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"name": "account",
|
|
53
|
-
"type": "address"
|
|
39
|
+
"name": "",
|
|
40
|
+
"type": "bool"
|
|
54
41
|
}
|
|
55
42
|
],
|
|
56
|
-
"
|
|
57
|
-
"
|
|
43
|
+
"payable": false,
|
|
44
|
+
"stateMutability": "nonpayable",
|
|
45
|
+
"type": "function"
|
|
58
46
|
},
|
|
59
47
|
{
|
|
60
|
-
"
|
|
61
|
-
"inputs": [
|
|
48
|
+
"constant": true,
|
|
49
|
+
"inputs": [],
|
|
50
|
+
"name": "totalSupply",
|
|
51
|
+
"outputs": [
|
|
62
52
|
{
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"name": "minter",
|
|
66
|
-
"type": "address"
|
|
53
|
+
"name": "",
|
|
54
|
+
"type": "uint256"
|
|
67
55
|
}
|
|
68
56
|
],
|
|
69
|
-
"
|
|
70
|
-
"
|
|
57
|
+
"payable": false,
|
|
58
|
+
"stateMutability": "view",
|
|
59
|
+
"type": "function"
|
|
71
60
|
},
|
|
72
61
|
{
|
|
73
|
-
"
|
|
62
|
+
"constant": false,
|
|
74
63
|
"inputs": [
|
|
75
64
|
{
|
|
76
|
-
"
|
|
77
|
-
"internalType": "address",
|
|
78
|
-
"name": "from",
|
|
65
|
+
"name": "sender",
|
|
79
66
|
"type": "address"
|
|
80
67
|
},
|
|
81
68
|
{
|
|
82
|
-
"
|
|
83
|
-
"internalType": "address",
|
|
84
|
-
"name": "to",
|
|
69
|
+
"name": "recipient",
|
|
85
70
|
"type": "address"
|
|
86
71
|
},
|
|
87
72
|
{
|
|
88
|
-
"
|
|
89
|
-
"internalType": "uint256",
|
|
90
|
-
"name": "value",
|
|
73
|
+
"name": "amount",
|
|
91
74
|
"type": "uint256"
|
|
92
75
|
}
|
|
93
76
|
],
|
|
94
|
-
"name": "
|
|
95
|
-
"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"anonymous": false,
|
|
99
|
-
"inputs": [
|
|
77
|
+
"name": "transferFrom",
|
|
78
|
+
"outputs": [
|
|
100
79
|
{
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"name": "account",
|
|
104
|
-
"type": "address"
|
|
80
|
+
"name": "",
|
|
81
|
+
"type": "bool"
|
|
105
82
|
}
|
|
106
83
|
],
|
|
107
|
-
"
|
|
108
|
-
"
|
|
84
|
+
"payable": false,
|
|
85
|
+
"stateMutability": "nonpayable",
|
|
86
|
+
"type": "function"
|
|
109
87
|
},
|
|
110
88
|
{
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"name": "owner",
|
|
115
|
-
"type": "address"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"internalType": "address",
|
|
119
|
-
"name": "spender",
|
|
120
|
-
"type": "address"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
"name": "allowance",
|
|
89
|
+
"constant": true,
|
|
90
|
+
"inputs": [],
|
|
91
|
+
"name": "decimals",
|
|
124
92
|
"outputs": [
|
|
125
93
|
{
|
|
126
|
-
"internalType": "uint256",
|
|
127
94
|
"name": "",
|
|
128
95
|
"type": "uint256"
|
|
129
96
|
}
|
|
130
97
|
],
|
|
98
|
+
"payable": false,
|
|
131
99
|
"stateMutability": "view",
|
|
132
100
|
"type": "function"
|
|
133
101
|
},
|
|
134
102
|
{
|
|
103
|
+
"constant": false,
|
|
135
104
|
"inputs": [
|
|
136
105
|
{
|
|
137
|
-
"internalType": "address",
|
|
138
106
|
"name": "spender",
|
|
139
107
|
"type": "address"
|
|
140
108
|
},
|
|
141
109
|
{
|
|
142
|
-
"
|
|
143
|
-
"name": "amount",
|
|
110
|
+
"name": "addedValue",
|
|
144
111
|
"type": "uint256"
|
|
145
112
|
}
|
|
146
113
|
],
|
|
147
|
-
"name": "
|
|
114
|
+
"name": "increaseAllowance",
|
|
148
115
|
"outputs": [
|
|
149
116
|
{
|
|
150
|
-
"internalType": "bool",
|
|
151
117
|
"name": "",
|
|
152
118
|
"type": "bool"
|
|
153
119
|
}
|
|
154
120
|
],
|
|
121
|
+
"payable": false,
|
|
122
|
+
"stateMutability": "nonpayable",
|
|
123
|
+
"type": "function"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"constant": false,
|
|
127
|
+
"inputs": [
|
|
128
|
+
{
|
|
129
|
+
"name": "_quantity",
|
|
130
|
+
"type": "uint256"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"name": "burn",
|
|
134
|
+
"outputs": [],
|
|
135
|
+
"payable": false,
|
|
155
136
|
"stateMutability": "nonpayable",
|
|
156
137
|
"type": "function"
|
|
157
138
|
},
|
|
158
139
|
{
|
|
140
|
+
"constant": true,
|
|
159
141
|
"inputs": [
|
|
160
142
|
{
|
|
161
|
-
"internalType": "address",
|
|
162
143
|
"name": "account",
|
|
163
144
|
"type": "address"
|
|
164
145
|
}
|
|
@@ -166,247 +147,323 @@ export const Decentr_jsonAbi = [
|
|
|
166
147
|
"name": "balanceOf",
|
|
167
148
|
"outputs": [
|
|
168
149
|
{
|
|
169
|
-
"internalType": "uint256",
|
|
170
150
|
"name": "",
|
|
171
151
|
"type": "uint256"
|
|
172
152
|
}
|
|
173
153
|
],
|
|
154
|
+
"payable": false,
|
|
174
155
|
"stateMutability": "view",
|
|
175
156
|
"type": "function"
|
|
176
157
|
},
|
|
177
158
|
{
|
|
159
|
+
"constant": false,
|
|
178
160
|
"inputs": [],
|
|
179
|
-
"name": "
|
|
180
|
-
"outputs": [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
"name": "",
|
|
184
|
-
"type": "uint8"
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
"stateMutability": "view",
|
|
161
|
+
"name": "renounceOwnership",
|
|
162
|
+
"outputs": [],
|
|
163
|
+
"payable": false,
|
|
164
|
+
"stateMutability": "nonpayable",
|
|
188
165
|
"type": "function"
|
|
189
166
|
},
|
|
190
167
|
{
|
|
168
|
+
"constant": false,
|
|
191
169
|
"inputs": [
|
|
192
170
|
{
|
|
193
|
-
"
|
|
194
|
-
"name": "spender",
|
|
171
|
+
"name": "_holder",
|
|
195
172
|
"type": "address"
|
|
196
173
|
},
|
|
197
174
|
{
|
|
198
|
-
"
|
|
199
|
-
"name": "subtractedValue",
|
|
175
|
+
"name": "_quantity",
|
|
200
176
|
"type": "uint256"
|
|
201
177
|
}
|
|
202
178
|
],
|
|
203
|
-
"name": "
|
|
179
|
+
"name": "unlock",
|
|
180
|
+
"outputs": [],
|
|
181
|
+
"payable": false,
|
|
182
|
+
"stateMutability": "nonpayable",
|
|
183
|
+
"type": "function"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"constant": true,
|
|
187
|
+
"inputs": [],
|
|
188
|
+
"name": "owner",
|
|
189
|
+
"outputs": [
|
|
190
|
+
{
|
|
191
|
+
"name": "",
|
|
192
|
+
"type": "address"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"payable": false,
|
|
196
|
+
"stateMutability": "view",
|
|
197
|
+
"type": "function"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"constant": true,
|
|
201
|
+
"inputs": [],
|
|
202
|
+
"name": "isOwner",
|
|
204
203
|
"outputs": [
|
|
205
204
|
{
|
|
206
|
-
"internalType": "bool",
|
|
207
205
|
"name": "",
|
|
208
206
|
"type": "bool"
|
|
209
207
|
}
|
|
210
208
|
],
|
|
209
|
+
"payable": false,
|
|
210
|
+
"stateMutability": "view",
|
|
211
|
+
"type": "function"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"constant": true,
|
|
215
|
+
"inputs": [],
|
|
216
|
+
"name": "symbol",
|
|
217
|
+
"outputs": [
|
|
218
|
+
{
|
|
219
|
+
"name": "",
|
|
220
|
+
"type": "string"
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
"payable": false,
|
|
224
|
+
"stateMutability": "view",
|
|
225
|
+
"type": "function"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"constant": false,
|
|
229
|
+
"inputs": [
|
|
230
|
+
{
|
|
231
|
+
"name": "_quantity",
|
|
232
|
+
"type": "uint256"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"name": "mint",
|
|
236
|
+
"outputs": [],
|
|
237
|
+
"payable": false,
|
|
211
238
|
"stateMutability": "nonpayable",
|
|
212
239
|
"type": "function"
|
|
213
240
|
},
|
|
214
241
|
{
|
|
242
|
+
"constant": false,
|
|
215
243
|
"inputs": [
|
|
216
244
|
{
|
|
217
|
-
"internalType": "address",
|
|
218
245
|
"name": "spender",
|
|
219
246
|
"type": "address"
|
|
220
247
|
},
|
|
221
248
|
{
|
|
222
|
-
"
|
|
223
|
-
"name": "addedValue",
|
|
249
|
+
"name": "subtractedValue",
|
|
224
250
|
"type": "uint256"
|
|
225
251
|
}
|
|
226
252
|
],
|
|
227
|
-
"name": "
|
|
253
|
+
"name": "decreaseAllowance",
|
|
228
254
|
"outputs": [
|
|
229
255
|
{
|
|
230
|
-
"internalType": "bool",
|
|
231
256
|
"name": "",
|
|
232
257
|
"type": "bool"
|
|
233
258
|
}
|
|
234
259
|
],
|
|
260
|
+
"payable": false,
|
|
235
261
|
"stateMutability": "nonpayable",
|
|
236
262
|
"type": "function"
|
|
237
263
|
},
|
|
238
264
|
{
|
|
265
|
+
"constant": false,
|
|
239
266
|
"inputs": [
|
|
240
267
|
{
|
|
241
|
-
"
|
|
242
|
-
"name": "receiver",
|
|
268
|
+
"name": "recipient",
|
|
243
269
|
"type": "address"
|
|
244
270
|
},
|
|
245
271
|
{
|
|
246
|
-
"internalType": "uint256",
|
|
247
272
|
"name": "amount",
|
|
248
273
|
"type": "uint256"
|
|
249
274
|
}
|
|
250
275
|
],
|
|
251
|
-
"name": "
|
|
276
|
+
"name": "transfer",
|
|
252
277
|
"outputs": [
|
|
253
278
|
{
|
|
254
|
-
"
|
|
255
|
-
"name": "success",
|
|
279
|
+
"name": "",
|
|
256
280
|
"type": "bool"
|
|
257
281
|
}
|
|
258
282
|
],
|
|
283
|
+
"payable": false,
|
|
259
284
|
"stateMutability": "nonpayable",
|
|
260
285
|
"type": "function"
|
|
261
286
|
},
|
|
262
287
|
{
|
|
263
|
-
"
|
|
264
|
-
"
|
|
288
|
+
"constant": true,
|
|
289
|
+
"inputs": [
|
|
290
|
+
{
|
|
291
|
+
"name": "owner",
|
|
292
|
+
"type": "address"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "spender",
|
|
296
|
+
"type": "address"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"name": "allowance",
|
|
265
300
|
"outputs": [
|
|
266
301
|
{
|
|
267
|
-
"internalType": "string",
|
|
268
302
|
"name": "",
|
|
269
|
-
"type": "
|
|
303
|
+
"type": "uint256"
|
|
270
304
|
}
|
|
271
305
|
],
|
|
306
|
+
"payable": false,
|
|
272
307
|
"stateMutability": "view",
|
|
273
308
|
"type": "function"
|
|
274
309
|
},
|
|
275
310
|
{
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"outputs": [],
|
|
279
|
-
"stateMutability": "nonpayable",
|
|
280
|
-
"type": "function"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"inputs": [],
|
|
284
|
-
"name": "paused",
|
|
285
|
-
"outputs": [
|
|
311
|
+
"constant": false,
|
|
312
|
+
"inputs": [
|
|
286
313
|
{
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
|
|
314
|
+
"name": "_steemAddr",
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "_quantity",
|
|
319
|
+
"type": "uint256"
|
|
290
320
|
}
|
|
291
321
|
],
|
|
292
|
-
"
|
|
322
|
+
"name": "lock",
|
|
323
|
+
"outputs": [],
|
|
324
|
+
"payable": false,
|
|
325
|
+
"stateMutability": "nonpayable",
|
|
293
326
|
"type": "function"
|
|
294
327
|
},
|
|
295
328
|
{
|
|
329
|
+
"constant": false,
|
|
296
330
|
"inputs": [
|
|
297
331
|
{
|
|
298
|
-
"
|
|
299
|
-
"name": "_minter",
|
|
332
|
+
"name": "newOwner",
|
|
300
333
|
"type": "address"
|
|
301
334
|
}
|
|
302
335
|
],
|
|
303
|
-
"name": "
|
|
336
|
+
"name": "transferOwnership",
|
|
304
337
|
"outputs": [],
|
|
338
|
+
"payable": false,
|
|
305
339
|
"stateMutability": "nonpayable",
|
|
306
340
|
"type": "function"
|
|
307
341
|
},
|
|
308
342
|
{
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"outputs": [
|
|
343
|
+
"constant": false,
|
|
344
|
+
"inputs": [
|
|
312
345
|
{
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"type": "string"
|
|
346
|
+
"name": "_newMinter",
|
|
347
|
+
"type": "address"
|
|
316
348
|
}
|
|
317
349
|
],
|
|
318
|
-
"
|
|
350
|
+
"name": "setMinter",
|
|
351
|
+
"outputs": [],
|
|
352
|
+
"payable": false,
|
|
353
|
+
"stateMutability": "nonpayable",
|
|
319
354
|
"type": "function"
|
|
320
355
|
},
|
|
321
356
|
{
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
"outputs": [
|
|
357
|
+
"anonymous": false,
|
|
358
|
+
"inputs": [
|
|
325
359
|
{
|
|
326
|
-
"
|
|
327
|
-
"name": "",
|
|
328
|
-
"type": "
|
|
360
|
+
"indexed": true,
|
|
361
|
+
"name": "minter",
|
|
362
|
+
"type": "address"
|
|
329
363
|
}
|
|
330
364
|
],
|
|
331
|
-
"
|
|
332
|
-
"type": "
|
|
365
|
+
"name": "SetMinter",
|
|
366
|
+
"type": "event"
|
|
333
367
|
},
|
|
334
368
|
{
|
|
369
|
+
"anonymous": false,
|
|
335
370
|
"inputs": [
|
|
336
371
|
{
|
|
337
|
-
"
|
|
338
|
-
"name": "
|
|
372
|
+
"indexed": true,
|
|
373
|
+
"name": "holder",
|
|
339
374
|
"type": "address"
|
|
340
375
|
},
|
|
341
376
|
{
|
|
342
|
-
"
|
|
377
|
+
"indexed": true,
|
|
343
378
|
"name": "amount",
|
|
344
379
|
"type": "uint256"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"indexed": false,
|
|
383
|
+
"name": "steemAddr",
|
|
384
|
+
"type": "string"
|
|
345
385
|
}
|
|
346
386
|
],
|
|
347
|
-
"name": "
|
|
348
|
-
"
|
|
387
|
+
"name": "LockCrystals",
|
|
388
|
+
"type": "event"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"anonymous": false,
|
|
392
|
+
"inputs": [
|
|
349
393
|
{
|
|
350
|
-
"
|
|
351
|
-
"name": "",
|
|
352
|
-
"type": "
|
|
394
|
+
"indexed": true,
|
|
395
|
+
"name": "previousOwner",
|
|
396
|
+
"type": "address"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"indexed": true,
|
|
400
|
+
"name": "newOwner",
|
|
401
|
+
"type": "address"
|
|
353
402
|
}
|
|
354
403
|
],
|
|
355
|
-
"
|
|
356
|
-
"type": "
|
|
404
|
+
"name": "OwnershipTransferred",
|
|
405
|
+
"type": "event"
|
|
357
406
|
},
|
|
358
407
|
{
|
|
408
|
+
"anonymous": false,
|
|
359
409
|
"inputs": [
|
|
360
410
|
{
|
|
361
|
-
"
|
|
362
|
-
"name": "
|
|
411
|
+
"indexed": true,
|
|
412
|
+
"name": "from",
|
|
363
413
|
"type": "address"
|
|
364
414
|
},
|
|
365
415
|
{
|
|
366
|
-
"
|
|
367
|
-
"name": "
|
|
416
|
+
"indexed": true,
|
|
417
|
+
"name": "to",
|
|
368
418
|
"type": "address"
|
|
369
419
|
},
|
|
370
420
|
{
|
|
371
|
-
"
|
|
372
|
-
"name": "
|
|
421
|
+
"indexed": false,
|
|
422
|
+
"name": "value",
|
|
373
423
|
"type": "uint256"
|
|
374
424
|
}
|
|
375
425
|
],
|
|
376
|
-
"name": "
|
|
377
|
-
"
|
|
426
|
+
"name": "Transfer",
|
|
427
|
+
"type": "event"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"anonymous": false,
|
|
431
|
+
"inputs": [
|
|
378
432
|
{
|
|
379
|
-
"
|
|
380
|
-
"name": "",
|
|
381
|
-
"type": "
|
|
433
|
+
"indexed": true,
|
|
434
|
+
"name": "owner",
|
|
435
|
+
"type": "address"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"indexed": true,
|
|
439
|
+
"name": "spender",
|
|
440
|
+
"type": "address"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"indexed": false,
|
|
444
|
+
"name": "value",
|
|
445
|
+
"type": "uint256"
|
|
382
446
|
}
|
|
383
447
|
],
|
|
384
|
-
"
|
|
385
|
-
"type": "
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"inputs": [],
|
|
389
|
-
"name": "unpause",
|
|
390
|
-
"outputs": [],
|
|
391
|
-
"stateMutability": "nonpayable",
|
|
392
|
-
"type": "function"
|
|
448
|
+
"name": "Approval",
|
|
449
|
+
"type": "event"
|
|
393
450
|
}
|
|
394
451
|
] as const satisfies Abi;
|
|
395
452
|
|
|
396
453
|
/**
|
|
397
|
-
* Type-safe ABI for
|
|
454
|
+
* Type-safe ABI for DarkEnergyCrystals
|
|
398
455
|
*/
|
|
399
|
-
export type
|
|
456
|
+
export type DarkEnergyCrystalsAbi = typeof DarkEnergyCrystalsAbi;
|
|
400
457
|
|
|
401
458
|
/**
|
|
402
|
-
* Contract instance type for
|
|
459
|
+
* Contract instance type for DarkEnergyCrystals
|
|
403
460
|
*/
|
|
404
461
|
// Use any for contract type to avoid complex viem type issues
|
|
405
462
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
406
|
-
export type
|
|
463
|
+
export type DarkEnergyCrystalsContract = any;
|
|
407
464
|
|
|
408
465
|
/**
|
|
409
|
-
*
|
|
466
|
+
* DarkEnergyCrystals Contract Class
|
|
410
467
|
*
|
|
411
468
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
412
469
|
*
|
|
@@ -414,12 +471,12 @@ export type Decentr_jsonContract = any;
|
|
|
414
471
|
* ```typescript
|
|
415
472
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
416
473
|
* import { mainnet } from 'viem/chains';
|
|
417
|
-
* import {
|
|
474
|
+
* import { DarkEnergyCrystals } from 'DarkEnergyCrystals';
|
|
418
475
|
*
|
|
419
476
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
420
477
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
421
478
|
*
|
|
422
|
-
* const contract = new
|
|
479
|
+
* const contract = new DarkEnergyCrystals('0x...', { publicClient, walletClient });
|
|
423
480
|
*
|
|
424
481
|
* // Read functions
|
|
425
482
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -437,8 +494,8 @@ export type Decentr_jsonContract = any;
|
|
|
437
494
|
* });
|
|
438
495
|
* ```
|
|
439
496
|
*/
|
|
440
|
-
export class
|
|
441
|
-
private contract:
|
|
497
|
+
export class DarkEnergyCrystals {
|
|
498
|
+
private contract: DarkEnergyCrystalsContract;
|
|
442
499
|
private contractAddress: Address;
|
|
443
500
|
private publicClient: PublicClient;
|
|
444
501
|
|
|
@@ -453,7 +510,7 @@ export class Decentr_json {
|
|
|
453
510
|
this.publicClient = clients.publicClient;
|
|
454
511
|
this.contract = getContract({
|
|
455
512
|
address,
|
|
456
|
-
abi:
|
|
513
|
+
abi: DarkEnergyCrystalsAbi,
|
|
457
514
|
client: {
|
|
458
515
|
public: clients.publicClient,
|
|
459
516
|
wallet: clients.walletClient,
|
|
@@ -469,26 +526,26 @@ export class Decentr_json {
|
|
|
469
526
|
}
|
|
470
527
|
|
|
471
528
|
/**
|
|
472
|
-
* Get the underlying viem contract instance
|
|
529
|
+
* Get the underlying viem contract instance.
|
|
473
530
|
*/
|
|
474
|
-
getContract():
|
|
531
|
+
getContract(): DarkEnergyCrystalsContract {
|
|
475
532
|
return this.contract;
|
|
476
533
|
}
|
|
477
534
|
|
|
478
535
|
/**
|
|
479
|
-
*
|
|
536
|
+
* name
|
|
480
537
|
* view
|
|
481
538
|
*/
|
|
482
|
-
async
|
|
483
|
-
return this.contract.read.
|
|
539
|
+
async name(): Promise<string> {
|
|
540
|
+
return this.contract.read.name() as Promise<string>;
|
|
484
541
|
}
|
|
485
542
|
|
|
486
543
|
/**
|
|
487
|
-
*
|
|
544
|
+
* totalSupply
|
|
488
545
|
* view
|
|
489
546
|
*/
|
|
490
|
-
async
|
|
491
|
-
return this.contract.read.
|
|
547
|
+
async totalSupply(): Promise<bigint> {
|
|
548
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
492
549
|
}
|
|
493
550
|
|
|
494
551
|
/**
|
|
@@ -500,19 +557,27 @@ export class Decentr_json {
|
|
|
500
557
|
}
|
|
501
558
|
|
|
502
559
|
/**
|
|
503
|
-
*
|
|
560
|
+
* balanceOf
|
|
504
561
|
* view
|
|
505
562
|
*/
|
|
506
|
-
async
|
|
507
|
-
return this.contract.read.
|
|
563
|
+
async balanceOf(account: `0x${string}`): Promise<bigint> {
|
|
564
|
+
return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* owner
|
|
569
|
+
* view
|
|
570
|
+
*/
|
|
571
|
+
async owner(): Promise<`0x${string}`> {
|
|
572
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
508
573
|
}
|
|
509
574
|
|
|
510
575
|
/**
|
|
511
|
-
*
|
|
576
|
+
* isOwner
|
|
512
577
|
* view
|
|
513
578
|
*/
|
|
514
|
-
async
|
|
515
|
-
return this.contract.read.
|
|
579
|
+
async isOwner(): Promise<boolean> {
|
|
580
|
+
return this.contract.read.isOwner() as Promise<boolean>;
|
|
516
581
|
}
|
|
517
582
|
|
|
518
583
|
/**
|
|
@@ -524,11 +589,11 @@ export class Decentr_json {
|
|
|
524
589
|
}
|
|
525
590
|
|
|
526
591
|
/**
|
|
527
|
-
*
|
|
592
|
+
* allowance
|
|
528
593
|
* view
|
|
529
594
|
*/
|
|
530
|
-
async
|
|
531
|
-
return this.contract.read.
|
|
595
|
+
async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
|
|
596
|
+
return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
|
|
532
597
|
}
|
|
533
598
|
|
|
534
599
|
/**
|
|
@@ -555,11 +620,11 @@ export class Decentr_json {
|
|
|
555
620
|
}
|
|
556
621
|
|
|
557
622
|
/**
|
|
558
|
-
*
|
|
623
|
+
* transferFrom
|
|
559
624
|
* nonpayable
|
|
560
625
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
561
626
|
*/
|
|
562
|
-
async
|
|
627
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
563
628
|
accessList?: import('viem').AccessList;
|
|
564
629
|
authorizationList?: import('viem').AuthorizationList;
|
|
565
630
|
chain?: import('viem').Chain | null;
|
|
@@ -574,7 +639,7 @@ export class Decentr_json {
|
|
|
574
639
|
if (!this.contract.write) {
|
|
575
640
|
throw new Error('Wallet client is required for write operations');
|
|
576
641
|
}
|
|
577
|
-
return this.contract.write.
|
|
642
|
+
return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
578
643
|
}
|
|
579
644
|
|
|
580
645
|
/**
|
|
@@ -601,11 +666,34 @@ export class Decentr_json {
|
|
|
601
666
|
}
|
|
602
667
|
|
|
603
668
|
/**
|
|
604
|
-
*
|
|
669
|
+
* burn
|
|
670
|
+
* nonpayable
|
|
671
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
672
|
+
*/
|
|
673
|
+
async burn(_quantity: bigint, options?: {
|
|
674
|
+
accessList?: import('viem').AccessList;
|
|
675
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
676
|
+
chain?: import('viem').Chain | null;
|
|
677
|
+
dataSuffix?: `0x${string}`;
|
|
678
|
+
gas?: bigint;
|
|
679
|
+
gasPrice?: bigint;
|
|
680
|
+
maxFeePerGas?: bigint;
|
|
681
|
+
maxPriorityFeePerGas?: bigint;
|
|
682
|
+
nonce?: number;
|
|
683
|
+
value?: bigint;
|
|
684
|
+
}): Promise<`0x${string}`> {
|
|
685
|
+
if (!this.contract.write) {
|
|
686
|
+
throw new Error('Wallet client is required for write operations');
|
|
687
|
+
}
|
|
688
|
+
return this.contract.write.burn([_quantity] as const, options) as Promise<`0x${string}`>;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* renounceOwnership
|
|
605
693
|
* nonpayable
|
|
606
694
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
607
695
|
*/
|
|
608
|
-
async
|
|
696
|
+
async renounceOwnership(options?: {
|
|
609
697
|
accessList?: import('viem').AccessList;
|
|
610
698
|
authorizationList?: import('viem').AuthorizationList;
|
|
611
699
|
chain?: import('viem').Chain | null;
|
|
@@ -620,15 +708,15 @@ export class Decentr_json {
|
|
|
620
708
|
if (!this.contract.write) {
|
|
621
709
|
throw new Error('Wallet client is required for write operations');
|
|
622
710
|
}
|
|
623
|
-
return this.contract.write.
|
|
711
|
+
return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
|
|
624
712
|
}
|
|
625
713
|
|
|
626
714
|
/**
|
|
627
|
-
*
|
|
715
|
+
* unlock
|
|
628
716
|
* nonpayable
|
|
629
717
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
630
718
|
*/
|
|
631
|
-
async
|
|
719
|
+
async unlock(_holder: `0x${string}`, _quantity: bigint, options?: {
|
|
632
720
|
accessList?: import('viem').AccessList;
|
|
633
721
|
authorizationList?: import('viem').AuthorizationList;
|
|
634
722
|
chain?: import('viem').Chain | null;
|
|
@@ -643,15 +731,15 @@ export class Decentr_json {
|
|
|
643
731
|
if (!this.contract.write) {
|
|
644
732
|
throw new Error('Wallet client is required for write operations');
|
|
645
733
|
}
|
|
646
|
-
return this.contract.write.
|
|
734
|
+
return this.contract.write.unlock([_holder, _quantity] as const, options) as Promise<`0x${string}`>;
|
|
647
735
|
}
|
|
648
736
|
|
|
649
737
|
/**
|
|
650
|
-
*
|
|
738
|
+
* mint
|
|
651
739
|
* nonpayable
|
|
652
740
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
653
741
|
*/
|
|
654
|
-
async
|
|
742
|
+
async mint(_quantity: bigint, options?: {
|
|
655
743
|
accessList?: import('viem').AccessList;
|
|
656
744
|
authorizationList?: import('viem').AuthorizationList;
|
|
657
745
|
chain?: import('viem').Chain | null;
|
|
@@ -666,7 +754,30 @@ export class Decentr_json {
|
|
|
666
754
|
if (!this.contract.write) {
|
|
667
755
|
throw new Error('Wallet client is required for write operations');
|
|
668
756
|
}
|
|
669
|
-
return this.contract.write.
|
|
757
|
+
return this.contract.write.mint([_quantity] as const, options) as Promise<`0x${string}`>;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* decreaseAllowance
|
|
762
|
+
* nonpayable
|
|
763
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
764
|
+
*/
|
|
765
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
766
|
+
accessList?: import('viem').AccessList;
|
|
767
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
768
|
+
chain?: import('viem').Chain | null;
|
|
769
|
+
dataSuffix?: `0x${string}`;
|
|
770
|
+
gas?: bigint;
|
|
771
|
+
gasPrice?: bigint;
|
|
772
|
+
maxFeePerGas?: bigint;
|
|
773
|
+
maxPriorityFeePerGas?: bigint;
|
|
774
|
+
nonce?: number;
|
|
775
|
+
value?: bigint;
|
|
776
|
+
}): Promise<`0x${string}`> {
|
|
777
|
+
if (!this.contract.write) {
|
|
778
|
+
throw new Error('Wallet client is required for write operations');
|
|
779
|
+
}
|
|
780
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
670
781
|
}
|
|
671
782
|
|
|
672
783
|
/**
|
|
@@ -693,11 +804,11 @@ export class Decentr_json {
|
|
|
693
804
|
}
|
|
694
805
|
|
|
695
806
|
/**
|
|
696
|
-
*
|
|
807
|
+
* lock
|
|
697
808
|
* nonpayable
|
|
698
809
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
699
810
|
*/
|
|
700
|
-
async
|
|
811
|
+
async lock(_steemAddr: string, _quantity: bigint, options?: {
|
|
701
812
|
accessList?: import('viem').AccessList;
|
|
702
813
|
authorizationList?: import('viem').AuthorizationList;
|
|
703
814
|
chain?: import('viem').Chain | null;
|
|
@@ -712,15 +823,15 @@ export class Decentr_json {
|
|
|
712
823
|
if (!this.contract.write) {
|
|
713
824
|
throw new Error('Wallet client is required for write operations');
|
|
714
825
|
}
|
|
715
|
-
return this.contract.write.
|
|
826
|
+
return this.contract.write.lock([_steemAddr, _quantity] as const, options) as Promise<`0x${string}`>;
|
|
716
827
|
}
|
|
717
828
|
|
|
718
829
|
/**
|
|
719
|
-
*
|
|
830
|
+
* transferOwnership
|
|
720
831
|
* nonpayable
|
|
721
832
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
722
833
|
*/
|
|
723
|
-
async
|
|
834
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
724
835
|
accessList?: import('viem').AccessList;
|
|
725
836
|
authorizationList?: import('viem').AuthorizationList;
|
|
726
837
|
chain?: import('viem').Chain | null;
|
|
@@ -735,7 +846,30 @@ export class Decentr_json {
|
|
|
735
846
|
if (!this.contract.write) {
|
|
736
847
|
throw new Error('Wallet client is required for write operations');
|
|
737
848
|
}
|
|
738
|
-
return this.contract.write.
|
|
849
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* setMinter
|
|
854
|
+
* nonpayable
|
|
855
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
856
|
+
*/
|
|
857
|
+
async setMinter(_newMinter: `0x${string}`, options?: {
|
|
858
|
+
accessList?: import('viem').AccessList;
|
|
859
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
860
|
+
chain?: import('viem').Chain | null;
|
|
861
|
+
dataSuffix?: `0x${string}`;
|
|
862
|
+
gas?: bigint;
|
|
863
|
+
gasPrice?: bigint;
|
|
864
|
+
maxFeePerGas?: bigint;
|
|
865
|
+
maxPriorityFeePerGas?: bigint;
|
|
866
|
+
nonce?: number;
|
|
867
|
+
value?: bigint;
|
|
868
|
+
}): Promise<`0x${string}`> {
|
|
869
|
+
if (!this.contract.write) {
|
|
870
|
+
throw new Error('Wallet client is required for write operations');
|
|
871
|
+
}
|
|
872
|
+
return this.contract.write.setMinter([_newMinter] as const, options) as Promise<`0x${string}`>;
|
|
739
873
|
}
|
|
740
874
|
|
|
741
875
|
|
|
@@ -774,11 +908,11 @@ export class Decentr_json {
|
|
|
774
908
|
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
775
909
|
},
|
|
776
910
|
/**
|
|
777
|
-
* Simulate
|
|
911
|
+
* Simulate transferFrom
|
|
778
912
|
* Returns gas estimate and result without sending transaction
|
|
779
913
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
780
914
|
*/
|
|
781
|
-
async
|
|
915
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
782
916
|
accessList?: import('viem').AccessList;
|
|
783
917
|
authorizationList?: import('viem').AuthorizationList;
|
|
784
918
|
chain?: import('viem').Chain | null;
|
|
@@ -790,7 +924,7 @@ export class Decentr_json {
|
|
|
790
924
|
nonce?: number;
|
|
791
925
|
value?: bigint;
|
|
792
926
|
}): Promise<boolean> {
|
|
793
|
-
return contract.simulate.
|
|
927
|
+
return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
|
|
794
928
|
},
|
|
795
929
|
/**
|
|
796
930
|
* Simulate increaseAllowance
|
|
@@ -812,11 +946,11 @@ export class Decentr_json {
|
|
|
812
946
|
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
813
947
|
},
|
|
814
948
|
/**
|
|
815
|
-
* Simulate
|
|
949
|
+
* Simulate burn
|
|
816
950
|
* Returns gas estimate and result without sending transaction
|
|
817
951
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
818
952
|
*/
|
|
819
|
-
async
|
|
953
|
+
async burn(_quantity: bigint, options?: {
|
|
820
954
|
accessList?: import('viem').AccessList;
|
|
821
955
|
authorizationList?: import('viem').AuthorizationList;
|
|
822
956
|
chain?: import('viem').Chain | null;
|
|
@@ -827,15 +961,15 @@ export class Decentr_json {
|
|
|
827
961
|
maxPriorityFeePerGas?: bigint;
|
|
828
962
|
nonce?: number;
|
|
829
963
|
value?: bigint;
|
|
830
|
-
}): Promise<
|
|
831
|
-
return contract.simulate.
|
|
964
|
+
}): Promise<void> {
|
|
965
|
+
return contract.simulate.burn([_quantity] as const, options) as Promise<void>;
|
|
832
966
|
},
|
|
833
967
|
/**
|
|
834
|
-
* Simulate
|
|
968
|
+
* Simulate renounceOwnership
|
|
835
969
|
* Returns gas estimate and result without sending transaction
|
|
836
970
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
837
971
|
*/
|
|
838
|
-
async
|
|
972
|
+
async renounceOwnership(options?: {
|
|
839
973
|
accessList?: import('viem').AccessList;
|
|
840
974
|
authorizationList?: import('viem').AuthorizationList;
|
|
841
975
|
chain?: import('viem').Chain | null;
|
|
@@ -847,14 +981,14 @@ export class Decentr_json {
|
|
|
847
981
|
nonce?: number;
|
|
848
982
|
value?: bigint;
|
|
849
983
|
}): Promise<void> {
|
|
850
|
-
return contract.simulate.
|
|
984
|
+
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
851
985
|
},
|
|
852
986
|
/**
|
|
853
|
-
* Simulate
|
|
987
|
+
* Simulate unlock
|
|
854
988
|
* Returns gas estimate and result without sending transaction
|
|
855
989
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
856
990
|
*/
|
|
857
|
-
async
|
|
991
|
+
async unlock(_holder: `0x${string}`, _quantity: bigint, options?: {
|
|
858
992
|
accessList?: import('viem').AccessList;
|
|
859
993
|
authorizationList?: import('viem').AuthorizationList;
|
|
860
994
|
chain?: import('viem').Chain | null;
|
|
@@ -866,7 +1000,45 @@ export class Decentr_json {
|
|
|
866
1000
|
nonce?: number;
|
|
867
1001
|
value?: bigint;
|
|
868
1002
|
}): Promise<void> {
|
|
869
|
-
return contract.simulate.
|
|
1003
|
+
return contract.simulate.unlock([_holder, _quantity] as const, options) as Promise<void>;
|
|
1004
|
+
},
|
|
1005
|
+
/**
|
|
1006
|
+
* Simulate mint
|
|
1007
|
+
* Returns gas estimate and result without sending transaction
|
|
1008
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1009
|
+
*/
|
|
1010
|
+
async mint(_quantity: bigint, options?: {
|
|
1011
|
+
accessList?: import('viem').AccessList;
|
|
1012
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1013
|
+
chain?: import('viem').Chain | null;
|
|
1014
|
+
dataSuffix?: `0x${string}`;
|
|
1015
|
+
gas?: bigint;
|
|
1016
|
+
gasPrice?: bigint;
|
|
1017
|
+
maxFeePerGas?: bigint;
|
|
1018
|
+
maxPriorityFeePerGas?: bigint;
|
|
1019
|
+
nonce?: number;
|
|
1020
|
+
value?: bigint;
|
|
1021
|
+
}): Promise<void> {
|
|
1022
|
+
return contract.simulate.mint([_quantity] as const, options) as Promise<void>;
|
|
1023
|
+
},
|
|
1024
|
+
/**
|
|
1025
|
+
* Simulate decreaseAllowance
|
|
1026
|
+
* Returns gas estimate and result without sending transaction
|
|
1027
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1028
|
+
*/
|
|
1029
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1030
|
+
accessList?: import('viem').AccessList;
|
|
1031
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1032
|
+
chain?: import('viem').Chain | null;
|
|
1033
|
+
dataSuffix?: `0x${string}`;
|
|
1034
|
+
gas?: bigint;
|
|
1035
|
+
gasPrice?: bigint;
|
|
1036
|
+
maxFeePerGas?: bigint;
|
|
1037
|
+
maxPriorityFeePerGas?: bigint;
|
|
1038
|
+
nonce?: number;
|
|
1039
|
+
value?: bigint;
|
|
1040
|
+
}): Promise<boolean> {
|
|
1041
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
870
1042
|
},
|
|
871
1043
|
/**
|
|
872
1044
|
* Simulate transfer
|
|
@@ -888,11 +1060,11 @@ export class Decentr_json {
|
|
|
888
1060
|
return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
|
|
889
1061
|
},
|
|
890
1062
|
/**
|
|
891
|
-
* Simulate
|
|
1063
|
+
* Simulate lock
|
|
892
1064
|
* Returns gas estimate and result without sending transaction
|
|
893
1065
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
894
1066
|
*/
|
|
895
|
-
async
|
|
1067
|
+
async lock(_steemAddr: string, _quantity: bigint, options?: {
|
|
896
1068
|
accessList?: import('viem').AccessList;
|
|
897
1069
|
authorizationList?: import('viem').AuthorizationList;
|
|
898
1070
|
chain?: import('viem').Chain | null;
|
|
@@ -903,15 +1075,34 @@ export class Decentr_json {
|
|
|
903
1075
|
maxPriorityFeePerGas?: bigint;
|
|
904
1076
|
nonce?: number;
|
|
905
1077
|
value?: bigint;
|
|
906
|
-
}): Promise<
|
|
907
|
-
return contract.simulate.
|
|
1078
|
+
}): Promise<void> {
|
|
1079
|
+
return contract.simulate.lock([_steemAddr, _quantity] as const, options) as Promise<void>;
|
|
1080
|
+
},
|
|
1081
|
+
/**
|
|
1082
|
+
* Simulate transferOwnership
|
|
1083
|
+
* Returns gas estimate and result without sending transaction
|
|
1084
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1085
|
+
*/
|
|
1086
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1087
|
+
accessList?: import('viem').AccessList;
|
|
1088
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1089
|
+
chain?: import('viem').Chain | null;
|
|
1090
|
+
dataSuffix?: `0x${string}`;
|
|
1091
|
+
gas?: bigint;
|
|
1092
|
+
gasPrice?: bigint;
|
|
1093
|
+
maxFeePerGas?: bigint;
|
|
1094
|
+
maxPriorityFeePerGas?: bigint;
|
|
1095
|
+
nonce?: number;
|
|
1096
|
+
value?: bigint;
|
|
1097
|
+
}): Promise<void> {
|
|
1098
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
908
1099
|
},
|
|
909
1100
|
/**
|
|
910
|
-
* Simulate
|
|
1101
|
+
* Simulate setMinter
|
|
911
1102
|
* Returns gas estimate and result without sending transaction
|
|
912
1103
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
913
1104
|
*/
|
|
914
|
-
async
|
|
1105
|
+
async setMinter(_newMinter: `0x${string}`, options?: {
|
|
915
1106
|
accessList?: import('viem').AccessList;
|
|
916
1107
|
authorizationList?: import('viem').AuthorizationList;
|
|
917
1108
|
chain?: import('viem').Chain | null;
|
|
@@ -923,7 +1114,7 @@ export class Decentr_json {
|
|
|
923
1114
|
nonce?: number;
|
|
924
1115
|
value?: bigint;
|
|
925
1116
|
}): Promise<void> {
|
|
926
|
-
return contract.simulate.
|
|
1117
|
+
return contract.simulate.setMinter([_newMinter] as const, options) as Promise<void>;
|
|
927
1118
|
}
|
|
928
1119
|
};
|
|
929
1120
|
}
|
|
@@ -943,17 +1134,17 @@ export class Decentr_json {
|
|
|
943
1134
|
get watch() {
|
|
944
1135
|
return {
|
|
945
1136
|
/**
|
|
946
|
-
* Watch
|
|
1137
|
+
* Watch SetMinter events
|
|
947
1138
|
* @param callback Function to call when event is emitted
|
|
948
1139
|
* @param filter Optional filter for indexed parameters
|
|
949
1140
|
* @returns Unwatch function to stop listening
|
|
950
1141
|
*/
|
|
951
|
-
|
|
1142
|
+
SetMinter: (callback: (event: { minter: `0x${string}` }) => void, filter?: { minter?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
952
1143
|
return this.publicClient.watchContractEvent({
|
|
953
1144
|
address: this.contractAddress,
|
|
954
|
-
abi:
|
|
955
|
-
eventName: '
|
|
956
|
-
args: filter,
|
|
1145
|
+
abi: DarkEnergyCrystalsAbi,
|
|
1146
|
+
eventName: 'SetMinter',
|
|
1147
|
+
args: filter as any,
|
|
957
1148
|
onLogs: (logs: any[]) => {
|
|
958
1149
|
logs.forEach((log: any) => {
|
|
959
1150
|
callback(log.args as any);
|
|
@@ -962,17 +1153,17 @@ export class Decentr_json {
|
|
|
962
1153
|
}) as () => void;
|
|
963
1154
|
},
|
|
964
1155
|
/**
|
|
965
|
-
* Watch
|
|
1156
|
+
* Watch LockCrystals events
|
|
966
1157
|
* @param callback Function to call when event is emitted
|
|
967
1158
|
* @param filter Optional filter for indexed parameters
|
|
968
1159
|
* @returns Unwatch function to stop listening
|
|
969
1160
|
*/
|
|
970
|
-
|
|
1161
|
+
LockCrystals: (callback: (event: { holder: `0x${string}`; amount: bigint; steemAddr: string }) => void, filter?: { holder?: `0x${string}` | `0x${string}`[] | null; amount?: bigint | bigint[] | null }) => {
|
|
971
1162
|
return this.publicClient.watchContractEvent({
|
|
972
1163
|
address: this.contractAddress,
|
|
973
|
-
abi:
|
|
974
|
-
eventName: '
|
|
975
|
-
|
|
1164
|
+
abi: DarkEnergyCrystalsAbi,
|
|
1165
|
+
eventName: 'LockCrystals',
|
|
1166
|
+
args: filter as any,
|
|
976
1167
|
onLogs: (logs: any[]) => {
|
|
977
1168
|
logs.forEach((log: any) => {
|
|
978
1169
|
callback(log.args as any);
|
|
@@ -981,17 +1172,17 @@ export class Decentr_json {
|
|
|
981
1172
|
}) as () => void;
|
|
982
1173
|
},
|
|
983
1174
|
/**
|
|
984
|
-
* Watch
|
|
1175
|
+
* Watch OwnershipTransferred events
|
|
985
1176
|
* @param callback Function to call when event is emitted
|
|
986
1177
|
* @param filter Optional filter for indexed parameters
|
|
987
1178
|
* @returns Unwatch function to stop listening
|
|
988
1179
|
*/
|
|
989
|
-
|
|
1180
|
+
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
990
1181
|
return this.publicClient.watchContractEvent({
|
|
991
1182
|
address: this.contractAddress,
|
|
992
|
-
abi:
|
|
993
|
-
eventName: '
|
|
994
|
-
|
|
1183
|
+
abi: DarkEnergyCrystalsAbi,
|
|
1184
|
+
eventName: 'OwnershipTransferred',
|
|
1185
|
+
args: filter as any,
|
|
995
1186
|
onLogs: (logs: any[]) => {
|
|
996
1187
|
logs.forEach((log: any) => {
|
|
997
1188
|
callback(log.args as any);
|
|
@@ -1005,12 +1196,12 @@ export class Decentr_json {
|
|
|
1005
1196
|
* @param filter Optional filter for indexed parameters
|
|
1006
1197
|
* @returns Unwatch function to stop listening
|
|
1007
1198
|
*/
|
|
1008
|
-
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from
|
|
1199
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1009
1200
|
return this.publicClient.watchContractEvent({
|
|
1010
1201
|
address: this.contractAddress,
|
|
1011
|
-
abi:
|
|
1202
|
+
abi: DarkEnergyCrystalsAbi,
|
|
1012
1203
|
eventName: 'Transfer',
|
|
1013
|
-
args: filter,
|
|
1204
|
+
args: filter as any,
|
|
1014
1205
|
onLogs: (logs: any[]) => {
|
|
1015
1206
|
logs.forEach((log: any) => {
|
|
1016
1207
|
callback(log.args as any);
|
|
@@ -1019,17 +1210,17 @@ export class Decentr_json {
|
|
|
1019
1210
|
}) as () => void;
|
|
1020
1211
|
},
|
|
1021
1212
|
/**
|
|
1022
|
-
* Watch
|
|
1213
|
+
* Watch Approval events
|
|
1023
1214
|
* @param callback Function to call when event is emitted
|
|
1024
1215
|
* @param filter Optional filter for indexed parameters
|
|
1025
1216
|
* @returns Unwatch function to stop listening
|
|
1026
1217
|
*/
|
|
1027
|
-
|
|
1218
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1028
1219
|
return this.publicClient.watchContractEvent({
|
|
1029
1220
|
address: this.contractAddress,
|
|
1030
|
-
abi:
|
|
1031
|
-
eventName: '
|
|
1032
|
-
|
|
1221
|
+
abi: DarkEnergyCrystalsAbi,
|
|
1222
|
+
eventName: 'Approval',
|
|
1223
|
+
args: filter as any,
|
|
1033
1224
|
onLogs: (logs: any[]) => {
|
|
1034
1225
|
logs.forEach((log: any) => {
|
|
1035
1226
|
callback(log.args as any);
|