@gitmyabi/coinbasesmartwallet 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,1571 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * CoinbaseSmartWallet.Call struct type
7
+ */
8
+ export type CoinbaseSmartWallet_Call = {
9
+ target: `0x${string}`;
10
+ value: bigint;
11
+ data: `0x${string}`;
12
+ };
13
+
14
+ /**
15
+ * UserOperation struct type
16
+ */
17
+ export type UserOperation = {
18
+ sender: `0x${string}`;
19
+ nonce: bigint;
20
+ initCode: `0x${string}`;
21
+ callData: `0x${string}`;
22
+ callGasLimit: bigint;
23
+ verificationGasLimit: bigint;
24
+ preVerificationGas: bigint;
25
+ maxFeePerGas: bigint;
26
+ maxPriorityFeePerGas: bigint;
27
+ paymasterAndData: `0x${string}`;
28
+ signature: `0x${string}`;
29
+ };
30
+ /**
31
+ * CoinbaseSmartWallet_json ABI
32
+ *
33
+ * This ABI is typed using viem's type system for full type safety.
34
+ */
35
+ export const CoinbaseSmartWallet_jsonAbi = [
36
+ {
37
+ "inputs": [],
38
+ "stateMutability": "nonpayable",
39
+ "type": "constructor"
40
+ },
41
+ {
42
+ "inputs": [
43
+ {
44
+ "internalType": "bytes",
45
+ "name": "owner",
46
+ "type": "bytes"
47
+ }
48
+ ],
49
+ "name": "AlreadyOwner",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [],
54
+ "name": "Initialized",
55
+ "type": "error"
56
+ },
57
+ {
58
+ "inputs": [
59
+ {
60
+ "internalType": "bytes",
61
+ "name": "owner",
62
+ "type": "bytes"
63
+ }
64
+ ],
65
+ "name": "InvalidEthereumAddressOwner",
66
+ "type": "error"
67
+ },
68
+ {
69
+ "inputs": [
70
+ {
71
+ "internalType": "uint256",
72
+ "name": "key",
73
+ "type": "uint256"
74
+ }
75
+ ],
76
+ "name": "InvalidNonceKey",
77
+ "type": "error"
78
+ },
79
+ {
80
+ "inputs": [
81
+ {
82
+ "internalType": "bytes",
83
+ "name": "owner",
84
+ "type": "bytes"
85
+ }
86
+ ],
87
+ "name": "InvalidOwnerBytesLength",
88
+ "type": "error"
89
+ },
90
+ {
91
+ "inputs": [],
92
+ "name": "LastOwner",
93
+ "type": "error"
94
+ },
95
+ {
96
+ "inputs": [
97
+ {
98
+ "internalType": "uint256",
99
+ "name": "index",
100
+ "type": "uint256"
101
+ }
102
+ ],
103
+ "name": "NoOwnerAtIndex",
104
+ "type": "error"
105
+ },
106
+ {
107
+ "inputs": [
108
+ {
109
+ "internalType": "uint256",
110
+ "name": "ownersRemaining",
111
+ "type": "uint256"
112
+ }
113
+ ],
114
+ "name": "NotLastOwner",
115
+ "type": "error"
116
+ },
117
+ {
118
+ "inputs": [
119
+ {
120
+ "internalType": "bytes4",
121
+ "name": "selector",
122
+ "type": "bytes4"
123
+ }
124
+ ],
125
+ "name": "SelectorNotAllowed",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [],
130
+ "name": "Unauthorized",
131
+ "type": "error"
132
+ },
133
+ {
134
+ "inputs": [],
135
+ "name": "UnauthorizedCallContext",
136
+ "type": "error"
137
+ },
138
+ {
139
+ "inputs": [],
140
+ "name": "UpgradeFailed",
141
+ "type": "error"
142
+ },
143
+ {
144
+ "inputs": [
145
+ {
146
+ "internalType": "uint256",
147
+ "name": "index",
148
+ "type": "uint256"
149
+ },
150
+ {
151
+ "internalType": "bytes",
152
+ "name": "expectedOwner",
153
+ "type": "bytes"
154
+ },
155
+ {
156
+ "internalType": "bytes",
157
+ "name": "actualOwner",
158
+ "type": "bytes"
159
+ }
160
+ ],
161
+ "name": "WrongOwnerAtIndex",
162
+ "type": "error"
163
+ },
164
+ {
165
+ "anonymous": false,
166
+ "inputs": [
167
+ {
168
+ "indexed": true,
169
+ "internalType": "uint256",
170
+ "name": "index",
171
+ "type": "uint256"
172
+ },
173
+ {
174
+ "indexed": false,
175
+ "internalType": "bytes",
176
+ "name": "owner",
177
+ "type": "bytes"
178
+ }
179
+ ],
180
+ "name": "AddOwner",
181
+ "type": "event"
182
+ },
183
+ {
184
+ "anonymous": false,
185
+ "inputs": [
186
+ {
187
+ "indexed": true,
188
+ "internalType": "uint256",
189
+ "name": "index",
190
+ "type": "uint256"
191
+ },
192
+ {
193
+ "indexed": false,
194
+ "internalType": "bytes",
195
+ "name": "owner",
196
+ "type": "bytes"
197
+ }
198
+ ],
199
+ "name": "RemoveOwner",
200
+ "type": "event"
201
+ },
202
+ {
203
+ "anonymous": false,
204
+ "inputs": [
205
+ {
206
+ "indexed": true,
207
+ "internalType": "address",
208
+ "name": "implementation",
209
+ "type": "address"
210
+ }
211
+ ],
212
+ "name": "Upgraded",
213
+ "type": "event"
214
+ },
215
+ {
216
+ "stateMutability": "payable",
217
+ "type": "fallback"
218
+ },
219
+ {
220
+ "inputs": [],
221
+ "name": "REPLAYABLE_NONCE_KEY",
222
+ "outputs": [
223
+ {
224
+ "internalType": "uint256",
225
+ "name": "",
226
+ "type": "uint256"
227
+ }
228
+ ],
229
+ "stateMutability": "view",
230
+ "type": "function"
231
+ },
232
+ {
233
+ "inputs": [
234
+ {
235
+ "internalType": "address",
236
+ "name": "owner",
237
+ "type": "address"
238
+ }
239
+ ],
240
+ "name": "addOwnerAddress",
241
+ "outputs": [],
242
+ "stateMutability": "nonpayable",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "inputs": [
247
+ {
248
+ "internalType": "bytes32",
249
+ "name": "x",
250
+ "type": "bytes32"
251
+ },
252
+ {
253
+ "internalType": "bytes32",
254
+ "name": "y",
255
+ "type": "bytes32"
256
+ }
257
+ ],
258
+ "name": "addOwnerPublicKey",
259
+ "outputs": [],
260
+ "stateMutability": "nonpayable",
261
+ "type": "function"
262
+ },
263
+ {
264
+ "inputs": [
265
+ {
266
+ "internalType": "bytes4",
267
+ "name": "functionSelector",
268
+ "type": "bytes4"
269
+ }
270
+ ],
271
+ "name": "canSkipChainIdValidation",
272
+ "outputs": [
273
+ {
274
+ "internalType": "bool",
275
+ "name": "",
276
+ "type": "bool"
277
+ }
278
+ ],
279
+ "stateMutability": "pure",
280
+ "type": "function"
281
+ },
282
+ {
283
+ "inputs": [],
284
+ "name": "domainSeparator",
285
+ "outputs": [
286
+ {
287
+ "internalType": "bytes32",
288
+ "name": "",
289
+ "type": "bytes32"
290
+ }
291
+ ],
292
+ "stateMutability": "view",
293
+ "type": "function"
294
+ },
295
+ {
296
+ "inputs": [],
297
+ "name": "eip712Domain",
298
+ "outputs": [
299
+ {
300
+ "internalType": "bytes1",
301
+ "name": "fields",
302
+ "type": "bytes1"
303
+ },
304
+ {
305
+ "internalType": "string",
306
+ "name": "name",
307
+ "type": "string"
308
+ },
309
+ {
310
+ "internalType": "string",
311
+ "name": "version",
312
+ "type": "string"
313
+ },
314
+ {
315
+ "internalType": "uint256",
316
+ "name": "chainId",
317
+ "type": "uint256"
318
+ },
319
+ {
320
+ "internalType": "address",
321
+ "name": "verifyingContract",
322
+ "type": "address"
323
+ },
324
+ {
325
+ "internalType": "bytes32",
326
+ "name": "salt",
327
+ "type": "bytes32"
328
+ },
329
+ {
330
+ "internalType": "uint256[]",
331
+ "name": "extensions",
332
+ "type": "uint256[]"
333
+ }
334
+ ],
335
+ "stateMutability": "view",
336
+ "type": "function"
337
+ },
338
+ {
339
+ "inputs": [],
340
+ "name": "entryPoint",
341
+ "outputs": [
342
+ {
343
+ "internalType": "address",
344
+ "name": "",
345
+ "type": "address"
346
+ }
347
+ ],
348
+ "stateMutability": "view",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [
353
+ {
354
+ "internalType": "address",
355
+ "name": "target",
356
+ "type": "address"
357
+ },
358
+ {
359
+ "internalType": "uint256",
360
+ "name": "value",
361
+ "type": "uint256"
362
+ },
363
+ {
364
+ "internalType": "bytes",
365
+ "name": "data",
366
+ "type": "bytes"
367
+ }
368
+ ],
369
+ "name": "execute",
370
+ "outputs": [],
371
+ "stateMutability": "payable",
372
+ "type": "function"
373
+ },
374
+ {
375
+ "inputs": [
376
+ {
377
+ "components": [
378
+ {
379
+ "internalType": "address",
380
+ "name": "target",
381
+ "type": "address"
382
+ },
383
+ {
384
+ "internalType": "uint256",
385
+ "name": "value",
386
+ "type": "uint256"
387
+ },
388
+ {
389
+ "internalType": "bytes",
390
+ "name": "data",
391
+ "type": "bytes"
392
+ }
393
+ ],
394
+ "internalType": "struct CoinbaseSmartWallet.Call[]",
395
+ "name": "calls",
396
+ "type": "tuple[]"
397
+ }
398
+ ],
399
+ "name": "executeBatch",
400
+ "outputs": [],
401
+ "stateMutability": "payable",
402
+ "type": "function"
403
+ },
404
+ {
405
+ "inputs": [
406
+ {
407
+ "internalType": "bytes[]",
408
+ "name": "calls",
409
+ "type": "bytes[]"
410
+ }
411
+ ],
412
+ "name": "executeWithoutChainIdValidation",
413
+ "outputs": [],
414
+ "stateMutability": "payable",
415
+ "type": "function"
416
+ },
417
+ {
418
+ "inputs": [
419
+ {
420
+ "components": [
421
+ {
422
+ "internalType": "address",
423
+ "name": "sender",
424
+ "type": "address"
425
+ },
426
+ {
427
+ "internalType": "uint256",
428
+ "name": "nonce",
429
+ "type": "uint256"
430
+ },
431
+ {
432
+ "internalType": "bytes",
433
+ "name": "initCode",
434
+ "type": "bytes"
435
+ },
436
+ {
437
+ "internalType": "bytes",
438
+ "name": "callData",
439
+ "type": "bytes"
440
+ },
441
+ {
442
+ "internalType": "uint256",
443
+ "name": "callGasLimit",
444
+ "type": "uint256"
445
+ },
446
+ {
447
+ "internalType": "uint256",
448
+ "name": "verificationGasLimit",
449
+ "type": "uint256"
450
+ },
451
+ {
452
+ "internalType": "uint256",
453
+ "name": "preVerificationGas",
454
+ "type": "uint256"
455
+ },
456
+ {
457
+ "internalType": "uint256",
458
+ "name": "maxFeePerGas",
459
+ "type": "uint256"
460
+ },
461
+ {
462
+ "internalType": "uint256",
463
+ "name": "maxPriorityFeePerGas",
464
+ "type": "uint256"
465
+ },
466
+ {
467
+ "internalType": "bytes",
468
+ "name": "paymasterAndData",
469
+ "type": "bytes"
470
+ },
471
+ {
472
+ "internalType": "bytes",
473
+ "name": "signature",
474
+ "type": "bytes"
475
+ }
476
+ ],
477
+ "internalType": "struct UserOperation",
478
+ "name": "userOp",
479
+ "type": "tuple"
480
+ }
481
+ ],
482
+ "name": "getUserOpHashWithoutChainId",
483
+ "outputs": [
484
+ {
485
+ "internalType": "bytes32",
486
+ "name": "",
487
+ "type": "bytes32"
488
+ }
489
+ ],
490
+ "stateMutability": "view",
491
+ "type": "function"
492
+ },
493
+ {
494
+ "inputs": [],
495
+ "name": "implementation",
496
+ "outputs": [
497
+ {
498
+ "internalType": "address",
499
+ "name": "$",
500
+ "type": "address"
501
+ }
502
+ ],
503
+ "stateMutability": "view",
504
+ "type": "function"
505
+ },
506
+ {
507
+ "inputs": [
508
+ {
509
+ "internalType": "bytes[]",
510
+ "name": "owners",
511
+ "type": "bytes[]"
512
+ }
513
+ ],
514
+ "name": "initialize",
515
+ "outputs": [],
516
+ "stateMutability": "payable",
517
+ "type": "function"
518
+ },
519
+ {
520
+ "inputs": [
521
+ {
522
+ "internalType": "address",
523
+ "name": "account",
524
+ "type": "address"
525
+ }
526
+ ],
527
+ "name": "isOwnerAddress",
528
+ "outputs": [
529
+ {
530
+ "internalType": "bool",
531
+ "name": "",
532
+ "type": "bool"
533
+ }
534
+ ],
535
+ "stateMutability": "view",
536
+ "type": "function"
537
+ },
538
+ {
539
+ "inputs": [
540
+ {
541
+ "internalType": "bytes",
542
+ "name": "account",
543
+ "type": "bytes"
544
+ }
545
+ ],
546
+ "name": "isOwnerBytes",
547
+ "outputs": [
548
+ {
549
+ "internalType": "bool",
550
+ "name": "",
551
+ "type": "bool"
552
+ }
553
+ ],
554
+ "stateMutability": "view",
555
+ "type": "function"
556
+ },
557
+ {
558
+ "inputs": [
559
+ {
560
+ "internalType": "bytes32",
561
+ "name": "x",
562
+ "type": "bytes32"
563
+ },
564
+ {
565
+ "internalType": "bytes32",
566
+ "name": "y",
567
+ "type": "bytes32"
568
+ }
569
+ ],
570
+ "name": "isOwnerPublicKey",
571
+ "outputs": [
572
+ {
573
+ "internalType": "bool",
574
+ "name": "",
575
+ "type": "bool"
576
+ }
577
+ ],
578
+ "stateMutability": "view",
579
+ "type": "function"
580
+ },
581
+ {
582
+ "inputs": [
583
+ {
584
+ "internalType": "bytes32",
585
+ "name": "hash",
586
+ "type": "bytes32"
587
+ },
588
+ {
589
+ "internalType": "bytes",
590
+ "name": "signature",
591
+ "type": "bytes"
592
+ }
593
+ ],
594
+ "name": "isValidSignature",
595
+ "outputs": [
596
+ {
597
+ "internalType": "bytes4",
598
+ "name": "result",
599
+ "type": "bytes4"
600
+ }
601
+ ],
602
+ "stateMutability": "view",
603
+ "type": "function"
604
+ },
605
+ {
606
+ "inputs": [],
607
+ "name": "nextOwnerIndex",
608
+ "outputs": [
609
+ {
610
+ "internalType": "uint256",
611
+ "name": "",
612
+ "type": "uint256"
613
+ }
614
+ ],
615
+ "stateMutability": "view",
616
+ "type": "function"
617
+ },
618
+ {
619
+ "inputs": [
620
+ {
621
+ "internalType": "uint256",
622
+ "name": "index",
623
+ "type": "uint256"
624
+ }
625
+ ],
626
+ "name": "ownerAtIndex",
627
+ "outputs": [
628
+ {
629
+ "internalType": "bytes",
630
+ "name": "",
631
+ "type": "bytes"
632
+ }
633
+ ],
634
+ "stateMutability": "view",
635
+ "type": "function"
636
+ },
637
+ {
638
+ "inputs": [],
639
+ "name": "ownerCount",
640
+ "outputs": [
641
+ {
642
+ "internalType": "uint256",
643
+ "name": "",
644
+ "type": "uint256"
645
+ }
646
+ ],
647
+ "stateMutability": "view",
648
+ "type": "function"
649
+ },
650
+ {
651
+ "inputs": [],
652
+ "name": "proxiableUUID",
653
+ "outputs": [
654
+ {
655
+ "internalType": "bytes32",
656
+ "name": "",
657
+ "type": "bytes32"
658
+ }
659
+ ],
660
+ "stateMutability": "view",
661
+ "type": "function"
662
+ },
663
+ {
664
+ "inputs": [
665
+ {
666
+ "internalType": "uint256",
667
+ "name": "index",
668
+ "type": "uint256"
669
+ },
670
+ {
671
+ "internalType": "bytes",
672
+ "name": "owner",
673
+ "type": "bytes"
674
+ }
675
+ ],
676
+ "name": "removeLastOwner",
677
+ "outputs": [],
678
+ "stateMutability": "nonpayable",
679
+ "type": "function"
680
+ },
681
+ {
682
+ "inputs": [
683
+ {
684
+ "internalType": "uint256",
685
+ "name": "index",
686
+ "type": "uint256"
687
+ },
688
+ {
689
+ "internalType": "bytes",
690
+ "name": "owner",
691
+ "type": "bytes"
692
+ }
693
+ ],
694
+ "name": "removeOwnerAtIndex",
695
+ "outputs": [],
696
+ "stateMutability": "nonpayable",
697
+ "type": "function"
698
+ },
699
+ {
700
+ "inputs": [],
701
+ "name": "removedOwnersCount",
702
+ "outputs": [
703
+ {
704
+ "internalType": "uint256",
705
+ "name": "",
706
+ "type": "uint256"
707
+ }
708
+ ],
709
+ "stateMutability": "view",
710
+ "type": "function"
711
+ },
712
+ {
713
+ "inputs": [
714
+ {
715
+ "internalType": "bytes32",
716
+ "name": "hash",
717
+ "type": "bytes32"
718
+ }
719
+ ],
720
+ "name": "replaySafeHash",
721
+ "outputs": [
722
+ {
723
+ "internalType": "bytes32",
724
+ "name": "",
725
+ "type": "bytes32"
726
+ }
727
+ ],
728
+ "stateMutability": "view",
729
+ "type": "function"
730
+ },
731
+ {
732
+ "inputs": [
733
+ {
734
+ "internalType": "address",
735
+ "name": "newImplementation",
736
+ "type": "address"
737
+ },
738
+ {
739
+ "internalType": "bytes",
740
+ "name": "data",
741
+ "type": "bytes"
742
+ }
743
+ ],
744
+ "name": "upgradeToAndCall",
745
+ "outputs": [],
746
+ "stateMutability": "payable",
747
+ "type": "function"
748
+ },
749
+ {
750
+ "inputs": [
751
+ {
752
+ "components": [
753
+ {
754
+ "internalType": "address",
755
+ "name": "sender",
756
+ "type": "address"
757
+ },
758
+ {
759
+ "internalType": "uint256",
760
+ "name": "nonce",
761
+ "type": "uint256"
762
+ },
763
+ {
764
+ "internalType": "bytes",
765
+ "name": "initCode",
766
+ "type": "bytes"
767
+ },
768
+ {
769
+ "internalType": "bytes",
770
+ "name": "callData",
771
+ "type": "bytes"
772
+ },
773
+ {
774
+ "internalType": "uint256",
775
+ "name": "callGasLimit",
776
+ "type": "uint256"
777
+ },
778
+ {
779
+ "internalType": "uint256",
780
+ "name": "verificationGasLimit",
781
+ "type": "uint256"
782
+ },
783
+ {
784
+ "internalType": "uint256",
785
+ "name": "preVerificationGas",
786
+ "type": "uint256"
787
+ },
788
+ {
789
+ "internalType": "uint256",
790
+ "name": "maxFeePerGas",
791
+ "type": "uint256"
792
+ },
793
+ {
794
+ "internalType": "uint256",
795
+ "name": "maxPriorityFeePerGas",
796
+ "type": "uint256"
797
+ },
798
+ {
799
+ "internalType": "bytes",
800
+ "name": "paymasterAndData",
801
+ "type": "bytes"
802
+ },
803
+ {
804
+ "internalType": "bytes",
805
+ "name": "signature",
806
+ "type": "bytes"
807
+ }
808
+ ],
809
+ "internalType": "struct UserOperation",
810
+ "name": "userOp",
811
+ "type": "tuple"
812
+ },
813
+ {
814
+ "internalType": "bytes32",
815
+ "name": "userOpHash",
816
+ "type": "bytes32"
817
+ },
818
+ {
819
+ "internalType": "uint256",
820
+ "name": "missingAccountFunds",
821
+ "type": "uint256"
822
+ }
823
+ ],
824
+ "name": "validateUserOp",
825
+ "outputs": [
826
+ {
827
+ "internalType": "uint256",
828
+ "name": "validationData",
829
+ "type": "uint256"
830
+ }
831
+ ],
832
+ "stateMutability": "nonpayable",
833
+ "type": "function"
834
+ },
835
+ {
836
+ "stateMutability": "payable",
837
+ "type": "receive"
838
+ }
839
+ ] as const satisfies Abi;
840
+
841
+ /**
842
+ * Type-safe ABI for CoinbaseSmartWallet_json
843
+ */
844
+ export type CoinbaseSmartWallet_jsonAbi = typeof CoinbaseSmartWallet_jsonAbi;
845
+
846
+ /**
847
+ * Contract instance type for CoinbaseSmartWallet_json
848
+ */
849
+ // Use any for contract type to avoid complex viem type issues
850
+ // The runtime behavior is type-safe through viem's ABI typing
851
+ export type CoinbaseSmartWallet_jsonContract = any;
852
+
853
+ /**
854
+ * CoinbaseSmartWallet_json Contract Class
855
+ *
856
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
857
+ *
858
+ * @example
859
+ * ```typescript
860
+ * import { createPublicClient, createWalletClient, http } from 'viem';
861
+ * import { mainnet } from 'viem/chains';
862
+ * import { CoinbaseSmartWallet_json } from 'CoinbaseSmartWallet_json';
863
+ *
864
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
865
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
866
+ *
867
+ * const contract = new CoinbaseSmartWallet_json('0x...', { publicClient, walletClient });
868
+ *
869
+ * // Read functions
870
+ * const result = await contract.balanceOf('0x...');
871
+ *
872
+ * // Write functions
873
+ * const hash = await contract.transfer('0x...', 1000n);
874
+ *
875
+ * // Simulate transactions (dry-run)
876
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
877
+ * console.log('Gas estimate:', simulation.request.gas);
878
+ *
879
+ * // Watch events
880
+ * const unwatch = contract.watch.Transfer((event) => {
881
+ * console.log('Transfer event:', event);
882
+ * });
883
+ * ```
884
+ */
885
+ export class CoinbaseSmartWallet_json {
886
+ private contract: CoinbaseSmartWallet_jsonContract;
887
+ private contractAddress: Address;
888
+ private publicClient: PublicClient;
889
+
890
+ constructor(
891
+ address: Address,
892
+ clients: {
893
+ publicClient: PublicClient;
894
+ walletClient?: WalletClient;
895
+ }
896
+ ) {
897
+ this.contractAddress = address;
898
+ this.publicClient = clients.publicClient;
899
+ this.contract = getContract({
900
+ address,
901
+ abi: CoinbaseSmartWallet_jsonAbi,
902
+ client: {
903
+ public: clients.publicClient,
904
+ wallet: clients.walletClient,
905
+ },
906
+ });
907
+ }
908
+
909
+ /**
910
+ * Get the contract address
911
+ */
912
+ get address(): Address {
913
+ return this.contractAddress;
914
+ }
915
+
916
+ /**
917
+ * Get the underlying viem contract instance
918
+ */
919
+ getContract(): CoinbaseSmartWallet_jsonContract {
920
+ return this.contract;
921
+ }
922
+
923
+ /**
924
+ * REPLAYABLE_NONCE_KEY
925
+ * view
926
+ */
927
+ async REPLAYABLE_NONCE_KEY(): Promise<bigint> {
928
+ return this.contract.read.REPLAYABLE_NONCE_KEY() as Promise<bigint>;
929
+ }
930
+
931
+ /**
932
+ * canSkipChainIdValidation
933
+ * pure
934
+ */
935
+ async canSkipChainIdValidation(functionSelector: `0x${string}`): Promise<boolean> {
936
+ return this.contract.read.canSkipChainIdValidation([functionSelector] as const) as Promise<boolean>;
937
+ }
938
+
939
+ /**
940
+ * domainSeparator
941
+ * view
942
+ */
943
+ async domainSeparator(): Promise<`0x${string}`> {
944
+ return this.contract.read.domainSeparator() as Promise<`0x${string}`>;
945
+ }
946
+
947
+ /**
948
+ * eip712Domain
949
+ * view
950
+ */
951
+ async eip712Domain(): Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]> {
952
+ return this.contract.read.eip712Domain() as Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]>;
953
+ }
954
+
955
+ /**
956
+ * entryPoint
957
+ * view
958
+ */
959
+ async entryPoint(): Promise<`0x${string}`> {
960
+ return this.contract.read.entryPoint() as Promise<`0x${string}`>;
961
+ }
962
+
963
+ /**
964
+ * getUserOpHashWithoutChainId
965
+ * view
966
+ */
967
+ async getUserOpHashWithoutChainId(userOp: UserOperation): Promise<`0x${string}`> {
968
+ return this.contract.read.getUserOpHashWithoutChainId([userOp] as const) as Promise<`0x${string}`>;
969
+ }
970
+
971
+ /**
972
+ * implementation
973
+ * view
974
+ */
975
+ async implementation(): Promise<`0x${string}`> {
976
+ return this.contract.read.implementation() as Promise<`0x${string}`>;
977
+ }
978
+
979
+ /**
980
+ * isOwnerAddress
981
+ * view
982
+ */
983
+ async isOwnerAddress(account: `0x${string}`): Promise<boolean> {
984
+ return this.contract.read.isOwnerAddress([account] as const) as Promise<boolean>;
985
+ }
986
+
987
+ /**
988
+ * isOwnerBytes
989
+ * view
990
+ */
991
+ async isOwnerBytes(account: `0x${string}`): Promise<boolean> {
992
+ return this.contract.read.isOwnerBytes([account] as const) as Promise<boolean>;
993
+ }
994
+
995
+ /**
996
+ * isOwnerPublicKey
997
+ * view
998
+ */
999
+ async isOwnerPublicKey(x: `0x${string}`, y: `0x${string}`): Promise<boolean> {
1000
+ return this.contract.read.isOwnerPublicKey([x, y] as const) as Promise<boolean>;
1001
+ }
1002
+
1003
+ /**
1004
+ * isValidSignature
1005
+ * view
1006
+ */
1007
+ async isValidSignature(hash: `0x${string}`, signature: `0x${string}`): Promise<`0x${string}`> {
1008
+ return this.contract.read.isValidSignature([hash, signature] as const) as Promise<`0x${string}`>;
1009
+ }
1010
+
1011
+ /**
1012
+ * nextOwnerIndex
1013
+ * view
1014
+ */
1015
+ async nextOwnerIndex(): Promise<bigint> {
1016
+ return this.contract.read.nextOwnerIndex() as Promise<bigint>;
1017
+ }
1018
+
1019
+ /**
1020
+ * ownerAtIndex
1021
+ * view
1022
+ */
1023
+ async ownerAtIndex(index: bigint): Promise<`0x${string}`> {
1024
+ return this.contract.read.ownerAtIndex([index] as const) as Promise<`0x${string}`>;
1025
+ }
1026
+
1027
+ /**
1028
+ * ownerCount
1029
+ * view
1030
+ */
1031
+ async ownerCount(): Promise<bigint> {
1032
+ return this.contract.read.ownerCount() as Promise<bigint>;
1033
+ }
1034
+
1035
+ /**
1036
+ * proxiableUUID
1037
+ * view
1038
+ */
1039
+ async proxiableUUID(): Promise<`0x${string}`> {
1040
+ return this.contract.read.proxiableUUID() as Promise<`0x${string}`>;
1041
+ }
1042
+
1043
+ /**
1044
+ * removedOwnersCount
1045
+ * view
1046
+ */
1047
+ async removedOwnersCount(): Promise<bigint> {
1048
+ return this.contract.read.removedOwnersCount() as Promise<bigint>;
1049
+ }
1050
+
1051
+ /**
1052
+ * replaySafeHash
1053
+ * view
1054
+ */
1055
+ async replaySafeHash(hash: `0x${string}`): Promise<`0x${string}`> {
1056
+ return this.contract.read.replaySafeHash([hash] as const) as Promise<`0x${string}`>;
1057
+ }
1058
+
1059
+ /**
1060
+ * addOwnerAddress
1061
+ * nonpayable
1062
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1063
+ */
1064
+ async addOwnerAddress(owner: `0x${string}`, options?: {
1065
+ accessList?: import('viem').AccessList;
1066
+ authorizationList?: import('viem').AuthorizationList;
1067
+ chain?: import('viem').Chain | null;
1068
+ dataSuffix?: `0x${string}`;
1069
+ gas?: bigint;
1070
+ gasPrice?: bigint;
1071
+ maxFeePerGas?: bigint;
1072
+ maxPriorityFeePerGas?: bigint;
1073
+ nonce?: number;
1074
+ value?: bigint;
1075
+ }): Promise<`0x${string}`> {
1076
+ if (!this.contract.write) {
1077
+ throw new Error('Wallet client is required for write operations');
1078
+ }
1079
+ return this.contract.write.addOwnerAddress([owner] as const, options) as Promise<`0x${string}`>;
1080
+ }
1081
+
1082
+ /**
1083
+ * addOwnerPublicKey
1084
+ * nonpayable
1085
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1086
+ */
1087
+ async addOwnerPublicKey(x: `0x${string}`, y: `0x${string}`, options?: {
1088
+ accessList?: import('viem').AccessList;
1089
+ authorizationList?: import('viem').AuthorizationList;
1090
+ chain?: import('viem').Chain | null;
1091
+ dataSuffix?: `0x${string}`;
1092
+ gas?: bigint;
1093
+ gasPrice?: bigint;
1094
+ maxFeePerGas?: bigint;
1095
+ maxPriorityFeePerGas?: bigint;
1096
+ nonce?: number;
1097
+ value?: bigint;
1098
+ }): Promise<`0x${string}`> {
1099
+ if (!this.contract.write) {
1100
+ throw new Error('Wallet client is required for write operations');
1101
+ }
1102
+ return this.contract.write.addOwnerPublicKey([x, y] as const, options) as Promise<`0x${string}`>;
1103
+ }
1104
+
1105
+ /**
1106
+ * execute
1107
+ * payable
1108
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1109
+ */
1110
+ async execute(target: `0x${string}`, value: bigint, data: `0x${string}`, options?: {
1111
+ accessList?: import('viem').AccessList;
1112
+ authorizationList?: import('viem').AuthorizationList;
1113
+ chain?: import('viem').Chain | null;
1114
+ dataSuffix?: `0x${string}`;
1115
+ gas?: bigint;
1116
+ gasPrice?: bigint;
1117
+ maxFeePerGas?: bigint;
1118
+ maxPriorityFeePerGas?: bigint;
1119
+ nonce?: number;
1120
+ value?: bigint;
1121
+ }): Promise<`0x${string}`> {
1122
+ if (!this.contract.write) {
1123
+ throw new Error('Wallet client is required for write operations');
1124
+ }
1125
+ return this.contract.write.execute([target, value, data] as const, options) as Promise<`0x${string}`>;
1126
+ }
1127
+
1128
+ /**
1129
+ * executeBatch
1130
+ * payable
1131
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1132
+ */
1133
+ async executeBatch(calls: CoinbaseSmartWallet_Call[], options?: {
1134
+ accessList?: import('viem').AccessList;
1135
+ authorizationList?: import('viem').AuthorizationList;
1136
+ chain?: import('viem').Chain | null;
1137
+ dataSuffix?: `0x${string}`;
1138
+ gas?: bigint;
1139
+ gasPrice?: bigint;
1140
+ maxFeePerGas?: bigint;
1141
+ maxPriorityFeePerGas?: bigint;
1142
+ nonce?: number;
1143
+ value?: bigint;
1144
+ }): Promise<`0x${string}`> {
1145
+ if (!this.contract.write) {
1146
+ throw new Error('Wallet client is required for write operations');
1147
+ }
1148
+ return this.contract.write.executeBatch([calls] as const, options) as Promise<`0x${string}`>;
1149
+ }
1150
+
1151
+ /**
1152
+ * executeWithoutChainIdValidation
1153
+ * payable
1154
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1155
+ */
1156
+ async executeWithoutChainIdValidation(calls: `0x${string}`[], options?: {
1157
+ accessList?: import('viem').AccessList;
1158
+ authorizationList?: import('viem').AuthorizationList;
1159
+ chain?: import('viem').Chain | null;
1160
+ dataSuffix?: `0x${string}`;
1161
+ gas?: bigint;
1162
+ gasPrice?: bigint;
1163
+ maxFeePerGas?: bigint;
1164
+ maxPriorityFeePerGas?: bigint;
1165
+ nonce?: number;
1166
+ value?: bigint;
1167
+ }): Promise<`0x${string}`> {
1168
+ if (!this.contract.write) {
1169
+ throw new Error('Wallet client is required for write operations');
1170
+ }
1171
+ return this.contract.write.executeWithoutChainIdValidation([calls] as const, options) as Promise<`0x${string}`>;
1172
+ }
1173
+
1174
+ /**
1175
+ * initialize
1176
+ * payable
1177
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1178
+ */
1179
+ async initialize(owners: `0x${string}`[], options?: {
1180
+ accessList?: import('viem').AccessList;
1181
+ authorizationList?: import('viem').AuthorizationList;
1182
+ chain?: import('viem').Chain | null;
1183
+ dataSuffix?: `0x${string}`;
1184
+ gas?: bigint;
1185
+ gasPrice?: bigint;
1186
+ maxFeePerGas?: bigint;
1187
+ maxPriorityFeePerGas?: bigint;
1188
+ nonce?: number;
1189
+ value?: bigint;
1190
+ }): Promise<`0x${string}`> {
1191
+ if (!this.contract.write) {
1192
+ throw new Error('Wallet client is required for write operations');
1193
+ }
1194
+ return this.contract.write.initialize([owners] as const, options) as Promise<`0x${string}`>;
1195
+ }
1196
+
1197
+ /**
1198
+ * removeLastOwner
1199
+ * nonpayable
1200
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1201
+ */
1202
+ async removeLastOwner(index: bigint, owner: `0x${string}`, options?: {
1203
+ accessList?: import('viem').AccessList;
1204
+ authorizationList?: import('viem').AuthorizationList;
1205
+ chain?: import('viem').Chain | null;
1206
+ dataSuffix?: `0x${string}`;
1207
+ gas?: bigint;
1208
+ gasPrice?: bigint;
1209
+ maxFeePerGas?: bigint;
1210
+ maxPriorityFeePerGas?: bigint;
1211
+ nonce?: number;
1212
+ value?: bigint;
1213
+ }): Promise<`0x${string}`> {
1214
+ if (!this.contract.write) {
1215
+ throw new Error('Wallet client is required for write operations');
1216
+ }
1217
+ return this.contract.write.removeLastOwner([index, owner] as const, options) as Promise<`0x${string}`>;
1218
+ }
1219
+
1220
+ /**
1221
+ * removeOwnerAtIndex
1222
+ * nonpayable
1223
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1224
+ */
1225
+ async removeOwnerAtIndex(index: bigint, owner: `0x${string}`, options?: {
1226
+ accessList?: import('viem').AccessList;
1227
+ authorizationList?: import('viem').AuthorizationList;
1228
+ chain?: import('viem').Chain | null;
1229
+ dataSuffix?: `0x${string}`;
1230
+ gas?: bigint;
1231
+ gasPrice?: bigint;
1232
+ maxFeePerGas?: bigint;
1233
+ maxPriorityFeePerGas?: bigint;
1234
+ nonce?: number;
1235
+ value?: bigint;
1236
+ }): Promise<`0x${string}`> {
1237
+ if (!this.contract.write) {
1238
+ throw new Error('Wallet client is required for write operations');
1239
+ }
1240
+ return this.contract.write.removeOwnerAtIndex([index, owner] as const, options) as Promise<`0x${string}`>;
1241
+ }
1242
+
1243
+ /**
1244
+ * upgradeToAndCall
1245
+ * payable
1246
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1247
+ */
1248
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1249
+ accessList?: import('viem').AccessList;
1250
+ authorizationList?: import('viem').AuthorizationList;
1251
+ chain?: import('viem').Chain | null;
1252
+ dataSuffix?: `0x${string}`;
1253
+ gas?: bigint;
1254
+ gasPrice?: bigint;
1255
+ maxFeePerGas?: bigint;
1256
+ maxPriorityFeePerGas?: bigint;
1257
+ nonce?: number;
1258
+ value?: bigint;
1259
+ }): Promise<`0x${string}`> {
1260
+ if (!this.contract.write) {
1261
+ throw new Error('Wallet client is required for write operations');
1262
+ }
1263
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
1264
+ }
1265
+
1266
+ /**
1267
+ * validateUserOp
1268
+ * nonpayable
1269
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1270
+ */
1271
+ async validateUserOp(userOp: UserOperation, userOpHash: `0x${string}`, missingAccountFunds: bigint, options?: {
1272
+ accessList?: import('viem').AccessList;
1273
+ authorizationList?: import('viem').AuthorizationList;
1274
+ chain?: import('viem').Chain | null;
1275
+ dataSuffix?: `0x${string}`;
1276
+ gas?: bigint;
1277
+ gasPrice?: bigint;
1278
+ maxFeePerGas?: bigint;
1279
+ maxPriorityFeePerGas?: bigint;
1280
+ nonce?: number;
1281
+ value?: bigint;
1282
+ }): Promise<`0x${string}`> {
1283
+ if (!this.contract.write) {
1284
+ throw new Error('Wallet client is required for write operations');
1285
+ }
1286
+ return this.contract.write.validateUserOp([userOp, userOpHash, missingAccountFunds] as const, options) as Promise<`0x${string}`>;
1287
+ }
1288
+
1289
+
1290
+
1291
+ /**
1292
+ * Simulate contract write operations (dry-run without sending transaction)
1293
+ *
1294
+ * @example
1295
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1296
+ * console.log('Gas estimate:', result.request.gas);
1297
+ * console.log('Would succeed:', result.result);
1298
+ */
1299
+ get simulate() {
1300
+ const contract = this.contract;
1301
+ if (!contract.simulate) {
1302
+ throw new Error('Public client is required for simulation');
1303
+ }
1304
+ return {
1305
+ /**
1306
+ * Simulate addOwnerAddress
1307
+ * Returns gas estimate and result without sending transaction
1308
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1309
+ */
1310
+ async addOwnerAddress(owner: `0x${string}`, options?: {
1311
+ accessList?: import('viem').AccessList;
1312
+ authorizationList?: import('viem').AuthorizationList;
1313
+ chain?: import('viem').Chain | null;
1314
+ dataSuffix?: `0x${string}`;
1315
+ gas?: bigint;
1316
+ gasPrice?: bigint;
1317
+ maxFeePerGas?: bigint;
1318
+ maxPriorityFeePerGas?: bigint;
1319
+ nonce?: number;
1320
+ value?: bigint;
1321
+ }): Promise<void> {
1322
+ return contract.simulate.addOwnerAddress([owner] as const, options) as Promise<void>;
1323
+ },
1324
+ /**
1325
+ * Simulate addOwnerPublicKey
1326
+ * Returns gas estimate and result without sending transaction
1327
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1328
+ */
1329
+ async addOwnerPublicKey(x: `0x${string}`, y: `0x${string}`, options?: {
1330
+ accessList?: import('viem').AccessList;
1331
+ authorizationList?: import('viem').AuthorizationList;
1332
+ chain?: import('viem').Chain | null;
1333
+ dataSuffix?: `0x${string}`;
1334
+ gas?: bigint;
1335
+ gasPrice?: bigint;
1336
+ maxFeePerGas?: bigint;
1337
+ maxPriorityFeePerGas?: bigint;
1338
+ nonce?: number;
1339
+ value?: bigint;
1340
+ }): Promise<void> {
1341
+ return contract.simulate.addOwnerPublicKey([x, y] as const, options) as Promise<void>;
1342
+ },
1343
+ /**
1344
+ * Simulate execute
1345
+ * Returns gas estimate and result without sending transaction
1346
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1347
+ */
1348
+ async execute(target: `0x${string}`, value: bigint, data: `0x${string}`, options?: {
1349
+ accessList?: import('viem').AccessList;
1350
+ authorizationList?: import('viem').AuthorizationList;
1351
+ chain?: import('viem').Chain | null;
1352
+ dataSuffix?: `0x${string}`;
1353
+ gas?: bigint;
1354
+ gasPrice?: bigint;
1355
+ maxFeePerGas?: bigint;
1356
+ maxPriorityFeePerGas?: bigint;
1357
+ nonce?: number;
1358
+ value?: bigint;
1359
+ }): Promise<void> {
1360
+ return contract.simulate.execute([target, value, data] as const, options) as Promise<void>;
1361
+ },
1362
+ /**
1363
+ * Simulate executeBatch
1364
+ * Returns gas estimate and result without sending transaction
1365
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1366
+ */
1367
+ async executeBatch(calls: CoinbaseSmartWallet_Call[], options?: {
1368
+ accessList?: import('viem').AccessList;
1369
+ authorizationList?: import('viem').AuthorizationList;
1370
+ chain?: import('viem').Chain | null;
1371
+ dataSuffix?: `0x${string}`;
1372
+ gas?: bigint;
1373
+ gasPrice?: bigint;
1374
+ maxFeePerGas?: bigint;
1375
+ maxPriorityFeePerGas?: bigint;
1376
+ nonce?: number;
1377
+ value?: bigint;
1378
+ }): Promise<void> {
1379
+ return contract.simulate.executeBatch([calls] as const, options) as Promise<void>;
1380
+ },
1381
+ /**
1382
+ * Simulate executeWithoutChainIdValidation
1383
+ * Returns gas estimate and result without sending transaction
1384
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1385
+ */
1386
+ async executeWithoutChainIdValidation(calls: `0x${string}`[], options?: {
1387
+ accessList?: import('viem').AccessList;
1388
+ authorizationList?: import('viem').AuthorizationList;
1389
+ chain?: import('viem').Chain | null;
1390
+ dataSuffix?: `0x${string}`;
1391
+ gas?: bigint;
1392
+ gasPrice?: bigint;
1393
+ maxFeePerGas?: bigint;
1394
+ maxPriorityFeePerGas?: bigint;
1395
+ nonce?: number;
1396
+ value?: bigint;
1397
+ }): Promise<void> {
1398
+ return contract.simulate.executeWithoutChainIdValidation([calls] as const, options) as Promise<void>;
1399
+ },
1400
+ /**
1401
+ * Simulate initialize
1402
+ * Returns gas estimate and result without sending transaction
1403
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1404
+ */
1405
+ async initialize(owners: `0x${string}`[], options?: {
1406
+ accessList?: import('viem').AccessList;
1407
+ authorizationList?: import('viem').AuthorizationList;
1408
+ chain?: import('viem').Chain | null;
1409
+ dataSuffix?: `0x${string}`;
1410
+ gas?: bigint;
1411
+ gasPrice?: bigint;
1412
+ maxFeePerGas?: bigint;
1413
+ maxPriorityFeePerGas?: bigint;
1414
+ nonce?: number;
1415
+ value?: bigint;
1416
+ }): Promise<void> {
1417
+ return contract.simulate.initialize([owners] as const, options) as Promise<void>;
1418
+ },
1419
+ /**
1420
+ * Simulate removeLastOwner
1421
+ * Returns gas estimate and result without sending transaction
1422
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1423
+ */
1424
+ async removeLastOwner(index: bigint, owner: `0x${string}`, options?: {
1425
+ accessList?: import('viem').AccessList;
1426
+ authorizationList?: import('viem').AuthorizationList;
1427
+ chain?: import('viem').Chain | null;
1428
+ dataSuffix?: `0x${string}`;
1429
+ gas?: bigint;
1430
+ gasPrice?: bigint;
1431
+ maxFeePerGas?: bigint;
1432
+ maxPriorityFeePerGas?: bigint;
1433
+ nonce?: number;
1434
+ value?: bigint;
1435
+ }): Promise<void> {
1436
+ return contract.simulate.removeLastOwner([index, owner] as const, options) as Promise<void>;
1437
+ },
1438
+ /**
1439
+ * Simulate removeOwnerAtIndex
1440
+ * Returns gas estimate and result without sending transaction
1441
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1442
+ */
1443
+ async removeOwnerAtIndex(index: bigint, owner: `0x${string}`, options?: {
1444
+ accessList?: import('viem').AccessList;
1445
+ authorizationList?: import('viem').AuthorizationList;
1446
+ chain?: import('viem').Chain | null;
1447
+ dataSuffix?: `0x${string}`;
1448
+ gas?: bigint;
1449
+ gasPrice?: bigint;
1450
+ maxFeePerGas?: bigint;
1451
+ maxPriorityFeePerGas?: bigint;
1452
+ nonce?: number;
1453
+ value?: bigint;
1454
+ }): Promise<void> {
1455
+ return contract.simulate.removeOwnerAtIndex([index, owner] as const, options) as Promise<void>;
1456
+ },
1457
+ /**
1458
+ * Simulate upgradeToAndCall
1459
+ * Returns gas estimate and result without sending transaction
1460
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1461
+ */
1462
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1463
+ accessList?: import('viem').AccessList;
1464
+ authorizationList?: import('viem').AuthorizationList;
1465
+ chain?: import('viem').Chain | null;
1466
+ dataSuffix?: `0x${string}`;
1467
+ gas?: bigint;
1468
+ gasPrice?: bigint;
1469
+ maxFeePerGas?: bigint;
1470
+ maxPriorityFeePerGas?: bigint;
1471
+ nonce?: number;
1472
+ value?: bigint;
1473
+ }): Promise<void> {
1474
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
1475
+ },
1476
+ /**
1477
+ * Simulate validateUserOp
1478
+ * Returns gas estimate and result without sending transaction
1479
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1480
+ */
1481
+ async validateUserOp(userOp: UserOperation, userOpHash: `0x${string}`, missingAccountFunds: bigint, options?: {
1482
+ accessList?: import('viem').AccessList;
1483
+ authorizationList?: import('viem').AuthorizationList;
1484
+ chain?: import('viem').Chain | null;
1485
+ dataSuffix?: `0x${string}`;
1486
+ gas?: bigint;
1487
+ gasPrice?: bigint;
1488
+ maxFeePerGas?: bigint;
1489
+ maxPriorityFeePerGas?: bigint;
1490
+ nonce?: number;
1491
+ value?: bigint;
1492
+ }): Promise<bigint> {
1493
+ return contract.simulate.validateUserOp([userOp, userOpHash, missingAccountFunds] as const, options) as Promise<bigint>;
1494
+ }
1495
+ };
1496
+ }
1497
+
1498
+ /**
1499
+ * Watch contract events
1500
+ *
1501
+ * @example
1502
+ * // Watch all Transfer events
1503
+ * const unwatch = contract.watch.Transfer((event) => {
1504
+ * console.log('Transfer:', event);
1505
+ * });
1506
+ *
1507
+ * // Stop watching
1508
+ * unwatch();
1509
+ */
1510
+ get watch() {
1511
+ return {
1512
+ /**
1513
+ * Watch AddOwner events
1514
+ * @param callback Function to call when event is emitted
1515
+ * @param filter Optional filter for indexed parameters
1516
+ * @returns Unwatch function to stop listening
1517
+ */
1518
+ AddOwner: (callback: (event: { index: bigint; owner: `0x${string}` }) => void, filter?: { index: bigint }) => {
1519
+ return this.publicClient.watchContractEvent({
1520
+ address: this.contractAddress,
1521
+ abi: CoinbaseSmartWallet_jsonAbi,
1522
+ eventName: 'AddOwner',
1523
+ args: filter,
1524
+ onLogs: (logs: any[]) => {
1525
+ logs.forEach((log: any) => {
1526
+ callback(log.args as any);
1527
+ });
1528
+ },
1529
+ }) as () => void;
1530
+ },
1531
+ /**
1532
+ * Watch RemoveOwner events
1533
+ * @param callback Function to call when event is emitted
1534
+ * @param filter Optional filter for indexed parameters
1535
+ * @returns Unwatch function to stop listening
1536
+ */
1537
+ RemoveOwner: (callback: (event: { index: bigint; owner: `0x${string}` }) => void, filter?: { index: bigint }) => {
1538
+ return this.publicClient.watchContractEvent({
1539
+ address: this.contractAddress,
1540
+ abi: CoinbaseSmartWallet_jsonAbi,
1541
+ eventName: 'RemoveOwner',
1542
+ args: filter,
1543
+ onLogs: (logs: any[]) => {
1544
+ logs.forEach((log: any) => {
1545
+ callback(log.args as any);
1546
+ });
1547
+ },
1548
+ }) as () => void;
1549
+ },
1550
+ /**
1551
+ * Watch Upgraded events
1552
+ * @param callback Function to call when event is emitted
1553
+ * @param filter Optional filter for indexed parameters
1554
+ * @returns Unwatch function to stop listening
1555
+ */
1556
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
1557
+ return this.publicClient.watchContractEvent({
1558
+ address: this.contractAddress,
1559
+ abi: CoinbaseSmartWallet_jsonAbi,
1560
+ eventName: 'Upgraded',
1561
+ args: filter,
1562
+ onLogs: (logs: any[]) => {
1563
+ logs.forEach((log: any) => {
1564
+ callback(log.args as any);
1565
+ });
1566
+ },
1567
+ }) as () => void;
1568
+ }
1569
+ };
1570
+ }
1571
+ }