@gitmyabi/vlns 0.0.0-stage → 1.0.0
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 +107 -2
- package/contracts/VLNS_json.d.ts +1298 -0
- package/contracts/VLNS_json.js +1414 -0
- package/contracts/VLNS_json.ts +1716 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
|
@@ -0,0 +1,1414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VLNS_json = exports.VLNS_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* VLNS_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.VLNS_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "deployer",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "address",
|
|
20
|
+
"name": "defaultRoyaltyReceiver",
|
|
21
|
+
"type": "address"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"stateMutability": "nonpayable",
|
|
25
|
+
"type": "constructor"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"inputs": [],
|
|
29
|
+
"name": "AlreadyLinked",
|
|
30
|
+
"type": "error"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"inputs": [],
|
|
34
|
+
"name": "CannotLink",
|
|
35
|
+
"type": "error"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"inputs": [],
|
|
39
|
+
"name": "FnSelectorNotRecognized",
|
|
40
|
+
"type": "error"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"inputs": [],
|
|
44
|
+
"name": "IsFinalized",
|
|
45
|
+
"type": "error"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "NotAuthorized",
|
|
50
|
+
"type": "error"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [],
|
|
54
|
+
"name": "NotLinked",
|
|
55
|
+
"type": "error"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"inputs": [],
|
|
59
|
+
"name": "SenderNotBase",
|
|
60
|
+
"type": "error"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"inputs": [],
|
|
64
|
+
"name": "SenderNotDeployer",
|
|
65
|
+
"type": "error"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "TransferToNonERC721ReceiverImplementer",
|
|
70
|
+
"type": "error"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"inputs": [],
|
|
74
|
+
"name": "ValueNotAccepted",
|
|
75
|
+
"type": "error"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"anonymous": false,
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"indexed": true,
|
|
82
|
+
"internalType": "address",
|
|
83
|
+
"name": "owner",
|
|
84
|
+
"type": "address"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"indexed": true,
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "account",
|
|
90
|
+
"type": "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"indexed": true,
|
|
94
|
+
"internalType": "uint256",
|
|
95
|
+
"name": "id",
|
|
96
|
+
"type": "uint256"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"name": "Approval",
|
|
100
|
+
"type": "event"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"anonymous": false,
|
|
104
|
+
"inputs": [
|
|
105
|
+
{
|
|
106
|
+
"indexed": true,
|
|
107
|
+
"internalType": "address",
|
|
108
|
+
"name": "owner",
|
|
109
|
+
"type": "address"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"indexed": true,
|
|
113
|
+
"internalType": "address",
|
|
114
|
+
"name": "operator",
|
|
115
|
+
"type": "address"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"indexed": false,
|
|
119
|
+
"internalType": "bool",
|
|
120
|
+
"name": "isApproved",
|
|
121
|
+
"type": "bool"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"name": "ApprovalForAll",
|
|
125
|
+
"type": "event"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"anonymous": false,
|
|
129
|
+
"inputs": [
|
|
130
|
+
{
|
|
131
|
+
"indexed": true,
|
|
132
|
+
"internalType": "address",
|
|
133
|
+
"name": "receiver",
|
|
134
|
+
"type": "address"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"indexed": false,
|
|
138
|
+
"internalType": "uint96",
|
|
139
|
+
"name": "feeNumerator",
|
|
140
|
+
"type": "uint96"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"name": "DefaultRoyaltyUpdated",
|
|
144
|
+
"type": "event"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"anonymous": false,
|
|
148
|
+
"inputs": [],
|
|
149
|
+
"name": "MirrorFinalized",
|
|
150
|
+
"type": "event"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"anonymous": false,
|
|
154
|
+
"inputs": [
|
|
155
|
+
{
|
|
156
|
+
"indexed": true,
|
|
157
|
+
"internalType": "address",
|
|
158
|
+
"name": "oldOwner",
|
|
159
|
+
"type": "address"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"indexed": true,
|
|
163
|
+
"internalType": "address",
|
|
164
|
+
"name": "newOwner",
|
|
165
|
+
"type": "address"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"name": "OwnershipTransferred",
|
|
169
|
+
"type": "event"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"anonymous": false,
|
|
173
|
+
"inputs": [
|
|
174
|
+
{
|
|
175
|
+
"indexed": true,
|
|
176
|
+
"internalType": "bytes32",
|
|
177
|
+
"name": "role",
|
|
178
|
+
"type": "bytes32"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"indexed": true,
|
|
182
|
+
"internalType": "bytes32",
|
|
183
|
+
"name": "previousAdminRole",
|
|
184
|
+
"type": "bytes32"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"indexed": true,
|
|
188
|
+
"internalType": "bytes32",
|
|
189
|
+
"name": "newAdminRole",
|
|
190
|
+
"type": "bytes32"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"name": "RoleAdminChanged",
|
|
194
|
+
"type": "event"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"anonymous": false,
|
|
198
|
+
"inputs": [
|
|
199
|
+
{
|
|
200
|
+
"indexed": true,
|
|
201
|
+
"internalType": "bytes32",
|
|
202
|
+
"name": "role",
|
|
203
|
+
"type": "bytes32"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"indexed": true,
|
|
207
|
+
"internalType": "address",
|
|
208
|
+
"name": "account",
|
|
209
|
+
"type": "address"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"indexed": true,
|
|
213
|
+
"internalType": "address",
|
|
214
|
+
"name": "sender",
|
|
215
|
+
"type": "address"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"name": "RoleGranted",
|
|
219
|
+
"type": "event"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"anonymous": false,
|
|
223
|
+
"inputs": [
|
|
224
|
+
{
|
|
225
|
+
"indexed": true,
|
|
226
|
+
"internalType": "bytes32",
|
|
227
|
+
"name": "role",
|
|
228
|
+
"type": "bytes32"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"indexed": true,
|
|
232
|
+
"internalType": "address",
|
|
233
|
+
"name": "account",
|
|
234
|
+
"type": "address"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"indexed": true,
|
|
238
|
+
"internalType": "address",
|
|
239
|
+
"name": "sender",
|
|
240
|
+
"type": "address"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"name": "RoleRevoked",
|
|
244
|
+
"type": "event"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"anonymous": false,
|
|
248
|
+
"inputs": [
|
|
249
|
+
{
|
|
250
|
+
"indexed": true,
|
|
251
|
+
"internalType": "address",
|
|
252
|
+
"name": "from",
|
|
253
|
+
"type": "address"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"indexed": true,
|
|
257
|
+
"internalType": "address",
|
|
258
|
+
"name": "to",
|
|
259
|
+
"type": "address"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"indexed": true,
|
|
263
|
+
"internalType": "uint256",
|
|
264
|
+
"name": "id",
|
|
265
|
+
"type": "uint256"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"name": "Transfer",
|
|
269
|
+
"type": "event"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"stateMutability": "payable",
|
|
273
|
+
"type": "fallback"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"inputs": [],
|
|
277
|
+
"name": "ADMIN_ROLE",
|
|
278
|
+
"outputs": [
|
|
279
|
+
{
|
|
280
|
+
"internalType": "bytes32",
|
|
281
|
+
"name": "",
|
|
282
|
+
"type": "bytes32"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"stateMutability": "view",
|
|
286
|
+
"type": "function"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"inputs": [],
|
|
290
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
291
|
+
"outputs": [
|
|
292
|
+
{
|
|
293
|
+
"internalType": "bytes32",
|
|
294
|
+
"name": "",
|
|
295
|
+
"type": "bytes32"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"stateMutability": "view",
|
|
299
|
+
"type": "function"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"inputs": [
|
|
303
|
+
{
|
|
304
|
+
"internalType": "address",
|
|
305
|
+
"name": "spender",
|
|
306
|
+
"type": "address"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"internalType": "uint256",
|
|
310
|
+
"name": "id",
|
|
311
|
+
"type": "uint256"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"name": "approve",
|
|
315
|
+
"outputs": [],
|
|
316
|
+
"stateMutability": "payable",
|
|
317
|
+
"type": "function"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"inputs": [
|
|
321
|
+
{
|
|
322
|
+
"internalType": "address",
|
|
323
|
+
"name": "nftOwner",
|
|
324
|
+
"type": "address"
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
"name": "balanceOf",
|
|
328
|
+
"outputs": [
|
|
329
|
+
{
|
|
330
|
+
"internalType": "uint256",
|
|
331
|
+
"name": "",
|
|
332
|
+
"type": "uint256"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"stateMutability": "view",
|
|
336
|
+
"type": "function"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"inputs": [],
|
|
340
|
+
"name": "baseERC20",
|
|
341
|
+
"outputs": [
|
|
342
|
+
{
|
|
343
|
+
"internalType": "address",
|
|
344
|
+
"name": "base",
|
|
345
|
+
"type": "address"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"stateMutability": "view",
|
|
349
|
+
"type": "function"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"inputs": [],
|
|
353
|
+
"name": "finalize",
|
|
354
|
+
"outputs": [],
|
|
355
|
+
"stateMutability": "nonpayable",
|
|
356
|
+
"type": "function"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"inputs": [],
|
|
360
|
+
"name": "finalized",
|
|
361
|
+
"outputs": [
|
|
362
|
+
{
|
|
363
|
+
"internalType": "bool",
|
|
364
|
+
"name": "",
|
|
365
|
+
"type": "bool"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"stateMutability": "view",
|
|
369
|
+
"type": "function"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"inputs": [
|
|
373
|
+
{
|
|
374
|
+
"internalType": "uint256",
|
|
375
|
+
"name": "id",
|
|
376
|
+
"type": "uint256"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"name": "getApproved",
|
|
380
|
+
"outputs": [
|
|
381
|
+
{
|
|
382
|
+
"internalType": "address",
|
|
383
|
+
"name": "",
|
|
384
|
+
"type": "address"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"stateMutability": "view",
|
|
388
|
+
"type": "function"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"inputs": [],
|
|
392
|
+
"name": "getDefaultRoyaltyRate",
|
|
393
|
+
"outputs": [
|
|
394
|
+
{
|
|
395
|
+
"internalType": "uint96",
|
|
396
|
+
"name": "",
|
|
397
|
+
"type": "uint96"
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
"stateMutability": "view",
|
|
401
|
+
"type": "function"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"inputs": [
|
|
405
|
+
{
|
|
406
|
+
"internalType": "bytes32",
|
|
407
|
+
"name": "role",
|
|
408
|
+
"type": "bytes32"
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
"name": "getRoleAdmin",
|
|
412
|
+
"outputs": [
|
|
413
|
+
{
|
|
414
|
+
"internalType": "bytes32",
|
|
415
|
+
"name": "",
|
|
416
|
+
"type": "bytes32"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"stateMutability": "view",
|
|
420
|
+
"type": "function"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"inputs": [
|
|
424
|
+
{
|
|
425
|
+
"internalType": "bytes32",
|
|
426
|
+
"name": "role",
|
|
427
|
+
"type": "bytes32"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"internalType": "address",
|
|
431
|
+
"name": "account",
|
|
432
|
+
"type": "address"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"name": "grantRole",
|
|
436
|
+
"outputs": [],
|
|
437
|
+
"stateMutability": "nonpayable",
|
|
438
|
+
"type": "function"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"inputs": [
|
|
442
|
+
{
|
|
443
|
+
"internalType": "bytes32",
|
|
444
|
+
"name": "role",
|
|
445
|
+
"type": "bytes32"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"internalType": "address",
|
|
449
|
+
"name": "account",
|
|
450
|
+
"type": "address"
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
"name": "hasRole",
|
|
454
|
+
"outputs": [
|
|
455
|
+
{
|
|
456
|
+
"internalType": "bool",
|
|
457
|
+
"name": "",
|
|
458
|
+
"type": "bool"
|
|
459
|
+
}
|
|
460
|
+
],
|
|
461
|
+
"stateMutability": "view",
|
|
462
|
+
"type": "function"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"inputs": [
|
|
466
|
+
{
|
|
467
|
+
"internalType": "address",
|
|
468
|
+
"name": "nftOwner",
|
|
469
|
+
"type": "address"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"internalType": "address",
|
|
473
|
+
"name": "operator",
|
|
474
|
+
"type": "address"
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"name": "isApprovedForAll",
|
|
478
|
+
"outputs": [
|
|
479
|
+
{
|
|
480
|
+
"internalType": "bool",
|
|
481
|
+
"name": "",
|
|
482
|
+
"type": "bool"
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
"stateMutability": "view",
|
|
486
|
+
"type": "function"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"inputs": [],
|
|
490
|
+
"name": "name",
|
|
491
|
+
"outputs": [
|
|
492
|
+
{
|
|
493
|
+
"internalType": "string",
|
|
494
|
+
"name": "",
|
|
495
|
+
"type": "string"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"stateMutability": "view",
|
|
499
|
+
"type": "function"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"inputs": [],
|
|
503
|
+
"name": "owner",
|
|
504
|
+
"outputs": [
|
|
505
|
+
{
|
|
506
|
+
"internalType": "address",
|
|
507
|
+
"name": "",
|
|
508
|
+
"type": "address"
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
"stateMutability": "view",
|
|
512
|
+
"type": "function"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"inputs": [
|
|
516
|
+
{
|
|
517
|
+
"internalType": "uint256",
|
|
518
|
+
"name": "id",
|
|
519
|
+
"type": "uint256"
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
"name": "ownerAt",
|
|
523
|
+
"outputs": [
|
|
524
|
+
{
|
|
525
|
+
"internalType": "address",
|
|
526
|
+
"name": "",
|
|
527
|
+
"type": "address"
|
|
528
|
+
}
|
|
529
|
+
],
|
|
530
|
+
"stateMutability": "view",
|
|
531
|
+
"type": "function"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"inputs": [
|
|
535
|
+
{
|
|
536
|
+
"internalType": "uint256",
|
|
537
|
+
"name": "id",
|
|
538
|
+
"type": "uint256"
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
"name": "ownerOf",
|
|
542
|
+
"outputs": [
|
|
543
|
+
{
|
|
544
|
+
"internalType": "address",
|
|
545
|
+
"name": "",
|
|
546
|
+
"type": "address"
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
"stateMutability": "view",
|
|
550
|
+
"type": "function"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"inputs": [],
|
|
554
|
+
"name": "pullOwner",
|
|
555
|
+
"outputs": [
|
|
556
|
+
{
|
|
557
|
+
"internalType": "bool",
|
|
558
|
+
"name": "",
|
|
559
|
+
"type": "bool"
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"stateMutability": "nonpayable",
|
|
563
|
+
"type": "function"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"inputs": [
|
|
567
|
+
{
|
|
568
|
+
"internalType": "bytes32",
|
|
569
|
+
"name": "role",
|
|
570
|
+
"type": "bytes32"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"internalType": "address",
|
|
574
|
+
"name": "account",
|
|
575
|
+
"type": "address"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"name": "renounceRole",
|
|
579
|
+
"outputs": [],
|
|
580
|
+
"stateMutability": "nonpayable",
|
|
581
|
+
"type": "function"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"inputs": [
|
|
585
|
+
{
|
|
586
|
+
"internalType": "bytes32",
|
|
587
|
+
"name": "role",
|
|
588
|
+
"type": "bytes32"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"internalType": "address",
|
|
592
|
+
"name": "account",
|
|
593
|
+
"type": "address"
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
"name": "revokeRole",
|
|
597
|
+
"outputs": [],
|
|
598
|
+
"stateMutability": "nonpayable",
|
|
599
|
+
"type": "function"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"inputs": [
|
|
603
|
+
{
|
|
604
|
+
"internalType": "uint256",
|
|
605
|
+
"name": "tokenId",
|
|
606
|
+
"type": "uint256"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"internalType": "uint256",
|
|
610
|
+
"name": "salePrice",
|
|
611
|
+
"type": "uint256"
|
|
612
|
+
}
|
|
613
|
+
],
|
|
614
|
+
"name": "royaltyInfo",
|
|
615
|
+
"outputs": [
|
|
616
|
+
{
|
|
617
|
+
"internalType": "address",
|
|
618
|
+
"name": "",
|
|
619
|
+
"type": "address"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"internalType": "uint256",
|
|
623
|
+
"name": "",
|
|
624
|
+
"type": "uint256"
|
|
625
|
+
}
|
|
626
|
+
],
|
|
627
|
+
"stateMutability": "view",
|
|
628
|
+
"type": "function"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"inputs": [
|
|
632
|
+
{
|
|
633
|
+
"internalType": "address",
|
|
634
|
+
"name": "from",
|
|
635
|
+
"type": "address"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"internalType": "address",
|
|
639
|
+
"name": "to",
|
|
640
|
+
"type": "address"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"internalType": "uint256",
|
|
644
|
+
"name": "id",
|
|
645
|
+
"type": "uint256"
|
|
646
|
+
}
|
|
647
|
+
],
|
|
648
|
+
"name": "safeTransferFrom",
|
|
649
|
+
"outputs": [],
|
|
650
|
+
"stateMutability": "payable",
|
|
651
|
+
"type": "function"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"inputs": [
|
|
655
|
+
{
|
|
656
|
+
"internalType": "address",
|
|
657
|
+
"name": "from",
|
|
658
|
+
"type": "address"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"internalType": "address",
|
|
662
|
+
"name": "to",
|
|
663
|
+
"type": "address"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"internalType": "uint256",
|
|
667
|
+
"name": "id",
|
|
668
|
+
"type": "uint256"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"internalType": "bytes",
|
|
672
|
+
"name": "data",
|
|
673
|
+
"type": "bytes"
|
|
674
|
+
}
|
|
675
|
+
],
|
|
676
|
+
"name": "safeTransferFrom",
|
|
677
|
+
"outputs": [],
|
|
678
|
+
"stateMutability": "payable",
|
|
679
|
+
"type": "function"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"inputs": [
|
|
683
|
+
{
|
|
684
|
+
"internalType": "address",
|
|
685
|
+
"name": "operator",
|
|
686
|
+
"type": "address"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"internalType": "bool",
|
|
690
|
+
"name": "approved",
|
|
691
|
+
"type": "bool"
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"name": "setApprovalForAll",
|
|
695
|
+
"outputs": [],
|
|
696
|
+
"stateMutability": "nonpayable",
|
|
697
|
+
"type": "function"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"inputs": [
|
|
701
|
+
{
|
|
702
|
+
"internalType": "address",
|
|
703
|
+
"name": "receiver",
|
|
704
|
+
"type": "address"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"internalType": "uint96",
|
|
708
|
+
"name": "feeNumerator",
|
|
709
|
+
"type": "uint96"
|
|
710
|
+
}
|
|
711
|
+
],
|
|
712
|
+
"name": "setDefaultRoyalty",
|
|
713
|
+
"outputs": [],
|
|
714
|
+
"stateMutability": "nonpayable",
|
|
715
|
+
"type": "function"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"inputs": [
|
|
719
|
+
{
|
|
720
|
+
"internalType": "bytes4",
|
|
721
|
+
"name": "interfaceId",
|
|
722
|
+
"type": "bytes4"
|
|
723
|
+
}
|
|
724
|
+
],
|
|
725
|
+
"name": "supportsInterface",
|
|
726
|
+
"outputs": [
|
|
727
|
+
{
|
|
728
|
+
"internalType": "bool",
|
|
729
|
+
"name": "",
|
|
730
|
+
"type": "bool"
|
|
731
|
+
}
|
|
732
|
+
],
|
|
733
|
+
"stateMutability": "view",
|
|
734
|
+
"type": "function"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"inputs": [],
|
|
738
|
+
"name": "symbol",
|
|
739
|
+
"outputs": [
|
|
740
|
+
{
|
|
741
|
+
"internalType": "string",
|
|
742
|
+
"name": "",
|
|
743
|
+
"type": "string"
|
|
744
|
+
}
|
|
745
|
+
],
|
|
746
|
+
"stateMutability": "view",
|
|
747
|
+
"type": "function"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"inputs": [
|
|
751
|
+
{
|
|
752
|
+
"internalType": "uint256",
|
|
753
|
+
"name": "id",
|
|
754
|
+
"type": "uint256"
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
"name": "tokenURI",
|
|
758
|
+
"outputs": [
|
|
759
|
+
{
|
|
760
|
+
"internalType": "string",
|
|
761
|
+
"name": "",
|
|
762
|
+
"type": "string"
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
"stateMutability": "view",
|
|
766
|
+
"type": "function"
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"inputs": [],
|
|
770
|
+
"name": "totalSupply",
|
|
771
|
+
"outputs": [
|
|
772
|
+
{
|
|
773
|
+
"internalType": "uint256",
|
|
774
|
+
"name": "",
|
|
775
|
+
"type": "uint256"
|
|
776
|
+
}
|
|
777
|
+
],
|
|
778
|
+
"stateMutability": "view",
|
|
779
|
+
"type": "function"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"inputs": [
|
|
783
|
+
{
|
|
784
|
+
"internalType": "address",
|
|
785
|
+
"name": "from",
|
|
786
|
+
"type": "address"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"internalType": "address",
|
|
790
|
+
"name": "to",
|
|
791
|
+
"type": "address"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"internalType": "uint256",
|
|
795
|
+
"name": "id",
|
|
796
|
+
"type": "uint256"
|
|
797
|
+
}
|
|
798
|
+
],
|
|
799
|
+
"name": "transferFrom",
|
|
800
|
+
"outputs": [],
|
|
801
|
+
"stateMutability": "payable",
|
|
802
|
+
"type": "function"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
"inputs": [],
|
|
806
|
+
"name": "withdrawETH",
|
|
807
|
+
"outputs": [],
|
|
808
|
+
"stateMutability": "nonpayable",
|
|
809
|
+
"type": "function"
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"stateMutability": "payable",
|
|
813
|
+
"type": "receive"
|
|
814
|
+
}
|
|
815
|
+
];
|
|
816
|
+
/**
|
|
817
|
+
* VLNS_json Contract Class
|
|
818
|
+
*
|
|
819
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* ```typescript
|
|
823
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
824
|
+
* import { mainnet } from 'viem/chains';
|
|
825
|
+
* import { VLNS_json } from 'VLNS_json';
|
|
826
|
+
*
|
|
827
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
828
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
829
|
+
*
|
|
830
|
+
* const contract = new VLNS_json('0x...', { publicClient, walletClient });
|
|
831
|
+
*
|
|
832
|
+
* // Read functions
|
|
833
|
+
* const result = await contract.balanceOf('0x...');
|
|
834
|
+
*
|
|
835
|
+
* // Write functions
|
|
836
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
837
|
+
*
|
|
838
|
+
* // Simulate transactions (dry-run)
|
|
839
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
840
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
841
|
+
*
|
|
842
|
+
* // Watch events
|
|
843
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
844
|
+
* console.log('Transfer event:', event);
|
|
845
|
+
* });
|
|
846
|
+
* ```
|
|
847
|
+
*/
|
|
848
|
+
class VLNS_json {
|
|
849
|
+
constructor(address, clients) {
|
|
850
|
+
this.contractAddress = address;
|
|
851
|
+
this.publicClient = clients.publicClient;
|
|
852
|
+
this.contract = (0, viem_1.getContract)({
|
|
853
|
+
address,
|
|
854
|
+
abi: exports.VLNS_jsonAbi,
|
|
855
|
+
client: {
|
|
856
|
+
public: clients.publicClient,
|
|
857
|
+
wallet: clients.walletClient,
|
|
858
|
+
},
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Get the contract address
|
|
863
|
+
*/
|
|
864
|
+
get address() {
|
|
865
|
+
return this.contractAddress;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Get the underlying viem contract instance
|
|
869
|
+
*/
|
|
870
|
+
getContract() {
|
|
871
|
+
return this.contract;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* ADMIN_ROLE
|
|
875
|
+
* view
|
|
876
|
+
*/
|
|
877
|
+
async ADMIN_ROLE() {
|
|
878
|
+
return this.contract.read.ADMIN_ROLE();
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* DEFAULT_ADMIN_ROLE
|
|
882
|
+
* view
|
|
883
|
+
*/
|
|
884
|
+
async DEFAULT_ADMIN_ROLE() {
|
|
885
|
+
return this.contract.read.DEFAULT_ADMIN_ROLE();
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* balanceOf
|
|
889
|
+
* view
|
|
890
|
+
*/
|
|
891
|
+
async balanceOf(nftOwner) {
|
|
892
|
+
return this.contract.read.balanceOf([nftOwner]);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* baseERC20
|
|
896
|
+
* view
|
|
897
|
+
*/
|
|
898
|
+
async baseERC20() {
|
|
899
|
+
return this.contract.read.baseERC20();
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* finalized
|
|
903
|
+
* view
|
|
904
|
+
*/
|
|
905
|
+
async finalized() {
|
|
906
|
+
return this.contract.read.finalized();
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* getApproved
|
|
910
|
+
* view
|
|
911
|
+
*/
|
|
912
|
+
async getApproved(id) {
|
|
913
|
+
return this.contract.read.getApproved([id]);
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* getDefaultRoyaltyRate
|
|
917
|
+
* view
|
|
918
|
+
*/
|
|
919
|
+
async getDefaultRoyaltyRate() {
|
|
920
|
+
return this.contract.read.getDefaultRoyaltyRate();
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* getRoleAdmin
|
|
924
|
+
* view
|
|
925
|
+
*/
|
|
926
|
+
async getRoleAdmin(role) {
|
|
927
|
+
return this.contract.read.getRoleAdmin([role]);
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* hasRole
|
|
931
|
+
* view
|
|
932
|
+
*/
|
|
933
|
+
async hasRole(role, account) {
|
|
934
|
+
return this.contract.read.hasRole([role, account]);
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* isApprovedForAll
|
|
938
|
+
* view
|
|
939
|
+
*/
|
|
940
|
+
async isApprovedForAll(nftOwner, operator) {
|
|
941
|
+
return this.contract.read.isApprovedForAll([nftOwner, operator]);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* name
|
|
945
|
+
* view
|
|
946
|
+
*/
|
|
947
|
+
async name() {
|
|
948
|
+
return this.contract.read.name();
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* owner
|
|
952
|
+
* view
|
|
953
|
+
*/
|
|
954
|
+
async owner() {
|
|
955
|
+
return this.contract.read.owner();
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* ownerAt
|
|
959
|
+
* view
|
|
960
|
+
*/
|
|
961
|
+
async ownerAt(id) {
|
|
962
|
+
return this.contract.read.ownerAt([id]);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* ownerOf
|
|
966
|
+
* view
|
|
967
|
+
*/
|
|
968
|
+
async ownerOf(id) {
|
|
969
|
+
return this.contract.read.ownerOf([id]);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* royaltyInfo
|
|
973
|
+
* view
|
|
974
|
+
*/
|
|
975
|
+
async royaltyInfo(tokenId, salePrice) {
|
|
976
|
+
return this.contract.read.royaltyInfo([tokenId, salePrice]);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* supportsInterface
|
|
980
|
+
* view
|
|
981
|
+
*/
|
|
982
|
+
async supportsInterface(interfaceId) {
|
|
983
|
+
return this.contract.read.supportsInterface([interfaceId]);
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* symbol
|
|
987
|
+
* view
|
|
988
|
+
*/
|
|
989
|
+
async symbol() {
|
|
990
|
+
return this.contract.read.symbol();
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* tokenURI
|
|
994
|
+
* view
|
|
995
|
+
*/
|
|
996
|
+
async tokenURI(id) {
|
|
997
|
+
return this.contract.read.tokenURI([id]);
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* totalSupply
|
|
1001
|
+
* view
|
|
1002
|
+
*/
|
|
1003
|
+
async totalSupply() {
|
|
1004
|
+
return this.contract.read.totalSupply();
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* approve
|
|
1008
|
+
* payable
|
|
1009
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1010
|
+
*/
|
|
1011
|
+
async approve(spender, id, options) {
|
|
1012
|
+
if (!this.contract.write) {
|
|
1013
|
+
throw new Error('Wallet client is required for write operations');
|
|
1014
|
+
}
|
|
1015
|
+
return this.contract.write.approve([spender, id], options);
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* finalize
|
|
1019
|
+
* nonpayable
|
|
1020
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1021
|
+
*/
|
|
1022
|
+
async finalize(options) {
|
|
1023
|
+
if (!this.contract.write) {
|
|
1024
|
+
throw new Error('Wallet client is required for write operations');
|
|
1025
|
+
}
|
|
1026
|
+
return this.contract.write.finalize(options);
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* grantRole
|
|
1030
|
+
* nonpayable
|
|
1031
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1032
|
+
*/
|
|
1033
|
+
async grantRole(role, account, options) {
|
|
1034
|
+
if (!this.contract.write) {
|
|
1035
|
+
throw new Error('Wallet client is required for write operations');
|
|
1036
|
+
}
|
|
1037
|
+
return this.contract.write.grantRole([role, account], options);
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* pullOwner
|
|
1041
|
+
* nonpayable
|
|
1042
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1043
|
+
*/
|
|
1044
|
+
async pullOwner(options) {
|
|
1045
|
+
if (!this.contract.write) {
|
|
1046
|
+
throw new Error('Wallet client is required for write operations');
|
|
1047
|
+
}
|
|
1048
|
+
return this.contract.write.pullOwner(options);
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* renounceRole
|
|
1052
|
+
* nonpayable
|
|
1053
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1054
|
+
*/
|
|
1055
|
+
async renounceRole(role, account, options) {
|
|
1056
|
+
if (!this.contract.write) {
|
|
1057
|
+
throw new Error('Wallet client is required for write operations');
|
|
1058
|
+
}
|
|
1059
|
+
return this.contract.write.renounceRole([role, account], options);
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* revokeRole
|
|
1063
|
+
* nonpayable
|
|
1064
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1065
|
+
*/
|
|
1066
|
+
async revokeRole(role, account, options) {
|
|
1067
|
+
if (!this.contract.write) {
|
|
1068
|
+
throw new Error('Wallet client is required for write operations');
|
|
1069
|
+
}
|
|
1070
|
+
return this.contract.write.revokeRole([role, account], options);
|
|
1071
|
+
}
|
|
1072
|
+
async safeTransferFrom(...args) {
|
|
1073
|
+
if (!this.contract.write) {
|
|
1074
|
+
throw new Error('Wallet client is required for write operations');
|
|
1075
|
+
}
|
|
1076
|
+
return this.contract.write.safeTransferFrom(args);
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* setApprovalForAll
|
|
1080
|
+
* nonpayable
|
|
1081
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1082
|
+
*/
|
|
1083
|
+
async setApprovalForAll(operator, approved, options) {
|
|
1084
|
+
if (!this.contract.write) {
|
|
1085
|
+
throw new Error('Wallet client is required for write operations');
|
|
1086
|
+
}
|
|
1087
|
+
return this.contract.write.setApprovalForAll([operator, approved], options);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* setDefaultRoyalty
|
|
1091
|
+
* nonpayable
|
|
1092
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1093
|
+
*/
|
|
1094
|
+
async setDefaultRoyalty(receiver, feeNumerator, options) {
|
|
1095
|
+
if (!this.contract.write) {
|
|
1096
|
+
throw new Error('Wallet client is required for write operations');
|
|
1097
|
+
}
|
|
1098
|
+
return this.contract.write.setDefaultRoyalty([receiver, feeNumerator], options);
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* transferFrom
|
|
1102
|
+
* payable
|
|
1103
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1104
|
+
*/
|
|
1105
|
+
async transferFrom(from, to, id, options) {
|
|
1106
|
+
if (!this.contract.write) {
|
|
1107
|
+
throw new Error('Wallet client is required for write operations');
|
|
1108
|
+
}
|
|
1109
|
+
return this.contract.write.transferFrom([from, to, id], options);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* withdrawETH
|
|
1113
|
+
* nonpayable
|
|
1114
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1115
|
+
*/
|
|
1116
|
+
async withdrawETH(options) {
|
|
1117
|
+
if (!this.contract.write) {
|
|
1118
|
+
throw new Error('Wallet client is required for write operations');
|
|
1119
|
+
}
|
|
1120
|
+
return this.contract.write.withdrawETH(options);
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1127
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1128
|
+
* console.log('Would succeed:', result.result);
|
|
1129
|
+
*/
|
|
1130
|
+
get simulate() {
|
|
1131
|
+
const contract = this.contract;
|
|
1132
|
+
if (!contract.simulate) {
|
|
1133
|
+
throw new Error('Public client is required for simulation');
|
|
1134
|
+
}
|
|
1135
|
+
return {
|
|
1136
|
+
/**
|
|
1137
|
+
* Simulate approve
|
|
1138
|
+
* Returns gas estimate and result without sending transaction
|
|
1139
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1140
|
+
*/
|
|
1141
|
+
async approve(spender, id, options) {
|
|
1142
|
+
return contract.simulate.approve([spender, id], options);
|
|
1143
|
+
},
|
|
1144
|
+
/**
|
|
1145
|
+
* Simulate finalize
|
|
1146
|
+
* Returns gas estimate and result without sending transaction
|
|
1147
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1148
|
+
*/
|
|
1149
|
+
async finalize(options) {
|
|
1150
|
+
return contract.simulate.finalize(options);
|
|
1151
|
+
},
|
|
1152
|
+
/**
|
|
1153
|
+
* Simulate grantRole
|
|
1154
|
+
* Returns gas estimate and result without sending transaction
|
|
1155
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1156
|
+
*/
|
|
1157
|
+
async grantRole(role, account, options) {
|
|
1158
|
+
return contract.simulate.grantRole([role, account], options);
|
|
1159
|
+
},
|
|
1160
|
+
/**
|
|
1161
|
+
* Simulate pullOwner
|
|
1162
|
+
* Returns gas estimate and result without sending transaction
|
|
1163
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1164
|
+
*/
|
|
1165
|
+
async pullOwner(options) {
|
|
1166
|
+
return contract.simulate.pullOwner(options);
|
|
1167
|
+
},
|
|
1168
|
+
/**
|
|
1169
|
+
* Simulate renounceRole
|
|
1170
|
+
* Returns gas estimate and result without sending transaction
|
|
1171
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1172
|
+
*/
|
|
1173
|
+
async renounceRole(role, account, options) {
|
|
1174
|
+
return contract.simulate.renounceRole([role, account], options);
|
|
1175
|
+
},
|
|
1176
|
+
/**
|
|
1177
|
+
* Simulate revokeRole
|
|
1178
|
+
* Returns gas estimate and result without sending transaction
|
|
1179
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1180
|
+
*/
|
|
1181
|
+
async revokeRole(role, account, options) {
|
|
1182
|
+
return contract.simulate.revokeRole([role, account], options);
|
|
1183
|
+
},
|
|
1184
|
+
/**
|
|
1185
|
+
* Simulate safeTransferFrom
|
|
1186
|
+
* Returns gas estimate and result without sending transaction
|
|
1187
|
+
* Supports multiple overloads: (address, address, uint256), (address, address, uint256, bytes)
|
|
1188
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1189
|
+
*/
|
|
1190
|
+
async safeTransferFrom(...args) {
|
|
1191
|
+
return contract.simulate.safeTransferFrom(args);
|
|
1192
|
+
},
|
|
1193
|
+
/**
|
|
1194
|
+
* Simulate setApprovalForAll
|
|
1195
|
+
* Returns gas estimate and result without sending transaction
|
|
1196
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1197
|
+
*/
|
|
1198
|
+
async setApprovalForAll(operator, approved, options) {
|
|
1199
|
+
return contract.simulate.setApprovalForAll([operator, approved], options);
|
|
1200
|
+
},
|
|
1201
|
+
/**
|
|
1202
|
+
* Simulate setDefaultRoyalty
|
|
1203
|
+
* Returns gas estimate and result without sending transaction
|
|
1204
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1205
|
+
*/
|
|
1206
|
+
async setDefaultRoyalty(receiver, feeNumerator, options) {
|
|
1207
|
+
return contract.simulate.setDefaultRoyalty([receiver, feeNumerator], options);
|
|
1208
|
+
},
|
|
1209
|
+
/**
|
|
1210
|
+
* Simulate transferFrom
|
|
1211
|
+
* Returns gas estimate and result without sending transaction
|
|
1212
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1213
|
+
*/
|
|
1214
|
+
async transferFrom(from, to, id, options) {
|
|
1215
|
+
return contract.simulate.transferFrom([from, to, id], options);
|
|
1216
|
+
},
|
|
1217
|
+
/**
|
|
1218
|
+
* Simulate withdrawETH
|
|
1219
|
+
* Returns gas estimate and result without sending transaction
|
|
1220
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1221
|
+
*/
|
|
1222
|
+
async withdrawETH(options) {
|
|
1223
|
+
return contract.simulate.withdrawETH(options);
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Watch contract events
|
|
1229
|
+
*
|
|
1230
|
+
* @example
|
|
1231
|
+
* // Watch all Transfer events
|
|
1232
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1233
|
+
* console.log('Transfer:', event);
|
|
1234
|
+
* });
|
|
1235
|
+
*
|
|
1236
|
+
* // Stop watching
|
|
1237
|
+
* unwatch();
|
|
1238
|
+
*/
|
|
1239
|
+
get watch() {
|
|
1240
|
+
return {
|
|
1241
|
+
/**
|
|
1242
|
+
* Watch Approval events
|
|
1243
|
+
* @param callback Function to call when event is emitted
|
|
1244
|
+
* @param filter Optional filter for indexed parameters
|
|
1245
|
+
* @returns Unwatch function to stop listening
|
|
1246
|
+
*/
|
|
1247
|
+
Approval: (callback, filter) => {
|
|
1248
|
+
return this.publicClient.watchContractEvent({
|
|
1249
|
+
address: this.contractAddress,
|
|
1250
|
+
abi: exports.VLNS_jsonAbi,
|
|
1251
|
+
eventName: 'Approval',
|
|
1252
|
+
args: filter,
|
|
1253
|
+
onLogs: (logs) => {
|
|
1254
|
+
logs.forEach((log) => {
|
|
1255
|
+
callback(log.args);
|
|
1256
|
+
});
|
|
1257
|
+
},
|
|
1258
|
+
});
|
|
1259
|
+
},
|
|
1260
|
+
/**
|
|
1261
|
+
* Watch ApprovalForAll events
|
|
1262
|
+
* @param callback Function to call when event is emitted
|
|
1263
|
+
* @param filter Optional filter for indexed parameters
|
|
1264
|
+
* @returns Unwatch function to stop listening
|
|
1265
|
+
*/
|
|
1266
|
+
ApprovalForAll: (callback, filter) => {
|
|
1267
|
+
return this.publicClient.watchContractEvent({
|
|
1268
|
+
address: this.contractAddress,
|
|
1269
|
+
abi: exports.VLNS_jsonAbi,
|
|
1270
|
+
eventName: 'ApprovalForAll',
|
|
1271
|
+
args: filter,
|
|
1272
|
+
onLogs: (logs) => {
|
|
1273
|
+
logs.forEach((log) => {
|
|
1274
|
+
callback(log.args);
|
|
1275
|
+
});
|
|
1276
|
+
},
|
|
1277
|
+
});
|
|
1278
|
+
},
|
|
1279
|
+
/**
|
|
1280
|
+
* Watch DefaultRoyaltyUpdated events
|
|
1281
|
+
* @param callback Function to call when event is emitted
|
|
1282
|
+
* @param filter Optional filter for indexed parameters
|
|
1283
|
+
* @returns Unwatch function to stop listening
|
|
1284
|
+
*/
|
|
1285
|
+
DefaultRoyaltyUpdated: (callback, filter) => {
|
|
1286
|
+
return this.publicClient.watchContractEvent({
|
|
1287
|
+
address: this.contractAddress,
|
|
1288
|
+
abi: exports.VLNS_jsonAbi,
|
|
1289
|
+
eventName: 'DefaultRoyaltyUpdated',
|
|
1290
|
+
args: filter,
|
|
1291
|
+
onLogs: (logs) => {
|
|
1292
|
+
logs.forEach((log) => {
|
|
1293
|
+
callback(log.args);
|
|
1294
|
+
});
|
|
1295
|
+
},
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
/**
|
|
1299
|
+
* Watch MirrorFinalized events
|
|
1300
|
+
* @param callback Function to call when event is emitted
|
|
1301
|
+
* @param filter Optional filter for indexed parameters
|
|
1302
|
+
* @returns Unwatch function to stop listening
|
|
1303
|
+
*/
|
|
1304
|
+
MirrorFinalized: (callback) => {
|
|
1305
|
+
return this.publicClient.watchContractEvent({
|
|
1306
|
+
address: this.contractAddress,
|
|
1307
|
+
abi: exports.VLNS_jsonAbi,
|
|
1308
|
+
eventName: 'MirrorFinalized',
|
|
1309
|
+
onLogs: (logs) => {
|
|
1310
|
+
logs.forEach((log) => {
|
|
1311
|
+
callback(log.args);
|
|
1312
|
+
});
|
|
1313
|
+
},
|
|
1314
|
+
});
|
|
1315
|
+
},
|
|
1316
|
+
/**
|
|
1317
|
+
* Watch OwnershipTransferred events
|
|
1318
|
+
* @param callback Function to call when event is emitted
|
|
1319
|
+
* @param filter Optional filter for indexed parameters
|
|
1320
|
+
* @returns Unwatch function to stop listening
|
|
1321
|
+
*/
|
|
1322
|
+
OwnershipTransferred: (callback, filter) => {
|
|
1323
|
+
return this.publicClient.watchContractEvent({
|
|
1324
|
+
address: this.contractAddress,
|
|
1325
|
+
abi: exports.VLNS_jsonAbi,
|
|
1326
|
+
eventName: 'OwnershipTransferred',
|
|
1327
|
+
args: filter,
|
|
1328
|
+
onLogs: (logs) => {
|
|
1329
|
+
logs.forEach((log) => {
|
|
1330
|
+
callback(log.args);
|
|
1331
|
+
});
|
|
1332
|
+
},
|
|
1333
|
+
});
|
|
1334
|
+
},
|
|
1335
|
+
/**
|
|
1336
|
+
* Watch RoleAdminChanged events
|
|
1337
|
+
* @param callback Function to call when event is emitted
|
|
1338
|
+
* @param filter Optional filter for indexed parameters
|
|
1339
|
+
* @returns Unwatch function to stop listening
|
|
1340
|
+
*/
|
|
1341
|
+
RoleAdminChanged: (callback, filter) => {
|
|
1342
|
+
return this.publicClient.watchContractEvent({
|
|
1343
|
+
address: this.contractAddress,
|
|
1344
|
+
abi: exports.VLNS_jsonAbi,
|
|
1345
|
+
eventName: 'RoleAdminChanged',
|
|
1346
|
+
args: filter,
|
|
1347
|
+
onLogs: (logs) => {
|
|
1348
|
+
logs.forEach((log) => {
|
|
1349
|
+
callback(log.args);
|
|
1350
|
+
});
|
|
1351
|
+
},
|
|
1352
|
+
});
|
|
1353
|
+
},
|
|
1354
|
+
/**
|
|
1355
|
+
* Watch RoleGranted events
|
|
1356
|
+
* @param callback Function to call when event is emitted
|
|
1357
|
+
* @param filter Optional filter for indexed parameters
|
|
1358
|
+
* @returns Unwatch function to stop listening
|
|
1359
|
+
*/
|
|
1360
|
+
RoleGranted: (callback, filter) => {
|
|
1361
|
+
return this.publicClient.watchContractEvent({
|
|
1362
|
+
address: this.contractAddress,
|
|
1363
|
+
abi: exports.VLNS_jsonAbi,
|
|
1364
|
+
eventName: 'RoleGranted',
|
|
1365
|
+
args: filter,
|
|
1366
|
+
onLogs: (logs) => {
|
|
1367
|
+
logs.forEach((log) => {
|
|
1368
|
+
callback(log.args);
|
|
1369
|
+
});
|
|
1370
|
+
},
|
|
1371
|
+
});
|
|
1372
|
+
},
|
|
1373
|
+
/**
|
|
1374
|
+
* Watch RoleRevoked events
|
|
1375
|
+
* @param callback Function to call when event is emitted
|
|
1376
|
+
* @param filter Optional filter for indexed parameters
|
|
1377
|
+
* @returns Unwatch function to stop listening
|
|
1378
|
+
*/
|
|
1379
|
+
RoleRevoked: (callback, filter) => {
|
|
1380
|
+
return this.publicClient.watchContractEvent({
|
|
1381
|
+
address: this.contractAddress,
|
|
1382
|
+
abi: exports.VLNS_jsonAbi,
|
|
1383
|
+
eventName: 'RoleRevoked',
|
|
1384
|
+
args: filter,
|
|
1385
|
+
onLogs: (logs) => {
|
|
1386
|
+
logs.forEach((log) => {
|
|
1387
|
+
callback(log.args);
|
|
1388
|
+
});
|
|
1389
|
+
},
|
|
1390
|
+
});
|
|
1391
|
+
},
|
|
1392
|
+
/**
|
|
1393
|
+
* Watch Transfer events
|
|
1394
|
+
* @param callback Function to call when event is emitted
|
|
1395
|
+
* @param filter Optional filter for indexed parameters
|
|
1396
|
+
* @returns Unwatch function to stop listening
|
|
1397
|
+
*/
|
|
1398
|
+
Transfer: (callback, filter) => {
|
|
1399
|
+
return this.publicClient.watchContractEvent({
|
|
1400
|
+
address: this.contractAddress,
|
|
1401
|
+
abi: exports.VLNS_jsonAbi,
|
|
1402
|
+
eventName: 'Transfer',
|
|
1403
|
+
args: filter,
|
|
1404
|
+
onLogs: (logs) => {
|
|
1405
|
+
logs.forEach((log) => {
|
|
1406
|
+
callback(log.args);
|
|
1407
|
+
});
|
|
1408
|
+
},
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
exports.VLNS_json = VLNS_json;
|