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