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