@pufferfinance/puffer-sdk 1.26.0 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,507 @@
1
+ const t = [
2
+ {
3
+ inputs: [],
4
+ name: "DOMAIN_SEPARATOR",
5
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
6
+ stateMutability: "view",
7
+ type: "function"
8
+ },
9
+ {
10
+ inputs: [],
11
+ name: "PUFFER_ORACLE",
12
+ outputs: [
13
+ { internalType: "contract IPufferOracleV2", name: "", type: "address" }
14
+ ],
15
+ stateMutability: "view",
16
+ type: "function"
17
+ },
18
+ {
19
+ inputs: [],
20
+ name: "RESTAKING_REWARDS_DEPOSITOR",
21
+ outputs: [
22
+ {
23
+ internalType: "contract IPufferRevenueDepositor",
24
+ name: "",
25
+ type: "address"
26
+ }
27
+ ],
28
+ stateMutability: "view",
29
+ type: "function"
30
+ },
31
+ {
32
+ inputs: [],
33
+ name: "UPGRADE_INTERFACE_VERSION",
34
+ outputs: [{ internalType: "string", name: "", type: "string" }],
35
+ stateMutability: "view",
36
+ type: "function"
37
+ },
38
+ {
39
+ inputs: [
40
+ { internalType: "address", name: "owner", type: "address" },
41
+ { internalType: "address", name: "spender", type: "address" }
42
+ ],
43
+ name: "allowance",
44
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
45
+ stateMutability: "view",
46
+ type: "function"
47
+ },
48
+ {
49
+ inputs: [
50
+ { internalType: "address", name: "spender", type: "address" },
51
+ { internalType: "uint256", name: "value", type: "uint256" }
52
+ ],
53
+ name: "approve",
54
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
55
+ stateMutability: "nonpayable",
56
+ type: "function"
57
+ },
58
+ {
59
+ inputs: [],
60
+ name: "asset",
61
+ outputs: [{ internalType: "address", name: "", type: "address" }],
62
+ stateMutability: "view",
63
+ type: "function"
64
+ },
65
+ {
66
+ inputs: [],
67
+ name: "authority",
68
+ outputs: [{ internalType: "address", name: "", type: "address" }],
69
+ stateMutability: "view",
70
+ type: "function"
71
+ },
72
+ {
73
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
74
+ name: "balanceOf",
75
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
76
+ stateMutability: "view",
77
+ type: "function"
78
+ },
79
+ {
80
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
81
+ name: "burn",
82
+ outputs: [],
83
+ stateMutability: "nonpayable",
84
+ type: "function"
85
+ },
86
+ {
87
+ inputs: [
88
+ { internalType: "uint256[]", name: "requestIds", type: "uint256[]" }
89
+ ],
90
+ name: "claimWithdrawalsFromLido",
91
+ outputs: [],
92
+ stateMutability: "nonpayable",
93
+ type: "function"
94
+ },
95
+ {
96
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
97
+ name: "convertToAssets",
98
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
99
+ stateMutability: "view",
100
+ type: "function"
101
+ },
102
+ {
103
+ inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
104
+ name: "convertToShares",
105
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
106
+ stateMutability: "view",
107
+ type: "function"
108
+ },
109
+ {
110
+ inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
111
+ name: "convertToSharesUp",
112
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
113
+ stateMutability: "view",
114
+ type: "function"
115
+ },
116
+ {
117
+ inputs: [],
118
+ name: "decimals",
119
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
120
+ stateMutability: "pure",
121
+ type: "function"
122
+ },
123
+ {
124
+ inputs: [
125
+ { internalType: "uint256", name: "assets", type: "uint256" },
126
+ { internalType: "address", name: "receiver", type: "address" }
127
+ ],
128
+ name: "deposit",
129
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
130
+ stateMutability: "nonpayable",
131
+ type: "function"
132
+ },
133
+ {
134
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
135
+ name: "depositETH",
136
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
137
+ stateMutability: "payable",
138
+ type: "function"
139
+ },
140
+ {
141
+ inputs: [],
142
+ name: "depositRewards",
143
+ outputs: [],
144
+ stateMutability: "payable",
145
+ type: "function"
146
+ },
147
+ {
148
+ inputs: [
149
+ { internalType: "uint256", name: "stETHSharesAmount", type: "uint256" },
150
+ { internalType: "address", name: "receiver", type: "address" }
151
+ ],
152
+ name: "depositStETH",
153
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
154
+ stateMutability: "nonpayable",
155
+ type: "function"
156
+ },
157
+ {
158
+ inputs: [],
159
+ name: "eip712Domain",
160
+ outputs: [
161
+ { internalType: "bytes1", name: "fields", type: "bytes1" },
162
+ { internalType: "string", name: "name", type: "string" },
163
+ { internalType: "string", name: "version", type: "string" },
164
+ { internalType: "uint256", name: "chainId", type: "uint256" },
165
+ { internalType: "address", name: "verifyingContract", type: "address" },
166
+ { internalType: "bytes32", name: "salt", type: "bytes32" },
167
+ { internalType: "uint256[]", name: "extensions", type: "uint256[]" }
168
+ ],
169
+ stateMutability: "view",
170
+ type: "function"
171
+ },
172
+ {
173
+ inputs: [],
174
+ name: "getExitFeeBasisPoints",
175
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
176
+ stateMutability: "view",
177
+ type: "function"
178
+ },
179
+ {
180
+ inputs: [],
181
+ name: "getPendingLidoETHAmount",
182
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
183
+ stateMutability: "view",
184
+ type: "function"
185
+ },
186
+ {
187
+ inputs: [],
188
+ name: "getTotalExitFeeBasisPoints",
189
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
190
+ stateMutability: "view",
191
+ type: "function"
192
+ },
193
+ {
194
+ inputs: [],
195
+ name: "getTotalRewardDepositAmount",
196
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
197
+ stateMutability: "view",
198
+ type: "function"
199
+ },
200
+ {
201
+ inputs: [],
202
+ name: "getTotalRewardMintAmount",
203
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
204
+ stateMutability: "view",
205
+ type: "function"
206
+ },
207
+ {
208
+ inputs: [],
209
+ name: "getTreasury",
210
+ outputs: [{ internalType: "address", name: "", type: "address" }],
211
+ stateMutability: "view",
212
+ type: "function"
213
+ },
214
+ {
215
+ inputs: [],
216
+ name: "getTreasuryExitFeeBasisPoints",
217
+ outputs: [{ internalType: "uint96", name: "", type: "uint96" }],
218
+ stateMutability: "view",
219
+ type: "function"
220
+ },
221
+ {
222
+ inputs: [
223
+ { internalType: "address", name: "accessManager", type: "address" }
224
+ ],
225
+ name: "initialize",
226
+ outputs: [],
227
+ stateMutability: "nonpayable",
228
+ type: "function"
229
+ },
230
+ {
231
+ inputs: [{ internalType: "uint256[]", name: "amounts", type: "uint256[]" }],
232
+ name: "initiateETHWithdrawalsFromLido",
233
+ outputs: [
234
+ { internalType: "uint256[]", name: "requestIds", type: "uint256[]" }
235
+ ],
236
+ stateMutability: "nonpayable",
237
+ type: "function"
238
+ },
239
+ {
240
+ inputs: [],
241
+ name: "isConsumingScheduledOp",
242
+ outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
243
+ stateMutability: "view",
244
+ type: "function"
245
+ },
246
+ {
247
+ inputs: [{ internalType: "address", name: "", type: "address" }],
248
+ name: "maxDeposit",
249
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
250
+ stateMutability: "view",
251
+ type: "function"
252
+ },
253
+ {
254
+ inputs: [{ internalType: "address", name: "", type: "address" }],
255
+ name: "maxMint",
256
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
257
+ stateMutability: "view",
258
+ type: "function"
259
+ },
260
+ {
261
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
262
+ name: "maxRedeem",
263
+ outputs: [{ internalType: "uint256", name: "maxShares", type: "uint256" }],
264
+ stateMutability: "view",
265
+ type: "function"
266
+ },
267
+ {
268
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
269
+ name: "maxWithdraw",
270
+ outputs: [{ internalType: "uint256", name: "maxAssets", type: "uint256" }],
271
+ stateMutability: "view",
272
+ type: "function"
273
+ },
274
+ {
275
+ inputs: [
276
+ { internalType: "uint256", name: "shares", type: "uint256" },
277
+ { internalType: "address", name: "receiver", type: "address" }
278
+ ],
279
+ name: "mint",
280
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
281
+ stateMutability: "nonpayable",
282
+ type: "function"
283
+ },
284
+ {
285
+ inputs: [
286
+ { internalType: "uint256", name: "rewardsAmount", type: "uint256" }
287
+ ],
288
+ name: "mintRewards",
289
+ outputs: [
290
+ { internalType: "uint256", name: "ethToPufETHRate", type: "uint256" },
291
+ { internalType: "uint256", name: "pufETHAmount", type: "uint256" }
292
+ ],
293
+ stateMutability: "nonpayable",
294
+ type: "function"
295
+ },
296
+ {
297
+ inputs: [],
298
+ name: "name",
299
+ outputs: [{ internalType: "string", name: "", type: "string" }],
300
+ stateMutability: "view",
301
+ type: "function"
302
+ },
303
+ {
304
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
305
+ name: "nonces",
306
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
307
+ stateMutability: "view",
308
+ type: "function"
309
+ },
310
+ {
311
+ inputs: [
312
+ { internalType: "address", name: "", type: "address" },
313
+ { internalType: "address", name: "", type: "address" },
314
+ { internalType: "uint256", name: "", type: "uint256" },
315
+ { internalType: "bytes", name: "", type: "bytes" }
316
+ ],
317
+ name: "onERC721Received",
318
+ outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
319
+ stateMutability: "nonpayable",
320
+ type: "function"
321
+ },
322
+ {
323
+ inputs: [
324
+ { internalType: "address", name: "owner", type: "address" },
325
+ { internalType: "address", name: "spender", type: "address" },
326
+ { internalType: "uint256", name: "value", type: "uint256" },
327
+ { internalType: "uint256", name: "deadline", type: "uint256" },
328
+ { internalType: "uint8", name: "v", type: "uint8" },
329
+ { internalType: "bytes32", name: "r", type: "bytes32" },
330
+ { internalType: "bytes32", name: "s", type: "bytes32" }
331
+ ],
332
+ name: "permit",
333
+ outputs: [],
334
+ stateMutability: "nonpayable",
335
+ type: "function"
336
+ },
337
+ {
338
+ inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
339
+ name: "previewDeposit",
340
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
341
+ stateMutability: "view",
342
+ type: "function"
343
+ },
344
+ {
345
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
346
+ name: "previewMint",
347
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
348
+ stateMutability: "view",
349
+ type: "function"
350
+ },
351
+ {
352
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
353
+ name: "previewRedeem",
354
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
355
+ stateMutability: "view",
356
+ type: "function"
357
+ },
358
+ {
359
+ inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
360
+ name: "previewWithdraw",
361
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
362
+ stateMutability: "view",
363
+ type: "function"
364
+ },
365
+ {
366
+ inputs: [],
367
+ name: "proxiableUUID",
368
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
369
+ stateMutability: "view",
370
+ type: "function"
371
+ },
372
+ {
373
+ inputs: [
374
+ { internalType: "uint256", name: "shares", type: "uint256" },
375
+ { internalType: "address", name: "receiver", type: "address" },
376
+ { internalType: "address", name: "owner", type: "address" }
377
+ ],
378
+ name: "redeem",
379
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
380
+ stateMutability: "nonpayable",
381
+ type: "function"
382
+ },
383
+ {
384
+ inputs: [
385
+ { internalType: "uint256", name: "pufETHAmount", type: "uint256" },
386
+ { internalType: "uint256", name: "ethAmount", type: "uint256" }
387
+ ],
388
+ name: "revertMintRewards",
389
+ outputs: [],
390
+ stateMutability: "nonpayable",
391
+ type: "function"
392
+ },
393
+ {
394
+ inputs: [
395
+ { internalType: "address", name: "newAuthority", type: "address" }
396
+ ],
397
+ name: "setAuthority",
398
+ outputs: [],
399
+ stateMutability: "nonpayable",
400
+ type: "function"
401
+ },
402
+ {
403
+ inputs: [
404
+ {
405
+ internalType: "uint256",
406
+ name: "newExitFeeBasisPoints",
407
+ type: "uint256"
408
+ }
409
+ ],
410
+ name: "setExitFeeBasisPoints",
411
+ outputs: [],
412
+ stateMutability: "nonpayable",
413
+ type: "function"
414
+ },
415
+ {
416
+ inputs: [
417
+ {
418
+ internalType: "uint96",
419
+ name: "newTreasuryExitFeeBasisPoints",
420
+ type: "uint96"
421
+ },
422
+ { internalType: "address", name: "newTreasury", type: "address" }
423
+ ],
424
+ name: "setTreasuryExitFeeBasisPoints",
425
+ outputs: [],
426
+ stateMutability: "nonpayable",
427
+ type: "function"
428
+ },
429
+ {
430
+ inputs: [],
431
+ name: "symbol",
432
+ outputs: [{ internalType: "string", name: "", type: "string" }],
433
+ stateMutability: "view",
434
+ type: "function"
435
+ },
436
+ {
437
+ inputs: [],
438
+ name: "totalAssets",
439
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
440
+ stateMutability: "view",
441
+ type: "function"
442
+ },
443
+ {
444
+ inputs: [],
445
+ name: "totalSupply",
446
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
447
+ stateMutability: "view",
448
+ type: "function"
449
+ },
450
+ {
451
+ inputs: [
452
+ { internalType: "address", name: "to", type: "address" },
453
+ { internalType: "uint256", name: "value", type: "uint256" }
454
+ ],
455
+ name: "transfer",
456
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
457
+ stateMutability: "nonpayable",
458
+ type: "function"
459
+ },
460
+ {
461
+ inputs: [
462
+ { internalType: "address", name: "to", type: "address" },
463
+ { internalType: "uint256", name: "ethAmount", type: "uint256" }
464
+ ],
465
+ name: "transferETH",
466
+ outputs: [],
467
+ stateMutability: "nonpayable",
468
+ type: "function"
469
+ },
470
+ {
471
+ inputs: [
472
+ { internalType: "address", name: "from", type: "address" },
473
+ { internalType: "address", name: "to", type: "address" },
474
+ { internalType: "uint256", name: "value", type: "uint256" }
475
+ ],
476
+ name: "transferFrom",
477
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
478
+ stateMutability: "nonpayable",
479
+ type: "function"
480
+ },
481
+ {
482
+ inputs: [
483
+ { internalType: "address", name: "newImplementation", type: "address" },
484
+ { internalType: "bytes", name: "data", type: "bytes" }
485
+ ],
486
+ name: "upgradeToAndCall",
487
+ outputs: [],
488
+ stateMutability: "payable",
489
+ type: "function"
490
+ },
491
+ {
492
+ inputs: [
493
+ { internalType: "uint256", name: "assets", type: "uint256" },
494
+ { internalType: "address", name: "receiver", type: "address" },
495
+ { internalType: "address", name: "owner", type: "address" }
496
+ ],
497
+ name: "withdraw",
498
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
499
+ stateMutability: "nonpayable",
500
+ type: "function"
501
+ },
502
+ { stateMutability: "payable", type: "receive" }
503
+ ];
504
+ export {
505
+ t as PufferVaultV5
506
+ };
507
+ //# sourceMappingURL=PufferVaultV5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PufferVaultV5.js","sources":["../../../../lib/contracts/abis/mainnet/PufferVaultV5.ts"],"sourcesContent":["export const PufferVaultV5 = <const>[\n {\n inputs: [],\n name: 'DOMAIN_SEPARATOR',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'PUFFER_ORACLE',\n outputs: [\n { internalType: 'contract IPufferOracleV2', name: '', type: 'address' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'RESTAKING_REWARDS_DEPOSITOR',\n outputs: [\n {\n internalType: 'contract IPufferRevenueDepositor',\n name: '',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'UPGRADE_INTERFACE_VERSION',\n outputs: [{ internalType: 'string', name: '', type: 'string' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'owner', type: 'address' },\n { internalType: 'address', name: 'spender', type: 'address' },\n ],\n name: 'allowance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'spender', type: 'address' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n ],\n name: 'approve',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'asset',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'authority',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n name: 'burn',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256[]', name: 'requestIds', type: 'uint256[]' },\n ],\n name: 'claimWithdrawalsFromLido',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n name: 'convertToAssets',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }],\n name: 'convertToShares',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }],\n name: 'convertToSharesUp',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'decimals',\n outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'assets', type: 'uint256' },\n { internalType: 'address', name: 'receiver', type: 'address' },\n ],\n name: 'deposit',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'receiver', type: 'address' }],\n name: 'depositETH',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'depositRewards',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'stETHSharesAmount', type: 'uint256' },\n { internalType: 'address', name: 'receiver', type: 'address' },\n ],\n name: 'depositStETH',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'eip712Domain',\n outputs: [\n { internalType: 'bytes1', name: 'fields', type: 'bytes1' },\n { internalType: 'string', name: 'name', type: 'string' },\n { internalType: 'string', name: 'version', type: 'string' },\n { internalType: 'uint256', name: 'chainId', type: 'uint256' },\n { internalType: 'address', name: 'verifyingContract', type: 'address' },\n { internalType: 'bytes32', name: 'salt', type: 'bytes32' },\n { internalType: 'uint256[]', name: 'extensions', type: 'uint256[]' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getExitFeeBasisPoints',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getPendingLidoETHAmount',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTotalExitFeeBasisPoints',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTotalRewardDepositAmount',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTotalRewardMintAmount',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTreasury',\n outputs: [{ internalType: 'address', name: '', type: 'address' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getTreasuryExitFeeBasisPoints',\n outputs: [{ internalType: 'uint96', name: '', type: 'uint96' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'accessManager', type: 'address' },\n ],\n name: 'initialize',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }],\n name: 'initiateETHWithdrawalsFromLido',\n outputs: [\n { internalType: 'uint256[]', name: 'requestIds', type: 'uint256[]' },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'isConsumingScheduledOp',\n outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: '', type: 'address' }],\n name: 'maxDeposit',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: '', type: 'address' }],\n name: 'maxMint',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'owner', type: 'address' }],\n name: 'maxRedeem',\n outputs: [{ internalType: 'uint256', name: 'maxShares', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'owner', type: 'address' }],\n name: 'maxWithdraw',\n outputs: [{ internalType: 'uint256', name: 'maxAssets', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'shares', type: 'uint256' },\n { internalType: 'address', name: 'receiver', type: 'address' },\n ],\n name: 'mint',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'rewardsAmount', type: 'uint256' },\n ],\n name: 'mintRewards',\n outputs: [\n { internalType: 'uint256', name: 'ethToPufETHRate', type: 'uint256' },\n { internalType: 'uint256', name: 'pufETHAmount', type: 'uint256' },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'name',\n outputs: [{ internalType: 'string', name: '', type: 'string' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'owner', type: 'address' }],\n name: 'nonces',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: '', type: 'address' },\n { internalType: 'address', name: '', type: 'address' },\n { internalType: 'uint256', name: '', type: 'uint256' },\n { internalType: 'bytes', name: '', type: 'bytes' },\n ],\n name: 'onERC721Received',\n outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'owner', type: 'address' },\n { internalType: 'address', name: 'spender', type: 'address' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n { internalType: 'uint256', name: 'deadline', type: 'uint256' },\n { internalType: 'uint8', name: 'v', type: 'uint8' },\n { internalType: 'bytes32', name: 'r', type: 'bytes32' },\n { internalType: 'bytes32', name: 's', type: 'bytes32' },\n ],\n name: 'permit',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }],\n name: 'previewDeposit',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n name: 'previewMint',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n name: 'previewRedeem',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }],\n name: 'previewWithdraw',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'proxiableUUID',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'shares', type: 'uint256' },\n { internalType: 'address', name: 'receiver', type: 'address' },\n { internalType: 'address', name: 'owner', type: 'address' },\n ],\n name: 'redeem',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'pufETHAmount', type: 'uint256' },\n { internalType: 'uint256', name: 'ethAmount', type: 'uint256' },\n ],\n name: 'revertMintRewards',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newAuthority', type: 'address' },\n ],\n name: 'setAuthority',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: 'newExitFeeBasisPoints',\n type: 'uint256',\n },\n ],\n name: 'setExitFeeBasisPoints',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'uint96',\n name: 'newTreasuryExitFeeBasisPoints',\n type: 'uint96',\n },\n { internalType: 'address', name: 'newTreasury', type: 'address' },\n ],\n name: 'setTreasuryExitFeeBasisPoints',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'symbol',\n outputs: [{ internalType: 'string', name: '', type: 'string' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'totalAssets',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'totalSupply',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'to', type: 'address' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n ],\n name: 'transfer',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'to', type: 'address' },\n { internalType: 'uint256', name: 'ethAmount', type: 'uint256' },\n ],\n name: 'transferETH',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'from', type: 'address' },\n { internalType: 'address', name: 'to', type: 'address' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n ],\n name: 'transferFrom',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'newImplementation', type: 'address' },\n { internalType: 'bytes', name: 'data', type: 'bytes' },\n ],\n name: 'upgradeToAndCall',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'assets', type: 'uint256' },\n { internalType: 'address', name: 'receiver', type: 'address' },\n { internalType: 'address', name: 'owner', type: 'address' },\n ],\n name: 'withdraw',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n];\n"],"names":["PufferVaultV5"],"mappings":"AAAO,MAAMA,IAAuB;AAAA,EAClC;AAAA,IACE,QAAQ,CAAC;AAAA,IACT,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,MACP,EAAE,cAAc,4BAA4B,MAAM,IAAI,MAAM,UAAU;AAAA,IACxE;AAAA,IACA,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC;AAAA,IACT,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,UAAU,MAAM,IAAI,MAAM,UAAU;AAAA,IAC9D,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,SAAS,MAAM,UAAU;AAAA,MAC1D,EAAE,cAAc,WAAW,MAAM,WAAW,MAAM,UAAU;AAAA,IAC9D;AAAA,IACA,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,WA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,EAAE,cAAc,WAAW,MAAM,MAAM,MAAM,UAAU;AAAA,MACvD,EAAE,cAAc,WAAW,MAAM,SAAS,MAAM,UAAU;AAAA,IAC5D;AAAA,IACA,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,QAAQ,MAAM,IAAI,MAAM,QAAQ;AAAA,IAC1D,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,qBAAqB,MAAM,UAAU;AAAA,MACtE,EAAE,cAAc,SAAS,MAAM,QAAQ,MAAM,QAAQ;AAAA,IACvD;AAAA,IACA,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,UAAU,MAAM,UAAU;AAAA,MAC3D,EAAE,cAAc,WAAW,MAAM,YAAY,MAAM,UAAU;AAAA,MAC7D,EAAE,cAAc,WAAW,MAAM,SAAS,MAAM,UAAU;AAAA,IAC5D;AAAA,IACA,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA,EAAE,iBAAiB,WAAW,MAAM,UAAU;AAChD;"}
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var g=(i,t,n)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n;var m=(i,t,n)=>g(i,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants-CxSgz27h.cjs"),a=require("../tokens.cjs"),y=require("../../utils/time.cjs"),S=require("../abis/mainnet/ERC20Permit.cjs"),C=require("../../getContract-DUA3M2pm.cjs"),P=require("../../secp256k1-YUzyTLhP.cjs");function E(i){const{r:t,s:n}=P.secp256k1.Signature.fromCompact(i.slice(2,130)),e=+`0x${i.slice(130)}`,[r,s]=(()=>{if(e===0||e===1)return[void 0,e];if(e===27)return[BigInt(e),0];if(e===28)return[BigInt(e),1];throw new Error("Invalid yParityOrV value")})();return typeof r<"u"?{r:o.numberToHex(t,{size:32}),s:o.numberToHex(n,{size:32}),v:r,yParity:s}:{r:o.numberToHex(t,{size:32}),s:o.numberToHex(n,{size:32}),yParity:s}}class T{constructor(t,n,e){m(this,"viemChain");m(this,"token");this.chain=t,this.walletClient=n,this.publicClient=e,this.viemChain=o.VIEM_CHAINS[t],this.token=a.Token.WETH}withToken(t){return this.token=t,this}getContract(){const t=a.TOKENS_ADDRESSES[this.token][this.chain],n=S.ERC20Permit,e={public:this.publicClient,wallet:this.walletClient};return C.getContract({address:t,abi:n,client:e})}async getPermitSignature(t,n,e){const r=this.getContract(),s=await r.read.nonces([t]),c={name:await r.read.name(),version:this.getPermitVersion(this.token),chainId:this.chain,verifyingContract:a.TOKENS_ADDRESSES[this.token][this.chain],salt:this.getPermitSalt(this.token)},u={Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},l=BigInt(y.getTimestampInSeconds()+60*60*2),p=await this.walletClient.signTypedData({account:t,domain:c,types:u,primaryType:"Permit",message:{owner:t,spender:n,value:e,nonce:s,deadline:l}});return{...E(p),deadline:l}}async getPermitData(t,n,e){const{r,s,v:h,yParity:c,deadline:u}=await this.getPermitSignature(t,n,e);return{r,s,v:Number(h??c),deadline:u,amount:e}}approve(t,n,e){return this.getContract().write.approve([n,e],{account:t,chain:this.viemChain})}getPermitVersion(t){return a.TOKENS_PERMIT_VERSION[t]}getPermitSalt(t){var n,e;return(e=(n=a.TOKENS_SALT)==null?void 0:n[t])==null?void 0:e[this.chain]}}exports.ERC20PermitHandler=T;
1
+ "use strict";var p=Object.defineProperty;var d=(i,t,n)=>t in i?p(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n;var m=(i,t,n)=>d(i,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants-CxSgz27h.cjs"),a=require("../tokens.cjs"),y=require("../../utils/time.cjs"),S=require("../abis/mainnet/ERC20Permit.cjs"),C=require("../../getContract-DUA3M2pm.cjs"),P=require("../../secp256k1-YUzyTLhP.cjs");function E(i){const{r:t,s:n}=P.secp256k1.Signature.fromCompact(i.slice(2,130)),e=+`0x${i.slice(130)}`,[r,s]=(()=>{if(e===0||e===1)return[void 0,e];if(e===27)return[BigInt(e),0];if(e===28)return[BigInt(e),1];throw new Error("Invalid yParityOrV value")})();return typeof r<"u"?{r:o.numberToHex(t,{size:32}),s:o.numberToHex(n,{size:32}),v:r,yParity:s}:{r:o.numberToHex(t,{size:32}),s:o.numberToHex(n,{size:32}),yParity:s}}class T{constructor(t,n,e){m(this,"viemChain");m(this,"token");this.chain=t,this.walletClient=n,this.publicClient=e,this.viemChain=o.VIEM_CHAINS[t],this.token=a.Token.WETH}withToken(t){return this.token=t,this}getContract(){const t=a.TOKENS_ADDRESSES[this.token][this.chain],n=S.ERC20Permit,e={public:this.publicClient,wallet:this.walletClient};return C.getContract({address:t,abi:n,client:e})}nonces(t){return this.getContract().read.nonces([t])}async getPermitSignature(t,n,e){const r=this.getContract(),s=await this.nonces(t),c={name:await r.read.name(),version:this.getPermitVersion(this.token),chainId:this.chain,verifyingContract:a.TOKENS_ADDRESSES[this.token][this.chain],salt:this.getPermitSalt(this.token)},u={Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},l=BigInt(y.getTimestampInSeconds()+60*60*2),g=await this.walletClient.signTypedData({account:t,domain:c,types:u,primaryType:"Permit",message:{owner:t,spender:n,value:e,nonce:s,deadline:l}});return{...E(g),deadline:l}}async getPermitData(t,n,e){const{r,s,v:h,yParity:c,deadline:u}=await this.getPermitSignature(t,n,e);return{r,s,v:Number(h??c),deadline:u,amount:e}}approve(t,n,e){return this.getContract().write.approve([n,e],{account:t,chain:this.viemChain})}getPermitVersion(t){return a.TOKENS_PERMIT_VERSION[t]}getPermitSalt(t){var n,e;return(e=(n=a.TOKENS_SALT)==null?void 0:n[t])==null?void 0:e[this.chain]}}exports.ERC20PermitHandler=T;
2
2
  //# sourceMappingURL=erc20-permit-handler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"erc20-permit-handler.cjs","sources":["../../../node_modules/.pnpm/viem@2.33.1_typescript@5.8.2_zod@3.24.2/node_modules/viem/_esm/utils/signature/parseSignature.js","../../../lib/contracts/handlers/erc20-permit-handler.ts"],"sourcesContent":["import { secp256k1 } from '@noble/curves/secp256k1';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * @description Parses a hex formatted signature into a structured signature.\n *\n * @param signatureHex Signature in hex format.\n * @returns The structured signature.\n *\n * @example\n * parseSignature('0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c')\n * // { r: '0x...', s: '0x...', v: 28n }\n */\nexport function parseSignature(signatureHex) {\n const { r, s } = secp256k1.Signature.fromCompact(signatureHex.slice(2, 130));\n const yParityOrV = Number(`0x${signatureHex.slice(130)}`);\n const [v, yParity] = (() => {\n if (yParityOrV === 0 || yParityOrV === 1)\n return [undefined, yParityOrV];\n if (yParityOrV === 27)\n return [BigInt(yParityOrV), 0];\n if (yParityOrV === 28)\n return [BigInt(yParityOrV), 1];\n throw new Error('Invalid yParityOrV value');\n })();\n if (typeof v !== 'undefined')\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n v,\n yParity,\n };\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n yParity,\n };\n}\n//# sourceMappingURL=parseSignature.js.map","import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n parseSignature,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport {\n AnyToken,\n TOKENS_ADDRESSES,\n TOKENS_SALT,\n TOKENS_PERMIT_VERSION,\n Token,\n} from '../tokens';\nimport { getTimestampInSeconds } from '../../utils/time';\nimport { ERC20Permit } from '../abis/mainnet/ERC20Permit';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for performing operations for and with ERC20Permit tokens.\n */\nexport class ERC20PermitHandler {\n private viemChain: ViemChain;\n private token: AnyToken;\n\n /**\n * Create the handler for processing tokens.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.token = Token.WETH;\n }\n\n /**\n * Set the token to use for executing transactions on the contract.\n *\n * @param token Token to use for the handler.\n * @returns The handler.\n */\n public withToken(token: AnyToken) {\n this.token = token;\n return this;\n }\n\n /**\n * Get the contract. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[this.token][this.chain];\n const abi = ERC20Permit;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Process and get permit signature for the given token to perform\n * transactions without calling `approve()`.\n *\n * @param ownerAddress Address of the token owner.\n * @param spenderAddress Address of the spender who needs the permit.\n * @param value Value of the transaction.\n * @returns Permit signature in the form `{ r, s, v?, yParity }`.\n */\n public async getPermitSignature(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n const contract = this.getContract();\n\n const permitNonces = await contract.read.nonces([ownerAddress]);\n const name = await contract.read.name();\n const domain = <const>{\n name,\n version: this.getPermitVersion(this.token),\n chainId: this.chain,\n verifyingContract: TOKENS_ADDRESSES[this.token][this.chain],\n salt: this.getPermitSalt(this.token),\n };\n const types = <const>{\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n };\n // Valid for 2 hours.\n const deadline = BigInt(getTimestampInSeconds() + 60 * 60 * 2);\n\n const signature = await this.walletClient.signTypedData({\n account: ownerAddress,\n domain,\n types,\n primaryType: 'Permit',\n message: {\n owner: ownerAddress,\n spender: spenderAddress,\n value,\n nonce: permitNonces,\n deadline,\n },\n });\n\n return { ...parseSignature(signature), deadline };\n }\n\n /**\n * Get the permit data for the given owner, spender and value.\n *\n * @param ownerAddress Address of the token owner.\n * @param spenderAddress Address of the spender who needs the permit.\n * @param value Value/amount to be permitted.\n * @returns Permit data in the form `{ r, s, v, deadline, amount }`.\n */\n public async getPermitData(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ): Promise<PermitData> {\n const { r, s, v, yParity, deadline } = await this.getPermitSignature(\n ownerAddress,\n spenderAddress,\n value,\n );\n\n /* istanbul ignore next */\n return { r, s, v: Number(v ?? yParity), deadline, amount: value };\n }\n\n /**\n * Approve transaction for the spender to spend the owner's tokens.\n *\n * @param ownerAddress Address of the caller of the transaction.\n * @param spenderAddress Address of the spender.\n * @param value Value to approve for the spender.\n * @returns Hash of the transaction.\n */\n public approve(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n return this.getContract().write.approve([spenderAddress, value], {\n account: ownerAddress,\n chain: this.viemChain,\n });\n }\n\n private getPermitVersion(token: AnyToken): string {\n return TOKENS_PERMIT_VERSION[token];\n }\n\n private getPermitSalt(token: AnyToken) {\n return TOKENS_SALT?.[token]?.[this.chain];\n }\n}\n"],"names":["parseSignature","signatureHex","r","s","secp256k1","yParityOrV","v","yParity","numberToHex","ERC20PermitHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","Token","token","address","TOKENS_ADDRESSES","abi","ERC20Permit","client","getContract","ownerAddress","spenderAddress","value","contract","permitNonces","domain","types","deadline","getTimestampInSeconds","signature","TOKENS_PERMIT_VERSION","TOKENS_SALT"],"mappings":"oeAYO,SAASA,EAAeC,EAAc,CACzC,KAAM,CAAE,EAAAC,EAAG,EAAAC,CAAG,EAAGC,YAAU,UAAU,YAAYH,EAAa,MAAM,EAAG,GAAG,CAAC,EACrEI,EAAa,CAAO,KAAKJ,EAAa,MAAM,GAAG,CAAC,GAChD,CAACK,EAAGC,CAAO,GAAK,IAAM,CACxB,GAAIF,IAAe,GAAKA,IAAe,EACnC,MAAO,CAAC,OAAWA,CAAU,EACjC,GAAIA,IAAe,GACf,MAAO,CAAC,OAAOA,CAAU,EAAG,CAAC,EACjC,GAAIA,IAAe,GACf,MAAO,CAAC,OAAOA,CAAU,EAAG,CAAC,EACjC,MAAM,IAAI,MAAM,0BAA0B,CAClD,GAAQ,EACJ,OAAI,OAAOC,EAAM,IACN,CACH,EAAGE,EAAAA,YAAYN,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAGM,EAAAA,YAAYL,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAAG,EACA,QAAAC,CACH,EACE,CACH,EAAGC,EAAAA,YAAYN,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAGM,EAAAA,YAAYL,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,QAAAI,CACH,CACL,CCbO,MAAME,CAAmB,CAa9B,YACUC,EACAC,EACAC,EACR,CAhBMC,EAAA,kBACAA,EAAA,cAYE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,MAAQK,EAAAA,MAAM,IAAA,CASd,UAAUC,EAAiB,CAChC,YAAK,MAAQA,EACN,IAAA,CASF,aAAc,CACnB,MAAMC,E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EAAG,EAAG,OAAOnB,GAAKC,CAAO,EAAG,SAAAuB,EAAU,OAAQL,CAAM,CAAA,CAW3D,QACLF,EACAC,EACAC,EACA,CACO,OAAA,KAAK,cAAc,MAAM,QAAQ,CAACD,EAAgBC,CAAK,EAAG,CAC/D,QAASF,EACT,MAAO,KAAK,SAAA,CACb,CAAA,CAGK,iBAAiBP,EAAyB,CAChD,OAAOiB,EAAAA,sBAAsBjB,CAAK,CAAA,CAG5B,cAAcA,EAAiB,SACrC,OAAOkB,GAAAA,EAAAA,gBAAAA,YAAAA,EAAclB,KAAdkB,YAAAA,EAAuB,KAAK,MAAK,CAE5C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"erc20-permit-handler.cjs","sources":["../../../node_modules/.pnpm/viem@2.33.1_typescript@5.8.2_zod@3.24.2/node_modules/viem/_esm/utils/signature/parseSignature.js","../../../lib/contracts/handlers/erc20-permit-handler.ts"],"sourcesContent":["import { secp256k1 } from '@noble/curves/secp256k1';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * @description Parses a hex formatted signature into a structured signature.\n *\n * @param signatureHex Signature in hex format.\n * @returns The structured signature.\n *\n * @example\n * parseSignature('0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c')\n * // { r: '0x...', s: '0x...', v: 28n }\n */\nexport function parseSignature(signatureHex) {\n const { r, s } = secp256k1.Signature.fromCompact(signatureHex.slice(2, 130));\n const yParityOrV = Number(`0x${signatureHex.slice(130)}`);\n const [v, yParity] = (() => {\n if (yParityOrV === 0 || yParityOrV === 1)\n return [undefined, yParityOrV];\n if (yParityOrV === 27)\n return [BigInt(yParityOrV), 0];\n if (yParityOrV === 28)\n return [BigInt(yParityOrV), 1];\n throw new Error('Invalid yParityOrV value');\n })();\n if (typeof v !== 'undefined')\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n v,\n yParity,\n };\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n yParity,\n };\n}\n//# sourceMappingURL=parseSignature.js.map","import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n parseSignature,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport {\n AnyToken,\n TOKENS_ADDRESSES,\n TOKENS_SALT,\n TOKENS_PERMIT_VERSION,\n Token,\n} from '../tokens';\nimport { getTimestampInSeconds } from '../../utils/time';\nimport { ERC20Permit } from '../abis/mainnet/ERC20Permit';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for performing operations for and with ERC20Permit tokens.\n */\nexport class ERC20PermitHandler {\n private viemChain: ViemChain;\n private token: AnyToken;\n\n /**\n * Create the handler for processing tokens.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.token = Token.WETH;\n }\n\n /**\n * Set the token to use for executing transactions on the contract.\n *\n * @param token Token to use for the handler.\n * @returns The handler.\n */\n public withToken(token: AnyToken) {\n this.token = token;\n return this;\n }\n\n /**\n * Get the contract. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[this.token][this.chain];\n const abi = ERC20Permit;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the nonces for the given account.\n *\n * @param account Address of the account.\n * @returns The nonces.\n */\n public nonces(account: Address) {\n return this.getContract().read.nonces([account]);\n }\n\n /**\n * Process and get permit signature for the given token to perform\n * transactions without calling `approve()`.\n *\n * @param ownerAddress Address of the token owner.\n * @param spenderAddress Address of the spender who needs the permit.\n * @param value Value of the transaction.\n * @returns Permit signature in the form `{ r, s, v?, yParity }`.\n */\n public async getPermitSignature(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n const contract = this.getContract();\n\n const permitNonces = await this.nonces(ownerAddress);\n const name = await contract.read.name();\n const domain = <const>{\n name,\n version: this.getPermitVersion(this.token),\n chainId: this.chain,\n verifyingContract: TOKENS_ADDRESSES[this.token][this.chain],\n salt: this.getPermitSalt(this.token),\n };\n const types = <const>{\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n };\n // Valid for 2 hours.\n const deadline = BigInt(getTimestampInSeconds() + 60 * 60 * 2);\n\n const signature = await this.walletClient.signTypedData({\n account: ownerAddress,\n domain,\n types,\n primaryType: 'Permit',\n message: {\n owner: ownerAddress,\n spender: spenderAddress,\n value,\n nonce: permitNonces,\n deadline,\n },\n });\n\n return { ...parseSignature(signature), deadline };\n }\n\n /**\n * Get the permit data for the given owner, spender and value.\n *\n * @param ownerAddress Address of the token owner.\n * @param spenderAddress Address of the spender who needs the permit.\n * @param value Value/amount to be permitted.\n * @returns Permit data in the form `{ r, s, v, deadline, amount }`.\n */\n public async getPermitData(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ): Promise<PermitData> {\n const { r, s, v, yParity, deadline } = await this.getPermitSignature(\n ownerAddress,\n spenderAddress,\n value,\n );\n\n /* istanbul ignore next */\n return { r, s, v: Number(v ?? yParity), deadline, amount: value };\n }\n\n /**\n * Approve transaction for the spender to spend the owner's tokens.\n *\n * @param ownerAddress Address of the caller of the transaction.\n * @param spenderAddress Address of the spender.\n * @param value Value to approve for the spender.\n * @returns Hash of the transaction.\n */\n public approve(\n ownerAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n return this.getContract().write.approve([spenderAddress, value], {\n account: ownerAddress,\n chain: this.viemChain,\n });\n }\n\n private getPermitVersion(token: AnyToken): string {\n return TOKENS_PERMIT_VERSION[token];\n }\n\n private getPermitSalt(token: AnyToken) {\n return TOKENS_SALT?.[token]?.[this.chain];\n }\n}\n"],"names":["parseSignature","signatureHex","r","s","secp256k1","yParityOrV","v","yParity","numberToHex","ERC20PermitHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","Token","token","address","TOKENS_ADDRESSES","abi","ERC20Permit","client","getContract","account","ownerAddress","spenderAddress","value","contract","permitNonces","domain","types","deadline","getTimestampInSeconds","signature","TOKENS_PERMIT_VERSION","TOKENS_SALT"],"mappings":"oeAYO,SAASA,EAAeC,EAAc,CACzC,KAAM,CAAE,EAAAC,EAAG,EAAAC,CAAG,EAAGC,YAAU,UAAU,YAAYH,EAAa,MAAM,EAAG,GAAG,CAAC,EACrEI,EAAa,CAAO,KAAKJ,EAAa,MAAM,GAAG,CAAC,GAChD,CAACK,EAAGC,CAAO,GAAK,IAAM,CACxB,GAAIF,IAAe,GAAKA,IAAe,EACnC,MAAO,CAAC,OAAWA,CAAU,EACjC,GAAIA,IAAe,GACf,MAAO,CAAC,OAAOA,CAAU,EAAG,CAAC,EACjC,GAAIA,IAAe,GACf,MAAO,CAAC,OAAOA,CAAU,EAAG,CAAC,EACjC,MAAM,IAAI,MAAM,0BAA0B,CAClD,GAAQ,EACJ,OAAI,OAAOC,EAAM,IACN,CACH,EAAGE,EAAAA,YAAYN,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAGM,EAAAA,YAAYL,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAAG,EACA,QAAAC,CACH,EACE,CACH,EAAGC,EAAAA,YAAYN,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,EAAGM,EAAAA,YAAYL,EAAG,CAAE,KAAM,EAAE,CAAE,EAC9B,QAAAI,CACH,CACL,CCbO,MAAME,CAAmB,CAa9B,YACUC,EACAC,EACAC,EACR,CAhBMC,EAAA,kBACAA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,EACA,MAAOE,EACP,SAAAG,CAAA,CACF,CACD,EAED,MAAO,CAAE,GAAG/B,EAAeiC,CAAS,EAAG,SAAAF,CAAS,CAAA,CAWlD,MAAa,cACXP,EACAC,EACAC,EACqB,CACf,KAAA,CAAE,EAAG,EAAG,EAAApB,EAAG,QAAAC,EAAS,SAAAwB,CAAS,EAAI,MAAM,KAAK,mBAChDP,EACAC,EACAC,CACF,EAGO,MAAA,CAAE,EAAG,EAAG,EAAG,OAAOpB,GAAKC,CAAO,EAAG,SAAAwB,EAAU,OAAQL,CAAM,CAAA,CAW3D,QACLF,EACAC,EACAC,EACA,CACO,OAAA,KAAK,cAAc,MAAM,QAAQ,CAACD,EAAgBC,CAAK,EAAG,CAC/D,QAASF,EACT,MAAO,KAAK,SAAA,CACb,CAAA,CAGK,iBAAiBR,EAAyB,CAChD,OAAOkB,EAAAA,sBAAsBlB,CAAK,CAAA,CAG5B,cAAcA,EAAiB,SACrC,OAAOmB,GAAAA,EAAAA,gBAAAA,YAAAA,EAAcnB,KAAdmB,YAAAA,EAAuB,KAAK,MAAK,CAE5C","x_google_ignoreList":[0]}
@@ -14982,6 +14982,13 @@ export declare class ERC20PermitHandler {
14982
14982
  } & import('viem').ExactPartial<Pick<import('viem').PublicActions<import('viem').Transport, ViemChain | undefined, import('viem').Account | undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import('viem').WalletActions<ViemChain | undefined, import('viem').Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import('viem').Client<import('viem').Transport, ViemChain | undefined, import('viem').Account | undefined, import('viem').WalletRpcSchema, import('viem').WalletActions<ViemChain | undefined, import('viem').Account | undefined>>) => client) => import('viem').Client<import('viem').Transport, ViemChain | undefined, import('viem').Account | undefined, import('viem').WalletRpcSchema, { [K in keyof client]: client[K]; } & import('viem').WalletActions<ViemChain | undefined, import('viem').Account | undefined>>;
14983
14983
  };
14984
14984
  }, Address>;
14985
+ /**
14986
+ * Get the nonces for the given account.
14987
+ *
14988
+ * @param account Address of the account.
14989
+ * @returns The nonces.
14990
+ */
14991
+ nonces(account: Address): Promise<bigint>;
14985
14992
  /**
14986
14993
  * Process and get permit signature for the given token to perform
14987
14994
  * transactions without calling `approve()`.