@pufferfinance/puffer-sdk 1.28.1 → 1.28.3

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 (258) hide show
  1. package/dist/api/puffer-client-helpers.cjs +1 -1
  2. package/dist/api/puffer-client-helpers.cjs.map +1 -1
  3. package/dist/api/puffer-client-helpers.js +7 -7
  4. package/dist/api/puffer-client-helpers.js.map +1 -1
  5. package/dist/api/puffer-client.cjs +1 -1
  6. package/dist/api/puffer-client.cjs.map +1 -1
  7. package/dist/api/puffer-client.js +119 -122
  8. package/dist/api/puffer-client.js.map +1 -1
  9. package/dist/ccip-78YM988s.js +150 -0
  10. package/dist/{ccip-C76-YhQK.js.map → ccip-78YM988s.js.map} +1 -1
  11. package/dist/ccip-LIGR3N1A.cjs +2 -0
  12. package/dist/{ccip-CEodLZ4s.cjs.map → ccip-LIGR3N1A.cjs.map} +1 -1
  13. package/dist/chains/constants.cjs +1 -1
  14. package/dist/chains/constants.js +1 -1
  15. package/dist/constants-6kuRTsbU.cjs +9 -0
  16. package/dist/{constants-CxSgz27h.cjs.map → constants-6kuRTsbU.cjs.map} +1 -1
  17. package/dist/{constants-C9YZ6Ewc.js → constants-CuIEh_ZS.js} +605 -656
  18. package/dist/{constants-C9YZ6Ewc.js.map → constants-CuIEh_ZS.js.map} +1 -1
  19. package/dist/contracts/abis/mainnet/Accountant.cjs.map +1 -1
  20. package/dist/contracts/abis/mainnet/Accountant.js.map +1 -1
  21. package/dist/contracts/abis/mainnet/AtomicQueue.cjs.map +1 -1
  22. package/dist/contracts/abis/mainnet/AtomicQueue.js.map +1 -1
  23. package/dist/contracts/abis/mainnet/BoringVault.cjs.map +1 -1
  24. package/dist/contracts/abis/mainnet/BoringVault.js.map +1 -1
  25. package/dist/contracts/abis/mainnet/CarrotStaker.cjs.map +1 -1
  26. package/dist/contracts/abis/mainnet/CarrotStaker.js.map +1 -1
  27. package/dist/contracts/abis/mainnet/CarrotVesting.cjs +1 -1
  28. package/dist/contracts/abis/mainnet/CarrotVesting.cjs.map +1 -1
  29. package/dist/contracts/abis/mainnet/CarrotVesting.d.ts +84 -92
  30. package/dist/contracts/abis/mainnet/CarrotVesting.js +56 -62
  31. package/dist/contracts/abis/mainnet/CarrotVesting.js.map +1 -1
  32. package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.cjs.map +1 -1
  33. package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.js.map +1 -1
  34. package/dist/contracts/abis/mainnet/Distributor.cjs.map +1 -1
  35. package/dist/contracts/abis/mainnet/Distributor.js.map +1 -1
  36. package/dist/contracts/abis/mainnet/ERC20Permit.cjs.map +1 -1
  37. package/dist/contracts/abis/mainnet/ERC20Permit.js.map +1 -1
  38. package/dist/contracts/abis/mainnet/GaugeRegistry.cjs.map +1 -1
  39. package/dist/contracts/abis/mainnet/GaugeRegistry.js.map +1 -1
  40. package/dist/contracts/abis/mainnet/GuardianModule.cjs.map +1 -1
  41. package/dist/contracts/abis/mainnet/GuardianModule.js.map +1 -1
  42. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.cjs.map +1 -1
  43. package/dist/contracts/abis/mainnet/InstitutionalAccessManager.js.map +1 -1
  44. package/dist/contracts/abis/mainnet/InstitutionalVault.cjs.map +1 -1
  45. package/dist/contracts/abis/mainnet/InstitutionalVault.js.map +1 -1
  46. package/dist/contracts/abis/mainnet/L1RewardManager.cjs.map +1 -1
  47. package/dist/contracts/abis/mainnet/L1RewardManager.js.map +1 -1
  48. package/dist/contracts/abis/mainnet/L2RewardManager.cjs.map +1 -1
  49. package/dist/contracts/abis/mainnet/L2RewardManager.js.map +1 -1
  50. package/dist/contracts/abis/mainnet/LagoonVault.cjs.map +1 -1
  51. package/dist/contracts/abis/mainnet/LagoonVault.js.map +1 -1
  52. package/dist/contracts/abis/mainnet/PufLocker.cjs.map +1 -1
  53. package/dist/contracts/abis/mainnet/PufLocker.js.map +1 -1
  54. package/dist/contracts/abis/mainnet/PufferDepositor.cjs.map +1 -1
  55. package/dist/contracts/abis/mainnet/PufferDepositor.js.map +1 -1
  56. package/dist/contracts/abis/mainnet/PufferL2Depositor.cjs.map +1 -1
  57. package/dist/contracts/abis/mainnet/PufferL2Depositor.js.map +1 -1
  58. package/dist/contracts/abis/mainnet/PufferOracleV2.cjs.map +1 -1
  59. package/dist/contracts/abis/mainnet/PufferOracleV2.js.map +1 -1
  60. package/dist/contracts/abis/mainnet/PufferProtocol.cjs.map +1 -1
  61. package/dist/contracts/abis/mainnet/PufferProtocol.js.map +1 -1
  62. package/dist/contracts/abis/mainnet/PufferVaultV5.cjs.map +1 -1
  63. package/dist/contracts/abis/mainnet/PufferVaultV5.js.map +1 -1
  64. package/dist/contracts/abis/mainnet/PufferWithdrawalManager.cjs.map +1 -1
  65. package/dist/contracts/abis/mainnet/PufferWithdrawalManager.js.map +1 -1
  66. package/dist/contracts/abis/mainnet/Teller.cjs.map +1 -1
  67. package/dist/contracts/abis/mainnet/Teller.js.map +1 -1
  68. package/dist/contracts/abis/mainnet/ValidatorTicket.cjs.map +1 -1
  69. package/dist/contracts/abis/mainnet/ValidatorTicket.js.map +1 -1
  70. package/dist/contracts/abis/mainnet/mtwCARROT.cjs.map +1 -1
  71. package/dist/contracts/abis/mainnet/mtwCARROT.js.map +1 -1
  72. package/dist/contracts/abis/mainnet/vlPUFFER.cjs.map +1 -1
  73. package/dist/contracts/abis/mainnet/vlPUFFER.js.map +1 -1
  74. package/dist/contracts/addresses.cjs +1 -1
  75. package/dist/contracts/addresses.cjs.map +1 -1
  76. package/dist/contracts/addresses.js +5 -5
  77. package/dist/contracts/addresses.js.map +1 -1
  78. package/dist/contracts/handlers/carrot-staking-handler.cjs +1 -1
  79. package/dist/contracts/handlers/carrot-staking-handler.cjs.map +1 -1
  80. package/dist/contracts/handlers/carrot-staking-handler.d.ts +96 -6599
  81. package/dist/contracts/handlers/carrot-staking-handler.js +13 -16
  82. package/dist/contracts/handlers/carrot-staking-handler.js.map +1 -1
  83. package/dist/contracts/handlers/carrot-vesting-handler.cjs +1 -1
  84. package/dist/contracts/handlers/carrot-vesting-handler.cjs.map +1 -1
  85. package/dist/contracts/handlers/carrot-vesting-handler.d.ts +102 -6605
  86. package/dist/contracts/handlers/carrot-vesting-handler.js +25 -39
  87. package/dist/contracts/handlers/carrot-vesting-handler.js.map +1 -1
  88. package/dist/contracts/handlers/concrete-vault-handler.cjs +1 -1
  89. package/dist/contracts/handlers/concrete-vault-handler.cjs.map +1 -1
  90. package/dist/contracts/handlers/concrete-vault-handler.d.ts +96 -6599
  91. package/dist/contracts/handlers/concrete-vault-handler.js +15 -18
  92. package/dist/contracts/handlers/concrete-vault-handler.js.map +1 -1
  93. package/dist/contracts/handlers/distributor-handler.cjs +1 -1
  94. package/dist/contracts/handlers/distributor-handler.cjs.map +1 -1
  95. package/dist/contracts/handlers/distributor-handler.d.ts +96 -6599
  96. package/dist/contracts/handlers/distributor-handler.js +15 -18
  97. package/dist/contracts/handlers/distributor-handler.js.map +1 -1
  98. package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
  99. package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
  100. package/dist/contracts/handlers/erc20-permit-handler.d.ts +96 -6599
  101. package/dist/contracts/handlers/erc20-permit-handler.js +34 -38
  102. package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
  103. package/dist/contracts/handlers/gauge-registry-handler.cjs +1 -1
  104. package/dist/contracts/handlers/gauge-registry-handler.cjs.map +1 -1
  105. package/dist/contracts/handlers/gauge-registry-handler.d.ts +96 -6599
  106. package/dist/contracts/handlers/gauge-registry-handler.js +11 -14
  107. package/dist/contracts/handlers/gauge-registry-handler.js.map +1 -1
  108. package/dist/contracts/handlers/guardian-module-handler.cjs +1 -1
  109. package/dist/contracts/handlers/guardian-module-handler.cjs.map +1 -1
  110. package/dist/contracts/handlers/guardian-module-handler.d.ts +96 -6599
  111. package/dist/contracts/handlers/guardian-module-handler.js +11 -14
  112. package/dist/contracts/handlers/guardian-module-handler.js.map +1 -1
  113. package/dist/contracts/handlers/institutional-access-manager-handler.cjs +1 -1
  114. package/dist/contracts/handlers/institutional-access-manager-handler.cjs.map +1 -1
  115. package/dist/contracts/handlers/institutional-access-manager-handler.d.ts +96 -6599
  116. package/dist/contracts/handlers/institutional-access-manager-handler.js +45 -50
  117. package/dist/contracts/handlers/institutional-access-manager-handler.js.map +1 -1
  118. package/dist/contracts/handlers/institutional-vault-handler.cjs +1 -1
  119. package/dist/contracts/handlers/institutional-vault-handler.cjs.map +1 -1
  120. package/dist/contracts/handlers/institutional-vault-handler.d.ts +96 -6599
  121. package/dist/contracts/handlers/institutional-vault-handler.js +16 -19
  122. package/dist/contracts/handlers/institutional-vault-handler.js.map +1 -1
  123. package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
  124. package/dist/contracts/handlers/l1-reward-manager-handler.cjs.map +1 -1
  125. package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +96 -6599
  126. package/dist/contracts/handlers/l1-reward-manager-handler.js +14 -17
  127. package/dist/contracts/handlers/l1-reward-manager-handler.js.map +1 -1
  128. package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
  129. package/dist/contracts/handlers/l2-reward-manager-handler.cjs.map +1 -1
  130. package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +96 -6599
  131. package/dist/contracts/handlers/l2-reward-manager-handler.js +13 -16
  132. package/dist/contracts/handlers/l2-reward-manager-handler.js.map +1 -1
  133. package/dist/contracts/handlers/lagoon-vault-handler.cjs +1 -1
  134. package/dist/contracts/handlers/lagoon-vault-handler.cjs.map +1 -1
  135. package/dist/contracts/handlers/lagoon-vault-handler.d.ts +96 -6599
  136. package/dist/contracts/handlers/lagoon-vault-handler.js +11 -14
  137. package/dist/contracts/handlers/lagoon-vault-handler.js.map +1 -1
  138. package/dist/contracts/handlers/mtw-carrot-handler.cjs +1 -1
  139. package/dist/contracts/handlers/mtw-carrot-handler.cjs.map +1 -1
  140. package/dist/contracts/handlers/mtw-carrot-handler.d.ts +96 -6599
  141. package/dist/contracts/handlers/mtw-carrot-handler.js +12 -15
  142. package/dist/contracts/handlers/mtw-carrot-handler.js.map +1 -1
  143. package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
  144. package/dist/contracts/handlers/nucleus-accountant-handler.cjs.map +1 -1
  145. package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +96 -6599
  146. package/dist/contracts/handlers/nucleus-accountant-handler.js +13 -16
  147. package/dist/contracts/handlers/nucleus-accountant-handler.js.map +1 -1
  148. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
  149. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs.map +1 -1
  150. package/dist/contracts/handlers/nucleus-atomic-queue-handler.d.ts +96 -6599
  151. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +14 -17
  152. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js.map +1 -1
  153. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
  154. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs.map +1 -1
  155. package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +96 -6599
  156. package/dist/contracts/handlers/nucleus-boring-vault-handler.js +18 -21
  157. package/dist/contracts/handlers/nucleus-boring-vault-handler.js.map +1 -1
  158. package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
  159. package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
  160. package/dist/contracts/handlers/nucleus-teller-handler.d.ts +96 -6599
  161. package/dist/contracts/handlers/nucleus-teller-handler.js +35 -38
  162. package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
  163. package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
  164. package/dist/contracts/handlers/puf-locker-handler.cjs.map +1 -1
  165. package/dist/contracts/handlers/puf-locker-handler.d.ts +96 -6599
  166. package/dist/contracts/handlers/puf-locker-handler.js +51 -54
  167. package/dist/contracts/handlers/puf-locker-handler.js.map +1 -1
  168. package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
  169. package/dist/contracts/handlers/puffer-depositor-handler.cjs.map +1 -1
  170. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +96 -6599
  171. package/dist/contracts/handlers/puffer-depositor-handler.js +28 -31
  172. package/dist/contracts/handlers/puffer-depositor-handler.js.map +1 -1
  173. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
  174. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs.map +1 -1
  175. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +96 -6599
  176. package/dist/contracts/handlers/puffer-l2-depositor-handler.js +42 -45
  177. package/dist/contracts/handlers/puffer-l2-depositor-handler.js.map +1 -1
  178. package/dist/contracts/handlers/puffer-oracle-v2-handler.cjs +1 -1
  179. package/dist/contracts/handlers/puffer-oracle-v2-handler.cjs.map +1 -1
  180. package/dist/contracts/handlers/puffer-oracle-v2-handler.d.ts +96 -6599
  181. package/dist/contracts/handlers/puffer-oracle-v2-handler.js +13 -16
  182. package/dist/contracts/handlers/puffer-oracle-v2-handler.js.map +1 -1
  183. package/dist/contracts/handlers/puffer-protocol-handler.cjs +1 -1
  184. package/dist/contracts/handlers/puffer-protocol-handler.cjs.map +1 -1
  185. package/dist/contracts/handlers/puffer-protocol-handler.d.ts +96 -6599
  186. package/dist/contracts/handlers/puffer-protocol-handler.js +12 -15
  187. package/dist/contracts/handlers/puffer-protocol-handler.js.map +1 -1
  188. package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
  189. package/dist/contracts/handlers/puffer-vault-handler.cjs.map +1 -1
  190. package/dist/contracts/handlers/puffer-vault-handler.d.ts +96 -6599
  191. package/dist/contracts/handlers/puffer-vault-handler.js +12 -15
  192. package/dist/contracts/handlers/puffer-vault-handler.js.map +1 -1
  193. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
  194. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs.map +1 -1
  195. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +96 -6599
  196. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +15 -18
  197. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js.map +1 -1
  198. package/dist/contracts/handlers/validator-ticket-handler.cjs +1 -1
  199. package/dist/contracts/handlers/validator-ticket-handler.cjs.map +1 -1
  200. package/dist/contracts/handlers/validator-ticket-handler.d.ts +96 -6599
  201. package/dist/contracts/handlers/validator-ticket-handler.js +12 -15
  202. package/dist/contracts/handlers/validator-ticket-handler.js.map +1 -1
  203. package/dist/contracts/handlers/vl-puffer-handler.cjs +1 -1
  204. package/dist/contracts/handlers/vl-puffer-handler.cjs.map +1 -1
  205. package/dist/contracts/handlers/vl-puffer-handler.d.ts +96 -6599
  206. package/dist/contracts/handlers/vl-puffer-handler.js +19 -22
  207. package/dist/contracts/handlers/vl-puffer-handler.js.map +1 -1
  208. package/dist/contracts/tokens.cjs +1 -1
  209. package/dist/contracts/tokens.cjs.map +1 -1
  210. package/dist/contracts/tokens.js +1 -1
  211. package/dist/contracts/tokens.js.map +1 -1
  212. package/dist/contracts/vaults-addresses.cjs +1 -1
  213. package/dist/contracts/vaults-addresses.cjs.map +1 -1
  214. package/dist/contracts/vaults-addresses.js +1 -1
  215. package/dist/contracts/vaults-addresses.js.map +1 -1
  216. package/dist/errors/base-error.cjs.map +1 -1
  217. package/dist/errors/base-error.js.map +1 -1
  218. package/dist/{getContract-DUA3M2pm.cjs → getContract-D4_SEfqa.cjs} +2 -2
  219. package/dist/{getContract-DUA3M2pm.cjs.map → getContract-D4_SEfqa.cjs.map} +1 -1
  220. package/dist/{getContract-DEPNMZxg.js → getContract-DQN7VDBo.js} +2 -2
  221. package/dist/{getContract-DEPNMZxg.js.map → getContract-DQN7VDBo.js.map} +1 -1
  222. package/dist/http-CajzXkt4.js +4005 -0
  223. package/dist/http-CajzXkt4.js.map +1 -0
  224. package/dist/http-qhIDc8Dn.cjs +5 -0
  225. package/dist/http-qhIDc8Dn.cjs.map +1 -0
  226. package/dist/{localBatchGatewayRequest-CKLnLqib.cjs → localBatchGatewayRequest-C7zYTS2c.cjs} +2 -2
  227. package/dist/{localBatchGatewayRequest-CKLnLqib.cjs.map → localBatchGatewayRequest-C7zYTS2c.cjs.map} +1 -1
  228. package/dist/{localBatchGatewayRequest-C0QtijkB.js → localBatchGatewayRequest-DtOvBmA9.js} +3 -3
  229. package/dist/{localBatchGatewayRequest-C0QtijkB.js.map → localBatchGatewayRequest-DtOvBmA9.js.map} +1 -1
  230. package/dist/main.cjs +1 -1
  231. package/dist/main.js +1 -1
  232. package/dist/secp256k1-CMP_u7qb.cjs +2 -0
  233. package/dist/secp256k1-CMP_u7qb.cjs.map +1 -0
  234. package/dist/secp256k1-DCMgMsfV.js +1297 -0
  235. package/dist/secp256k1-DCMgMsfV.js.map +1 -0
  236. package/dist/utils/time.cjs.map +1 -1
  237. package/dist/utils/time.js.map +1 -1
  238. package/dist/utils/version.cjs +1 -1
  239. package/dist/utils/version.js +1 -1
  240. package/dist/writeContract-BnmmOPwy.cjs +36 -0
  241. package/dist/writeContract-BnmmOPwy.cjs.map +1 -0
  242. package/dist/{writeContract-DkC9wV5p.js → writeContract-DYAfDrRz.js} +1788 -1712
  243. package/dist/writeContract-DYAfDrRz.js.map +1 -0
  244. package/package.json +8 -8
  245. package/dist/ccip-C76-YhQK.js +0 -152
  246. package/dist/ccip-CEodLZ4s.cjs +0 -2
  247. package/dist/constants-CxSgz27h.cjs +0 -9
  248. package/dist/createWalletClient-Cct6ojqI.cjs +0 -5
  249. package/dist/createWalletClient-Cct6ojqI.cjs.map +0 -1
  250. package/dist/createWalletClient-DAuQCrLq.js +0 -3262
  251. package/dist/createWalletClient-DAuQCrLq.js.map +0 -1
  252. package/dist/secp256k1-ClOw2ksU.js +0 -1291
  253. package/dist/secp256k1-ClOw2ksU.js.map +0 -1
  254. package/dist/secp256k1-YUzyTLhP.cjs +0 -2
  255. package/dist/secp256k1-YUzyTLhP.cjs.map +0 -1
  256. package/dist/writeContract-BfAYISeL.cjs +0 -36
  257. package/dist/writeContract-BfAYISeL.cjs.map +0 -1
  258. package/dist/writeContract-DkC9wV5p.js.map +0 -1
