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