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