@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 n = Object.defineProperty;
2
- var s = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var i = (r, t, e) => s(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { V as o } from "../../constants-C9YZ6Ewc.js";
5
- import { CONTRACT_ADDRESSES as c } from "../addresses.js";
6
- import { InvalidInputError as l } from "../../errors/validation-errors.js";
7
- import { L2RewardManager as m } from "../abis/mainnet/L2RewardManager.js";
8
- import { g as d } from "../../getContract-DEPNMZxg.js";
9
- class f {
1
+ import { V as a } from "../../constants-CuIEh_ZS.js";
2
+ import { CONTRACT_ADDRESSES as i } from "../addresses.js";
3
+ import { InvalidInputError as n } from "../../errors/validation-errors.js";
4
+ import { L2RewardManager as s } from "../abis/mainnet/L2RewardManager.js";
5
+ import { g as o } from "../../getContract-DQN7VDBo.js";
6
+ class u {
10
7
  /**
11
8
  * Create the handler for the `L2RewardManager` contract exposing
12
9
  * methods to interact with the contract.
@@ -17,10 +14,10 @@ class f {
17
14
  * @param publicClient The public client to use for public
18
15
  * interactions.
19
16
  */
20
- constructor(t, e, a) {
21
- i(this, "viemChain");
22
- this.chain = t, this.walletClient = e, this.publicClient = a, this.viemChain = o[t];
17
+ constructor(t, e, r) {
18
+ this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain = a[t];
23
19
  }
20
+ viemChain;
24
21
  /**
25
22
  * Get the contract. This is a method because the typings are complex
26
23
  * and lost when trying to make it a member.
@@ -28,8 +25,8 @@ class f {
28
25
  * @returns The viem contract.
29
26
  */
30
27
  getContract() {
31
- const t = c[this.chain].L2RewardManager, e = m, a = { public: this.publicClient, wallet: this.walletClient };
32
- return d({ address: t, abi: e, client: a });
28
+ const t = i[this.chain].L2RewardManager, e = s, r = { public: this.publicClient, wallet: this.walletClient };
29
+ return o({ address: t, abi: e, client: r });
33
30
  }
34
31
  /**
35
32
  * Get the authority address.
@@ -119,7 +116,7 @@ class f {
119
116
  */
120
117
  claimRewards(t, e) {
121
118
  if (e.length === 0)
122
- throw new l(
119
+ throw new n(
123
120
  "`claimOrders` cannot be empty and must be specified",
124
121
  {
125
122
  fixMessage: "Specify at least one or more claim orders to claim rewards"
@@ -134,6 +131,6 @@ class f {
134
131
  }
135
132
  }
136
133
  export {
137
- f as L2RewardManagerHandler
134
+ u as L2RewardManagerHandler
138
135
  };
139
136
  //# sourceMappingURL=l2-reward-manager-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"l2-reward-manager-handler.js","sources":["../../../lib/contracts/handlers/l2-reward-manager-handler.ts"],"sourcesContent":["import {\n Address,\n WalletClient,\n PublicClient,\n getContract,\n GetContractReturnType,\n} from 'viem';\nimport { ViemChain, VIEM_CHAINS, Chain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { InvalidInputError } from '../../errors/validation-errors';\nimport { L2RewardManager } from '../abis/mainnet/L2RewardManager';\n\nexport type ClaimOrder = {\n account: Address;\n amount: bigint;\n intervalId: Address;\n isL1Contract: boolean;\n merkleProof: Address[];\n};\n\n/**\n * Handler for the `L2RewardManager` contract.\n */\nexport class L2RewardManagerHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for the `L2RewardManager` 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 private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Get the contract. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].L2RewardManager as Address;\n const abi = L2RewardManager;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the authority address.\n *\n * @returns The authority address.\n */\n public authority() {\n return this.getContract().read.authority();\n }\n\n /**\n * Get the claiming delay.\n *\n * @returns The claiming delay.\n */\n public getClaimingDelay() {\n return this.getContract().read.getClaimingDelay();\n }\n\n /**\n * Get the epoch record for a specific period.\n *\n * @param intervalId The interval ID for a given start and end epoch.\n * See `getInternvalId`.\n * @returns The epoch record of exchange rate and reward root.\n */\n public getEpochRecord(intervalId: Address) {\n return this.getContract().read.getEpochRecord([intervalId]);\n }\n\n /**\n * Returns the interval ID for a given start and end epoch.\n *\n * @param startEpoch Start epoch of the interval.\n * @param endEpoch End epoch of the interval.\n * @returns Interval ID for the given start and end epoch.\n */\n public getIntervalId(startEpoch: bigint, endEpoch: bigint) {\n return this.getContract().read.getIntervalId([startEpoch, endEpoch]);\n }\n\n /**\n * Get the rewards claimer for a specific `account`.\n *\n * @param account Account for which to get the rewards claimer.\n * @returns Rewards claimer address.\n */\n public getRewardsClaimer(account: Address) {\n return this.getContract().read.getRewardsClaimer([account]);\n }\n\n /**\n * Check if the reward has been claimed for an account and a specific\n * interval.\n *\n * @param account The address of the account to check.\n * @param intervalId The claiming interval ID. See `getIntervalId`.\n * @returns Whether the reward has been claimed.\n */\n public isClaimed(account: Address, intervalId: Address) {\n return this.getContract().read.isClaimed([intervalId, account]);\n }\n\n /**\n * Check whether the claiming is locked for the given interval.\n *\n * @param intervalId The interval to check the claiming lock for. See\n * `getIntervalId`.\n * @returns Whether the claiming is locked for the given interval.\n */\n public isClaimingLocked(intervalId: Address) {\n return this.getContract().read.isClaimingLocked([intervalId]);\n }\n\n /**\n * Claims the rewards for a specific epoch range based on the\n * `ClaimOrder`.\n *\n * @param account The account using which to claim the rewards.\n * @param claimOrders One or more claim orders.\n * @param claimOrders[].account Account of the claim order.\n * @param claimOrders[].amount Amount of the claim order.\n * @param claimOrders[].intervalId Interval ID of the claim order. See\n * `getIntervalId`.\n * @param claimOrders[].isL1Contract Whether the claim order is for an\n * L1 contract.\n * @param claimOrders[].merkleProof Merkle proof of the claim order.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n * @throws {InvalidInputError} If `claimOrders` is empty.\n */\n public claimRewards(account: Address, claimOrders: ClaimOrder[]) {\n if (claimOrders.length === 0) {\n throw new InvalidInputError(\n '`claimOrders` cannot be empty and must be specified',\n {\n fixMessage:\n 'Specify at least one or more claim orders to claim rewards',\n },\n );\n }\n\n const transact = () =>\n this.getContract().write.claimRewards([claimOrders], {\n chain: this.viemChain,\n account,\n });\n const estimate = () =>\n this.getContract().estimateGas.claimRewards([claimOrders], {\n account,\n });\n\n return { transact, estimate };\n }\n}\n"],"names":["L2RewardManagerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","L2RewardManager","client","getContract","intervalId","startEpoch","endEpoch","account","claimOrders","InvalidInputError"],"mappings":";;;;;;;;AAuBO,MAAMA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalC,YACUC,GACAC,GACAC,GACR;AAhBM,IAAAC,EAAA;AAaE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7B,cAAc;AACnB,UAAMK,IAAUC,EAAmB,KAAK,KAAK,EAAE,iBACzCC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAa;AAEtE,WAAOC,EAAY,EAAE,SAAAL,GAAS,KAAAE,GAAK,QAAAE,GAAQ;AAAA,EAAA;AAAA;AAAA;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AAA,EAAc,MAAM,aAAa,CAACD,CAAW,GAAG;AAAA,MACnD,OAAO,KAAK;AAAA,MACZ,SAAAD;AAAA,IAAA,CACD,GAMgB,UALF,MACf,KAAK,YAAA,EAAc,YAAY,aAAa,CAACC,CAAW,GAAG;AAAA,MACzD,SAAAD;AAAA,IAAA,CACD,EAEyB;AAAA,EAAA;AAEhC;"}
1
+ {"version":3,"file":"l2-reward-manager-handler.js","sources":["../../../lib/contracts/handlers/l2-reward-manager-handler.ts"],"sourcesContent":["import {\n Address,\n WalletClient,\n PublicClient,\n getContract,\n GetContractReturnType,\n} from 'viem';\nimport { ViemChain, VIEM_CHAINS, Chain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { InvalidInputError } from '../../errors/validation-errors';\nimport { L2RewardManager } from '../abis/mainnet/L2RewardManager';\n\nexport type ClaimOrder = {\n account: Address;\n amount: bigint;\n intervalId: Address;\n isL1Contract: boolean;\n merkleProof: Address[];\n};\n\n/**\n * Handler for the `L2RewardManager` contract.\n */\nexport class L2RewardManagerHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for the `L2RewardManager` 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 private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Get the contract. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].L2RewardManager as Address;\n const abi = L2RewardManager;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the authority address.\n *\n * @returns The authority address.\n */\n public authority() {\n return this.getContract().read.authority();\n }\n\n /**\n * Get the claiming delay.\n *\n * @returns The claiming delay.\n */\n public getClaimingDelay() {\n return this.getContract().read.getClaimingDelay();\n }\n\n /**\n * Get the epoch record for a specific period.\n *\n * @param intervalId The interval ID for a given start and end epoch.\n * See `getInternvalId`.\n * @returns The epoch record of exchange rate and reward root.\n */\n public getEpochRecord(intervalId: Address) {\n return this.getContract().read.getEpochRecord([intervalId]);\n }\n\n /**\n * Returns the interval ID for a given start and end epoch.\n *\n * @param startEpoch Start epoch of the interval.\n * @param endEpoch End epoch of the interval.\n * @returns Interval ID for the given start and end epoch.\n */\n public getIntervalId(startEpoch: bigint, endEpoch: bigint) {\n return this.getContract().read.getIntervalId([startEpoch, endEpoch]);\n }\n\n /**\n * Get the rewards claimer for a specific `account`.\n *\n * @param account Account for which to get the rewards claimer.\n * @returns Rewards claimer address.\n */\n public getRewardsClaimer(account: Address) {\n return this.getContract().read.getRewardsClaimer([account]);\n }\n\n /**\n * Check if the reward has been claimed for an account and a specific\n * interval.\n *\n * @param account The address of the account to check.\n * @param intervalId The claiming interval ID. See `getIntervalId`.\n * @returns Whether the reward has been claimed.\n */\n public isClaimed(account: Address, intervalId: Address) {\n return this.getContract().read.isClaimed([intervalId, account]);\n }\n\n /**\n * Check whether the claiming is locked for the given interval.\n *\n * @param intervalId The interval to check the claiming lock for. See\n * `getIntervalId`.\n * @returns Whether the claiming is locked for the given interval.\n */\n public isClaimingLocked(intervalId: Address) {\n return this.getContract().read.isClaimingLocked([intervalId]);\n }\n\n /**\n * Claims the rewards for a specific epoch range based on the\n * `ClaimOrder`.\n *\n * @param account The account using which to claim the rewards.\n * @param claimOrders One or more claim orders.\n * @param claimOrders[].account Account of the claim order.\n * @param claimOrders[].amount Amount of the claim order.\n * @param claimOrders[].intervalId Interval ID of the claim order. See\n * `getIntervalId`.\n * @param claimOrders[].isL1Contract Whether the claim order is for an\n * L1 contract.\n * @param claimOrders[].merkleProof Merkle proof of the claim order.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n * @throws {InvalidInputError} If `claimOrders` is empty.\n */\n public claimRewards(account: Address, claimOrders: ClaimOrder[]) {\n if (claimOrders.length === 0) {\n throw new InvalidInputError(\n '`claimOrders` cannot be empty and must be specified',\n {\n fixMessage:\n 'Specify at least one or more claim orders to claim rewards',\n },\n );\n }\n\n const transact = () =>\n this.getContract().write.claimRewards([claimOrders], {\n chain: this.viemChain,\n account,\n });\n const estimate = () =>\n this.getContract().estimateGas.claimRewards([claimOrders], {\n account,\n });\n\n return { transact, estimate };\n }\n}\n"],"names":["L2RewardManagerHandler","chain","walletClient","publicClient","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","L2RewardManager","client","getContract","intervalId","startEpoch","endEpoch","account","claimOrders","InvalidInputError"],"mappings":";;;;;AAuBO,MAAMA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalC,YACUC,GACAC,GACAC,GACR;AAHQ,SAAA,QAAAF,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAER,KAAK,YAAYC,EAAYH,CAAK;AAAA,EACpC;AAAA,EAlBQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BD,cAAc;AACnB,UAAMI,IAAUC,EAAmB,KAAK,KAAK,EAAE,iBACzCC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAA;AAEzD,WAAOC,EAAY,EAAE,SAAAL,GAAS,KAAAE,GAAK,QAAAE,GAAQ;AAAA,EAK7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,YAAY;AACjB,WAAO,KAAK,cAAc,KAAK,UAAA;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,mBAAmB;AACxB,WAAO,KAAK,cAAc,KAAK,iBAAA;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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+1,2 @@
1
- "use strict";var r=Object.defineProperty;var s=(a,t,e)=>t in a?r(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var i=(a,t,e)=>s(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../constants-CxSgz27h.cjs"),o=require("../abis/mainnet/LagoonVault.cjs"),h=require("../tokens.cjs"),l=require("../vaults-addresses.cjs"),u=require("../../getContract-DUA3M2pm.cjs");class C{constructor(t,e,n){i(this,"viemChain");this.chain=t,this.walletClient=e,this.publicClient=n,this.viemChain=c.VIEM_CHAINS[t]}getContract(){const t=l.VAULTS_ADDRESSES[h.Token.tacpufETH][this.chain].LagoonVault,e=o.LagoonVault,n={public:this.publicClient,wallet:this.walletClient};return u.getContract({address:t,abi:e,client:n})}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}getAllowance(t,e){return this.getContract().read.allowance([t,e])}getBalance(t){return this.getContract().read.balanceOf([t])}getTotalSupply(){return this.getContract().read.totalSupply()}isTotalAssetsValid(){return this.getContract().read.isTotalAssetsValid()}symbol(){return this.getContract().read.symbol()}deposit(t,e,n){return n?this.getContract().write.deposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain}):this.getContract().write.deposit([t,e],{account:this.walletClient.account,chain:this.viemChain})}syncDeposit(t,e,n=e){return this.getContract().write.syncDeposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}requestDeposit(t,e,n=e){return this.getContract().write.requestDeposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain,value:t})}pendingDepositRequest(t=0n,e){return this.getContract().read.pendingDepositRequest([t,e])}withdraw(t,e,n=e){return this.getContract().write.withdraw([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}redeem(t,e,n=e){return this.getContract().write.redeem([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}requestRedeem(t,e,n=e){return this.getContract().write.requestRedeem([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}pendingRedeemRequest(t=0n,e){return this.getContract().read.pendingRedeemRequest([t,e])}previewDeposit(t){return this.getContract().read.previewDeposit([t])}previewWithdraw(t){return this.getContract().read.previewWithdraw([t])}previewRedeem(t){return this.getContract().read.previewRedeem([t])}convertToAssets(t,e){return e?this.getContract().read.convertToAssets([t,e]):this.getContract().read.convertToAssets([t])}convertToShares(t,e){return e?this.getContract().read.convertToShares([t,e]):this.getContract().read.convertToShares([t])}claimableDepositRequest(t=0n,e){return this.getContract().read.claimableDepositRequest([t,e])}claimableRedeemRequest(t=0n,e){return this.getContract().read.claimableRedeemRequest([t,e])}claimSharesAndRequestRedeem(t){return this.getContract().write.claimSharesAndRequestRedeem([t],{account:this.walletClient.account,chain:this.viemChain})}claimSharesOnBehalf(t){return this.getContract().write.claimSharesOnBehalf([t],{account:this.walletClient.account,chain:this.viemChain})}}exports.LagoonVaultHandler=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants-6kuRTsbU.cjs"),i=require("../abis/mainnet/LagoonVault.cjs"),r=require("../tokens.cjs"),s=require("../vaults-addresses.cjs"),c=require("../../getContract-D4_SEfqa.cjs");class o{constructor(t,e,n){this.chain=t,this.walletClient=e,this.publicClient=n,this.viemChain=a.VIEM_CHAINS[t]}viemChain;getContract(){const t=s.VAULTS_ADDRESSES[r.Token.tacpufETH][this.chain].LagoonVault,e=i.LagoonVault,n={public:this.publicClient,wallet:this.walletClient};return c.getContract({address:t,abi:e,client:n})}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}getAllowance(t,e){return this.getContract().read.allowance([t,e])}getBalance(t){return this.getContract().read.balanceOf([t])}getTotalSupply(){return this.getContract().read.totalSupply()}isTotalAssetsValid(){return this.getContract().read.isTotalAssetsValid()}symbol(){return this.getContract().read.symbol()}deposit(t,e,n){return n?this.getContract().write.deposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain}):this.getContract().write.deposit([t,e],{account:this.walletClient.account,chain:this.viemChain})}syncDeposit(t,e,n=e){return this.getContract().write.syncDeposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}requestDeposit(t,e,n=e){return this.getContract().write.requestDeposit([t,e,n],{account:this.walletClient.account,chain:this.viemChain,value:t})}pendingDepositRequest(t=0n,e){return this.getContract().read.pendingDepositRequest([t,e])}withdraw(t,e,n=e){return this.getContract().write.withdraw([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}redeem(t,e,n=e){return this.getContract().write.redeem([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}requestRedeem(t,e,n=e){return this.getContract().write.requestRedeem([t,e,n],{account:this.walletClient.account,chain:this.viemChain})}pendingRedeemRequest(t=0n,e){return this.getContract().read.pendingRedeemRequest([t,e])}previewDeposit(t){return this.getContract().read.previewDeposit([t])}previewWithdraw(t){return this.getContract().read.previewWithdraw([t])}previewRedeem(t){return this.getContract().read.previewRedeem([t])}convertToAssets(t,e){return e?this.getContract().read.convertToAssets([t,e]):this.getContract().read.convertToAssets([t])}convertToShares(t,e){return e?this.getContract().read.convertToShares([t,e]):this.getContract().read.convertToShares([t])}claimableDepositRequest(t=0n,e){return this.getContract().read.claimableDepositRequest([t,e])}claimableRedeemRequest(t=0n,e){return this.getContract().read.claimableRedeemRequest([t,e])}claimSharesAndRequestRedeem(t){return this.getContract().write.claimSharesAndRequestRedeem([t],{account:this.walletClient.account,chain:this.viemChain})}claimSharesOnBehalf(t){return this.getContract().write.claimSharesOnBehalf([t],{account:this.walletClient.account,chain:this.viemChain})}}exports.LagoonVaultHandler=o;
2
2
  //# sourceMappingURL=lagoon-vault-handler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lagoon-vault-handler.cjs","sources":["../../../lib/contracts/handlers/lagoon-vault-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { LagoonVault } from '../abis/mainnet/LagoonVault';\nimport { Token } from '../tokens';\nimport { VAULTS_ADDRESSES } from '../vaults-addresses';\n\n/**\n * Handler for the `LagoonVault` contract exposing methods to interact\n * with the contract.\n */\nexport class LagoonVaultHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for processing Lagoon vault.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = VAULTS_ADDRESSES[Token.tacpufETH][this.chain]\n .LagoonVault as Address;\n const abi = LagoonVault;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Approve a spender to spend the token.\n *\n * @param spender The spender of the token.\n * @param amount The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, amount: bigint) {\n return this.getContract().write.approve([spender, amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public getAllowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Get the balance for the address.\n *\n * @param address The address to get the balance of.\n * @returns The balance.\n */\n public getBalance(address: Address) {\n return this.getContract().read.balanceOf([address]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public getTotalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Check if the total assets are valid. Used for checking if\n * synchronous deposit is possible.\n *\n * @returns True if the total assets are valid, false otherwise.\n */\n public isTotalAssetsValid() {\n return this.getContract().read.isTotalAssetsValid();\n }\n\n /**\n * Get the symbol of the token. (tacpufETH)\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Deposit an amount of the assets (pufETH) to the vault to get shares\n * (tacpufETH).\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param controller The optional controller of the deposit. Set to\n * the receiver if not sure.\n * @returns The transaction.\n */\n public deposit(amount: bigint, receiver: Address, controller?: Address) {\n if (controller) {\n return this.getContract().write.deposit([amount, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n return this.getContract().write.deposit([amount, receiver], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Synchronously deposit an amount of the assets (pufETH) to the vault\n * to get shares (tacpufETH). This is only possible if `isTotalAssetsValid`\n * is true.\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param referral The referral of the deposit. Falls back to the\n * receiver if not provided.\n * @returns The transaction.\n */\n public syncDeposit(\n amount: bigint,\n receiver: Address,\n referral: Address = receiver,\n ) {\n return this.getContract().write.syncDeposit([amount, receiver, referral], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request an asynchronous deposit of an amount of the assets (pufETH)\n * to the vault to get shares (tacpufETH). This should be used if\n * `isTotalAssetsValid` is false.\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param controller The optional controller of the deposit. Falls back\n * to the receiver if not provided.\n * @returns The transaction.\n */\n public requestDeposit(\n amount: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.requestDeposit(\n [amount, receiver, controller],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n value: amount,\n },\n );\n }\n\n /**\n * Get the pending deposit request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the depositor or user who\n * initiated the deposit.\n * @returns The pending deposit request.\n */\n public pendingDepositRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.pendingDepositRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Withdraw an amount of the shares (pufETH) so the receiver\n * gets the assets (pufETH).\n *\n * @param assets The amount of assets (pufETH) to withdraw.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the withdrawal. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public withdraw(\n assets: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.withdraw([assets, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Redeem an amount of the shares (tacpufETH) so the receiver\n * gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the withdrawal. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public redeem(\n shares: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.redeem([shares, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request an asynchronous redeem of an amount of the shares (tacpufETH)\n * so the receiver gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the redemption. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public requestRedeem(\n shares: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.requestRedeem(\n [shares, receiver, controller],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the pending redeem request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the redeemer or user who\n * initiated the redeem.\n * @returns The pending redeem request.\n */\n public pendingRedeemRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.pendingRedeemRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Provides a preview of the number of shares that would be minted for\n * a given deposit amount, after fees.\n *\n * @param amount The amount to deposit.\n * @returns The preview.\n */\n public previewDeposit(amount: bigint) {\n return this.getContract().read.previewDeposit([amount]);\n }\n\n /**\n * Provides a preview of the number of shares (tacpufETH) that would be\n * burned for the given amount of assets (pufETH).\n *\n * @param assets The amount of assets (pufETH) to withdraw.\n * @returns The preview.\n */\n public previewWithdraw(assets: bigint) {\n return this.getContract().read.previewWithdraw([assets]);\n }\n\n /**\n * Provides a preview of the amount of assets (pufETH) that would be redeemed\n * for the given shares (tacpufETH), after withdrawal fees. Subtracts\n * the withdrawal fee from the share amount to determine the net\n * shares for asset conversion.\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @returns The preview.\n */\n public previewRedeem(shares: bigint) {\n return this.getContract().read.previewRedeem([shares]);\n }\n\n /**\n * Convert an amount of the shares (tacpufETH) to the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to convert.\n * @param requestId An optional request id for the conversion.\n * @returns The amount of assets (pufETH).\n */\n public convertToAssets(shares: bigint, requestId?: bigint) {\n if (requestId) {\n return this.getContract().read.convertToAssets([shares, requestId]);\n }\n\n return this.getContract().read.convertToAssets([shares]);\n }\n\n /**\n * Convert an amount of the assets (pufETH) to the shares (tacpufETH).\n *\n * @param assets The amount of assets (pufETH) to convert.\n * @param requestId An optional request id for the conversion.\n * @returns The amount of shares (tacpufETH).\n */\n public convertToShares(assets: bigint, requestId?: bigint) {\n if (requestId) {\n return this.getContract().read.convertToShares([assets, requestId]);\n }\n\n return this.getContract().read.convertToShares([assets]);\n }\n\n /**\n * Get the claimable deposit request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the depositor or user who\n * initiated the deposit.\n * @returns The claimable deposit request.\n */\n public claimableDepositRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.claimableDepositRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Get the claimable redeem request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the redeemer or user who\n * initiated the redeem.\n * @returns The claimable redeem request.\n */\n public claimableRedeemRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.claimableRedeemRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Claim shares and request a redeem of an amount of the shares (tacpufETH)\n * so the receiver gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to claim.\n * @returns The transaction.\n */\n public claimSharesAndRequestRedeem(shares: bigint) {\n return this.getContract().write.claimSharesAndRequestRedeem([shares], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Claim shares on behalf of multiple controllers.\n *\n * @param controllers The controllers to claim shares on behalf of.\n * @returns The transaction.\n */\n public claimSharesOnBehalf(controllers: Address[]) {\n return this.getContract().write.claimSharesOnBehalf([controllers], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["LagoonVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","VAULTS_ADDRESSES","Token","abi","LagoonVault","client","getContract","spender","amount","owner","receiver","controller","referral","requestId","assets","shares","controllers"],"mappings":"6bAiBO,MAAMA,CAAmB,CAY9B,YACUC,EACAC,EACAC,EACR,CAfMC,EAAA,kBAYE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,CAAA,CAQ7B,aAAc,CACnB,MAAMK,EAAUC,EAAAA,iBAAiBC,EAAA,MAAM,SAAS,EAAE,KAAK,KAAK,EACzD,YACGC,EAAMC,EAAA,YACNC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAN,EAAS,IAAAG,EAAK,OAAAE,EAAQ,CAAA,CActC,QAAQE,EAAkBC,EAAgB,CACxC,OAAA,KAAK,cAAc,MAAM,QAAQ,CAACD,EAASC,CAAM,EAAG,CACzD,QAAS,KAAK,aAAa,QAC3B,MAAO,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,GAAIF,EAAqB,CACzE,OAAO,KAAK,cAAc,KAAK,uBAAuB,CACpDE,EACAF,CAAA,CACD,CAAA,CAUI,4BAA4BI,EAAgB,CACjD,OAAO,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAACA,CAAM,EAAG,CACpE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CASI,oBAAoBC,EAAwB,CACjD,OAAO,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAACA,CAAW,EAAG,CACjE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAEL"}
1
+ {"version":3,"file":"lagoon-vault-handler.cjs","sources":["../../../lib/contracts/handlers/lagoon-vault-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { LagoonVault } from '../abis/mainnet/LagoonVault';\nimport { Token } from '../tokens';\nimport { VAULTS_ADDRESSES } from '../vaults-addresses';\n\n/**\n * Handler for the `LagoonVault` contract exposing methods to interact\n * with the contract.\n */\nexport class LagoonVaultHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for processing Lagoon vault.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = VAULTS_ADDRESSES[Token.tacpufETH][this.chain]\n .LagoonVault as Address;\n const abi = LagoonVault;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Approve a spender to spend the token.\n *\n * @param spender The spender of the token.\n * @param amount The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, amount: bigint) {\n return this.getContract().write.approve([spender, amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public getAllowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Get the balance for the address.\n *\n * @param address The address to get the balance of.\n * @returns The balance.\n */\n public getBalance(address: Address) {\n return this.getContract().read.balanceOf([address]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public getTotalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Check if the total assets are valid. Used for checking if\n * synchronous deposit is possible.\n *\n * @returns True if the total assets are valid, false otherwise.\n */\n public isTotalAssetsValid() {\n return this.getContract().read.isTotalAssetsValid();\n }\n\n /**\n * Get the symbol of the token. (tacpufETH)\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Deposit an amount of the assets (pufETH) to the vault to get shares\n * (tacpufETH).\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param controller The optional controller of the deposit. Set to\n * the receiver if not sure.\n * @returns The transaction.\n */\n public deposit(amount: bigint, receiver: Address, controller?: Address) {\n if (controller) {\n return this.getContract().write.deposit([amount, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n return this.getContract().write.deposit([amount, receiver], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Synchronously deposit an amount of the assets (pufETH) to the vault\n * to get shares (tacpufETH). This is only possible if `isTotalAssetsValid`\n * is true.\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param referral The referral of the deposit. Falls back to the\n * receiver if not provided.\n * @returns The transaction.\n */\n public syncDeposit(\n amount: bigint,\n receiver: Address,\n referral: Address = receiver,\n ) {\n return this.getContract().write.syncDeposit([amount, receiver, referral], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request an asynchronous deposit of an amount of the assets (pufETH)\n * to the vault to get shares (tacpufETH). This should be used if\n * `isTotalAssetsValid` is false.\n *\n * @param amount The amount to deposit.\n * @param receiver The receiver of the tacpufETH.\n * @param controller The optional controller of the deposit. Falls back\n * to the receiver if not provided.\n * @returns The transaction.\n */\n public requestDeposit(\n amount: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.requestDeposit(\n [amount, receiver, controller],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n value: amount,\n },\n );\n }\n\n /**\n * Get the pending deposit request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the depositor or user who\n * initiated the deposit.\n * @returns The pending deposit request.\n */\n public pendingDepositRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.pendingDepositRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Withdraw an amount of the shares (pufETH) so the receiver\n * gets the assets (pufETH).\n *\n * @param assets The amount of assets (pufETH) to withdraw.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the withdrawal. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public withdraw(\n assets: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.withdraw([assets, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Redeem an amount of the shares (tacpufETH) so the receiver\n * gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the withdrawal. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public redeem(\n shares: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.redeem([shares, receiver, controller], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Request an asynchronous redeem of an amount of the shares (tacpufETH)\n * so the receiver gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @param receiver The receiver of the assets.\n * @param controller The controller of the redemption. Falls back to\n * the receiver if not provided.\n * @returns The transaction.\n */\n public requestRedeem(\n shares: bigint,\n receiver: Address,\n controller: Address = receiver,\n ) {\n return this.getContract().write.requestRedeem(\n [shares, receiver, controller],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the pending redeem request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the redeemer or user who\n * initiated the redeem.\n * @returns The pending redeem request.\n */\n public pendingRedeemRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.pendingRedeemRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Provides a preview of the number of shares that would be minted for\n * a given deposit amount, after fees.\n *\n * @param amount The amount to deposit.\n * @returns The preview.\n */\n public previewDeposit(amount: bigint) {\n return this.getContract().read.previewDeposit([amount]);\n }\n\n /**\n * Provides a preview of the number of shares (tacpufETH) that would be\n * burned for the given amount of assets (pufETH).\n *\n * @param assets The amount of assets (pufETH) to withdraw.\n * @returns The preview.\n */\n public previewWithdraw(assets: bigint) {\n return this.getContract().read.previewWithdraw([assets]);\n }\n\n /**\n * Provides a preview of the amount of assets (pufETH) that would be redeemed\n * for the given shares (tacpufETH), after withdrawal fees. Subtracts\n * the withdrawal fee from the share amount to determine the net\n * shares for asset conversion.\n *\n * @param shares The amount of shares (tacpufETH) to redeem.\n * @returns The preview.\n */\n public previewRedeem(shares: bigint) {\n return this.getContract().read.previewRedeem([shares]);\n }\n\n /**\n * Convert an amount of the shares (tacpufETH) to the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to convert.\n * @param requestId An optional request id for the conversion.\n * @returns The amount of assets (pufETH).\n */\n public convertToAssets(shares: bigint, requestId?: bigint) {\n if (requestId) {\n return this.getContract().read.convertToAssets([shares, requestId]);\n }\n\n return this.getContract().read.convertToAssets([shares]);\n }\n\n /**\n * Convert an amount of the assets (pufETH) to the shares (tacpufETH).\n *\n * @param assets The amount of assets (pufETH) to convert.\n * @param requestId An optional request id for the conversion.\n * @returns The amount of shares (tacpufETH).\n */\n public convertToShares(assets: bigint, requestId?: bigint) {\n if (requestId) {\n return this.getContract().read.convertToShares([assets, requestId]);\n }\n\n return this.getContract().read.convertToShares([assets]);\n }\n\n /**\n * Get the claimable deposit request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the depositor or user who\n * initiated the deposit.\n * @returns The claimable deposit request.\n */\n public claimableDepositRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.claimableDepositRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Get the claimable redeem request for the request id and controller.\n *\n * @param requestId The request id. Use `0` as wild card.\n * @param controller The controller. Usually the redeemer or user who\n * initiated the redeem.\n * @returns The claimable redeem request.\n */\n public claimableRedeemRequest(requestId: bigint = 0n, controller: Address) {\n return this.getContract().read.claimableRedeemRequest([\n requestId,\n controller,\n ]);\n }\n\n /**\n * Claim shares and request a redeem of an amount of the shares (tacpufETH)\n * so the receiver gets the assets (pufETH).\n *\n * @param shares The amount of shares (tacpufETH) to claim.\n * @returns The transaction.\n */\n public claimSharesAndRequestRedeem(shares: bigint) {\n return this.getContract().write.claimSharesAndRequestRedeem([shares], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Claim shares on behalf of multiple controllers.\n *\n * @param controllers The controllers to claim shares on behalf of.\n * @returns The transaction.\n */\n public claimSharesOnBehalf(controllers: Address[]) {\n return this.getContract().write.claimSharesOnBehalf([controllers], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["LagoonVaultHandler","chain","walletClient","publicClient","VIEM_CHAINS","address","VAULTS_ADDRESSES","Token","abi","LagoonVault","client","getContract","spender","amount","owner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