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