@gitmyabi/oftwrapperdiamond 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,1018 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OFTWrapperDiamond_json = exports.OFTWrapperDiamond_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * OFTWrapperDiamond_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.OFTWrapperDiamond_jsonAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "address",
15
+ "name": "_collector",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "internalType": "address",
20
+ "name": "_owner",
21
+ "type": "address"
22
+ }
23
+ ],
24
+ "stateMutability": "nonpayable",
25
+ "type": "constructor"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "DiamondWritable__InvalidInitializationParameters",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "DiamondWritable__RemoveTargetNotZeroAddress",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [],
39
+ "name": "DiamondWritable__ReplaceTargetIsIdentical",
40
+ "type": "error"
41
+ },
42
+ {
43
+ "inputs": [],
44
+ "name": "DiamondWritable__SelectorAlreadyAdded",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [],
49
+ "name": "DiamondWritable__SelectorIsImmutable",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [],
54
+ "name": "DiamondWritable__SelectorNotFound",
55
+ "type": "error"
56
+ },
57
+ {
58
+ "inputs": [],
59
+ "name": "DiamondWritable__SelectorNotSpecified",
60
+ "type": "error"
61
+ },
62
+ {
63
+ "inputs": [],
64
+ "name": "DiamondWritable__TargetHasNoCode",
65
+ "type": "error"
66
+ },
67
+ {
68
+ "inputs": [],
69
+ "name": "ERC165Base__InvalidInterfaceId",
70
+ "type": "error"
71
+ },
72
+ {
73
+ "inputs": [],
74
+ "name": "Ownable__NotOwner",
75
+ "type": "error"
76
+ },
77
+ {
78
+ "inputs": [],
79
+ "name": "Ownable__NotTransitiveOwner",
80
+ "type": "error"
81
+ },
82
+ {
83
+ "inputs": [],
84
+ "name": "Pausable__NotPaused",
85
+ "type": "error"
86
+ },
87
+ {
88
+ "inputs": [],
89
+ "name": "Pausable__Paused",
90
+ "type": "error"
91
+ },
92
+ {
93
+ "inputs": [],
94
+ "name": "Proxy__ImplementationIsNotContract",
95
+ "type": "error"
96
+ },
97
+ {
98
+ "inputs": [],
99
+ "name": "ReentrancyGuard__ReentrantCall",
100
+ "type": "error"
101
+ },
102
+ {
103
+ "inputs": [],
104
+ "name": "SafeOwnable__NotNomineeOwner",
105
+ "type": "error"
106
+ },
107
+ {
108
+ "inputs": [],
109
+ "name": "SafeTransferError",
110
+ "type": "error"
111
+ },
112
+ {
113
+ "inputs": [],
114
+ "name": "SafeTransferNativeError",
115
+ "type": "error"
116
+ },
117
+ {
118
+ "anonymous": false,
119
+ "inputs": [
120
+ {
121
+ "components": [
122
+ {
123
+ "internalType": "address",
124
+ "name": "target",
125
+ "type": "address"
126
+ },
127
+ {
128
+ "internalType": "enum IDiamondWritableInternal.FacetCutAction",
129
+ "name": "action",
130
+ "type": "uint8"
131
+ },
132
+ {
133
+ "internalType": "bytes4[]",
134
+ "name": "selectors",
135
+ "type": "bytes4[]"
136
+ }
137
+ ],
138
+ "indexed": false,
139
+ "internalType": "struct IDiamondWritableInternal.FacetCut[]",
140
+ "name": "facetCuts",
141
+ "type": "tuple[]"
142
+ },
143
+ {
144
+ "indexed": false,
145
+ "internalType": "address",
146
+ "name": "target",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "indexed": false,
151
+ "internalType": "bytes",
152
+ "name": "data",
153
+ "type": "bytes"
154
+ }
155
+ ],
156
+ "name": "DiamondCut",
157
+ "type": "event"
158
+ },
159
+ {
160
+ "anonymous": false,
161
+ "inputs": [
162
+ {
163
+ "indexed": true,
164
+ "internalType": "address",
165
+ "name": "previousOwner",
166
+ "type": "address"
167
+ },
168
+ {
169
+ "indexed": true,
170
+ "internalType": "address",
171
+ "name": "newOwner",
172
+ "type": "address"
173
+ }
174
+ ],
175
+ "name": "OwnershipTransferred",
176
+ "type": "event"
177
+ },
178
+ {
179
+ "anonymous": false,
180
+ "inputs": [
181
+ {
182
+ "indexed": false,
183
+ "internalType": "address",
184
+ "name": "account",
185
+ "type": "address"
186
+ }
187
+ ],
188
+ "name": "Paused",
189
+ "type": "event"
190
+ },
191
+ {
192
+ "anonymous": false,
193
+ "inputs": [
194
+ {
195
+ "indexed": true,
196
+ "internalType": "address",
197
+ "name": "collector",
198
+ "type": "address"
199
+ }
200
+ ],
201
+ "name": "SetCollector",
202
+ "type": "event"
203
+ },
204
+ {
205
+ "anonymous": false,
206
+ "inputs": [
207
+ {
208
+ "indexed": false,
209
+ "internalType": "address",
210
+ "name": "account",
211
+ "type": "address"
212
+ }
213
+ ],
214
+ "name": "Unpaused",
215
+ "type": "event"
216
+ },
217
+ {
218
+ "stateMutability": "payable",
219
+ "type": "fallback"
220
+ },
221
+ {
222
+ "inputs": [],
223
+ "name": "SYSTEM_VERSION_ID",
224
+ "outputs": [
225
+ {
226
+ "internalType": "uint256",
227
+ "name": "",
228
+ "type": "uint256"
229
+ }
230
+ ],
231
+ "stateMutability": "pure",
232
+ "type": "function"
233
+ },
234
+ {
235
+ "inputs": [],
236
+ "name": "acceptOwnership",
237
+ "outputs": [],
238
+ "stateMutability": "nonpayable",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "inputs": [
243
+ {
244
+ "internalType": "address",
245
+ "name": "_tokenAddress",
246
+ "type": "address"
247
+ }
248
+ ],
249
+ "name": "cleanup",
250
+ "outputs": [],
251
+ "stateMutability": "nonpayable",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [
256
+ {
257
+ "internalType": "address",
258
+ "name": "_tokenAddress",
259
+ "type": "address"
260
+ },
261
+ {
262
+ "internalType": "uint256",
263
+ "name": "_tokenAmount",
264
+ "type": "uint256"
265
+ }
266
+ ],
267
+ "name": "cleanupWithAmount",
268
+ "outputs": [],
269
+ "stateMutability": "nonpayable",
270
+ "type": "function"
271
+ },
272
+ {
273
+ "inputs": [],
274
+ "name": "collector",
275
+ "outputs": [
276
+ {
277
+ "internalType": "address",
278
+ "name": "",
279
+ "type": "address"
280
+ }
281
+ ],
282
+ "stateMutability": "view",
283
+ "type": "function"
284
+ },
285
+ {
286
+ "inputs": [
287
+ {
288
+ "components": [
289
+ {
290
+ "internalType": "address",
291
+ "name": "target",
292
+ "type": "address"
293
+ },
294
+ {
295
+ "internalType": "enum IDiamondWritableInternal.FacetCutAction",
296
+ "name": "action",
297
+ "type": "uint8"
298
+ },
299
+ {
300
+ "internalType": "bytes4[]",
301
+ "name": "selectors",
302
+ "type": "bytes4[]"
303
+ }
304
+ ],
305
+ "internalType": "struct IDiamondWritableInternal.FacetCut[]",
306
+ "name": "facetCuts",
307
+ "type": "tuple[]"
308
+ },
309
+ {
310
+ "internalType": "address",
311
+ "name": "target",
312
+ "type": "address"
313
+ },
314
+ {
315
+ "internalType": "bytes",
316
+ "name": "data",
317
+ "type": "bytes"
318
+ }
319
+ ],
320
+ "name": "diamondCut",
321
+ "outputs": [],
322
+ "stateMutability": "nonpayable",
323
+ "type": "function"
324
+ },
325
+ {
326
+ "inputs": [
327
+ {
328
+ "internalType": "bytes4",
329
+ "name": "selector",
330
+ "type": "bytes4"
331
+ }
332
+ ],
333
+ "name": "facetAddress",
334
+ "outputs": [
335
+ {
336
+ "internalType": "address",
337
+ "name": "facet",
338
+ "type": "address"
339
+ }
340
+ ],
341
+ "stateMutability": "view",
342
+ "type": "function"
343
+ },
344
+ {
345
+ "inputs": [],
346
+ "name": "facetAddresses",
347
+ "outputs": [
348
+ {
349
+ "internalType": "address[]",
350
+ "name": "addresses",
351
+ "type": "address[]"
352
+ }
353
+ ],
354
+ "stateMutability": "view",
355
+ "type": "function"
356
+ },
357
+ {
358
+ "inputs": [
359
+ {
360
+ "internalType": "address",
361
+ "name": "facet",
362
+ "type": "address"
363
+ }
364
+ ],
365
+ "name": "facetFunctionSelectors",
366
+ "outputs": [
367
+ {
368
+ "internalType": "bytes4[]",
369
+ "name": "selectors",
370
+ "type": "bytes4[]"
371
+ }
372
+ ],
373
+ "stateMutability": "view",
374
+ "type": "function"
375
+ },
376
+ {
377
+ "inputs": [],
378
+ "name": "facets",
379
+ "outputs": [
380
+ {
381
+ "components": [
382
+ {
383
+ "internalType": "address",
384
+ "name": "target",
385
+ "type": "address"
386
+ },
387
+ {
388
+ "internalType": "bytes4[]",
389
+ "name": "selectors",
390
+ "type": "bytes4[]"
391
+ }
392
+ ],
393
+ "internalType": "struct IDiamondReadable.Facet[]",
394
+ "name": "diamondFacets",
395
+ "type": "tuple[]"
396
+ }
397
+ ],
398
+ "stateMutability": "view",
399
+ "type": "function"
400
+ },
401
+ {
402
+ "inputs": [
403
+ {
404
+ "internalType": "address",
405
+ "name": "_newOwner",
406
+ "type": "address"
407
+ }
408
+ ],
409
+ "name": "forceTransferOwnership",
410
+ "outputs": [],
411
+ "stateMutability": "nonpayable",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "inputs": [],
416
+ "name": "getFallbackAddress",
417
+ "outputs": [
418
+ {
419
+ "internalType": "address",
420
+ "name": "fallbackAddress",
421
+ "type": "address"
422
+ }
423
+ ],
424
+ "stateMutability": "view",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "inputs": [],
429
+ "name": "nomineeOwner",
430
+ "outputs": [
431
+ {
432
+ "internalType": "address",
433
+ "name": "",
434
+ "type": "address"
435
+ }
436
+ ],
437
+ "stateMutability": "view",
438
+ "type": "function"
439
+ },
440
+ {
441
+ "inputs": [],
442
+ "name": "owner",
443
+ "outputs": [
444
+ {
445
+ "internalType": "address",
446
+ "name": "",
447
+ "type": "address"
448
+ }
449
+ ],
450
+ "stateMutability": "view",
451
+ "type": "function"
452
+ },
453
+ {
454
+ "inputs": [],
455
+ "name": "pause",
456
+ "outputs": [],
457
+ "stateMutability": "nonpayable",
458
+ "type": "function"
459
+ },
460
+ {
461
+ "inputs": [],
462
+ "name": "paused",
463
+ "outputs": [
464
+ {
465
+ "internalType": "bool",
466
+ "name": "status",
467
+ "type": "bool"
468
+ }
469
+ ],
470
+ "stateMutability": "view",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [
475
+ {
476
+ "internalType": "address",
477
+ "name": "_collector",
478
+ "type": "address"
479
+ }
480
+ ],
481
+ "name": "setCollector",
482
+ "outputs": [],
483
+ "stateMutability": "nonpayable",
484
+ "type": "function"
485
+ },
486
+ {
487
+ "inputs": [
488
+ {
489
+ "internalType": "address",
490
+ "name": "fallbackAddress",
491
+ "type": "address"
492
+ }
493
+ ],
494
+ "name": "setFallbackAddress",
495
+ "outputs": [],
496
+ "stateMutability": "nonpayable",
497
+ "type": "function"
498
+ },
499
+ {
500
+ "inputs": [
501
+ {
502
+ "internalType": "bytes4",
503
+ "name": "interfaceId",
504
+ "type": "bytes4"
505
+ }
506
+ ],
507
+ "name": "supportsInterface",
508
+ "outputs": [
509
+ {
510
+ "internalType": "bool",
511
+ "name": "",
512
+ "type": "bool"
513
+ }
514
+ ],
515
+ "stateMutability": "view",
516
+ "type": "function"
517
+ },
518
+ {
519
+ "inputs": [
520
+ {
521
+ "internalType": "address",
522
+ "name": "_tokenAddress",
523
+ "type": "address"
524
+ }
525
+ ],
526
+ "name": "tokenBalance",
527
+ "outputs": [
528
+ {
529
+ "internalType": "uint256",
530
+ "name": "",
531
+ "type": "uint256"
532
+ }
533
+ ],
534
+ "stateMutability": "view",
535
+ "type": "function"
536
+ },
537
+ {
538
+ "inputs": [
539
+ {
540
+ "internalType": "address",
541
+ "name": "account",
542
+ "type": "address"
543
+ }
544
+ ],
545
+ "name": "transferOwnership",
546
+ "outputs": [],
547
+ "stateMutability": "nonpayable",
548
+ "type": "function"
549
+ },
550
+ {
551
+ "inputs": [],
552
+ "name": "unpause",
553
+ "outputs": [],
554
+ "stateMutability": "nonpayable",
555
+ "type": "function"
556
+ },
557
+ {
558
+ "stateMutability": "payable",
559
+ "type": "receive"
560
+ }
561
+ ];
562
+ /**
563
+ * OFTWrapperDiamond_json Contract Class
564
+ *
565
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
566
+ *
567
+ * @example
568
+ * ```typescript
569
+ * import { createPublicClient, createWalletClient, http } from 'viem';
570
+ * import { mainnet } from 'viem/chains';
571
+ * import { OFTWrapperDiamond_json } from 'OFTWrapperDiamond_json';
572
+ *
573
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
574
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
575
+ *
576
+ * const contract = new OFTWrapperDiamond_json('0x...', { publicClient, walletClient });
577
+ *
578
+ * // Read functions
579
+ * const result = await contract.balanceOf('0x...');
580
+ *
581
+ * // Write functions
582
+ * const hash = await contract.transfer('0x...', 1000n);
583
+ *
584
+ * // Simulate transactions (dry-run)
585
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
586
+ * console.log('Gas estimate:', simulation.request.gas);
587
+ *
588
+ * // Watch events
589
+ * const unwatch = contract.watch.Transfer((event) => {
590
+ * console.log('Transfer event:', event);
591
+ * });
592
+ * ```
593
+ */
594
+ class OFTWrapperDiamond_json {
595
+ constructor(address, clients) {
596
+ this.contractAddress = address;
597
+ this.publicClient = clients.publicClient;
598
+ this.contract = (0, viem_1.getContract)({
599
+ address,
600
+ abi: exports.OFTWrapperDiamond_jsonAbi,
601
+ client: {
602
+ public: clients.publicClient,
603
+ wallet: clients.walletClient,
604
+ },
605
+ });
606
+ }
607
+ /**
608
+ * Get the contract address
609
+ */
610
+ get address() {
611
+ return this.contractAddress;
612
+ }
613
+ /**
614
+ * Get the underlying viem contract instance
615
+ */
616
+ getContract() {
617
+ return this.contract;
618
+ }
619
+ /**
620
+ * SYSTEM_VERSION_ID
621
+ * pure
622
+ */
623
+ async SYSTEM_VERSION_ID() {
624
+ return this.contract.read.SYSTEM_VERSION_ID();
625
+ }
626
+ /**
627
+ * collector
628
+ * view
629
+ */
630
+ async collector() {
631
+ return this.contract.read.collector();
632
+ }
633
+ /**
634
+ * facetAddress
635
+ * view
636
+ */
637
+ async facetAddress(selector) {
638
+ return this.contract.read.facetAddress([selector]);
639
+ }
640
+ /**
641
+ * facetAddresses
642
+ * view
643
+ */
644
+ async facetAddresses() {
645
+ return this.contract.read.facetAddresses();
646
+ }
647
+ /**
648
+ * facetFunctionSelectors
649
+ * view
650
+ */
651
+ async facetFunctionSelectors(facet) {
652
+ return this.contract.read.facetFunctionSelectors([facet]);
653
+ }
654
+ /**
655
+ * facets
656
+ * view
657
+ */
658
+ async facets() {
659
+ return this.contract.read.facets();
660
+ }
661
+ /**
662
+ * getFallbackAddress
663
+ * view
664
+ */
665
+ async getFallbackAddress() {
666
+ return this.contract.read.getFallbackAddress();
667
+ }
668
+ /**
669
+ * nomineeOwner
670
+ * view
671
+ */
672
+ async nomineeOwner() {
673
+ return this.contract.read.nomineeOwner();
674
+ }
675
+ /**
676
+ * owner
677
+ * view
678
+ */
679
+ async owner() {
680
+ return this.contract.read.owner();
681
+ }
682
+ /**
683
+ * paused
684
+ * view
685
+ */
686
+ async paused() {
687
+ return this.contract.read.paused();
688
+ }
689
+ /**
690
+ * supportsInterface
691
+ * view
692
+ */
693
+ async supportsInterface(interfaceId) {
694
+ return this.contract.read.supportsInterface([interfaceId]);
695
+ }
696
+ /**
697
+ * tokenBalance
698
+ * view
699
+ */
700
+ async tokenBalance(_tokenAddress) {
701
+ return this.contract.read.tokenBalance([_tokenAddress]);
702
+ }
703
+ /**
704
+ * acceptOwnership
705
+ * nonpayable
706
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
707
+ */
708
+ async acceptOwnership(options) {
709
+ if (!this.contract.write) {
710
+ throw new Error('Wallet client is required for write operations');
711
+ }
712
+ return this.contract.write.acceptOwnership(options);
713
+ }
714
+ /**
715
+ * cleanup
716
+ * nonpayable
717
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
718
+ */
719
+ async cleanup(_tokenAddress, options) {
720
+ if (!this.contract.write) {
721
+ throw new Error('Wallet client is required for write operations');
722
+ }
723
+ return this.contract.write.cleanup([_tokenAddress], options);
724
+ }
725
+ /**
726
+ * cleanupWithAmount
727
+ * nonpayable
728
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
729
+ */
730
+ async cleanupWithAmount(_tokenAddress, _tokenAmount, options) {
731
+ if (!this.contract.write) {
732
+ throw new Error('Wallet client is required for write operations');
733
+ }
734
+ return this.contract.write.cleanupWithAmount([_tokenAddress, _tokenAmount], options);
735
+ }
736
+ /**
737
+ * diamondCut
738
+ * nonpayable
739
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
740
+ */
741
+ async diamondCut(facetCuts, target, data, options) {
742
+ if (!this.contract.write) {
743
+ throw new Error('Wallet client is required for write operations');
744
+ }
745
+ return this.contract.write.diamondCut([facetCuts, target, data], options);
746
+ }
747
+ /**
748
+ * forceTransferOwnership
749
+ * nonpayable
750
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
751
+ */
752
+ async forceTransferOwnership(_newOwner, options) {
753
+ if (!this.contract.write) {
754
+ throw new Error('Wallet client is required for write operations');
755
+ }
756
+ return this.contract.write.forceTransferOwnership([_newOwner], options);
757
+ }
758
+ /**
759
+ * pause
760
+ * nonpayable
761
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
762
+ */
763
+ async pause(options) {
764
+ if (!this.contract.write) {
765
+ throw new Error('Wallet client is required for write operations');
766
+ }
767
+ return this.contract.write.pause(options);
768
+ }
769
+ /**
770
+ * setCollector
771
+ * nonpayable
772
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
773
+ */
774
+ async setCollector(_collector, options) {
775
+ if (!this.contract.write) {
776
+ throw new Error('Wallet client is required for write operations');
777
+ }
778
+ return this.contract.write.setCollector([_collector], options);
779
+ }
780
+ /**
781
+ * setFallbackAddress
782
+ * nonpayable
783
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
784
+ */
785
+ async setFallbackAddress(fallbackAddress, options) {
786
+ if (!this.contract.write) {
787
+ throw new Error('Wallet client is required for write operations');
788
+ }
789
+ return this.contract.write.setFallbackAddress([fallbackAddress], options);
790
+ }
791
+ /**
792
+ * transferOwnership
793
+ * nonpayable
794
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
795
+ */
796
+ async transferOwnership(account, options) {
797
+ if (!this.contract.write) {
798
+ throw new Error('Wallet client is required for write operations');
799
+ }
800
+ return this.contract.write.transferOwnership([account], options);
801
+ }
802
+ /**
803
+ * unpause
804
+ * nonpayable
805
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
806
+ */
807
+ async unpause(options) {
808
+ if (!this.contract.write) {
809
+ throw new Error('Wallet client is required for write operations');
810
+ }
811
+ return this.contract.write.unpause(options);
812
+ }
813
+ /**
814
+ * Simulate contract write operations (dry-run without sending transaction)
815
+ *
816
+ * @example
817
+ * const result = await contract.simulate.transfer('0x...', 1000n);
818
+ * console.log('Gas estimate:', result.request.gas);
819
+ * console.log('Would succeed:', result.result);
820
+ */
821
+ get simulate() {
822
+ const contract = this.contract;
823
+ if (!contract.simulate) {
824
+ throw new Error('Public client is required for simulation');
825
+ }
826
+ return {
827
+ /**
828
+ * Simulate acceptOwnership
829
+ * Returns gas estimate and result without sending transaction
830
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
831
+ */
832
+ async acceptOwnership(options) {
833
+ return contract.simulate.acceptOwnership(options);
834
+ },
835
+ /**
836
+ * Simulate cleanup
837
+ * Returns gas estimate and result without sending transaction
838
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
839
+ */
840
+ async cleanup(_tokenAddress, options) {
841
+ return contract.simulate.cleanup([_tokenAddress], options);
842
+ },
843
+ /**
844
+ * Simulate cleanupWithAmount
845
+ * Returns gas estimate and result without sending transaction
846
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
847
+ */
848
+ async cleanupWithAmount(_tokenAddress, _tokenAmount, options) {
849
+ return contract.simulate.cleanupWithAmount([_tokenAddress, _tokenAmount], options);
850
+ },
851
+ /**
852
+ * Simulate diamondCut
853
+ * Returns gas estimate and result without sending transaction
854
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
855
+ */
856
+ async diamondCut(facetCuts, target, data, options) {
857
+ return contract.simulate.diamondCut([facetCuts, target, data], options);
858
+ },
859
+ /**
860
+ * Simulate forceTransferOwnership
861
+ * Returns gas estimate and result without sending transaction
862
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
863
+ */
864
+ async forceTransferOwnership(_newOwner, options) {
865
+ return contract.simulate.forceTransferOwnership([_newOwner], options);
866
+ },
867
+ /**
868
+ * Simulate pause
869
+ * Returns gas estimate and result without sending transaction
870
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
871
+ */
872
+ async pause(options) {
873
+ return contract.simulate.pause(options);
874
+ },
875
+ /**
876
+ * Simulate setCollector
877
+ * Returns gas estimate and result without sending transaction
878
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
879
+ */
880
+ async setCollector(_collector, options) {
881
+ return contract.simulate.setCollector([_collector], options);
882
+ },
883
+ /**
884
+ * Simulate setFallbackAddress
885
+ * Returns gas estimate and result without sending transaction
886
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
887
+ */
888
+ async setFallbackAddress(fallbackAddress, options) {
889
+ return contract.simulate.setFallbackAddress([fallbackAddress], options);
890
+ },
891
+ /**
892
+ * Simulate transferOwnership
893
+ * Returns gas estimate and result without sending transaction
894
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
895
+ */
896
+ async transferOwnership(account, options) {
897
+ return contract.simulate.transferOwnership([account], options);
898
+ },
899
+ /**
900
+ * Simulate unpause
901
+ * Returns gas estimate and result without sending transaction
902
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
903
+ */
904
+ async unpause(options) {
905
+ return contract.simulate.unpause(options);
906
+ }
907
+ };
908
+ }
909
+ /**
910
+ * Watch contract events
911
+ *
912
+ * @example
913
+ * // Watch all Transfer events
914
+ * const unwatch = contract.watch.Transfer((event) => {
915
+ * console.log('Transfer:', event);
916
+ * });
917
+ *
918
+ * // Stop watching
919
+ * unwatch();
920
+ */
921
+ get watch() {
922
+ return {
923
+ /**
924
+ * Watch DiamondCut events
925
+ * @param callback Function to call when event is emitted
926
+ * @param filter Optional filter for indexed parameters
927
+ * @returns Unwatch function to stop listening
928
+ */
929
+ DiamondCut: (callback) => {
930
+ return this.publicClient.watchContractEvent({
931
+ address: this.contractAddress,
932
+ abi: exports.OFTWrapperDiamond_jsonAbi,
933
+ eventName: 'DiamondCut',
934
+ onLogs: (logs) => {
935
+ logs.forEach((log) => {
936
+ callback(log.args);
937
+ });
938
+ },
939
+ });
940
+ },
941
+ /**
942
+ * Watch OwnershipTransferred events
943
+ * @param callback Function to call when event is emitted
944
+ * @param filter Optional filter for indexed parameters
945
+ * @returns Unwatch function to stop listening
946
+ */
947
+ OwnershipTransferred: (callback, filter) => {
948
+ return this.publicClient.watchContractEvent({
949
+ address: this.contractAddress,
950
+ abi: exports.OFTWrapperDiamond_jsonAbi,
951
+ eventName: 'OwnershipTransferred',
952
+ args: filter,
953
+ onLogs: (logs) => {
954
+ logs.forEach((log) => {
955
+ callback(log.args);
956
+ });
957
+ },
958
+ });
959
+ },
960
+ /**
961
+ * Watch Paused events
962
+ * @param callback Function to call when event is emitted
963
+ * @param filter Optional filter for indexed parameters
964
+ * @returns Unwatch function to stop listening
965
+ */
966
+ Paused: (callback) => {
967
+ return this.publicClient.watchContractEvent({
968
+ address: this.contractAddress,
969
+ abi: exports.OFTWrapperDiamond_jsonAbi,
970
+ eventName: 'Paused',
971
+ onLogs: (logs) => {
972
+ logs.forEach((log) => {
973
+ callback(log.args);
974
+ });
975
+ },
976
+ });
977
+ },
978
+ /**
979
+ * Watch SetCollector events
980
+ * @param callback Function to call when event is emitted
981
+ * @param filter Optional filter for indexed parameters
982
+ * @returns Unwatch function to stop listening
983
+ */
984
+ SetCollector: (callback, filter) => {
985
+ return this.publicClient.watchContractEvent({
986
+ address: this.contractAddress,
987
+ abi: exports.OFTWrapperDiamond_jsonAbi,
988
+ eventName: 'SetCollector',
989
+ args: filter,
990
+ onLogs: (logs) => {
991
+ logs.forEach((log) => {
992
+ callback(log.args);
993
+ });
994
+ },
995
+ });
996
+ },
997
+ /**
998
+ * Watch Unpaused events
999
+ * @param callback Function to call when event is emitted
1000
+ * @param filter Optional filter for indexed parameters
1001
+ * @returns Unwatch function to stop listening
1002
+ */
1003
+ Unpaused: (callback) => {
1004
+ return this.publicClient.watchContractEvent({
1005
+ address: this.contractAddress,
1006
+ abi: exports.OFTWrapperDiamond_jsonAbi,
1007
+ eventName: 'Unpaused',
1008
+ onLogs: (logs) => {
1009
+ logs.forEach((log) => {
1010
+ callback(log.args);
1011
+ });
1012
+ },
1013
+ });
1014
+ }
1015
+ };
1016
+ }
1017
+ }
1018
+ exports.OFTWrapperDiamond_json = OFTWrapperDiamond_json;