@@ -1,12 +1,9 @@
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-C9YZ6Ewc.js";
6
- import { InvalidContractAddressError as w } from "../../errors/validation-errors.js";
7
- import { g as p } from "../../getContract-DEPNMZxg.js";
8
- import { b as I } from "../../writeContract-DkC9wV5p.js";
9
- class O {
1
+ import { InstitutionalAccessManager as o } from "../abis/mainnet/InstitutionalAccessManager.js";
2
+ import { V as c, s as l, b as d, h, t as u, a as g } from "../../constants-CuIEh_ZS.js";
3
+ import { InvalidContractAddressError as C } from "../../errors/validation-errors.js";
4
+ import { g as m } from "../../getContract-DQN7VDBo.js";
5
+ import { b } from "../../writeContract-DYAfDrRz.js";
6
+ class v {
10
7
  /**
11
8
  * Create the handler for the Institutional `AccessManager` contract
12
9
  * exposing methods to interact with the contract.
@@ -18,25 +15,25 @@ class O {
18
15
  * interactions.
19
16
  */
20
17
  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
- }
18
+ this.walletClient = e, this.publicClient = r, this.viemChain = c[t];
19
+ }
20
+ viemChain;
21
+ address;
22
+ selectorsMap = {
23
+ "0x6056b271": "completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],bool[])",
24
+ "0x29d85402": "customExternalCall(address,bytes,uint256)",
25
+ "0x6e553f65": "deposit(uint256,address)",
26
+ "0x2d2da806": "depositETH(address)",
27
+ "0xba087652": "redeem(uint256,address,address)",
28
+ "0xb460af94": "withdraw(uint256,address,address)",
29
+ "0xa9059cbb": "transfer(address,uint256)",
30
+ "0x23b872dd": "transferFrom(address,address,uint256)",
31
+ "0x94bf804d": "mint(uint256,address)",
32
+ "0x61c17990": "startRestakingValidators(bytes[],bytes[],bytes32[])",
33
+ "0x3e5e60c6": "startNonRestakingValidators(bytes[],bytes[],bytes32[])",
34
+ "0x852aa33d": "queueWithdrawals(uint256)",
35
+ "0xad0cdf3e": "setValidatorsETH(uint128,uint128)"
36
+ };
40
37
  /**
41
38
  * Set the address of the contract for this handler.
42
39
  *
@@ -62,14 +59,14 @@ class O {
62
59
  */
