@gitmyabi/vault 1.0.9 → 1.0.10

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