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