63
60
  getContract() {
64
61
  if (!this.address)
65
- throw new w(
62
+ throw new C(
66
63
  "No address specified for the contract",
67
64
  {
68
65
  fixMessage: "Set the contract address in the handler by using the setAddress method"
69
66
  }
70
67
  );
71
- const t = h, e = { public: this.publicClient, wallet: this.walletClient };
72
- return p({
68
+ const t = o, e = { public: this.publicClient, wallet: this.walletClient };
69
+ return m({
73
70
  address: this.address,
74
71
  abi: t,
75
72
  client: e
@@ -100,12 +97,12 @@ class O {
100
97
  * @returns Whether the caller can call the target immediately and the delay.
101
98
  */
102
99
  async canCall(t, e, r) {
103
- const [a, n] = await this.getContract().read.canCall([
100
+ const [a, s] = await this.getContract().read.canCall([
104
101
  t,
105
102
  e,
106
103
  r
107
104
  ]);
108
- return { canCall: a, canCallDelay: n };
105
+ return { canCall: a, canCallDelay: s };
109
106
  }
110
107
  /**
111
108
  * Cancel a scheduled operation.
@@ -145,8 +142,8 @@ class O {
145
142
  * @returns The access information.
146
143
  */
147
144
  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 };
145
+ const r = this.processRoleIdOrLabel(t), [a, s, n, i] = await this.getContract().read.getAccess([r, e]);
146
+ return { since: a, currentDelay: s, pendingDelay: n, effect: i };
150
147
  }
151
148
  /**
152
149
  * Get the nonce for an operation ID.
@@ -245,11 +242,11 @@ class O {
245
242
  * @returns Whether the account has the role and the execution delay.
246
243
  */
247
244
  async hasRole(t, e) {
248
- const r = this.processRoleIdOrLabel(t), [a, n] = await this.getContract().read.hasRole([
245
+ const r = this.processRoleIdOrLabel(t), [a, s] = await this.getContract().read.hasRole([
249
246
  r,
250
247
  e
251
248
  ]);
252
- return { isMember: a, executionDelay: n };
249
+ return { isMember: a, executionDelay: s };
253
250
  }
254
251
  /**
255
252
  * Hash an operation.
@@ -456,8 +453,8 @@ class O {
456
453
  * @returns The role ID.
457
454
  */
458
455
  labelToRoleId(t) {
459
- const r = g(t).reverse(), a = C(r);
460
- return m(a);
456
+ const r = l(t).reverse(), a = d(r);
457
+ return h(a);
461
458
  }
462
459
  /**
463
460
  * Convert a role ID to a label. Only useful if the `roleId` was
@@ -467,8 +464,8 @@ class O {
467
464
  * @returns The label.
468
465
  */
469
466
  roleIdToLabel(t) {
470
- const e = b(t), r = R(e).reverse();
471
- return I(r);
467
+ const e = u(t), r = g(e).reverse();
468
+ return b(r);
472
469
  }
473
470
  /**
474
471
  * Get the selector for a function name.
@@ -477,10 +474,9 @@ class O {
477
474
  * @returns The selector.
478
475
  */
479
476
  getSelectorFromFunctionName(t) {
480
- var e;
481
- return (e = Object.entries(this.selectorsMap).find(
482
- ([, r]) => r.includes(t)
483
- )) == null ? void 0 : e[0];
477
+ return Object.entries(this.selectorsMap).find(
478
+ ([, e]) => e.includes(t)
479
+ )?.[0];
484
480
  }
485
481
  /**
486
482
  * Get the function name for a selector.
@@ -489,16 +485,15 @@ class O {
489
485
  * @returns The function name.
490
486
  */
491
487
  getFunctionNameFromSelector(t) {
492
- var e;
493
- return (e = Object.entries(this.selectorsMap).find(
494
- ([r]) => r === t
495
- )) == null ? void 0 : e[1];
488
+ return Object.entries(this.selectorsMap).find(
489
+ ([e]) => e === t
490
+ )?.[1];
496
491
  }
497
492
  processRoleIdOrLabel(t) {
498
493
  return typeof t == "string" ? this.labelToRoleId(t) : t;
499
494
  }
500
495
  }
501
496
  export {
502
- O as InstitutionalAccessManagerHandler
497
+ v as InstitutionalAccessManagerHandler
503
498
  };
504
499
  //# sourceMappingURL=institutional-access-manager-handler.js.map
@@ -1 +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,cAAc;AAAA,IAChB;AAcU,SAAA,eAAAF,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7B,YAAYK,GAAkB;AACnC,gBAAK,UAAUA,GAER;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQF,aAAa;AAClB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAA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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
+ {"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","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","key"],"mappings":";;;;;AAuBO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B7C,YACEC,GACQC,GACAC,GACR;AAFQ,SAAA,eAAAD,GACA,KAAA,eAAAC,GAER,KAAK,YAAYC,EAAYH,CAAK;AAAA,EACpC;AAAA,EAnCQ;AAAA,EACA;AAAA,EACA,eAAoC;AAAA,IAC1C,cACE;AAAA,IACF,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2BT,YAAYI,GAAkB;AACnC,gBAAK,UAAUA,GAER;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,aAAa;AAClB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,cAAc;AACnB,QAAI,CAAC,KAAK;AACR,YAAM,IAAIC;AAAA,QACR;AAAA,QACA;AAAA,UACE,YAAY;AAAA,QAAA;AAAA,MACd;AAIJ,UAAMC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAA;AAEzD,WAAOC,EAAY;AAAA,MACjB,SAAS,KAAK;AAAA,MACd,KAAAH;AAAA,MACA,QAAAE;AAAA,IAAA,CACD;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,eAAe;AACpB,WAAO,KAAK,cAAc,KAAK,WAAA;AAAA,EACjC;AAAA;AAAA;AAAA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AAuB;AAC7D,WAAO,KAAK,cAAc,MAAM,gBAAgB,CAACxB,GAAQwB,CAAY,GAAG;AAAA,MACtE,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcO,cAAcR,GAAe;AAGlC,UAAMS,IAFQC,EAAcV,CAAK,EAEX,QAAA,GAChBW,IAAMC,EAAWH,CAAO;AAE9B,WAAOI,EAAYF,CAAG;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,cAAcnB,GAAgB;AACnC,UAAMmB,IAAMG,EAAMtB,CAAM,GAElBiB,IAAUM,EAAQJ,CAAG,EAAE,QAAA;AAE7B,WAAOK,EAAcP,CAAO;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,4BAA4BQ,GAAsB;AACvD,WAAO,OAAO,QAAQ,KAAK,YAAY,EAAE;AAAA,MAAK,CAAC,GAAG5B,CAAK,MACrDA,EAAM,SAAS4B,CAAY;AAAA,IAAA,IACzB,CAAC;AAAA,EACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,4BAA4BhC,GAAe;AAChD,WAAO,OAAO,QAAQ,KAAK,YAAY,EAAE;AAAA,MACvC,CAAC,CAACiC,CAAG,MAAMA,MAAQjC;AAAA,IAAA,IACjB,CAAC;AAAA,EACP;AAAA,EAEQ,qBAAqBK,GAAgC;AAC3D,WAAI,OAAOA,KAAkB,WACpB,KAAK,cAAcA,CAAa,IAGlCA;AAAA,EACT;AACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var o=(r,t,e)=>t in r?s(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var n=(r,t,e)=>o(r,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../abis/mainnet/InstitutionalVault.cjs"),h=require("../../constants-CxSgz27h.cjs"),l=require("../../errors/validation-errors.cjs"),u=require("../../getContract-DUA3M2pm.cjs");class d{constructor(t,e,a){n(this,"viemChain");n(this,"address");this.walletClient=e,this.publicClient=a,this.viemChain=h.VIEM_CHAINS[t]}withAddress(t){return this.address=t,this}getAddress(){return this.address}getContract(){if(!this.address)throw new l.InvalidContractAddressError("No address specified for the contract",{fixMessage:"Set the contract address in the handler by using the setAddress method"});const t=c.InstitutionalVault,e={public:this.publicClient,wallet:this.walletClient};return u.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,a){return this.getContract().write.redeem([t,e,a],{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,a,i){return this.getContract().write.startNonRestakingValidators([t,e,a,i],{account:this.walletClient.account,chain:this.viemChain})}startRestakingValidators(t,e,a,i){return this.getContract().write.startRestakingValidators([t,e,a,i],{account:this.walletClient.account,chain:this.viemChain})}withdraw(t,e,a){return this.getContract().write.withdraw([t,e,a],{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,a){return this.getContract().write.transferFrom([t,e,a],{account:this.walletClient.account,chain:this.viemChain})}customExternalCall(t,e,a){return this.getContract().write.customExternalCall([t,e,a],{account:this.walletClient.account,chain:this.viemChain})}requestEigenPodConsolidation(t,e,a){return this.getContract().write.requestEigenPodConsolidation([t,e],{account:this.walletClient.account,chain:this.viemChain,value:a})}}exports.InstitutionalVaultHandler=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../abis/mainnet/InstitutionalVault.cjs"),n=require("../../constants-6kuRTsbU.cjs"),s=require("../../errors/validation-errors.cjs"),o=require("../../getContract-D4_SEfqa.cjs");class c{constructor(t,e,a){this.walletClient=e,this.publicClient=a,this.viemChain=n.VIEM_CHAINS[t]}viemChain;address;withAddress(t){return this.address=t,this}getAddress(){return this.address}getContract(){if(!this.address)throw new s.InvalidContractAddressError("No address specified for the contract",{fixMessage:"Set the contract address in the handler by using the setAddress method"});const t=i.InstitutionalVault,e={public:this.publicClient,wallet:this.walletClient};return o.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,a){return this.getContract().write.redeem([t,e,a],{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,a,r){return this.getContract().write.startNonRestakingValidators([t,e,a,r],{account:this.walletClient.account,chain:this.viemChain})}startRestakingValidators(t,e,a,r){return this.getContract().write.startRestakingValidators([t,e,a,r],{account:this.walletClient.account,chain:this.viemChain})}withdraw(t,e,a){return this.getContract().write.withdraw([t,e,a],{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,a){return this.getContract().write.transferFrom([t,e,a],{account:this.walletClient.account,chain:this.viemChain})}customExternalCall(t,e,a){return this.getContract().write.customExternalCall([t,e,a],{account:this.walletClient.account,chain:this.viemChain})}requestEigenPodConsolidation(t,e,a){return this.getContract().write.requestEigenPodConsolidation([t,e],{account:this.walletClient.account,chain:this.viemChain,value:a})}}exports.InstitutionalVaultHandler=c;
2
2
  //# sourceMappingURL=institutional-vault-handler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"institutional-vault-handler.cjs","sources":["../../../lib/contracts/handlers/institutional-vault-handler.ts"],"sourcesContent":["import {\n Chain as ViemChain,\n WalletClient,\n PublicClient,\n getContract,\n GetContractReturnType,\n Address,\n Hex,\n} from 'viem';\nimport { InstitutionalVault } from '../abis/mainnet/InstitutionalVault';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { InvalidContractAddressError } from '../../errors/validation-errors';\n\nexport type QueuedWithdrawal = {\n staker: Address;\n delegatedTo: Address;\n withdrawer: Address;\n nonce: bigint;\n startBlock: number;\n strategies: Address[];\n scaledShares: bigint[];\n};\n\n/**\n * Handler for the `InstitutionalVault` contract exposing methods to\n * interact with the contract.\n */\nexport class InstitutionalVaultHandler {\n private viemChain: ViemChain;\n private address?: Address;\n\n /**\n * Create the handler for the `InstitutionalVault` contract exposing\n * 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 = InstitutionalVault;\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 beacon deposit contract address.\n *\n * @returns The beacon deposit contract address.\n */\n public getBeaconDepositContract() {\n return this.getContract().read.BEACON_DEPOSIT_CONTRACT();\n }\n\n /**\n * Get the eigen delegation manager contract address.\n *\n * @returns The eigen delegation manager.\n */\n public getEigenDelegationManager() {\n return this.getContract().read.EIGEN_DELEGATION_MANAGER();\n }\n\n /**\n * Get the eigen pod manager contract address.\n *\n * @returns The eigen pod manager contract address.\n */\n public getEigenPodManager() {\n return this.getContract().read.EIGEN_POD_MANAGER();\n }\n\n /**\n * Get the eigen pod address.\n *\n * @returns The eigen pod address.\n */\n public getEigenPod() {\n return this.getContract().read.getEigenPod();\n }\n\n /**\n * Get the allowance for the spender to spend the owner's tokens.\n *\n * @param owner The owner of the tokens.\n * @param spender The spender of the tokens.\n * @returns The allowance of the owner for the spender.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Approve the spender to spend the owner's tokens.\n *\n * @param spender The spender of the tokens.\n * @param amount The amount of tokens to approve.\n */\n public approve(spender: Address, amount: bigint) {\n return this.getContract().write.approve([spender, amount], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the asset of the vault.\n *\n * @returns The asset of the vault.\n */\n public asset() {\n return this.getContract().read.asset();\n }\n\n /**\n * Get the authority of the vault.\n *\n * @returns The authority of the vault.\n */\n public authority() {\n return this.getContract().read.authority();\n }\n\n /**\n * Get the balance of the address.\n *\n * @param address The address to get the balance of.\n * @returns The balance of the address.\n */\n public balanceOf(address: Address) {\n return this.getContract().read.balanceOf([address]);\n }\n\n /**\n * Get the number of decimals of the token.\n *\n * @returns The number of decimals of the token.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Complete the queued withdrawals.\n *\n * @param withdrawals The withdrawals to complete.\n * @param receiveAsTokens Whether to receive the assets as tokens.\n */\n public completeQueuedWithdrawals(\n withdrawals: QueuedWithdrawal[],\n receiveAsTokens: boolean[],\n ) {\n return this.getContract().write.completeQueuedWithdrawals(\n [withdrawals, receiveAsTokens],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Convert shares to assets.\n *\n * @param shares The number of shares to convert.\n * @returns The number of assets.\n */\n public convertToAssets(shares: bigint) {\n return this.getContract().read.convertToAssets([shares]);\n }\n\n /**\n * Convert assets to shares.\n *\n * @param assets The number of assets to convert.\n * @returns The number of shares.\n */\n public convertToShares(assets: bigint) {\n return this.getContract().read.convertToShares([assets]);\n }\n\n /**\n * Deposit assets into the vault.\n *\n * @param assets The number of assets to deposit.\n * @param receiver The address to receive the shares.\n */\n public deposit(assets: bigint, receiver: Address) {\n return this.getContract().write.deposit([assets, receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Deposit ETH into the vault.\n *\n * @param receiver The address to receive the shares.\n * @param value The amount of ETH to deposit.\n */\n public depositETH(receiver: Address, value: bigint) {\n return this.getContract().write.depositETH([receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n value,\n });\n }\n\n /**\n * Get the non-restaked validator ETH.\n *\n * @returns The non-restaked validator ETH.\n */\n public getNonRestakedValidatorETH() {\n return this.getContract().read.getNonRestakedValidatorETH();\n }\n\n /**\n * Get the restaked validator ETH.\n *\n * @returns The restaked validator ETH.\n */\n public getRestakedValidatorETH() {\n return this.getContract().read.getRestakedValidatorETH();\n }\n\n /**\n * Get the withdrawal credentials.\n *\n * @returns The withdrawal credentials.\n */\n public getWithdrawalCredentials() {\n return this.getContract().read.getWithdrawalCredentials();\n }\n\n /**\n * Get the maximum deposit amount for the address.\n *\n * @param address The address to get the maximum deposit amount for.\n * @returns The maximum deposit amount for the address.\n */\n public maxDeposit(address: Address) {\n return this.getContract().read.maxDeposit([address]);\n }\n\n /**\n * Get the maximum mint amount for the address.\n *\n * @param address The address to get the maximum mint amount for.\n * @returns The maximum mint amount for the address.\n */\n public maxMint(address: Address) {\n return this.getContract().read.maxMint([address]);\n }\n\n /**\n * Get the maximum redeem amount for the address.\n *\n * @param address The address to get the maximum redeem amount for.\n * @returns The maximum redeem amount for the address.\n */\n public maxRedeem(address: Address) {\n return this.getContract().read.maxRedeem([address]);\n }\n\n /**\n * Get the maximum withdraw amount for the address.\n *\n * @param address The address to get the maximum withdraw amount for.\n * @returns The maximum withdraw amount for the address.\n */\n public maxWithdraw(address: Address) {\n return this.getContract().read.maxWithdraw([address]);\n }\n\n /**\n * Mint shares to the receiver.\n *\n * @param shares The number of shares to mint.\n * @param receiver The address to receive the shares.\n */\n public mint(shares: bigint, receiver: Address) {\n return this.getContract().write.mint([shares, receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the name of the contract.\n *\n * @returns The name of the contract.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Preview the deposit amount for the assets.\n *\n * @param assets The number of assets to deposit.\n * @returns The number of shares to receive.\n */\n public previewDeposit(assets: bigint) {\n return this.getContract().read.previewDeposit([assets]);\n }\n\n /**\n * Preview the mint amount for the shares.\n *\n * @param shares The number of shares to mint.\n * @returns The number of assets to receive.\n */\n public previewMint(shares: bigint) {\n return this.getContract().read.previewMint([shares]);\n }\n\n /**\n * Preview the redeem amount for the shares.\n *\n * @param shares The number of shares to redeem.\n * @returns The number of assets to receive.\n */\n public previewRedeem(shares: bigint) {\n return this.getContract().read.previewRedeem([shares]);\n }\n\n /**\n * Preview the withdraw amount for the shares.\n *\n * @param shares The number of shares to withdraw.\n * @returns The number of assets to receive.\n */\n public previewWithdraw(shares: bigint) {\n return this.getContract().read.previewWithdraw([shares]);\n }\n\n /**\n * Queue the withdrawals.\n *\n * @param shares The number of shares to withdraw.\n */\n public queueWithdrawals(shares: bigint) {\n return this.getContract().write.queueWithdrawals([shares], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Redeem the shares to the receiver.\n *\n * @param shares The number of shares to redeem.\n * @param receiver The address to receive the assets.\n * @param owner The owner of the shares.\n */\n public redeem(shares: bigint, receiver: Address, owner: Address) {\n return this.getContract().write.redeem([shares, receiver, owner], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the validators ETH.\n *\n * @param restakedValidatorsETH The amount of restaked validator ETH.\n * @param nonRestakedValidatorsETH The amount of non-restaked validator ETH.\n */\n public setValidatorsETH(\n restakedValidatorsETH: bigint,\n nonRestakedValidatorsETH: bigint,\n ) {\n return this.getContract().write.setValidatorsETH(\n [restakedValidatorsETH, nonRestakedValidatorsETH],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Start the non-restaking validators.\n *\n * @param pubKeys The public keys of the validators.\n * @param signatures The signatures of the validators.\n * @param amountsInGwei The amounts of the validators.\n * @param depositDataRoots The deposit data roots of the validators.\n */\n public startNonRestakingValidators(\n pubKeys: Address[],\n signatures: Address[],\n amountsInGwei: bigint[],\n depositDataRoots: Address[],\n ) {\n return this.getContract().write.startNonRestakingValidators(\n [pubKeys, signatures, amountsInGwei, depositDataRoots],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Start the restaking validators.\n *\n * @param pubKeys The public keys of the validators.\n * @param signatures The signatures of the validators.\n * @param amountsInGwei The amounts of the validators.\n * @param depositDataRoots The deposit data roots of the validators.\n */\n public startRestakingValidators(\n pubKeys: Address[],\n signatures: Address[],\n amountsInGwei: bigint[],\n depositDataRoots: Address[],\n ) {\n return this.getContract().write.startRestakingValidators(\n [pubKeys, signatures, amountsInGwei, depositDataRoots],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Withdraw the assets to the receiver.\n *\n * @param assets The number of assets to withdraw.\n * @param receiver The address to receive the assets.\n * @param owner The owner of the assets.\n */\n public withdraw(assets: bigint, receiver: Address, owner: Address) {\n return this.getContract().write.withdraw([assets, receiver, owner], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the symbol of the contract.\n *\n * @returns The symbol of the contract.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Get the total assets of the vault.\n *\n * @returns The total assets of the vault.\n */\n public totalAssets() {\n return this.getContract().read.totalAssets();\n }\n\n /**\n * Get the total supply of the vault.\n *\n * @returns The total supply of the vault.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Transfer the value to the to address.\n *\n * @param to The address to transfer the value to.\n * @param value The amount of value to transfer.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Transfer the value from the from address to the to address.\n *\n * @param from The address to transfer the value from.\n * @param to The address to transfer the value to.\n * @param value The amount of value to transfer.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Call a custom external function.\n *\n * @param target The target contract address.\n * @param data The calldata to send a transaction to the target contract.\n * @param value The amount of value to send to the target contract.\n */\n public customExternalCall(target: Address, data: Hex, value: bigint) {\n return this.getContract().write.customExternalCall([target, data, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request EigenPod consolidation.\n *\n * @param srcPubkeys The source public keys.\n * @param targetPubkeys The target public keys.\n * @param value The amount to send to the target contract (small quantity of GWei)\n */\n public requestEigenPodConsolidation(\n srcPubkeys: Address[],\n targetPubkeys: Address[],\n value: bigint,\n ) {\n return this.getContract().write.requestEigenPodConsolidation(\n [srcPubkeys, targetPubkeys],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n value,\n },\n );\n }\n}\n"],"names":["InstitutionalVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","InvalidContractAddressError","abi","InstitutionalVault","client","getContract","owner","spender","amount","withdrawals","receiveAsTokens","shares","assets","receiver","value","restakedValidatorsETH","nonRestakedValidatorsETH","pubKeys","signatures","amountsInGwei","depositDataRoots","to","from","target","data","srcPubkeys","targetPubkeys"],"mappings":"obA2BO,MAAMA,CAA0B,CAcrC,YACEC,EACQC,EACAC,EACR,CAjBMC,EAAA,kBACAA,EAAA,gBAcE,KAAA,aAAAF,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,CAAA,CAS7B,YAAYK,EAAkB,CACnC,YAAK,QAAUA,EAER,IAAA,CAQF,YAAa,CAClB,OAAO,KAAK,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,KAAK,SAAA,CACb,CAAA,CAQI,QAAS,CACd,OAAO,KAAK,cAAc,KAAK,OAAO,CAAA,CAQjC,aAAc,CACnB,OAAO,KAAK,cAAc,KAAK,YAAY,CAAA,CAQtC,aAAc,CACnB,OAAO,KAAK,cAAc,KAAK,YAAY,CAAA,CAStC,SAASe,EAAaP,EAAe,CACnC,OAAA,KAAK,cAAc,MAAM,SAAS,CAACO,EAAIP,CAAK,EAAG,CACpD,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAUI,aAAaQ,EAAeD,EAAaP,EAAe,CACtD,OAAA,KAAK,cAAc,MAAM,aAAa,CAACQ,EAAMD,EAAIP,CAAK,EAAG,CAC9D,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAUI,mBAAmBS,EAAiBC,EAAWV,EAAe,CAC5D,OAAA,KAAK,cAAc,MAAM,mBAAmB,CAACS,EAAQC,EAAMV,CAAK,EAAG,CACxE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAUI,6BACLW,EACAC,EACAZ,EACA,CACO,OAAA,KAAK,cAAc,MAAM,6BAC9B,CAACW,EAAYC,CAAa,EAC1B,CACE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,UACZ,MAAAZ,CAAA,CAEJ,CAAA,CAEJ"}
1
+ {"version":3,"file":"institutional-vault-handler.cjs","sources":["../../../lib/contracts/handlers/institutional-vault-handler.ts"],"sourcesContent":["import {\n Chain as ViemChain,\n WalletClient,\n PublicClient,\n getContract,\n GetContractReturnType,\n Address,\n Hex,\n} from 'viem';\nimport { InstitutionalVault } from '../abis/mainnet/InstitutionalVault';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { InvalidContractAddressError } from '../../errors/validation-errors';\n\nexport type QueuedWithdrawal = {\n staker: Address;\n delegatedTo: Address;\n withdrawer: Address;\n nonce: bigint;\n startBlock: number;\n strategies: Address[];\n scaledShares: bigint[];\n};\n\n/**\n * Handler for the `InstitutionalVault` contract exposing methods to\n * interact with the contract.\n */\nexport class InstitutionalVaultHandler {\n private viemChain: ViemChain;\n private address?: Address;\n\n /**\n * Create the handler for the `InstitutionalVault` contract exposing\n * 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 = InstitutionalVault;\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 beacon deposit contract address.\n *\n * @returns The beacon deposit contract address.\n */\n public getBeaconDepositContract() {\n return this.getContract().read.BEACON_DEPOSIT_CONTRACT();\n }\n\n /**\n * Get the eigen delegation manager contract address.\n *\n * @returns The eigen delegation manager.\n */\n public getEigenDelegationManager() {\n return this.getContract().read.EIGEN_DELEGATION_MANAGER();\n }\n\n /**\n * Get the eigen pod manager contract address.\n *\n * @returns The eigen pod manager contract address.\n */\n public getEigenPodManager() {\n return this.getContract().read.EIGEN_POD_MANAGER();\n }\n\n /**\n * Get the eigen pod address.\n *\n * @returns The eigen pod address.\n */\n public getEigenPod() {\n return this.getContract().read.getEigenPod();\n }\n\n /**\n * Get the allowance for the spender to spend the owner's tokens.\n *\n * @param owner The owner of the tokens.\n * @param spender The spender of the tokens.\n * @returns The allowance of the owner for the spender.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Approve the spender to spend the owner's tokens.\n *\n * @param spender The spender of the tokens.\n * @param amount The amount of tokens to approve.\n */\n public approve(spender: Address, amount: bigint) {\n return this.getContract().write.approve([spender, amount], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the asset of the vault.\n *\n * @returns The asset of the vault.\n */\n public asset() {\n return this.getContract().read.asset();\n }\n\n /**\n * Get the authority of the vault.\n *\n * @returns The authority of the vault.\n */\n public authority() {\n return this.getContract().read.authority();\n }\n\n /**\n * Get the balance of the address.\n *\n * @param address The address to get the balance of.\n * @returns The balance of the address.\n */\n public balanceOf(address: Address) {\n return this.getContract().read.balanceOf([address]);\n }\n\n /**\n * Get the number of decimals of the token.\n *\n * @returns The number of decimals of the token.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Complete the queued withdrawals.\n *\n * @param withdrawals The withdrawals to complete.\n * @param receiveAsTokens Whether to receive the assets as tokens.\n */\n public completeQueuedWithdrawals(\n withdrawals: QueuedWithdrawal[],\n receiveAsTokens: boolean[],\n ) {\n return this.getContract().write.completeQueuedWithdrawals(\n [withdrawals, receiveAsTokens],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Convert shares to assets.\n *\n * @param shares The number of shares to convert.\n * @returns The number of assets.\n */\n public convertToAssets(shares: bigint) {\n return this.getContract().read.convertToAssets([shares]);\n }\n\n /**\n * Convert assets to shares.\n *\n * @param assets The number of assets to convert.\n * @returns The number of shares.\n */\n public convertToShares(assets: bigint) {\n return this.getContract().read.convertToShares([assets]);\n }\n\n /**\n * Deposit assets into the vault.\n *\n * @param assets The number of assets to deposit.\n * @param receiver The address to receive the shares.\n */\n public deposit(assets: bigint, receiver: Address) {\n return this.getContract().write.deposit([assets, receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Deposit ETH into the vault.\n *\n * @param receiver The address to receive the shares.\n * @param value The amount of ETH to deposit.\n */\n public depositETH(receiver: Address, value: bigint) {\n return this.getContract().write.depositETH([receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n value,\n });\n }\n\n /**\n * Get the non-restaked validator ETH.\n *\n * @returns The non-restaked validator ETH.\n */\n public getNonRestakedValidatorETH() {\n return this.getContract().read.getNonRestakedValidatorETH();\n }\n\n /**\n * Get the restaked validator ETH.\n *\n * @returns The restaked validator ETH.\n */\n public getRestakedValidatorETH() {\n return this.getContract().read.getRestakedValidatorETH();\n }\n\n /**\n * Get the withdrawal credentials.\n *\n * @returns The withdrawal credentials.\n */\n public getWithdrawalCredentials() {\n return this.getContract().read.getWithdrawalCredentials();\n }\n\n /**\n * Get the maximum deposit amount for the address.\n *\n * @param address The address to get the maximum deposit amount for.\n * @returns The maximum deposit amount for the address.\n */\n public maxDeposit(address: Address) {\n return this.getContract().read.maxDeposit([address]);\n }\n\n /**\n * Get the maximum mint amount for the address.\n *\n * @param address The address to get the maximum mint amount for.\n * @returns The maximum mint amount for the address.\n */\n public maxMint(address: Address) {\n return this.getContract().read.maxMint([address]);\n }\n\n /**\n * Get the maximum redeem amount for the address.\n *\n * @param address The address to get the maximum redeem amount for.\n * @returns The maximum redeem amount for the address.\n */\n public maxRedeem(address: Address) {\n return this.getContract().read.maxRedeem([address]);\n }\n\n /**\n * Get the maximum withdraw amount for the address.\n *\n * @param address The address to get the maximum withdraw amount for.\n * @returns The maximum withdraw amount for the address.\n */\n public maxWithdraw(address: Address) {\n return this.getContract().read.maxWithdraw([address]);\n }\n\n /**\n * Mint shares to the receiver.\n *\n * @param shares The number of shares to mint.\n * @param receiver The address to receive the shares.\n */\n public mint(shares: bigint, receiver: Address) {\n return this.getContract().write.mint([shares, receiver], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the name of the contract.\n *\n * @returns The name of the contract.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Preview the deposit amount for the assets.\n *\n * @param assets The number of assets to deposit.\n * @returns The number of shares to receive.\n */\n public previewDeposit(assets: bigint) {\n return this.getContract().read.previewDeposit([assets]);\n }\n\n /**\n * Preview the mint amount for the shares.\n *\n * @param shares The number of shares to mint.\n * @returns The number of assets to receive.\n */\n public previewMint(shares: bigint) {\n return this.getContract().read.previewMint([shares]);\n }\n\n /**\n * Preview the redeem amount for the shares.\n *\n * @param shares The number of shares to redeem.\n * @returns The number of assets to receive.\n */\n public previewRedeem(shares: bigint) {\n return this.getContract().read.previewRedeem([shares]);\n }\n\n /**\n * Preview the withdraw amount for the shares.\n *\n * @param shares The number of shares to withdraw.\n * @returns The number of assets to receive.\n */\n public previewWithdraw(shares: bigint) {\n return this.getContract().read.previewWithdraw([shares]);\n }\n\n /**\n * Queue the withdrawals.\n *\n * @param shares The number of shares to withdraw.\n */\n public queueWithdrawals(shares: bigint) {\n return this.getContract().write.queueWithdrawals([shares], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Redeem the shares to the receiver.\n *\n * @param shares The number of shares to redeem.\n * @param receiver The address to receive the assets.\n * @param owner The owner of the shares.\n */\n public redeem(shares: bigint, receiver: Address, owner: Address) {\n return this.getContract().write.redeem([shares, receiver, owner], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the validators ETH.\n *\n * @param restakedValidatorsETH The amount of restaked validator ETH.\n * @param nonRestakedValidatorsETH The amount of non-restaked validator ETH.\n */\n public setValidatorsETH(\n restakedValidatorsETH: bigint,\n nonRestakedValidatorsETH: bigint,\n ) {\n return this.getContract().write.setValidatorsETH(\n [restakedValidatorsETH, nonRestakedValidatorsETH],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Start the non-restaking validators.\n *\n * @param pubKeys The public keys of the validators.\n * @param signatures The signatures of the validators.\n * @param amountsInGwei The amounts of the validators.\n * @param depositDataRoots The deposit data roots of the validators.\n */\n public startNonRestakingValidators(\n pubKeys: Address[],\n signatures: Address[],\n amountsInGwei: bigint[],\n depositDataRoots: Address[],\n ) {\n return this.getContract().write.startNonRestakingValidators(\n [pubKeys, signatures, amountsInGwei, depositDataRoots],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Start the restaking validators.\n *\n * @param pubKeys The public keys of the validators.\n * @param signatures The signatures of the validators.\n * @param amountsInGwei The amounts of the validators.\n * @param depositDataRoots The deposit data roots of the validators.\n */\n public startRestakingValidators(\n pubKeys: Address[],\n signatures: Address[],\n amountsInGwei: bigint[],\n depositDataRoots: Address[],\n ) {\n return this.getContract().write.startRestakingValidators(\n [pubKeys, signatures, amountsInGwei, depositDataRoots],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Withdraw the assets to the receiver.\n *\n * @param assets The number of assets to withdraw.\n * @param receiver The address to receive the assets.\n * @param owner The owner of the assets.\n */\n public withdraw(assets: bigint, receiver: Address, owner: Address) {\n return this.getContract().write.withdraw([assets, receiver, owner], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the symbol of the contract.\n *\n * @returns The symbol of the contract.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Get the total assets of the vault.\n *\n * @returns The total assets of the vault.\n */\n public totalAssets() {\n return this.getContract().read.totalAssets();\n }\n\n /**\n * Get the total supply of the vault.\n *\n * @returns The total supply of the vault.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Transfer the value to the to address.\n *\n * @param to The address to transfer the value to.\n * @param value The amount of value to transfer.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Transfer the value from the from address to the to address.\n *\n * @param from The address to transfer the value from.\n * @param to The address to transfer the value to.\n * @param value The amount of value to transfer.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Call a custom external function.\n *\n * @param target The target contract address.\n * @param data The calldata to send a transaction to the target contract.\n * @param value The amount of value to send to the target contract.\n */\n public customExternalCall(target: Address, data: Hex, value: bigint) {\n return this.getContract().write.customExternalCall([target, data, value], {\n account: this.walletClient.account!,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request EigenPod consolidation.\n *\n * @param srcPubkeys The source public keys.\n * @param targetPubkeys The target public keys.\n * @param value The amount to send to the target contract (small quantity of GWei)\n */\n public requestEigenPodConsolidation(\n srcPubkeys: Address[],\n targetPubkeys: Address[],\n value: bigint,\n ) {\n return this.getContract().write.requestEigenPodConsolidation(\n [srcPubkeys, targetPubkeys],\n {\n account: this.walletClient.account!,\n chain: this.viemChain,\n value,\n },\n );\n }\n}\n"],"names":["InstitutionalVaultHandler","chain","walletClient","publicClient","VIEM_CHAINS","address","InvalidContractAddressError","abi","InstitutionalVault","client","getContract","owner","spender","amount","withdrawals","receiveAsTokens","shares","assets","receiver","value","restakedValidatorsETH","nonRestakedValidatorsETH","pubKeys","signatures","amountsInGwei","depositDataRoots","to","from","target","data","srcPubkeys","targetPubkeys"],"mappings":"gRA2BO,MAAMA,CAA0B,CAcrC,YACEC,EACQC,EACAC,EACR,CAFQ,KAAA,aAAAD,EACA,KAAA,aAAAC,EAER,KAAK,UAAYC,EAAAA,YAAYH,CAAK,CACpC,CAnBQ,UACA,QA0BD,YAAYI,EAAkB,CACnC,YAAK,QAAUA,EAER,IACT,CAOO,YAAa,CAClB,OAAO,KAAK,OACd,CAQO,aAAc,CACnB,GAAI,CAAC,KAAK,QACR,MAAM,IAAIC,EAAAA,4BACR,wCACA,CACE,WAAY,wEAAA,CACd,EAIJ,MAAMC,EAAMC,E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