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