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