@gitmyabi/vault 1.0.5 → 1.0.7
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.
- package/README.md +5 -5
- package/contracts/ERC1967Proxy_json.d.ts +144 -0
- package/contracts/ERC1967Proxy_json.js +180 -0
- package/contracts/ERC1967Proxy_json.ts +209 -0
- package/contracts/Vault_json.d.ts +1069 -129
- package/contracts/Vault_json.js +1008 -126
- package/contracts/Vault_json.ts +1421 -210
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +4 -1
- package/contracts/index.ts +2 -0
- package/package.json +3 -3
package/contracts/Vault_json.ts
CHANGED
|
@@ -8,57 +8,165 @@ 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,
|
|
11
81
|
"inputs": [
|
|
12
82
|
{
|
|
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,
|
|
13
96
|
"internalType": "bytes32",
|
|
14
|
-
"name": "
|
|
97
|
+
"name": "newAdminRole",
|
|
15
98
|
"type": "bytes32"
|
|
16
99
|
}
|
|
17
100
|
],
|
|
18
|
-
"
|
|
19
|
-
"type": "
|
|
101
|
+
"name": "RoleAdminChanged",
|
|
102
|
+
"type": "event"
|
|
20
103
|
},
|
|
21
104
|
{
|
|
22
105
|
"anonymous": false,
|
|
23
106
|
"inputs": [
|
|
107
|
+
{
|
|
108
|
+
"indexed": true,
|
|
109
|
+
"internalType": "bytes32",
|
|
110
|
+
"name": "role",
|
|
111
|
+
"type": "bytes32"
|
|
112
|
+
},
|
|
24
113
|
{
|
|
25
114
|
"indexed": true,
|
|
26
115
|
"internalType": "address",
|
|
27
|
-
"name": "
|
|
116
|
+
"name": "account",
|
|
28
117
|
"type": "address"
|
|
29
118
|
},
|
|
30
119
|
{
|
|
31
|
-
"indexed":
|
|
32
|
-
"internalType": "
|
|
33
|
-
"name": "
|
|
34
|
-
"type": "
|
|
120
|
+
"indexed": true,
|
|
121
|
+
"internalType": "address",
|
|
122
|
+
"name": "sender",
|
|
123
|
+
"type": "address"
|
|
35
124
|
}
|
|
36
125
|
],
|
|
37
|
-
"name": "
|
|
126
|
+
"name": "RoleGranted",
|
|
38
127
|
"type": "event"
|
|
39
128
|
},
|
|
40
129
|
{
|
|
41
130
|
"anonymous": false,
|
|
42
131
|
"inputs": [
|
|
132
|
+
{
|
|
133
|
+
"indexed": true,
|
|
134
|
+
"internalType": "bytes32",
|
|
135
|
+
"name": "role",
|
|
136
|
+
"type": "bytes32"
|
|
137
|
+
},
|
|
43
138
|
{
|
|
44
139
|
"indexed": true,
|
|
45
140
|
"internalType": "address",
|
|
46
|
-
"name": "
|
|
141
|
+
"name": "account",
|
|
47
142
|
"type": "address"
|
|
48
143
|
},
|
|
49
144
|
{
|
|
50
|
-
"indexed":
|
|
51
|
-
"internalType": "
|
|
52
|
-
"name": "
|
|
53
|
-
"type": "
|
|
145
|
+
"indexed": true,
|
|
146
|
+
"internalType": "address",
|
|
147
|
+
"name": "sender",
|
|
148
|
+
"type": "address"
|
|
54
149
|
}
|
|
55
150
|
],
|
|
56
|
-
"name": "
|
|
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"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"name": "Upgraded",
|
|
57
165
|
"type": "event"
|
|
58
166
|
},
|
|
59
167
|
{
|
|
60
168
|
"inputs": [],
|
|
61
|
-
"name": "
|
|
169
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
62
170
|
"outputs": [
|
|
63
171
|
{
|
|
64
172
|
"internalType": "bytes32",
|
|
@@ -71,12 +179,12 @@ export const Vault_jsonAbi = [
|
|
|
71
179
|
},
|
|
72
180
|
{
|
|
73
181
|
"inputs": [],
|
|
74
|
-
"name": "
|
|
182
|
+
"name": "PAYEE_ROLE",
|
|
75
183
|
"outputs": [
|
|
76
184
|
{
|
|
77
|
-
"internalType": "
|
|
185
|
+
"internalType": "bytes32",
|
|
78
186
|
"name": "",
|
|
79
|
-
"type": "
|
|
187
|
+
"type": "bytes32"
|
|
80
188
|
}
|
|
81
189
|
],
|
|
82
190
|
"stateMutability": "view",
|
|
@@ -84,38 +192,119 @@ export const Vault_jsonAbi = [
|
|
|
84
192
|
},
|
|
85
193
|
{
|
|
86
194
|
"inputs": [],
|
|
87
|
-
"name": "
|
|
195
|
+
"name": "PAYER_ROLE",
|
|
88
196
|
"outputs": [
|
|
89
197
|
{
|
|
90
|
-
"internalType": "
|
|
198
|
+
"internalType": "bytes32",
|
|
91
199
|
"name": "",
|
|
92
|
-
"type": "
|
|
200
|
+
"type": "bytes32"
|
|
93
201
|
}
|
|
94
202
|
],
|
|
95
203
|
"stateMutability": "view",
|
|
96
204
|
"type": "function"
|
|
97
205
|
},
|
|
98
206
|
{
|
|
99
|
-
"inputs": [
|
|
100
|
-
|
|
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",
|
|
101
279
|
"outputs": [
|
|
102
280
|
{
|
|
103
|
-
"internalType": "
|
|
281
|
+
"internalType": "bytes32",
|
|
104
282
|
"name": "",
|
|
105
|
-
"type": "
|
|
283
|
+
"type": "bytes32"
|
|
106
284
|
}
|
|
107
285
|
],
|
|
108
|
-
"stateMutability": "
|
|
286
|
+
"stateMutability": "view",
|
|
109
287
|
"type": "function"
|
|
110
288
|
},
|
|
111
289
|
{
|
|
112
|
-
"inputs": [
|
|
113
|
-
|
|
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",
|
|
114
303
|
"outputs": [
|
|
115
304
|
{
|
|
116
|
-
"internalType": "
|
|
305
|
+
"internalType": "address",
|
|
117
306
|
"name": "",
|
|
118
|
-
"type": "
|
|
307
|
+
"type": "address"
|
|
119
308
|
}
|
|
120
309
|
],
|
|
121
310
|
"stateMutability": "view",
|
|
@@ -124,194 +313,1102 @@ export const Vault_jsonAbi = [
|
|
|
124
313
|
{
|
|
125
314
|
"inputs": [
|
|
126
315
|
{
|
|
127
|
-
"internalType": "
|
|
128
|
-
"name": "
|
|
129
|
-
"type": "
|
|
316
|
+
"internalType": "bytes32",
|
|
317
|
+
"name": "role",
|
|
318
|
+
"type": "bytes32"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"name": "getRoleMemberCount",
|
|
322
|
+
"outputs": [
|
|
323
|
+
{
|
|
324
|
+
"internalType": "uint256",
|
|
325
|
+
"name": "",
|
|
326
|
+
"type": "uint256"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"stateMutability": "view",
|
|
330
|
+
"type": "function"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"inputs": [
|
|
334
|
+
{
|
|
335
|
+
"internalType": "bytes32",
|
|
336
|
+
"name": "role",
|
|
337
|
+
"type": "bytes32"
|
|
130
338
|
},
|
|
131
339
|
{
|
|
132
|
-
"internalType": "address
|
|
133
|
-
"name": "
|
|
340
|
+
"internalType": "address",
|
|
341
|
+
"name": "account",
|
|
134
342
|
"type": "address"
|
|
135
343
|
}
|
|
136
344
|
],
|
|
137
|
-
"name": "
|
|
345
|
+
"name": "grantRole",
|
|
138
346
|
"outputs": [],
|
|
139
347
|
"stateMutability": "nonpayable",
|
|
140
348
|
"type": "function"
|
|
141
349
|
},
|
|
142
350
|
{
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
351
|
+
"inputs": [
|
|
352
|
+
{
|
|
353
|
+
"internalType": "bytes32",
|
|
354
|
+
"name": "role",
|
|
355
|
+
"type": "bytes32"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"internalType": "address",
|
|
359
|
+
"name": "account",
|
|
360
|
+
"type": "address"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
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",
|
|
377
|
+
"outputs": [],
|
|
378
|
+
"stateMutability": "nonpayable",
|
|
379
|
+
"type": "function"
|
|
380
|
+
},
|
|
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
|
+
{
|
|
612
|
+
"stateMutability": "payable",
|
|
613
|
+
"type": "receive"
|
|
614
|
+
}
|
|
615
|
+
] as const satisfies Abi;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Type-safe ABI for Vault_json
|
|
619
|
+
*/
|
|
620
|
+
export type Vault_jsonAbi = typeof Vault_jsonAbi;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Contract instance type for Vault_json
|
|
624
|
+
*/
|
|
625
|
+
// Use any for contract type to avoid complex viem type issues
|
|
626
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
627
|
+
export type Vault_jsonContract = any;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Vault_json Contract Class
|
|
631
|
+
*
|
|
632
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* ```typescript
|
|
636
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
637
|
+
* import { mainnet } from 'viem/chains';
|
|
638
|
+
* import { Vault_json } from 'Vault_json';
|
|
639
|
+
*
|
|
640
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
641
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
642
|
+
*
|
|
643
|
+
* const contract = new Vault_json('0x...', { publicClient, walletClient });
|
|
644
|
+
*
|
|
645
|
+
* // Read functions
|
|
646
|
+
* const result = await contract.balanceOf('0x...');
|
|
647
|
+
*
|
|
648
|
+
* // Write functions
|
|
649
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
650
|
+
*
|
|
651
|
+
* // Simulate transactions (dry-run)
|
|
652
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
653
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
654
|
+
*
|
|
655
|
+
* // Watch events
|
|
656
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
657
|
+
* console.log('Transfer event:', event);
|
|
658
|
+
* });
|
|
659
|
+
* ```
|
|
660
|
+
*/
|
|
661
|
+
export class Vault_json {
|
|
662
|
+
private contract: Vault_jsonContract;
|
|
663
|
+
private contractAddress: Address;
|
|
664
|
+
private publicClient: PublicClient;
|
|
665
|
+
|
|
666
|
+
constructor(
|
|
667
|
+
address: Address,
|
|
668
|
+
clients: {
|
|
669
|
+
publicClient: PublicClient;
|
|
670
|
+
walletClient?: WalletClient;
|
|
671
|
+
}
|
|
672
|
+
) {
|
|
673
|
+
this.contractAddress = address;
|
|
674
|
+
this.publicClient = clients.publicClient;
|
|
675
|
+
this.contract = getContract({
|
|
676
|
+
address,
|
|
677
|
+
abi: Vault_jsonAbi,
|
|
678
|
+
client: {
|
|
679
|
+
public: clients.publicClient,
|
|
680
|
+
wallet: clients.walletClient,
|
|
681
|
+
},
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Get the contract address
|
|
687
|
+
*/
|
|
688
|
+
get address(): Address {
|
|
689
|
+
return this.contractAddress;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Get the underlying viem contract instance
|
|
694
|
+
*/
|
|
695
|
+
getContract(): Vault_jsonContract {
|
|
696
|
+
return this.contract;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
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
|
|
733
|
+
* view
|
|
734
|
+
*/
|
|
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}`>;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* getRoleMemberCount
|
|
741
|
+
* view
|
|
742
|
+
*/
|
|
743
|
+
async getRoleMemberCount(role: `0x${string}`): Promise<bigint> {
|
|
744
|
+
return this.contract.read.getRoleMemberCount([role] as const) as Promise<bigint>;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* hasRole
|
|
749
|
+
* view
|
|
750
|
+
*/
|
|
751
|
+
async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
|
|
752
|
+
return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
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
|
|
766
|
+
*/
|
|
767
|
+
async proxiableUUID(): Promise<`0x${string}`> {
|
|
768
|
+
return this.contract.read.proxiableUUID() as Promise<`0x${string}`>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* supportsInterface
|
|
773
|
+
* view
|
|
774
|
+
*/
|
|
775
|
+
async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
|
|
776
|
+
return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* batchTransferErc20
|
|
781
|
+
* nonpayable
|
|
782
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
783
|
+
*/
|
|
784
|
+
async batchTransferErc20(tokens: `0x${string}`[], payees: `0x${string}`[], amounts: bigint[], options?: {
|
|
785
|
+
accessList?: import('viem').AccessList;
|
|
786
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
787
|
+
chain?: import('viem').Chain | null;
|
|
788
|
+
dataSuffix?: `0x${string}`;
|
|
789
|
+
gas?: bigint;
|
|
790
|
+
gasPrice?: bigint;
|
|
791
|
+
maxFeePerGas?: bigint;
|
|
792
|
+
maxPriorityFeePerGas?: bigint;
|
|
793
|
+
nonce?: number;
|
|
794
|
+
value?: bigint;
|
|
795
|
+
}): Promise<`0x${string}`> {
|
|
796
|
+
if (!this.contract.write) {
|
|
797
|
+
throw new Error('Wallet client is required for write operations');
|
|
798
|
+
}
|
|
799
|
+
return this.contract.write.batchTransferErc20([tokens, payees, amounts] as const, options) as Promise<`0x${string}`>;
|
|
800
|
+
}
|
|
801
|
+
|
|
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
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* batchTransferEther
|
|
827
|
+
* nonpayable
|
|
828
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
829
|
+
*/
|
|
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');
|
|
844
|
+
}
|
|
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');
|
|
202
1028
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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>;
|
|
212
1405
|
},
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Get the contract address
|
|
218
|
-
*/
|
|
219
|
-
get address(): Address {
|
|
220
|
-
return this.contractAddress;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Get the underlying viem contract instance
|
|
225
|
-
*/
|
|
226
|
-
getContract(): Vault_jsonContract {
|
|
227
|
-
return this.contract;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* SEAL
|
|
232
|
-
* view
|
|
233
|
-
*/
|
|
234
|
-
async SEAL(): Promise<`0x${string}`> {
|
|
235
|
-
return this.contract.read.SEAL() as Promise<`0x${string}`>;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* balance
|
|
240
|
-
* view
|
|
241
|
-
*/
|
|
242
|
-
async balance(): Promise<bigint> {
|
|
243
|
-
return this.contract.read.balance() as Promise<bigint>;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* found
|
|
248
|
-
* view
|
|
249
|
-
*/
|
|
250
|
-
async found(): Promise<boolean> {
|
|
251
|
-
return this.contract.read.found() as Promise<boolean>;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* rules
|
|
256
|
-
* pure
|
|
257
|
-
*/
|
|
258
|
-
async rules(): Promise<string> {
|
|
259
|
-
return this.contract.read.rules() as Promise<string>;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* state
|
|
264
|
-
* view
|
|
265
|
-
*/
|
|
266
|
-
async state(): Promise<string> {
|
|
267
|
-
return this.contract.read.state() as Promise<string>;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* unlock
|
|
272
|
-
* nonpayable
|
|
273
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
274
|
-
*/
|
|
275
|
-
async unlock(secret: `0x${string}`, to: `0x${string}`, options?: {
|
|
276
|
-
accessList?: import('viem').AccessList;
|
|
277
|
-
authorizationList?: import('viem').AuthorizationList;
|
|
278
|
-
chain?: import('viem').Chain | null;
|
|
279
|
-
dataSuffix?: `0x${string}`;
|
|
280
|
-
gas?: bigint;
|
|
281
|
-
gasPrice?: bigint;
|
|
282
|
-
maxFeePerGas?: bigint;
|
|
283
|
-
maxPriorityFeePerGas?: bigint;
|
|
284
|
-
nonce?: number;
|
|
285
|
-
value?: bigint;
|
|
286
|
-
}): Promise<`0x${string}`> {
|
|
287
|
-
if (!this.contract.write) {
|
|
288
|
-
throw new Error('Wallet client is required for write operations');
|
|
289
|
-
}
|
|
290
|
-
return this.contract.write.unlock([secret, to] as const, options) as Promise<`0x${string}`>;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/**
|
|
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);
|
|
302
|
-
*/
|
|
303
|
-
get simulate() {
|
|
304
|
-
const contract = this.contract;
|
|
305
|
-
if (!contract.simulate) {
|
|
306
|
-
throw new Error('Public client is required for simulation');
|
|
307
|
-
}
|
|
308
|
-
return {
|
|
309
1406
|
/**
|
|
310
|
-
* Simulate
|
|
1407
|
+
* Simulate upgradeToAndCall
|
|
311
1408
|
* Returns gas estimate and result without sending transaction
|
|
312
1409
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
313
1410
|
*/
|
|
314
|
-
async
|
|
1411
|
+
async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
|
|
315
1412
|
accessList?: import('viem').AccessList;
|
|
316
1413
|
authorizationList?: import('viem').AuthorizationList;
|
|
317
1414
|
chain?: import('viem').Chain | null;
|
|
@@ -323,7 +1420,7 @@ export class Vault_json {
|
|
|
323
1420
|
nonce?: number;
|
|
324
1421
|
value?: bigint;
|
|
325
1422
|
}): Promise<void> {
|
|
326
|
-
return contract.simulate.
|
|
1423
|
+
return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
|
|
327
1424
|
}
|
|
328
1425
|
};
|
|
329
1426
|
}
|
|
@@ -343,16 +1440,130 @@ export class Vault_json {
|
|
|
343
1440
|
get watch() {
|
|
344
1441
|
return {
|
|
345
1442
|
/**
|
|
346
|
-
* Watch
|
|
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
|
|
347
1558
|
* @param callback Function to call when event is emitted
|
|
348
1559
|
* @param filter Optional filter for indexed parameters
|
|
349
1560
|
* @returns Unwatch function to stop listening
|
|
350
1561
|
*/
|
|
351
|
-
|
|
1562
|
+
RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
|
|
352
1563
|
return this.publicClient.watchContractEvent({
|
|
353
1564
|
address: this.contractAddress,
|
|
354
1565
|
abi: Vault_jsonAbi,
|
|
355
|
-
eventName: '
|
|
1566
|
+
eventName: 'RoleRevoked',
|
|
356
1567
|
args: filter,
|
|
357
1568
|
onLogs: (logs: any[]) => {
|
|
358
1569
|
logs.forEach((log: any) => {
|
|
@@ -362,16 +1573,16 @@ export class Vault_json {
|
|
|
362
1573
|
}) as () => void;
|
|
363
1574
|
},
|
|
364
1575
|
/**
|
|
365
|
-
* Watch
|
|
1576
|
+
* Watch Upgraded events
|
|
366
1577
|
* @param callback Function to call when event is emitted
|
|
367
1578
|
* @param filter Optional filter for indexed parameters
|
|
368
1579
|
* @returns Unwatch function to stop listening
|
|
369
1580
|
*/
|
|
370
|
-
|
|
1581
|
+
Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
|
|
371
1582
|
return this.publicClient.watchContractEvent({
|
|
372
1583
|
address: this.contractAddress,
|
|
373
1584
|
abi: Vault_jsonAbi,
|
|
374
|
-
eventName: '
|
|
1585
|
+
eventName: 'Upgraded',
|
|
375
1586
|
args: filter,
|
|
376
1587
|
onLogs: (logs: any[]) => {
|
|
377
1588
|
logs.forEach((log: any) => {
|