@pufferfinance/puffer-sdk 1.22.1 → 1.23.0

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.
Files changed (100) hide show
  1. package/dist/api/puffer-client-helpers.cjs +1 -1
  2. package/dist/api/puffer-client-helpers.js +13 -13
  3. package/dist/api/puffer-client.cjs +1 -1
  4. package/dist/api/puffer-client.cjs.map +1 -1
  5. package/dist/api/puffer-client.d.ts +3 -0
  6. package/dist/api/puffer-client.js +30 -23
  7. package/dist/api/puffer-client.js.map +1 -1
  8. package/dist/{ccip-ChHXXL5d.js → ccip-CiQCCFUl.js} +14 -14
  9. package/dist/{ccip-ChHXXL5d.js.map → ccip-CiQCCFUl.js.map} +1 -1
  10. package/dist/{ccip-oOJ9rRj3.cjs → ccip-DIWF4nDh.cjs} +2 -2
  11. package/dist/{ccip-oOJ9rRj3.cjs.map → ccip-DIWF4nDh.cjs.map} +1 -1
  12. package/dist/chains/constants.cjs +1 -1
  13. package/dist/chains/constants.js +1 -1
  14. package/dist/{constants-LC89CXNv.js → constants-BaHwPdbi.js} +60 -60
  15. package/dist/{constants-LC89CXNv.js.map → constants-BaHwPdbi.js.map} +1 -1
  16. package/dist/{constants-BI6T6ZbJ.cjs → constants-c-vATmlG.cjs} +2 -2
  17. package/dist/{constants-BI6T6ZbJ.cjs.map → constants-c-vATmlG.cjs.map} +1 -1
  18. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.cjs +2 -0
  19. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.cjs.map +1 -0
  20. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.d.ts +513 -0
  21. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.js +310 -0
  22. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.js.map +1 -0
  23. package/dist/contracts/addresses.cjs +1 -1
  24. package/dist/contracts/addresses.js +1 -1
  25. package/dist/contracts/handlers/carrot-staking-handler.cjs +1 -1
  26. package/dist/contracts/handlers/carrot-staking-handler.js +2 -2
  27. package/dist/contracts/handlers/concrete-vault-handler.cjs +1 -1
  28. package/dist/contracts/handlers/concrete-vault-handler.js +2 -2
  29. package/dist/contracts/handlers/distributor-handler.cjs +1 -1
  30. package/dist/contracts/handlers/distributor-handler.js +2 -2
  31. package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
  32. package/dist/contracts/handlers/erc20-permit-handler.js +3 -3
  33. package/dist/contracts/handlers/guardian-module-handler.cjs +1 -1
  34. package/dist/contracts/handlers/guardian-module-handler.js +2 -2
  35. package/dist/contracts/handlers/institutional-access-manager-handler.cjs +2 -0
  36. package/dist/contracts/handlers/institutional-access-manager-handler.cjs.map +1 -0
  37. package/dist/contracts/handlers/institutional-access-manager-handler.d.ts +15374 -0
  38. package/dist/contracts/handlers/institutional-access-manager-handler.js +504 -0
  39. package/dist/contracts/handlers/institutional-access-manager-handler.js.map +1 -0
  40. package/dist/contracts/handlers/institutional-vault-handler.cjs +1 -1
  41. package/dist/contracts/handlers/institutional-vault-handler.cjs.map +1 -1
  42. package/dist/contracts/handlers/institutional-vault-handler.d.ts +1 -1
  43. package/dist/contracts/handlers/institutional-vault-handler.js +3 -3
  44. package/dist/contracts/handlers/institutional-vault-handler.js.map +1 -1
  45. package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
  46. package/dist/contracts/handlers/l1-reward-manager-handler.js +2 -2
  47. package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
  48. package/dist/contracts/handlers/l2-reward-manager-handler.js +2 -2
  49. package/dist/contracts/handlers/mtw-carrot-handler.cjs +1 -1
  50. package/dist/contracts/handlers/mtw-carrot-handler.js +2 -2
  51. package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
  52. package/dist/contracts/handlers/nucleus-accountant-handler.js +1 -1
  53. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
  54. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +2 -2
  55. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
  56. package/dist/contracts/handlers/nucleus-boring-vault-handler.js +2 -2
  57. package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
  58. package/dist/contracts/handlers/nucleus-teller-handler.js +2 -2
  59. package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
  60. package/dist/contracts/handlers/puf-locker-handler.js +2 -2
  61. package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
  62. package/dist/contracts/handlers/puffer-depositor-handler.js +2 -2
  63. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
  64. package/dist/contracts/handlers/puffer-l2-depositor-handler.js +2 -2
  65. package/dist/contracts/handlers/puffer-oracle-v2-handler.cjs +1 -1
  66. package/dist/contracts/handlers/puffer-oracle-v2-handler.js +2 -2
  67. package/dist/contracts/handlers/puffer-protocol-handler.cjs +1 -1
  68. package/dist/contracts/handlers/puffer-protocol-handler.js +2 -2
  69. package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
  70. package/dist/contracts/handlers/puffer-vault-handler.js +2 -2
  71. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
  72. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +2 -2
  73. package/dist/contracts/handlers/validator-ticket-handler.cjs +1 -1
  74. package/dist/contracts/handlers/validator-ticket-handler.js +2 -2
  75. package/dist/contracts/tokens.cjs +1 -1
  76. package/dist/contracts/tokens.js +1 -1
  77. package/dist/contracts/vaults-addresses.cjs +1 -1
  78. package/dist/contracts/vaults-addresses.js +1 -1
  79. package/dist/{createWalletClient-BI9ya5Hq.js → createWalletClient-D74YRepQ.js} +44 -44
  80. package/dist/{createWalletClient-BI9ya5Hq.js.map → createWalletClient-D74YRepQ.js.map} +1 -1
  81. package/dist/{createWalletClient-KYWq_Sx_.cjs → createWalletClient-DKSH6l9_.cjs} +2 -2
  82. package/dist/{createWalletClient-KYWq_Sx_.cjs.map → createWalletClient-DKSH6l9_.cjs.map} +1 -1
  83. package/dist/{getContract-Ck2VtUkY.js → getContract-DGV8J5xI.js} +11 -11
  84. package/dist/{getContract-Ck2VtUkY.js.map → getContract-DGV8J5xI.js.map} +1 -1
  85. package/dist/{getContract-CPwqa1sR.cjs → getContract-RNLlK54b.cjs} +2 -2
  86. package/dist/{getContract-CPwqa1sR.cjs.map → getContract-RNLlK54b.cjs.map} +1 -1
  87. package/dist/main.cjs +1 -1
  88. package/dist/main.js +1 -1
  89. package/dist/{secp256k1-rB-jsNOU.js → secp256k1-B-LxKJrQ.js} +2 -2
  90. package/dist/{secp256k1-rB-jsNOU.js.map → secp256k1-B-LxKJrQ.js.map} +1 -1
  91. package/dist/secp256k1-CC-cv1vD.cjs +2 -0
  92. package/dist/{secp256k1-93KDDbJS.cjs.map → secp256k1-CC-cv1vD.cjs.map} +1 -1
  93. package/dist/utils/version.cjs +1 -1
  94. package/dist/utils/version.js +1 -1
  95. package/dist/{writeContract-DlZ0jYhZ.js → writeContract-BU3yK-Xj.js} +513 -512
  96. package/dist/{writeContract-DlZ0jYhZ.js.map → writeContract-BU3yK-Xj.js.map} +1 -1
  97. package/dist/{writeContract-DPtg3nGu.cjs → writeContract-CKqv1dsa.cjs} +17 -17
  98. package/dist/{writeContract-DPtg3nGu.cjs.map → writeContract-CKqv1dsa.cjs.map} +1 -1
  99. package/package.json +1 -1
  100. package/dist/secp256k1-93KDDbJS.cjs +0 -2
@@ -0,0 +1,504 @@
1
+ var l = Object.defineProperty;
2
+ var d = (s, t, e) => t in s ? l(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var i = (s, t, e) => d(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { InstitutionalAccessManager as h } from "../abis/mainnet/InstitutionalAccessManager.js";
5
+ import { V as u, s as g, b as C, h as m, t as b, a as R } from "../../constants-BaHwPdbi.js";
6
+ import { InvalidContractAddressError as w } from "../../errors/validation-errors.js";
7
+ import { g as p } from "../../getContract-DGV8J5xI.js";
8
+ import { b as I } from "../../writeContract-BU3yK-Xj.js";
9
+ class O {
10
+ /**
11
+ * Create the handler for the Institutional `AccessManager` contract
12
+ * exposing methods to interact with the contract.
13
+ *
14
+ * @param chain Chain to use for the client.
15
+ * @param walletClient The wallet client to use for wallet
16
+ * interactions.
17
+ * @param publicClient The public client to use for public
18
+ * interactions.
19
+ */
20
+ constructor(t, e, r) {
21
+ i(this, "viemChain");
22
+ i(this, "address");
23
+ i(this, "selectorsMap", {
24
+ "0x6056b271": "completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],bool[])",
25
+ "0x29d85402": "customExternalCall(address,bytes,uint256)",
26
+ "0x6e553f65": "deposit(uint256,address)",
27
+ "0x2d2da806": "depositETH(address)",
28
+ "0xba087652": "redeem(uint256,address,address)",
29
+ "0xb460af94": "withdraw(uint256,address,address)",
30
+ "0xa9059cbb": "transfer(address,uint256)",
31
+ "0x23b872dd": "transferFrom(address,address,uint256)",
32
+ "0x94bf804d": "mint(uint256,address)",
33
+ "0x61c17990": "startRestakingValidators(bytes[],bytes[],bytes32[])",
34
+ "0x3e5e60c6": "startNonRestakingValidators(bytes[],bytes[],bytes32[])",
35
+ "0x852aa33d": "queueWithdrawals(uint256)",
36
+ "0xad0cdf3e": "setValidatorsETH(uint128,uint128)"
37
+ });
38
+ this.walletClient = e, this.publicClient = r, this.viemChain = u[t];
39
+ }
40
+ /**
41
+ * Set the address of the contract for this handler.
42
+ *
43
+ * @param address The address of the contract.
44
+ * @returns The handler.
45
+ */
46
+ withAddress(t) {
47
+ return this.address = t, this;
48
+ }
49
+ /**
50
+ * Get the address of the contract for this handler.
51
+ *
52
+ * @returns The address of the contract.
53
+ */
54
+ getAddress() {
55
+ return this.address;
56
+ }
57
+ /**
58
+ * Get the contract. This is a method because the typings are complex
59
+ * and lost when trying to make it a member.
60
+ *
61
+ * @returns The viem contract.
62
+ */
63
+ getContract() {
64
+ if (!this.address)
65
+ throw new w(
66
+ "No address specified for the contract",
67
+ {
68
+ fixMessage: "Set the contract address in the handler by using the setAddress method"
69
+ }
70
+ );
71
+ const t = h, e = { public: this.publicClient, wallet: this.walletClient };
72
+ return p({
73
+ address: this.address,
74
+ abi: t,
75
+ client: e
76
+ });
77
+ }
78
+ /**
79
+ * Get the admin role.
80
+ *
81
+ * @returns The admin role.
82
+ */
83
+ getAdminRole() {
84
+ return this.getContract().read.ADMIN_ROLE();
85
+ }
86
+ /**
87
+ * Get the public role.
88
+ *
89
+ * @returns The public role.
90
+ */
91
+ getPublicRole() {
92
+ return this.getContract().read.PUBLIC_ROLE();
93
+ }
94
+ /**
95
+ * Check if a caller can call a target with a specific selector.
96
+ *
97
+ * @param caller The caller address.
98
+ * @param target The target contract address.
99
+ * @param selector The function selector.
100
+ * @returns Whether the caller can call the target immediately and the delay.
101
+ */
102
+ async canCall(t, e, r) {
103
+ const [a, n] = await this.getContract().read.canCall([
104
+ t,
105
+ e,
106
+ r
107
+ ]);
108
+ return { canCall: a, canCallDelay: n };
109
+ }
110
+ /**
111
+ * Cancel a scheduled operation.
112
+ *
113
+ * @param caller The caller address.
114
+ * @param target The target contract address.
115
+ * @param data The operation data.
116
+ * @returns The nonce.
117
+ */
118
+ cancel(t, e, r) {
119
+ return this.getContract().write.cancel([t, e, r], {
120
+ account: this.walletClient.account,
121
+ chain: this.viemChain
122
+ });
123
+ }
124
+ /**
125
+ * Execute a target with data.
126
+ *
127
+ * @param target The target contract address.
128
+ * @param data The data to execute.
129
+ * @param value The value to send.
130
+ * @returns The nonce.
131
+ */
132
+ execute(t, e, r) {
133
+ return this.getContract().write.execute([t, e], {
134
+ account: this.walletClient.account,
135
+ chain: this.viemChain,
136
+ value: r
137
+ });
138
+ }
139
+ /**
140
+ * Get access information for a role and account.
141
+ *
142
+ * @param roleIdOrLabel The role ID or role label generated with
143
+ * `labelToRoleId`.
144
+ * @param account The account address.
145
+ * @returns The access information.
146
+ */
147
+ async getAccess(t, e) {
148
+ const r = this.processRoleIdOrLabel(t), [a, n, o, c] = await this.getContract().read.getAccess([r, e]);
149
+ return { since: a, currentDelay: n, pendingDelay: o, effect: c };
150
+ }
151
+ /**
152
+ * Get the nonce for an operation ID.
153
+ *
154
+ * @param id The operation ID.
155
+ * @returns The nonce.
156
+ */
157
+ getNonce(t) {
158
+ return this.getContract().read.getNonce([t]);
159
+ }
160
+ /**
161
+ * Get the admin role for a role ID.
162
+ *
163
+ * @param roleIdOrLabel The role ID or role label generated with
164
+ * `labelToRoleId`.
165
+ * @returns The admin role ID.
166
+ */
167
+ getRoleAdmin(t) {
168
+ const e = this.processRoleIdOrLabel(t);
169
+ return this.getContract().read.getRoleAdmin([e]);
170
+ }
171
+ /**
172
+ * Get the grant delay for a role ID.
173
+ *
174
+ * @param roleIdOrLabel The role ID or role label generated with
175
+ * `labelToRoleId`.
176
+ * @returns The grant delay.
177
+ */
178
+ getRoleGrantDelay(t) {
179
+ const e = this.processRoleIdOrLabel(t);
180
+ return this.getContract().read.getRoleGrantDelay([e]);
181
+ }
182
+ /**
183
+ * Get the guardian role for a role ID.
184
+ *
185
+ * @param roleIdOrLabel The role ID or role label generated with
186
+ * `labelToRoleId`.
187
+ * @returns The guardian role ID.
188
+ */
189
+ getRoleGuardian(t) {
190
+ const e = this.processRoleIdOrLabel(t);
191
+ return this.getContract().read.getRoleGuardian([e]);
192
+ }
193
+ /**
194
+ * Get the schedule for an operation ID.
195
+ *
196
+ * @param id The operation ID.
197
+ * @returns The schedule time.
198
+ */
199
+ getSchedule(t) {
200
+ return this.getContract().read.getSchedule([t]);
201
+ }
202
+ /**
203
+ * Get the admin delay for a target.
204
+ *
205
+ * @param target The target contract address.
206
+ * @returns The admin delay.
207
+ */
208
+ getTargetAdminDelay(t) {
209
+ return this.getContract().read.getTargetAdminDelay([t]);
210
+ }
211
+ /**
212
+ * Get the function role for a target and selector.
213
+ *
214
+ * @param target The target contract address.
215
+ * @param selector The function selector.
216
+ * @returns The role ID.
217
+ */
218
+ getTargetFunctionRole(t, e) {
219
+ return this.getContract().read.getTargetFunctionRole([t, e]);
220
+ }
221
+ /**
222
+ * Grant a role to an account.
223
+ *
224
+ * @param roleIdOrLabel The role ID or role label generated with
225
+ * `labelToRoleId`.
226
+ * @param account The account address.
227
+ * @param executionDelay The execution delay.
228
+ */
229
+ grantRole(t, e, r) {
230
+ const a = this.processRoleIdOrLabel(t);
231
+ return this.getContract().write.grantRole(
232
+ [a, e, r],
233
+ {
234
+ account: this.walletClient.account,
235
+ chain: this.viemChain
236
+ }
237
+ );
238
+ }
239
+ /**
240
+ * Check if an account has a role.
241
+ *
242
+ * @param roleIdOrLabel The role ID or role label generated with
243
+ * `labelToRoleId`.
244
+ * @param account The account address.
245
+ * @returns Whether the account has the role and the execution delay.
246
+ */
247
+ async hasRole(t, e) {
248
+ const r = this.processRoleIdOrLabel(t), [a, n] = await this.getContract().read.hasRole([
249
+ r,
250
+ e
251
+ ]);
252
+ return { isMember: a, executionDelay: n };
253
+ }
254
+ /**
255
+ * Hash an operation.
256
+ *
257
+ * @param caller The caller address.
258
+ * @param target The target address.
259
+ * @param data The operation data.
260
+ * @returns The operation hash.
261
+ */
262
+ hashOperation(t, e, r) {
263
+ return this.getContract().read.hashOperation([t, e, r]);
264
+ }
265
+ /**
266
+ * Check if a target is closed.
267
+ *
268
+ * @param target The target contract address.
269
+ * @returns Whether the target is closed.
270
+ */
271
+ isTargetClosed(t) {
272
+ return this.getContract().read.isTargetClosed([t]);
273
+ }
274
+ /**
275
+ * Label a role.
276
+ *
277
+ * @param roleIdOrLabel The role ID or role label generated with
278
+ * `labelToRoleId`.
279
+ * @param label The label.
280
+ * @returns The transaction hash.
281
+ */
282
+ labelRole(t, e) {
283
+ const r = this.processRoleIdOrLabel(t);
284
+ return this.getContract().write.labelRole([r, e], {
285
+ account: this.walletClient.account,
286
+ chain: this.viemChain
287
+ });
288
+ }
289
+ /**
290
+ * Get the minimum setback.
291
+ *
292
+ * @returns The minimum setback.
293
+ */
294
+ getMinSetback() {
295
+ return this.getContract().read.minSetback();
296
+ }
297
+ /**
298
+ * Execute multiple calls.
299
+ *
300
+ * @param data Array of call data.
301
+ * @returns Array of results.
302
+ */
303
+ multicall(t) {
304
+ return this.getContract().write.multicall([t], {
305
+ account: this.walletClient.account,
306
+ chain: this.viemChain
307
+ });
308
+ }
309
+ /**
310
+ * Renounce a role.
311
+ *
312
+ * @param roleIdOrLabel The role ID or role label generated with
313
+ * `labelToRoleId`.
314
+ * @param callerConfirmation The caller confirmation address.
315
+ */
316
+ renounceRole(t, e) {
317
+ const r = this.processRoleIdOrLabel(t);
318
+ return this.getContract().write.renounceRole([r, e], {
319
+ account: this.walletClient.account,
320
+ chain: this.viemChain
321
+ });
322
+ }
323
+ /**
324
+ * Revoke a role from an account.
325
+ *
326
+ * @param roleIdOrLabel The role ID or role label generated with
327
+ * `labelToRoleId`.
328
+ * @param account The account address.
329
+ */
330
+ revokeRole(t, e) {
331
+ const r = this.processRoleIdOrLabel(t);
332
+ return this.getContract().write.revokeRole([r, e], {
333
+ account: this.walletClient.account,
334
+ chain: this.viemChain
335
+ });
336
+ }
337
+ /**
338
+ * Schedule an operation.
339
+ *
340
+ * @param target The target contract address.
341
+ * @param data The operation data.
342
+ * @param when The execution time.
343
+ * @returns The operation ID and nonce.
344
+ */
345
+ schedule(t, e, r) {
346
+ return this.getContract().write.schedule([t, e, r], {
347
+ account: this.walletClient.account,
348
+ chain: this.viemChain
349
+ });
350
+ }
351
+ /**
352
+ * Set the grant delay for a role.
353
+ *
354
+ * @param roleIdOrLabel The role ID or role label generated with
355
+ * `labelToRoleId`.
356
+ * @param newDelay The new delay.
357
+ */
358
+ setGrantDelay(t, e) {
359
+ const r = this.processRoleIdOrLabel(t);
360
+ return this.getContract().write.setGrantDelay([r, e], {
361
+ account: this.walletClient.account,
362
+ chain: this.viemChain
363
+ });
364
+ }
365
+ /**
366
+ * Set the admin role for a role.
367
+ *
368
+ * @param roleIdOrLabel The role ID or role label generated with
369
+ * `labelToRoleId`.
370
+ * @param admin The admin role ID.
371
+ */
372
+ setRoleAdmin(t, e) {
373
+ const r = this.processRoleIdOrLabel(t);
374
+ return this.getContract().write.setRoleAdmin([r, e], {
375
+ account: this.walletClient.account,
376
+ chain: this.viemChain
377
+ });
378
+ }
379
+ /**
380
+ * Set the guardian role for a role.
381
+ *
382
+ * @param roleIdOrLabel The role ID or role label generated with
383
+ * `labelToRoleId`.
384
+ * @param guardian The guardian role ID.
385
+ */
386
+ setRoleGuardian(t, e) {
387
+ const r = this.processRoleIdOrLabel(t);
388
+ return this.getContract().write.setRoleGuardian([r, e], {
389
+ account: this.walletClient.account,
390
+ chain: this.viemChain
391
+ });
392
+ }
393
+ /**
394
+ * Set the admin delay for a target.
395
+ *
396
+ * @param target The target contract address.
397
+ * @param newDelay The new delay.
398
+ */
399
+ setTargetAdminDelay(t, e) {
400
+ return this.getContract().write.setTargetAdminDelay([t, e], {
401
+ account: this.walletClient.account,
402
+ chain: this.viemChain
403
+ });
404
+ }
405
+ /**
406
+ * Set whether a target is closed.
407
+ *
408
+ * @param target The target contract address.
409
+ * @param closed Whether the target is closed.
410
+ */
411
+ setTargetClosed(t, e) {
412
+ return this.getContract().write.setTargetClosed([t, e], {
413
+ account: this.walletClient.account,
414
+ chain: this.viemChain
415
+ });
416
+ }
417
+ /**
418
+ * Set the function role for a target.
419
+ *
420
+ * @param target The target address.
421
+ * @param selectors Array of function selectors.
422
+ * @param roleIdOrLabel The role ID or role label generated with
423
+ * `labelToRoleId`.
424
+ */
425
+ setTargetFunctionRole(t, e, r) {
426
+ const a = this.processRoleIdOrLabel(r);
427
+ return this.getContract().write.setTargetFunctionRole(
428
+ [t, e, a],
429
+ {
430
+ account: this.walletClient.account,
431
+ chain: this.viemChain
432
+ }
433
+ );
434
+ }
435
+ /**
436
+ * Update the authority for a target.
437
+ *
438
+ * @param target The target address.
439
+ * @param newAuthority The new authority address.
440
+ */
441
+ updateAuthority(t, e) {
442
+ return this.getContract().write.updateAuthority([t, e], {
443
+ account: this.walletClient.account,
444
+ chain: this.viemChain
445
+ });
446
+ }
447
+ /**************************************************/
448
+ /****************** Helper Methods ****************/
449
+ /**************************************************/
450
+ /**
451
+ * Convert a label to a role ID. Useful if you want to create a roleId
452
+ * from a label which can then be used to get the label back using
453
+ * `roleIdToLabel`.
454
+ *
455
+ * @param label The label to convert.
456
+ * @returns The role ID.
457
+ */
458
+ labelToRoleId(t) {
459
+ const r = g(t).reverse(), a = C(r);
460
+ return m(a);
461
+ }
462
+ /**
463
+ * Convert a role ID to a label. Only useful if the `roleId` was
464
+ * created using `labelToRoleId`.
465
+ *
466
+ * @param roleId The role ID to convert.
467
+ * @returns The label.
468
+ */
469
+ roleIdToLabel(t) {
470
+ const e = b(t), r = R(e).reverse();
471
+ return I(r);
472
+ }
473
+ /**
474
+ * Get the selector for a function name.
475
+ *
476
+ * @param functionName The function name.
477
+ * @returns The selector.
478
+ */
479
+ getSelectorFromFunctionName(t) {
480
+ var e;
481
+ return (e = Object.entries(this.selectorsMap).find(
482
+ ([, r]) => r.includes(t)
483
+ )) == null ? void 0 : e[0];
484
+ }
485
+ /**
486
+ * Get the function name for a selector.
487
+ *
488
+ * @param selector The selector.
489
+ * @returns The function name.
490
+ */
491
+ getFunctionNameFromSelector(t) {
492
+ var e;
493
+ return (e = Object.entries(this.selectorsMap).find(
494
+ ([r]) => r === t
495
+ )) == null ? void 0 : e[1];
496
+ }
497
+ processRoleIdOrLabel(t) {
498
+ return typeof t == "string" ? this.labelToRoleId(t) : t;
499
+ }
500
+ }
501
+ export {
502
+ O as InstitutionalAccessManagerHandler
503
+ };
504
+ //# sourceMappingURL=institutional-access-manager-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"institutional-access-manager-handler.js","sources":["../../../lib/contracts/handlers/institutional-access-manager-handler.ts"],"sourcesContent":["import {\n Chain as ViemChain,\n WalletClient,\n PublicClient,\n getContract,\n GetContractReturnType,\n Address,\n Hex,\n stringToBytes,\n bytesToHex,\n hexToBigInt,\n toHex,\n toBytes,\n bytesToString,\n} from 'viem';\nimport { InstitutionalAccessManager } from '../abis/mainnet/InstitutionalAccessManager';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { InvalidContractAddressError } from '../../errors/validation-errors';\n\n/**\n * Handler for the `InstitutionalAccessManager` contract exposing methods to\n * interact with the contract.\n */\nexport class InstitutionalAccessManagerHandler {\n private viemChain: ViemChain;\n private address?: Address;\n private selectorsMap: Record<Hex, string> = {\n '0x6056b271':\n 'completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],bool[])',\n '0x29d85402': 'customExternalCall(address,bytes,uint256)',\n '0x6e553f65': 'deposit(uint256,address)',\n '0x2d2da806': 'depositETH(address)',\n '0xba087652': 'redeem(uint256,address,address)',\n '0xb460af94': 'withdraw(uint256,address,address)',\n '0xa9059cbb': 'transfer(address,uint256)',\n '0x23b872dd': 'transferFrom(address,address,uint256)',\n '0x94bf804d': 'mint(uint256,address)',\n '0x61c17990': 'startRestakingValidators(bytes[],bytes[],bytes32[])',\n '0x3e5e60c6': 'startNonRestakingValidators(bytes[],bytes[],bytes32[])',\n '0x852aa33d': 'queueWithdrawals(uint256)',\n '0xad0cdf3e': 'setValidatorsETH(uint128,uint128)',\n };\n\n /**\n * Create the handler for the Institutional `AccessManager` contract\n * exposing methods to interact with the contract.\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 chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Set the address of the contract for this handler.\n *\n * @param address The address of the contract.\n * @returns The handler.\n */\n public withAddress(address: Address) {\n this.address = address;\n\n return this;\n }\n\n /**\n * Get the address of the contract for this handler.\n *\n * @returns The address of the contract.\n */\n public getAddress() {\n return this.address;\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 if (!this.address) {\n throw new InvalidContractAddressError(\n `No address specified for the contract`,\n {\n fixMessage: `Set the contract address in the handler by using the setAddress method`,\n },\n );\n }\n\n const abi = InstitutionalAccessManager;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({\n address: this.address,\n abi,\n client,\n }) as GetContractReturnType<typeof abi, typeof client, Address>;\n }\n\n /**\n * Get the admin role.\n *\n * @returns The admin role.\n */\n public getAdminRole() {\n return this.getContract().read.ADMIN_ROLE();\n }\n\n /**\n * Get the public role.\n *\n * @returns The public role.\n */\n public getPublicRole() {\n return this.getContract().read.PUBLIC_ROLE();\n }\n\n /**\n * Check if a caller can call a target with a specific selector.\n *\n * @param caller The caller address.\n * @param target The target contract address.\n * @param selector The function selector.\n * @returns Whether the caller can call the target immediately and the delay.\n */\n public async canCall(caller: Address, target: Address, selector: Hex) {\n const [immediate, delay] = await this.getContract().read.canCall([\n caller,\n target,\n selector,\n ]);\n\n return { canCall: immediate, canCallDelay: delay };\n }\n\n /**\n * Cancel a scheduled operation.\n *\n * @param caller The caller address.\n * @param target The target contract address.\n * @param data The operation data.\n * @returns The nonce.\n */\n public cancel(caller: Address, target: Address, data: Hex) {\n return this.getContract().write.cancel([caller, target, data], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Execute a target with data.\n *\n * @param target The target contract address.\n * @param data The data to execute.\n * @param value The value to send.\n * @returns The nonce.\n */\n public execute(target: Address, data: Hex, value?: bigint) {\n return this.getContract().write.execute([target, data], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n value,\n });\n }\n\n /**\n * Get access information for a role and account.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param account The account address.\n * @returns The access information.\n */\n public async getAccess(roleIdOrLabel: bigint | string, account: Address) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n const [since, currentDelay, pendingDelay, effect] =\n await this.getContract().read.getAccess([roleId, account]);\n\n return { since, currentDelay, pendingDelay, effect };\n }\n\n /**\n * Get the nonce for an operation ID.\n *\n * @param id The operation ID.\n * @returns The nonce.\n */\n public getNonce(id: Hex) {\n return this.getContract().read.getNonce([id]);\n }\n\n /**\n * Get the admin role for a role ID.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @returns The admin role ID.\n */\n public getRoleAdmin(roleIdOrLabel: bigint | string) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n return this.getContract().read.getRoleAdmin([roleId]);\n }\n\n /**\n * Get the grant delay for a role ID.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @returns The grant delay.\n */\n public getRoleGrantDelay(roleIdOrLabel: bigint | string) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n return this.getContract().read.getRoleGrantDelay([roleId]);\n }\n\n /**\n * Get the guardian role for a role ID.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @returns The guardian role ID.\n */\n public getRoleGuardian(roleIdOrLabel: bigint | string) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n return this.getContract().read.getRoleGuardian([roleId]);\n }\n\n /**\n * Get the schedule for an operation ID.\n *\n * @param id The operation ID.\n * @returns The schedule time.\n */\n public getSchedule(id: Hex) {\n return this.getContract().read.getSchedule([id]);\n }\n\n /**\n * Get the admin delay for a target.\n *\n * @param target The target contract address.\n * @returns The admin delay.\n */\n public getTargetAdminDelay(target: Address) {\n return this.getContract().read.getTargetAdminDelay([target]);\n }\n\n /**\n * Get the function role for a target and selector.\n *\n * @param target The target contract address.\n * @param selector The function selector.\n * @returns The role ID.\n */\n public getTargetFunctionRole(target: Address, selector: Hex) {\n return this.getContract().read.getTargetFunctionRole([target, selector]);\n }\n\n /**\n * Grant a role to an account.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param account The account address.\n * @param executionDelay The execution delay.\n */\n public grantRole(\n roleIdOrLabel: bigint | string,\n account: Address,\n executionDelay: number,\n ) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.grantRole(\n [roleId, account, executionDelay],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Check if an account has a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param account The account address.\n * @returns Whether the account has the role and the execution delay.\n */\n public async hasRole(roleIdOrLabel: bigint | string, account: Address) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n const [isMember, executionDelay] = await this.getContract().read.hasRole([\n roleId,\n account,\n ]);\n\n return { isMember, executionDelay };\n }\n\n /**\n * Hash an operation.\n *\n * @param caller The caller address.\n * @param target The target address.\n * @param data The operation data.\n * @returns The operation hash.\n */\n public hashOperation(caller: Address, target: Address, data: Hex) {\n return this.getContract().read.hashOperation([caller, target, data]);\n }\n\n /**\n * Check if a target is closed.\n *\n * @param target The target contract address.\n * @returns Whether the target is closed.\n */\n public isTargetClosed(target: Address) {\n return this.getContract().read.isTargetClosed([target]);\n }\n\n /**\n * Label a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param label The label.\n * @returns The transaction hash.\n */\n public labelRole(roleIdOrLabel: bigint | string, label: string) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.labelRole([roleId, label], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the minimum setback.\n *\n * @returns The minimum setback.\n */\n public getMinSetback() {\n return this.getContract().read.minSetback();\n }\n\n /**\n * Execute multiple calls.\n *\n * @param data Array of call data.\n * @returns Array of results.\n */\n public multicall(data: Hex[]) {\n return this.getContract().write.multicall([data], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Renounce a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param callerConfirmation The caller confirmation address.\n */\n public renounceRole(\n roleIdOrLabel: bigint | string,\n callerConfirmation: Address,\n ) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.renounceRole([roleId, callerConfirmation], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Revoke a role from an account.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param account The account address.\n */\n public revokeRole(roleIdOrLabel: bigint | string, account: Address) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.revokeRole([roleId, account], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Schedule an operation.\n *\n * @param target The target contract address.\n * @param data The operation data.\n * @param when The execution time.\n * @returns The operation ID and nonce.\n */\n public schedule(target: Address, data: Hex, when: number) {\n return this.getContract().write.schedule([target, data, when], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the grant delay for a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param newDelay The new delay.\n */\n public setGrantDelay(roleIdOrLabel: bigint | string, newDelay: number) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.setGrantDelay([roleId, newDelay], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the admin role for a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param admin The admin role ID.\n */\n public setRoleAdmin(roleIdOrLabel: bigint | string, admin: bigint) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.setRoleAdmin([roleId, admin], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the guardian role for a role.\n *\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n * @param guardian The guardian role ID.\n */\n public setRoleGuardian(roleIdOrLabel: bigint | string, guardian: bigint) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.setRoleGuardian([roleId, guardian], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the admin delay for a target.\n *\n * @param target The target contract address.\n * @param newDelay The new delay.\n */\n public setTargetAdminDelay(target: Address, newDelay: number) {\n return this.getContract().write.setTargetAdminDelay([target, newDelay], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set whether a target is closed.\n *\n * @param target The target contract address.\n * @param closed Whether the target is closed.\n */\n public setTargetClosed(target: Address, closed: boolean) {\n return this.getContract().write.setTargetClosed([target, closed], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the function role for a target.\n *\n * @param target The target address.\n * @param selectors Array of function selectors.\n * @param roleIdOrLabel The role ID or role label generated with\n * `labelToRoleId`.\n */\n public setTargetFunctionRole(\n target: Address,\n selectors: Hex[],\n roleIdOrLabel: bigint | string,\n ) {\n const roleId = this.processRoleIdOrLabel(roleIdOrLabel);\n\n return this.getContract().write.setTargetFunctionRole(\n [target, selectors, roleId],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Update the authority for a target.\n *\n * @param target The target address.\n * @param newAuthority The new authority address.\n */\n public updateAuthority(target: Address, newAuthority: Address) {\n return this.getContract().write.updateAuthority([target, newAuthority], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**************************************************/\n /****************** Helper Methods ****************/\n /**************************************************/\n\n /**\n * Convert a label to a role ID. Useful if you want to create a roleId\n * from a label which can then be used to get the label back using\n * `roleIdToLabel`.\n *\n * @param label The label to convert.\n * @returns The role ID.\n */\n public labelToRoleId(label: string) {\n const bytes = stringToBytes(label);\n // Reverse the bytes to make it little-endian.\n const leBytes = bytes.reverse();\n const hex = bytesToHex(leBytes);\n\n return hexToBigInt(hex);\n }\n\n /**\n * Convert a role ID to a label. Only useful if the `roleId` was\n * created using `labelToRoleId`.\n *\n * @param roleId The role ID to convert.\n * @returns The label.\n */\n public roleIdToLabel(roleId: bigint) {\n const hex = toHex(roleId);\n // Reverse the bytes to make it little-endian.\n const leBytes = toBytes(hex).reverse();\n\n return bytesToString(leBytes);\n }\n\n /**\n * Get the selector for a function name.\n *\n * @param functionName The function name.\n * @returns The selector.\n */\n public getSelectorFromFunctionName(functionName: string) {\n return Object.entries(this.selectorsMap).find(([, value]) =>\n value.includes(functionName),\n )?.[0];\n }\n\n /**\n * Get the function name for a selector.\n *\n * @param selector The selector.\n * @returns The function name.\n */\n public getFunctionNameFromSelector(selector: Hex) {\n return Object.entries(this.selectorsMap).find(\n ([key]) => key === selector,\n )?.[1];\n }\n\n private processRoleIdOrLabel(roleIdOrLabel: bigint | string) {\n if (typeof roleIdOrLabel === 'string') {\n return this.labelToRoleId(roleIdOrLabel);\n }\n\n return roleIdOrLabel;\n }\n}\n"],"names":["InstitutionalAccessManagerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","InvalidContractAddressError","abi","InstitutionalAccessManager","client","getContract","caller","target","selector","immediate","delay","data","value","roleIdOrLabel","account","roleId","since","currentDelay","pendingDelay","effect","id","executionDelay","isMember","label","callerConfirmation","when","newDelay","admin","guardian","closed","selectors","newAuthority","leBytes","stringToBytes","hex","bytesToHex","hexToBigInt","toHex","toBytes","bytesToString","functionName","_a","key"],"mappings":";;;;;;;;AAuBO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B7C,YACEC,GACQC,GACAC,GACR;AAjCM,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA,sBAAoC;AAAA,MAC1C,cACE;AAAA,MACF,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAAc;AAAA,MACd,cAA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MG,EAAMtB,CAAM,GAElBiB,IAAUM,EAAQJ,CAAG,EAAE,QAAQ;AAErC,WAAOK,EAAcP,CAAO;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvB,4BAA4BQ,GAAsB;;AACvD,YAAOC,IAAA,OAAO,QAAQ,KAAK,YAAY,EAAE;AAAA,MAAK,CAAC,GAAG7B,CAAK,MACrDA,EAAM,SAAS4B,CAAY;AAAA,UADtB,gBAAAC,EAEH;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,4BAA4BjC,GAAe;;AAChD,YAAOiC,IAAA,OAAO,QAAQ,KAAK,YAAY,EAAE;AAAA,MACvC,CAAC,CAACC,CAAG,MAAMA,MAAQlC;AAAA,UADd,gBAAAiC,EAEH;AAAA,EAAC;AAAA,EAGC,qBAAqB5B,GAAgC;AACvD,WAAA,OAAOA,KAAkB,WACpB,KAAK,cAAcA,CAAa,IAGlCA;AAAA,EAAA;AAEX;"}
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var s=(a,t,e)=>t in a?n(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var i=(a,t,e)=>s(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../abis/mainnet/InstitutionalVault.cjs"),c=require("../../constants-BI6T6ZbJ.cjs"),h=require("../../errors/validation-errors.cjs"),l=require("../../getContract-CPwqa1sR.cjs");class d{constructor(t,e,r){i(this,"viemChain");i(this,"address");this.walletClient=e,this.publicClient=r,this.viemChain=c.VIEM_CHAINS[t]}setAddress(t){return this.address=t,this}getAddress(){return this.address}getContract(){if(!this.address)throw new h.InvalidContractAddressError("No address specified for the contract",{fixMessage:"Set the contract address in the handler by using the setAddress method"});const t=o.InstitutionalVault,e={public:this.publicClient,wallet:this.walletClient};return l.getContract({address:this.address,abi:t,client:e})}getBeaconDepositContract(){return this.getContract().read.BEACON_DEPOSIT_CONTRACT()}getEigenDelegationManager(){return this.getContract().read.EIGEN_DELEGATION_MANAGER()}getEigenPodManager(){return this.getContract().read.EIGEN_POD_MANAGER()}getEigenPod(){return this.getContract().read.getEigenPod()}allowance(t,e){return this.getContract().read.allowance([t,e])}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}asset(){return this.getContract().read.asset()}authority(){return this.getContract().read.authority()}balanceOf(t){return this.getContract().read.balanceOf([t])}decimals(){return this.getContract().read.decimals()}completeQueuedWithdrawals(t,e){return this.getContract().write.completeQueuedWithdrawals([t,e],{account:this.walletClient.account,chain:this.viemChain})}convertToAssets(t){return this.getContract().read.convertToAssets([t])}convertToShares(t){return this.getContract().read.convertToShares([t])}deposit(t,e){return this.getContract().write.deposit([t,e],{account:this.walletClient.account,chain:this.viemChain})}depositETH(t,e){return this.getContract().write.depositETH([t],{account:this.walletClient.account,chain:this.viemChain,value:e})}getNonRestakedValidatorETH(){return this.getContract().read.getNonRestakedValidatorETH()}getRestakedValidatorETH(){return this.getContract().read.getRestakedValidatorETH()}getWithdrawalCredentials(){return this.getContract().read.getWithdrawalCredentials()}maxDeposit(t){return this.getContract().read.maxDeposit([t])}maxMint(t){return this.getContract().read.maxMint([t])}maxRedeem(t){return this.getContract().read.maxRedeem([t])}maxWithdraw(t){return this.getContract().read.maxWithdraw([t])}mint(t,e){return this.getContract().write.mint([t,e],{account:this.walletClient.account,chain:this.viemChain})}name(){return this.getContract().read.name()}previewDeposit(t){return this.getContract().read.previewDeposit([t])}previewMint(t){return this.getContract().read.previewMint([t])}previewRedeem(t){return this.getContract().read.previewRedeem([t])}previewWithdraw(t){return this.getContract().read.previewWithdraw([t])}queueWithdrawals(t){return this.getContract().write.queueWithdrawals([t],{account:this.walletClient.account,chain:this.viemChain})}redeem(t,e,r){return this.getContract().write.redeem([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}setValidatorsETH(t,e){return this.getContract().write.setValidatorsETH([t,e],{account:this.walletClient.account,chain:this.viemChain})}startNonRestakingValidators(t,e,r){return this.getContract().write.startNonRestakingValidators([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}startRestakingValidators(t,e,r){return this.getContract().write.startRestakingValidators([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}withdraw(t,e,r){return this.getContract().write.withdraw([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}symbol(){return this.getContract().read.symbol()}totalAssets(){return this.getContract().read.totalAssets()}totalSupply(){return this.getContract().read.totalSupply()}transfer(t,e){return this.getContract().write.transfer([t,e],{account:this.walletClient.account,chain:this.viemChain})}transferFrom(t,e,r){return this.getContract().write.transferFrom([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}}exports.InstitutionalVaultHandler=d;
1
+ "use strict";var n=Object.defineProperty;var s=(a,t,e)=>t in a?n(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var i=(a,t,e)=>s(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../abis/mainnet/InstitutionalVault.cjs"),c=require("../../constants-c-vATmlG.cjs"),h=require("../../errors/validation-errors.cjs"),l=require("../../getContract-RNLlK54b.cjs");class d{constructor(t,e,r){i(this,"viemChain");i(this,"address");this.walletClient=e,this.publicClient=r,this.viemChain=c.VIEM_CHAINS[t]}withAddress(t){return this.address=t,this}getAddress(){return this.address}getContract(){if(!this.address)throw new h.InvalidContractAddressError("No address specified for the contract",{fixMessage:"Set the contract address in the handler by using the setAddress method"});const t=o.InstitutionalVault,e={public:this.publicClient,wallet:this.walletClient};return l.getContract({address:this.address,abi:t,client:e})}getBeaconDepositContract(){return this.getContract().read.BEACON_DEPOSIT_CONTRACT()}getEigenDelegationManager(){return this.getContract().read.EIGEN_DELEGATION_MANAGER()}getEigenPodManager(){return this.getContract().read.EIGEN_POD_MANAGER()}getEigenPod(){return this.getContract().read.getEigenPod()}allowance(t,e){return this.getContract().read.allowance([t,e])}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}asset(){return this.getContract().read.asset()}authority(){return this.getContract().read.authority()}balanceOf(t){return this.getContract().read.balanceOf([t])}decimals(){return this.getContract().read.decimals()}completeQueuedWithdrawals(t,e){return this.getContract().write.completeQueuedWithdrawals([t,e],{account:this.walletClient.account,chain:this.viemChain})}convertToAssets(t){return this.getContract().read.convertToAssets([t])}convertToShares(t){return this.getContract().read.convertToShares([t])}deposit(t,e){return this.getContract().write.deposit([t,e],{account:this.walletClient.account,chain:this.viemChain})}depositETH(t,e){return this.getContract().write.depositETH([t],{account:this.walletClient.account,chain:this.viemChain,value:e})}getNonRestakedValidatorETH(){return this.getContract().read.getNonRestakedValidatorETH()}getRestakedValidatorETH(){return this.getContract().read.getRestakedValidatorETH()}getWithdrawalCredentials(){return this.getContract().read.getWithdrawalCredentials()}maxDeposit(t){return this.getContract().read.maxDeposit([t])}maxMint(t){return this.getContract().read.maxMint([t])}maxRedeem(t){return this.getContract().read.maxRedeem([t])}maxWithdraw(t){return this.getContract().read.maxWithdraw([t])}mint(t,e){return this.getContract().write.mint([t,e],{account:this.walletClient.account,chain:this.viemChain})}name(){return this.getContract().read.name()}previewDeposit(t){return this.getContract().read.previewDeposit([t])}previewMint(t){return this.getContract().read.previewMint([t])}previewRedeem(t){return this.getContract().read.previewRedeem([t])}previewWithdraw(t){return this.getContract().read.previewWithdraw([t])}queueWithdrawals(t){return this.getContract().write.queueWithdrawals([t],{account:this.walletClient.account,chain:this.viemChain})}redeem(t,e,r){return this.getContract().write.redeem([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}setValidatorsETH(t,e){return this.getContract().write.setValidatorsETH([t,e],{account:this.walletClient.account,chain:this.viemChain})}startNonRestakingValidators(t,e,r){return this.getContract().write.startNonRestakingValidators([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}startRestakingValidators(t,e,r){return this.getContract().write.startRestakingValidators([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}withdraw(t,e,r){return this.getContract().write.withdraw([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}symbol(){return this.getContract().read.symbol()}totalAssets(){return this.getContract().read.totalAssets()}totalSupply(){return this.getContract().read.totalSupply()}transfer(t,e){return this.getContract().write.transfer([t,e],{account:this.walletClient.account,chain:this.viemChain})}transferFrom(t,e,r){return this.getContract().write.transferFrom([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}}exports.InstitutionalVaultHandler=d;
2
2
  //# sourceMappingURL=institutional-vault-handler.cjs.map