@lidofinance/lsv-cli 1.0.0-alpha.62 → 1.0.0-alpha.63

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 (433) hide show
  1. package/LICENSE +1 -1
  2. package/dist/abi/AccessControlConfirmable.d.ts +4 -3
  3. package/dist/abi/AccessControlConfirmable.js +4 -2
  4. package/dist/abi/AccessControlConfirmable.js.map +1 -1
  5. package/dist/abi/Dashboard.d.ts +121 -88
  6. package/dist/abi/Dashboard.js +67 -78
  7. package/dist/abi/Dashboard.js.map +1 -1
  8. package/dist/abi/LazyOracle.d.ts +44 -3
  9. package/dist/abi/LazyOracle.js +57 -3
  10. package/dist/abi/LazyOracle.js.map +1 -1
  11. package/dist/abi/OperatorGrid.d.ts +615 -1
  12. package/dist/abi/OperatorGrid.js +50 -1
  13. package/dist/abi/OperatorGrid.js.map +1 -1
  14. package/dist/abi/PredepositGuarantee.d.ts +33 -34
  15. package/dist/abi/PredepositGuarantee.js +6 -37
  16. package/dist/abi/PredepositGuarantee.js.map +1 -1
  17. package/dist/abi/StakingVault.d.ts +57 -9
  18. package/dist/abi/StakingVault.js +3 -6
  19. package/dist/abi/StakingVault.js.map +1 -1
  20. package/dist/abi/VaultFactory.d.ts +78 -24
  21. package/dist/abi/VaultFactory.js +19 -1
  22. package/dist/abi/VaultFactory.js.map +1 -1
  23. package/dist/abi/VaultHub.d.ts +38 -4
  24. package/dist/abi/VaultHub.js +13 -0
  25. package/dist/abi/VaultHub.js.map +1 -1
  26. package/dist/abi/VaultViewer.d.ts +130 -196
  27. package/dist/abi/VaultViewer.js +169 -257
  28. package/dist/abi/VaultViewer.js.map +1 -1
  29. package/dist/abi/defi-wrapper/Distributor.d.ts +486 -0
  30. package/dist/abi/defi-wrapper/Distributor.js +633 -0
  31. package/dist/abi/defi-wrapper/Distributor.js.map +1 -0
  32. package/dist/abi/defi-wrapper/Factory.d.ts +1184 -0
  33. package/dist/abi/defi-wrapper/Factory.js +932 -0
  34. package/dist/abi/defi-wrapper/Factory.js.map +1 -0
  35. package/dist/abi/defi-wrapper/StvPool.d.ts +1079 -0
  36. package/dist/abi/defi-wrapper/StvPool.js +1410 -0
  37. package/dist/abi/defi-wrapper/StvPool.js.map +1 -0
  38. package/dist/abi/defi-wrapper/StvStETHPool.d.ts +1772 -0
  39. package/dist/abi/defi-wrapper/StvStETHPool.js +2316 -0
  40. package/dist/abi/defi-wrapper/StvStETHPool.js.map +1 -0
  41. package/dist/abi/defi-wrapper/WithdrawalQueue.d.ts +1265 -0
  42. package/dist/abi/defi-wrapper/WithdrawalQueue.js +1647 -0
  43. package/dist/abi/defi-wrapper/WithdrawalQueue.js.map +1 -0
  44. package/dist/abi/defi-wrapper/index.d.ts +5 -0
  45. package/dist/abi/defi-wrapper/index.js +6 -0
  46. package/dist/abi/defi-wrapper/index.js.map +1 -0
  47. package/dist/configs/constants.d.ts +44 -2
  48. package/dist/configs/constants.js +2 -2
  49. package/dist/configs/constants.js.map +1 -1
  50. package/dist/configs/deployed.d.ts +2 -2
  51. package/dist/configs/deployed.js +48 -6
  52. package/dist/configs/deployed.js.map +1 -1
  53. package/dist/configs/utils.d.ts +1 -0
  54. package/dist/configs/utils.js +4 -0
  55. package/dist/configs/utils.js.map +1 -1
  56. package/dist/contracts/dashboard-impl.d.ts +4 -0
  57. package/dist/contracts/dashboard-impl.js +17 -0
  58. package/dist/contracts/dashboard-impl.js.map +1 -0
  59. package/dist/contracts/dashboard.d.ts +2 -2
  60. package/dist/contracts/dashboard.js +3 -2
  61. package/dist/contracts/dashboard.js.map +1 -1
  62. package/dist/contracts/defi-wrapper/distributor.d.ts +4 -0
  63. package/dist/contracts/defi-wrapper/distributor.js +12 -0
  64. package/dist/contracts/defi-wrapper/distributor.js.map +1 -0
  65. package/dist/contracts/defi-wrapper/factory.d.ts +4 -0
  66. package/dist/contracts/defi-wrapper/factory.js +12 -0
  67. package/dist/contracts/defi-wrapper/factory.js.map +1 -0
  68. package/dist/contracts/defi-wrapper/index.d.ts +5 -0
  69. package/dist/contracts/defi-wrapper/index.js +6 -0
  70. package/dist/contracts/defi-wrapper/index.js.map +1 -0
  71. package/dist/contracts/defi-wrapper/stv-pool.d.ts +4 -0
  72. package/dist/contracts/defi-wrapper/stv-pool.js +12 -0
  73. package/dist/contracts/defi-wrapper/stv-pool.js.map +1 -0
  74. package/dist/contracts/defi-wrapper/stv-steth-pool.d.ts +4 -0
  75. package/dist/contracts/defi-wrapper/stv-steth-pool.js +12 -0
  76. package/dist/contracts/defi-wrapper/stv-steth-pool.js.map +1 -0
  77. package/dist/contracts/defi-wrapper/withdrawal-queue.d.ts +4 -0
  78. package/dist/contracts/defi-wrapper/withdrawal-queue.js +12 -0
  79. package/dist/contracts/defi-wrapper/withdrawal-queue.js.map +1 -0
  80. package/dist/contracts/index.d.ts +1 -0
  81. package/dist/contracts/index.js +1 -0
  82. package/dist/contracts/index.js.map +1 -1
  83. package/dist/contracts/lazy-oracle.js +3 -2
  84. package/dist/contracts/lazy-oracle.js.map +1 -1
  85. package/dist/contracts/locator.d.ts +3 -9655
  86. package/dist/contracts/locator.js +4 -3
  87. package/dist/contracts/locator.js.map +1 -1
  88. package/dist/contracts/operator-grid.d.ts +1 -1
  89. package/dist/contracts/operator-grid.js +3 -2
  90. package/dist/contracts/operator-grid.js.map +1 -1
  91. package/dist/contracts/pdg.js +3 -2
  92. package/dist/contracts/pdg.js.map +1 -1
  93. package/dist/contracts/steth.d.ts +54 -54
  94. package/dist/contracts/steth.js +3 -2
  95. package/dist/contracts/steth.js.map +1 -1
  96. package/dist/contracts/vault-factory.d.ts +3 -26297
  97. package/dist/contracts/vault-factory.js +4 -3
  98. package/dist/contracts/vault-factory.js.map +1 -1
  99. package/dist/contracts/vault-hub.js +3 -2
  100. package/dist/contracts/vault-hub.js.map +1 -1
  101. package/dist/contracts/vault-viewer.d.ts +3 -11789
  102. package/dist/contracts/vault-viewer.js +9 -7
  103. package/dist/contracts/vault-viewer.js.map +1 -1
  104. package/dist/contracts/vault.d.ts +2 -2
  105. package/dist/contracts/vault.js +3 -2
  106. package/dist/contracts/vault.js.map +1 -1
  107. package/dist/contracts/wsteth.d.ts +3 -24690
  108. package/dist/contracts/wsteth.js +4 -3
  109. package/dist/contracts/wsteth.js.map +1 -1
  110. package/dist/features/defi-wrapper/create-vault.d.ts +17 -0
  111. package/dist/features/defi-wrapper/create-vault.js +137 -0
  112. package/dist/features/defi-wrapper/create-vault.js.map +1 -0
  113. package/dist/features/defi-wrapper/defi-wrapper-factory.d.ts +112 -0
  114. package/dist/features/defi-wrapper/defi-wrapper-factory.js +228 -0
  115. package/dist/features/defi-wrapper/defi-wrapper-factory.js.map +1 -0
  116. package/dist/features/defi-wrapper/index.d.ts +3 -0
  117. package/dist/features/defi-wrapper/index.js +4 -0
  118. package/dist/features/defi-wrapper/index.js.map +1 -0
  119. package/dist/features/defi-wrapper/pool-info.d.ts +35 -0
  120. package/dist/features/defi-wrapper/pool-info.js +97 -0
  121. package/dist/features/defi-wrapper/pool-info.js.map +1 -0
  122. package/dist/features/deposits/check-bls-deposits.d.ts +2 -1
  123. package/dist/features/deposits/check-bls-deposits.js +11 -2
  124. package/dist/features/deposits/check-bls-deposits.js.map +1 -1
  125. package/dist/features/deposits/make-pdg-proof.d.ts +8 -0
  126. package/dist/features/deposits/make-pdg-proof.js +17 -1
  127. package/dist/features/deposits/make-pdg-proof.js.map +1 -1
  128. package/dist/features/deposits/no-pdg.d.ts +1 -1
  129. package/dist/features/deposits/no-pdg.js +6 -3
  130. package/dist/features/deposits/no-pdg.js.map +1 -1
  131. package/dist/features/dev-tools/impersonate.d.ts +14 -0
  132. package/dist/features/dev-tools/impersonate.js +64 -0
  133. package/dist/features/dev-tools/impersonate.js.map +1 -0
  134. package/dist/features/dev-tools/index.d.ts +1 -0
  135. package/dist/features/dev-tools/index.js +2 -0
  136. package/dist/features/dev-tools/index.js.map +1 -0
  137. package/dist/features/index.d.ts +2 -0
  138. package/dist/features/index.js +2 -0
  139. package/dist/features/index.js.map +1 -1
  140. package/dist/features/mint-burn/allowance.js +1 -1
  141. package/dist/features/mint-burn/allowance.js.map +1 -1
  142. package/dist/features/pdg.d.ts +7 -0
  143. package/dist/features/pdg.js +5 -5
  144. package/dist/features/pdg.js.map +1 -1
  145. package/dist/features/utils/get-boolean.d.ts +1 -0
  146. package/dist/features/utils/get-boolean.js +13 -0
  147. package/dist/features/utils/get-boolean.js.map +1 -0
  148. package/dist/features/utils/index.d.ts +2 -0
  149. package/dist/features/utils/index.js +2 -0
  150. package/dist/features/utils/index.js.map +1 -1
  151. package/dist/features/utils/quarantine.d.ts +2 -0
  152. package/dist/features/utils/quarantine.js +2 -0
  153. package/dist/features/utils/quarantine.js.map +1 -1
  154. package/dist/features/utils/report-fresh.js +17 -1
  155. package/dist/features/utils/report-fresh.js.map +1 -1
  156. package/dist/features/utils/settled-growth.d.ts +1 -0
  157. package/dist/features/utils/settled-growth.js +16 -0
  158. package/dist/features/utils/settled-growth.js.map +1 -0
  159. package/dist/features/vault-factory.d.ts +2 -2
  160. package/dist/features/vault-factory.js +8 -3
  161. package/dist/features/vault-factory.js.map +1 -1
  162. package/dist/features/vault-operations/create-vault.d.ts +4 -2
  163. package/dist/features/vault-operations/create-vault.js +13 -5
  164. package/dist/features/vault-operations/create-vault.js.map +1 -1
  165. package/dist/features/vault-operations/dashboard-by-vault.js +4 -4
  166. package/dist/features/vault-operations/dashboard-by-vault.js.map +1 -1
  167. package/dist/features/vault-operations/vault-info.js +5 -3
  168. package/dist/features/vault-operations/vault-info.js.map +1 -1
  169. package/dist/features/vault-operations/vault-overview.js +13 -13
  170. package/dist/features/vault-operations/vault-overview.js.map +1 -1
  171. package/dist/features/vault-operations/vault-roles.d.ts +2 -1
  172. package/dist/features/vault-operations/vault-roles.js +22 -23
  173. package/dist/features/vault-operations/vault-roles.js.map +1 -1
  174. package/dist/features/vault-operations/vaults-by-role.d.ts +5 -0
  175. package/dist/features/vault-operations/vaults-by-role.js +123 -36
  176. package/dist/features/vault-operations/vaults-by-role.js.map +1 -1
  177. package/dist/features/vault.js +4 -2
  178. package/dist/features/vault.js.map +1 -1
  179. package/dist/index.js +17 -10
  180. package/dist/index.js.map +1 -1
  181. package/dist/programs/account/read.js +1 -1
  182. package/dist/programs/account/read.js.map +1 -1
  183. package/dist/programs/account/write.js +14 -0
  184. package/dist/programs/account/write.js.map +1 -1
  185. package/dist/programs/contracts/dashboard/config.js +4 -4
  186. package/dist/programs/contracts/dashboard/config.js.map +1 -1
  187. package/dist/programs/contracts/dashboard/read.js +9 -9
  188. package/dist/programs/contracts/dashboard/read.js.map +1 -1
  189. package/dist/programs/contracts/dashboard/write.js +118 -46
  190. package/dist/programs/contracts/dashboard/write.js.map +1 -1
  191. package/dist/programs/contracts/hub/config.js +0 -10
  192. package/dist/programs/contracts/hub/config.js.map +1 -1
  193. package/dist/programs/contracts/hub/read.js +63 -2
  194. package/dist/programs/contracts/hub/read.js.map +1 -1
  195. package/dist/programs/contracts/hub/write.js +1 -1
  196. package/dist/programs/contracts/hub/write.js.map +1 -1
  197. package/dist/programs/contracts/lazy-oracle/config.js +33 -0
  198. package/dist/programs/contracts/lazy-oracle/config.js.map +1 -1
  199. package/dist/programs/contracts/operator-grid/write.js +2 -75
  200. package/dist/programs/contracts/operator-grid/write.js.map +1 -1
  201. package/dist/programs/contracts/pdg/read.js +2 -5
  202. package/dist/programs/contracts/pdg/read.js.map +1 -1
  203. package/dist/programs/contracts/pdg/write.js +41 -9
  204. package/dist/programs/contracts/pdg/write.js.map +1 -1
  205. package/dist/programs/contracts/vault/write.js +34 -23
  206. package/dist/programs/contracts/vault/write.js.map +1 -1
  207. package/dist/programs/contracts/vault-factory/config.js +14 -1
  208. package/dist/programs/contracts/vault-factory/config.js.map +1 -1
  209. package/dist/programs/contracts/vault-factory/write.js +25 -15
  210. package/dist/programs/contracts/vault-factory/write.js.map +1 -1
  211. package/dist/programs/contracts/vault-viewer/config.js +102 -59
  212. package/dist/programs/contracts/vault-viewer/config.js.map +1 -1
  213. package/dist/programs/contracts/vault-viewer/read.js +22 -76
  214. package/dist/programs/contracts/vault-viewer/read.js.map +1 -1
  215. package/dist/programs/defi-wrapper/contracts/distributor/config.d.ts +3 -0
  216. package/dist/programs/defi-wrapper/contracts/distributor/config.js +44 -0
  217. package/dist/programs/defi-wrapper/contracts/distributor/config.js.map +1 -0
  218. package/dist/programs/defi-wrapper/contracts/distributor/index.d.ts +3 -0
  219. package/dist/programs/defi-wrapper/contracts/distributor/index.js +4 -0
  220. package/dist/programs/defi-wrapper/contracts/distributor/index.js.map +1 -0
  221. package/dist/programs/defi-wrapper/contracts/distributor/main.d.ts +1 -0
  222. package/dist/programs/defi-wrapper/contracts/distributor/main.js +5 -0
  223. package/dist/programs/defi-wrapper/contracts/distributor/main.js.map +1 -0
  224. package/dist/programs/defi-wrapper/contracts/distributor/read.d.ts +1 -0
  225. package/dist/programs/defi-wrapper/contracts/distributor/read.js +40 -0
  226. package/dist/programs/defi-wrapper/contracts/distributor/read.js.map +1 -0
  227. package/dist/programs/defi-wrapper/contracts/distributor/write.d.ts +1 -0
  228. package/dist/programs/defi-wrapper/contracts/distributor/write.js +70 -0
  229. package/dist/programs/defi-wrapper/contracts/distributor/write.js.map +1 -0
  230. package/dist/programs/defi-wrapper/contracts/factory/config.d.ts +3 -0
  231. package/dist/programs/defi-wrapper/contracts/factory/config.js +2 -0
  232. package/dist/programs/defi-wrapper/contracts/factory/config.js.map +1 -0
  233. package/dist/programs/defi-wrapper/contracts/factory/index.d.ts +3 -0
  234. package/dist/programs/defi-wrapper/contracts/factory/index.js +4 -0
  235. package/dist/programs/defi-wrapper/contracts/factory/index.js.map +1 -0
  236. package/dist/programs/defi-wrapper/contracts/factory/main.d.ts +1 -0
  237. package/dist/programs/defi-wrapper/contracts/factory/main.js +6 -0
  238. package/dist/programs/defi-wrapper/contracts/factory/main.js.map +1 -0
  239. package/dist/programs/defi-wrapper/contracts/factory/read.d.ts +1 -0
  240. package/dist/programs/defi-wrapper/contracts/factory/read.js +50 -0
  241. package/dist/programs/defi-wrapper/contracts/factory/read.js.map +1 -0
  242. package/dist/programs/defi-wrapper/contracts/factory/write.d.ts +1 -0
  243. package/dist/programs/defi-wrapper/contracts/factory/write.js +144 -0
  244. package/dist/programs/defi-wrapper/contracts/factory/write.js.map +1 -0
  245. package/dist/programs/defi-wrapper/contracts/index.d.ts +6 -0
  246. package/dist/programs/defi-wrapper/contracts/index.js +7 -0
  247. package/dist/programs/defi-wrapper/contracts/index.js.map +1 -0
  248. package/dist/programs/defi-wrapper/contracts/main.d.ts +1 -0
  249. package/dist/programs/defi-wrapper/contracts/main.js +6 -0
  250. package/dist/programs/defi-wrapper/contracts/main.js.map +1 -0
  251. package/dist/programs/defi-wrapper/contracts/stv-pool/config.d.ts +3 -0
  252. package/dist/programs/defi-wrapper/contracts/stv-pool/config.js +73 -0
  253. package/dist/programs/defi-wrapper/contracts/stv-pool/config.js.map +1 -0
  254. package/dist/programs/defi-wrapper/contracts/stv-pool/index.d.ts +3 -0
  255. package/dist/programs/defi-wrapper/contracts/stv-pool/index.js +4 -0
  256. package/dist/programs/defi-wrapper/contracts/stv-pool/index.js.map +1 -0
  257. package/dist/programs/defi-wrapper/contracts/stv-pool/main.d.ts +1 -0
  258. package/dist/programs/defi-wrapper/contracts/stv-pool/main.js +6 -0
  259. package/dist/programs/defi-wrapper/contracts/stv-pool/main.js.map +1 -0
  260. package/dist/programs/defi-wrapper/contracts/stv-pool/read.d.ts +1 -0
  261. package/dist/programs/defi-wrapper/contracts/stv-pool/read.js +70 -0
  262. package/dist/programs/defi-wrapper/contracts/stv-pool/read.js.map +1 -0
  263. package/dist/programs/defi-wrapper/contracts/stv-pool/write.d.ts +1 -0
  264. package/dist/programs/defi-wrapper/contracts/stv-pool/write.js +138 -0
  265. package/dist/programs/defi-wrapper/contracts/stv-pool/write.js.map +1 -0
  266. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/config.d.ts +3 -0
  267. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/config.js +120 -0
  268. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/config.js.map +1 -0
  269. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/index.d.ts +3 -0
  270. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/index.js +4 -0
  271. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/index.js.map +1 -0
  272. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/main.d.ts +1 -0
  273. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/main.js +6 -0
  274. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/main.js.map +1 -0
  275. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/read.d.ts +1 -0
  276. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/read.js +70 -0
  277. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/read.js.map +1 -0
  278. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/write.d.ts +1 -0
  279. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/write.js +173 -0
  280. package/dist/programs/defi-wrapper/contracts/stv-steth-pool/write.js.map +1 -0
  281. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/config.d.ts +3 -0
  282. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/config.js +66 -0
  283. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/config.js.map +1 -0
  284. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/index.d.ts +3 -0
  285. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/index.js +4 -0
  286. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/index.js.map +1 -0
  287. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/main.d.ts +1 -0
  288. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/main.js +6 -0
  289. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/main.js.map +1 -0
  290. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/read.d.ts +1 -0
  291. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/read.js +65 -0
  292. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/read.js.map +1 -0
  293. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/write.d.ts +1 -0
  294. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/write.js +171 -0
  295. package/dist/programs/defi-wrapper/contracts/withdrawal-queue/write.js.map +1 -0
  296. package/dist/programs/defi-wrapper/index.d.ts +3 -0
  297. package/dist/programs/defi-wrapper/index.js +4 -0
  298. package/dist/programs/defi-wrapper/index.js.map +1 -0
  299. package/dist/programs/defi-wrapper/main.d.ts +1 -0
  300. package/dist/programs/defi-wrapper/main.js +6 -0
  301. package/dist/programs/defi-wrapper/main.js.map +1 -0
  302. package/dist/programs/defi-wrapper/use-cases/health/index.d.ts +3 -0
  303. package/dist/programs/defi-wrapper/use-cases/health/index.js +4 -0
  304. package/dist/programs/defi-wrapper/use-cases/health/index.js.map +1 -0
  305. package/dist/programs/defi-wrapper/use-cases/health/main.d.ts +1 -0
  306. package/dist/programs/defi-wrapper/use-cases/health/main.js +6 -0
  307. package/dist/programs/defi-wrapper/use-cases/health/main.js.map +1 -0
  308. package/dist/programs/defi-wrapper/use-cases/health/read.d.ts +1 -0
  309. package/dist/programs/defi-wrapper/use-cases/health/read.js +338 -0
  310. package/dist/programs/defi-wrapper/use-cases/health/read.js.map +1 -0
  311. package/dist/programs/defi-wrapper/use-cases/health/utils.d.ts +56 -0
  312. package/dist/programs/defi-wrapper/use-cases/health/utils.js +389 -0
  313. package/dist/programs/defi-wrapper/use-cases/health/utils.js.map +1 -0
  314. package/dist/programs/defi-wrapper/use-cases/health/write.d.ts +1 -0
  315. package/dist/programs/defi-wrapper/use-cases/health/write.js +254 -0
  316. package/dist/programs/defi-wrapper/use-cases/health/write.js.map +1 -0
  317. package/dist/programs/defi-wrapper/use-cases/index.d.ts +3 -0
  318. package/dist/programs/defi-wrapper/use-cases/index.js +4 -0
  319. package/dist/programs/defi-wrapper/use-cases/index.js.map +1 -0
  320. package/dist/programs/defi-wrapper/use-cases/main.d.ts +1 -0
  321. package/dist/programs/defi-wrapper/use-cases/main.js +6 -0
  322. package/dist/programs/defi-wrapper/use-cases/main.js.map +1 -0
  323. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/create-pool.d.ts +1 -0
  324. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/create-pool.js +143 -0
  325. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/create-pool.js.map +1 -0
  326. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/index.d.ts +3 -0
  327. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/index.js +5 -0
  328. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/index.js.map +1 -0
  329. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/main.d.ts +1 -0
  330. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/main.js +6 -0
  331. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/main.js.map +1 -0
  332. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/read.d.ts +1 -0
  333. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/read.js +130 -0
  334. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/read.js.map +1 -0
  335. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/write.d.ts +1 -0
  336. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/write.js +13 -0
  337. package/dist/programs/defi-wrapper/use-cases/wrapper-operations/write.js.map +1 -0
  338. package/dist/programs/dev-tools/anvil/index.d.ts +2 -0
  339. package/dist/programs/dev-tools/anvil/index.js +3 -0
  340. package/dist/programs/dev-tools/anvil/index.js.map +1 -0
  341. package/dist/programs/dev-tools/anvil/main.d.ts +1 -0
  342. package/dist/programs/dev-tools/anvil/main.js +5 -0
  343. package/dist/programs/dev-tools/anvil/main.js.map +1 -0
  344. package/dist/programs/dev-tools/anvil/write.d.ts +1 -0
  345. package/dist/programs/dev-tools/anvil/write.js +122 -0
  346. package/dist/programs/dev-tools/anvil/write.js.map +1 -0
  347. package/dist/programs/dev-tools/defi-wrapper/index.d.ts +2 -0
  348. package/dist/programs/dev-tools/defi-wrapper/index.js +3 -0
  349. package/dist/programs/dev-tools/defi-wrapper/index.js.map +1 -0
  350. package/dist/programs/dev-tools/defi-wrapper/main.d.ts +1 -0
  351. package/dist/programs/dev-tools/defi-wrapper/main.js +6 -0
  352. package/dist/programs/dev-tools/defi-wrapper/main.js.map +1 -0
  353. package/dist/programs/dev-tools/defi-wrapper/write.d.ts +1 -0
  354. package/dist/programs/dev-tools/defi-wrapper/write.js +77 -0
  355. package/dist/programs/dev-tools/defi-wrapper/write.js.map +1 -0
  356. package/dist/programs/dev-tools/index.d.ts +3 -0
  357. package/dist/programs/dev-tools/index.js +4 -0
  358. package/dist/programs/dev-tools/index.js.map +1 -0
  359. package/dist/programs/dev-tools/main.d.ts +1 -0
  360. package/dist/programs/dev-tools/main.js +6 -0
  361. package/dist/programs/dev-tools/main.js.map +1 -0
  362. package/dist/programs/index.d.ts +2 -0
  363. package/dist/programs/index.js +2 -0
  364. package/dist/programs/index.js.map +1 -1
  365. package/dist/programs/pdg-helpers.js +5 -5
  366. package/dist/programs/pdg-helpers.js.map +1 -1
  367. package/dist/programs/use-cases/deposits/read.js +4 -4
  368. package/dist/programs/use-cases/deposits/read.js.map +1 -1
  369. package/dist/programs/use-cases/deposits/write.js +111 -16
  370. package/dist/programs/use-cases/deposits/write.js.map +1 -1
  371. package/dist/programs/use-cases/metrics/read.js +29 -13
  372. package/dist/programs/use-cases/metrics/read.js.map +1 -1
  373. package/dist/programs/use-cases/report/write.js +3 -0
  374. package/dist/programs/use-cases/report/write.js.map +1 -1
  375. package/dist/programs/use-cases/vault-operations/create-vault.js +13 -7
  376. package/dist/programs/use-cases/vault-operations/create-vault.js.map +1 -1
  377. package/dist/programs/use-cases/vault-operations/write.js +5 -0
  378. package/dist/programs/use-cases/vault-operations/write.js.map +1 -1
  379. package/dist/providers/wallet.d.ts +6981 -166
  380. package/dist/providers/wallet.js +15 -5
  381. package/dist/providers/wallet.js.map +1 -1
  382. package/dist/utils/arguments.d.ts +5 -0
  383. package/dist/utils/arguments.js +24 -3
  384. package/dist/utils/arguments.js.map +1 -1
  385. package/dist/utils/bls.d.ts +2 -2
  386. package/dist/utils/bls.js +8 -7
  387. package/dist/utils/bls.js.map +1 -1
  388. package/dist/utils/cache.d.ts +26 -0
  389. package/dist/utils/cache.js +88 -3
  390. package/dist/utils/cache.js.map +1 -1
  391. package/dist/utils/charts/blessed/charts-apr.js +1 -1
  392. package/dist/utils/charts/blessed/charts-apr.js.map +1 -1
  393. package/dist/utils/charts/blessed/charts-rewards.js +1 -1
  394. package/dist/utils/charts/blessed/charts-rewards.js.map +1 -1
  395. package/dist/utils/charts/simple/simple-charts.js +1 -1
  396. package/dist/utils/charts/simple/simple-charts.js.map +1 -1
  397. package/dist/utils/commands/confirmations.d.ts +1 -1
  398. package/dist/utils/commands/confirmations.js +5 -5
  399. package/dist/utils/commands/confirmations.js.map +1 -1
  400. package/dist/utils/fetchCL.d.ts +1 -5
  401. package/dist/utils/fetchCL.js +5 -7
  402. package/dist/utils/fetchCL.js.map +1 -1
  403. package/dist/utils/health/health-utils.d.ts +54 -54
  404. package/dist/utils/health/health-utils.js +1 -1
  405. package/dist/utils/health/health-utils.js.map +1 -1
  406. package/dist/utils/prompts/confirmations.js +1 -1
  407. package/dist/utils/prompts/confirmations.js.map +1 -1
  408. package/dist/utils/proof/constants.d.ts +6 -0
  409. package/dist/utils/proof/constants.js +7 -0
  410. package/dist/utils/proof/constants.js.map +1 -0
  411. package/dist/utils/proof/first-validator-gindex.js +0 -4
  412. package/dist/utils/proof/first-validator-gindex.js.map +1 -1
  413. package/dist/utils/proof/proofs.d.ts +7 -8
  414. package/dist/utils/proof/proofs.js +36 -28
  415. package/dist/utils/proof/proofs.js.map +1 -1
  416. package/dist/utils/read-programs-by-abi.d.ts +1 -1
  417. package/dist/utils/read-programs-by-abi.js +4 -18
  418. package/dist/utils/read-programs-by-abi.js.map +1 -1
  419. package/dist/utils/report/report.js +1 -1
  420. package/dist/utils/report/report.js.map +1 -1
  421. package/dist/utils/report/statistic-data.js +1 -1
  422. package/dist/utils/report/statistic-data.js.map +1 -1
  423. package/dist/utils/transactions/tx-private-key.d.ts +2 -2
  424. package/dist/utils/transactions/tx-private-key.js +6 -6
  425. package/dist/utils/transactions/tx-private-key.js.map +1 -1
  426. package/dist/utils/transactions/tx-wc.d.ts +29 -1
  427. package/dist/utils/transactions/tx-wc.js +43 -26
  428. package/dist/utils/transactions/tx-wc.js.map +1 -1
  429. package/dist/utils/wallet-connect.d.ts +4 -7664
  430. package/dist/utils/wallet-connect.js +17 -5
  431. package/dist/utils/wallet-connect.js.map +1 -1
  432. package/dist/version/index.js +1 -1
  433. package/package.json +5 -6
@@ -1,8 +1,9 @@
1
1
  import { Option } from 'commander';
2
- import { getVaultViewerContract } from '../../../contracts/index.js';
3
- import { getAccount } from '../../../providers/index.js';
4
2
  import { VaultViewerAbi } from '../../../abi/index.js';
5
- import { generateReadCommands, callReadMethod, callReadMethodSilent, logTable, getCommandsJson, logInfo, } from '../../../utils/index.js';
3
+ import { getAccount } from '../../../providers/index.js';
4
+ import { getVaultsByAddress, getVaultsByRoleMember, getAllVaults, } from '../../../features/index.js';
5
+ import { getVaultViewerContract } from '../../../contracts/index.js';
6
+ import { generateReadCommands, logTable, getCommandsJson, logInfo, stringToHex, } from '../../../utils/index.js';
6
7
  import { vaultViewer } from './main.js';
7
8
  import { readCommandConfig } from './config.js';
8
9
  export const vaultViewerRead = vaultViewer
@@ -17,115 +18,60 @@ vaultViewerRead.on('option:-cmd2json', function () {
17
18
  generateReadCommands(VaultViewerAbi, getVaultViewerContract, vaultViewerRead, readCommandConfig);
18
19
  vaultViewerRead
19
20
  .command('my')
20
- .description('get my vaults')
21
+ .description('get all my vaults')
21
22
  .option('-s, --simple', 'simple output')
22
23
  .action(async ({ simple }) => {
23
- const contract = getVaultViewerContract();
24
- const account = await getAccount();
25
- const vaults = await callReadMethodSilent(contract, 'vaultsByOwner', [
26
- account.address,
27
- ]);
28
- if (simple) {
29
- console.info(vaults);
30
- return;
31
- }
32
- logTable({
33
- data: vaults.map((vault, idx) => [idx, vault]),
34
- params: {
35
- head: ['Index', 'Vault Address'],
36
- },
37
- });
38
- });
39
- vaultViewerRead
40
- .command('my-bound')
41
- .description('get my vaults - bound')
42
- .argument('<from>', 'from - vault index')
43
- .argument('<to>', 'to - vault index')
44
- .option('-s, --simple', 'simple output')
45
- .action(async (from, to, { simple }) => {
46
- const contract = getVaultViewerContract();
47
24
  const account = await getAccount();
48
- const [vaults] = await callReadMethod(contract, 'vaultsByOwnerBound', [
49
- account.address,
50
- from,
51
- to,
52
- ]);
25
+ const vaults = await getVaultsByAddress(account.address);
53
26
  if (simple) {
54
27
  console.info(vaults);
55
28
  return;
56
29
  }
57
30
  logTable({
58
- data: vaults.map((vault, idx) => [idx, vault]),
31
+ data: Object.entries(vaults).map(([vault, roles]) => [
32
+ vault,
33
+ roles.join(', '),
34
+ ]),
59
35
  params: {
60
- head: ['Index', 'Vault Address'],
36
+ head: ['Vault Address', 'Roles'],
61
37
  },
62
38
  });
63
39
  });
64
40
  vaultViewerRead
65
41
  .command('my-by-role')
66
- .description('get my vaults by role')
67
- .argument('<role>', 'role')
42
+ .description('get all vaults where I have a role')
43
+ .argument('<role>', 'role', stringToHex)
68
44
  .option('-s, --simple', 'simple output')
69
45
  .action(async (role, { simple }) => {
70
- const contract = getVaultViewerContract();
71
- const account = await getAccount();
72
- const vaults = await callReadMethodSilent(contract, 'vaultsByRole', [
73
- role,
74
- account.address,
75
- ]);
76
- if (simple) {
77
- console.info(vaults);
78
- return;
79
- }
80
- logTable({
81
- data: vaults.map((vault, idx) => [idx, vault]),
82
- params: {
83
- head: ['Index', 'Vault Address'],
84
- },
85
- });
86
- });
87
- vaultViewerRead
88
- .command('my-by-role-bound')
89
- .description('get my vaults by role - bound')
90
- .argument('<from>', 'from - vault index')
91
- .argument('<to>', 'to - vault index')
92
- .option('-s, --simple', 'simple output')
93
- .action(async (role, from, to, { simple }) => {
94
- const contract = getVaultViewerContract();
95
46
  const account = await getAccount();
96
- const [vaults] = await callReadMethod(contract, 'vaultsByRoleBound', [
97
- role,
98
- account.address,
99
- from,
100
- to,
101
- ]);
47
+ const vaults = await getVaultsByRoleMember(role, account.address);
102
48
  if (simple) {
103
49
  console.info(vaults);
104
50
  return;
105
51
  }
106
52
  logTable({
107
- data: vaults.map((vault, idx) => [idx, vault]),
53
+ data: vaults.map((vault) => [vault]),
108
54
  params: {
109
- head: ['Index', 'Vault Address'],
55
+ head: ['Vault Address'],
110
56
  },
111
57
  });
112
58
  });
113
59
  vaultViewerRead
114
- .command('connected')
115
- .description('get vaults connected to vault hub')
60
+ .command('all')
61
+ .description('get all vaults connected to vault hub')
116
62
  .option('-s, --simple', 'simple output')
117
63
  .action(async ({ simple }) => {
118
- const contract = getVaultViewerContract();
119
- const vaults = await callReadMethodSilent(contract, 'vaultsConnected');
64
+ const vaults = await getAllVaults();
120
65
  if (simple) {
121
66
  console.info(vaults);
122
67
  return;
123
68
  }
124
69
  logTable({
125
- data: vaults.map((vault, idx) => [idx, vault]),
70
+ data: vaults.map((vault) => [vault]),
126
71
  params: {
127
- head: ['Index', 'Vault Address'],
72
+ head: ['Vault Address'],
128
73
  },
129
74
  });
75
+ logInfo(`Total vaults: ${vaults.length}`);
130
76
  });
131
77
  //# sourceMappingURL=read.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../programs/contracts/vault-viewer/read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB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C,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,eAAe,CAAC;SACxB;KACF,CAAC,CAAC;IACH,OAAO,CAAC,iBAAiB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DistributorAbi } from '../../../../abi/defi-wrapper/index.js';
2
+ import { ReadProgramCommandConfig } from '../../../../utils/index.js';
3
+ export declare const readCommandConfig: ReadProgramCommandConfig<typeof DistributorAbi>;
@@ -0,0 +1,44 @@
1
+ import { stringToAddress } from '../../../../utils/index.js';
2
+ export const readCommandConfig = {
3
+ cid: {
4
+ name: 'cid',
5
+ description: 'get IPFS CID of the last published Merkle tree',
6
+ },
7
+ claimed: {
8
+ name: 'claimed',
9
+ description: 'get claimed amounts by account and token',
10
+ arguments: {
11
+ account: {
12
+ name: 'account',
13
+ description: 'account address',
14
+ modifier: stringToAddress,
15
+ },
16
+ token: {
17
+ name: 'token',
18
+ description: 'token address',
19
+ modifier: stringToAddress,
20
+ },
21
+ },
22
+ },
23
+ getTokens: {
24
+ name: 'get-tokens',
25
+ description: 'get the list of supported tokens',
26
+ },
27
+ lastProcessedBlock: {
28
+ name: 'last-processed-block',
29
+ description: 'get the last processed block number for user tracking',
30
+ },
31
+ root: {
32
+ name: 'root',
33
+ description: 'get the Merkle root of the distribution',
34
+ },
35
+ MANAGER_ROLE: {
36
+ name: 'MANAGER_ROLE',
37
+ description: 'get the manager role',
38
+ },
39
+ DEFAULT_ADMIN_ROLE: {
40
+ name: 'DEFAULT_ADMIN_ROLE',
41
+ description: 'get the default admin role',
42
+ },
43
+ };
44
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/distributor/config.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,eAAe,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,CAAC,MAAM,iBAAiB,GAE1B;IACF,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,gDAAgD;KAC9D;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,0CAA0C;QACvD,SAAS,EAAE;YACT,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iBAAiB;gBAC9B,QAAQ,EAAE,eAAe;aAC1B;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,eAAe;gBAC5B,QAAQ,EAAE,eAAe;aAC1B;SACF;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,kCAAkC;KAChD;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uDAAuD;KACrE;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,yCAAyC;KACvD;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,sBAAsB;KACpC;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,4BAA4B;KAC1C;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './main.js';
2
+ export * from './read.js';
3
+ export * from './write.js';
@@ -0,0 +1,4 @@
1
+ export * from './main.js';
2
+ export * from './read.js';
3
+ export * from './write.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/distributor/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const distributor: import("commander").Command;
@@ -0,0 +1,5 @@
1
+ import { defiWrapperContracts } from '../main.js';
2
+ export const distributor = defiWrapperContracts
3
+ .command('distributor')
4
+ .description('distributor contract');
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/distributor/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB;KAC5C,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { Option } from 'commander';
2
+ import { DistributorAbi } from '../../../../abi/defi-wrapper/index.js';
3
+ import { getDistributorContract } from '../../../../contracts/defi-wrapper/index.js';
4
+ import { generateReadCommands, logInfo, getCommandsJson, stringToAddress, callReadMethodSilent, logResult, } from '../../../../utils/index.js';
5
+ import { distributor } from './main.js';
6
+ import { readCommandConfig } from './config.js';
7
+ const distributorRead = distributor
8
+ .command('read')
9
+ .alias('r')
10
+ .description('read commands');
11
+ distributorRead.addOption(new Option('-cmd2json'));
12
+ distributorRead.on('option:-cmd2json', function () {
13
+ logInfo(getCommandsJson(distributorRead));
14
+ process.exit();
15
+ });
16
+ distributorRead
17
+ .command('info')
18
+ .description('get distributor base info')
19
+ .argument('<address>', 'distributor address', stringToAddress)
20
+ .action(async (address) => {
21
+ const contract = await getDistributorContract(address);
22
+ const [DEFAULT_ADMIN_ROLE, MANAGER_ROLE, cid, root, lastProcessedBlock] = await Promise.all([
23
+ callReadMethodSilent(contract, 'DEFAULT_ADMIN_ROLE'),
24
+ callReadMethodSilent(contract, 'MANAGER_ROLE'),
25
+ callReadMethodSilent(contract, 'cid'),
26
+ callReadMethodSilent(contract, 'root'),
27
+ callReadMethodSilent(contract, 'lastProcessedBlock'),
28
+ ]);
29
+ logResult({
30
+ data: [
31
+ ['DEFAULT_ADMIN_ROLE', DEFAULT_ADMIN_ROLE],
32
+ ['MANAGER_ROLE', MANAGER_ROLE],
33
+ ['cid', cid],
34
+ ['root', root],
35
+ ['lastProcessedBlock', lastProcessedBlock],
36
+ ],
37
+ });
38
+ });
39
+ generateReadCommands(DistributorAbi, getDistributorContract, distributorRead, readCommandConfig);
40
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/distributor/read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,eAAe,GAAG,WAAW;KAChC,OAAO,CAAC,MAAM,CAAC;KACf,KAAK,CAAC,GAAG,CAAC;KACV,WAAW,CAAC,eAAe,CAAC,CAAC;AAEhC,eAAe,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;AACnD,eAAe,CAAC,EAAE,CAAC,kBAAkB,EAAE;IACrC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,eAAe;KACZ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2BAA2B,CAAC;KACxC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,EAAE,eAAe,CAAC;KAC7D,MAAM,CAAC,KAAK,EAAE,OAAgB,EAAE,EAAE;IACjC,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAEvD,MAAM,CAAC,kBAAkB,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,kBAAkB,CAAC,GACrE,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,CAAC;QACpD,oBAAoB,CAAC,QAAQ,EAAE,cAAc,CAAC;QAC9C,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC;QACrC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC;QACtC,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,CAAC;KACrD,CAAC,CAAC;IAEL,SAAS,CAAC;QACR,IAAI,EAAE;YACJ,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAC1C,CAAC,cAAc,EAAE,YAAY,CAAC;YAC9B,CAAC,KAAK,EAAE,GAAG,CAAC;YACZ,CAAC,MAAM,EAAE,IAAI,CAAC;YACd,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;SAC3C;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,oBAAoB,CAClB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,iBAAiB,CAClB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { Option } from 'commander';
2
+ import { logInfo, getCommandsJson, stringToAddress, callWriteMethodWithReceipt, etherToWei, stringToHexArray, confirmOperation, } from '../../../../utils/index.js';
3
+ import { distributor } from './main.js';
4
+ import { formatEther, stringToHex } from 'viem';
5
+ import { getDistributorContract } from '../../../../contracts/defi-wrapper/index.js';
6
+ const distributorWrite = distributor
7
+ .command('write')
8
+ .alias('w')
9
+ .description('distributor write commands');
10
+ distributorWrite.addOption(new Option('-cmd2json'));
11
+ distributorWrite.on('option:-cmd2json', function () {
12
+ logInfo(getCommandsJson(distributorWrite));
13
+ process.exit();
14
+ });
15
+ distributorWrite
16
+ .command('add-token')
17
+ .description('add a token to the list of supported tokens')
18
+ .argument('<address>', 'distributor address', stringToAddress)
19
+ .argument('<token>', 'token address', stringToAddress)
20
+ .action(async (address, token) => {
21
+ const contract = await getDistributorContract(address);
22
+ const confirmationMessage = `Are you sure you want to add the token ${token} to the list of supported tokens?`;
23
+ const confirm = await confirmOperation(confirmationMessage);
24
+ if (!confirm)
25
+ return;
26
+ await callWriteMethodWithReceipt({
27
+ contract,
28
+ methodName: 'addToken',
29
+ payload: [token],
30
+ });
31
+ });
32
+ distributorWrite
33
+ .command('set-merkle-root')
34
+ .description('sets the Merkle root and CID')
35
+ .argument('<address>', 'distributor address', stringToAddress)
36
+ .argument('<root>', 'root', stringToHex)
37
+ .argument('<cid>', 'cid', stringToHex)
38
+ .action(async (address, root, cid) => {
39
+ const contract = await getDistributorContract(address);
40
+ const confirmationMessage = `Are you sure you want to set the Merkle root ${root} and CID ${cid}?`;
41
+ const confirm = await confirmOperation(confirmationMessage);
42
+ if (!confirm)
43
+ return;
44
+ await callWriteMethodWithReceipt({
45
+ contract,
46
+ methodName: 'setMerkleRoot',
47
+ payload: [root, cid],
48
+ });
49
+ });
50
+ distributorWrite
51
+ .command('claim')
52
+ .description('claims rewards')
53
+ .argument('<address>', 'distributor address', stringToAddress)
54
+ .argument('<recipient>', 'recipient address', stringToAddress)
55
+ .argument('<token>', 'token address', stringToAddress)
56
+ .argument('<amount>', 'amount', etherToWei)
57
+ .argument('<proof>', 'proof', stringToHexArray)
58
+ .action(async (address, recipient, token, amount, proof) => {
59
+ const contract = await getDistributorContract(address);
60
+ const confirmationMessage = `Are you sure you want to claim ${formatEther(amount)} ${token} for ${recipient}?`;
61
+ const confirm = await confirmOperation(confirmationMessage);
62
+ if (!confirm)
63
+ return;
64
+ await callWriteMethodWithReceipt({
65
+ contract,
66
+ methodName: 'claim',
67
+ payload: [recipient, token, amount, proof],
68
+ });
69
+ });
70
+ //# sourceMappingURL=write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts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EAChB,SAAkB,EAClB,KAAc,EACd,MAAc,EACd,KAAY,EACZ,EAAE;IACF,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAEvD,MAAM,mBAAmB,GAAG,kCAAkC,WAAW,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,SAAS,GAAG,CAAC;IAC/G,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IAC5D,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,MAAM,0BAA0B,CAAC;QAC/B,QAAQ;QACR,UAAU,EAAE,OAAO;QACnB,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;KAC3C,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FactoryAbi } from '../../../../abi/defi-wrapper/index.js';
2
+ import { ReadProgramCommandConfig } from '../../../../utils/index.js';
3
+ export declare const readCommandConfig: ReadProgramCommandConfig<typeof FactoryAbi>;
@@ -0,0 +1,2 @@
1
+ export const readCommandConfig = {};
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/factory/config.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAC5B,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './main.js';
2
+ export * from './read.js';
3
+ export * from './write.js';
@@ -0,0 +1,4 @@
1
+ export * from './main.js';
2
+ export * from './read.js';
3
+ export * from './write.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/factory/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const factory: import("commander").Command;
@@ -0,0 +1,6 @@
1
+ import { defiWrapperContracts } from '../main.js';
2
+ export const factory = defiWrapperContracts
3
+ .command('factory')
4
+ .alias('f')
5
+ .description('factory contract');
6
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/factory/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB;KACxC,OAAO,CAAC,SAAS,CAAC;KAClB,KAAK,CAAC,GAAG,CAAC;KACV,WAAW,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { Option } from 'commander';
2
+ import { FactoryAbi } from '../../../../abi/defi-wrapper/index.js';
3
+ import { getFactoryContract } from '../../../../contracts/defi-wrapper/index.js';
4
+ import { generateReadCommands, logInfo, getCommandsJson, stringToAddress, callReadMethodSilent, logResult, } from '../../../../utils/index.js';
5
+ import { factory } from './main.js';
6
+ import { readCommandConfig } from './config.js';
7
+ const factoryRead = factory
8
+ .command('read')
9
+ .alias('r')
10
+ .description('read commands');
11
+ factoryRead.addOption(new Option('-cmd2json'));
12
+ factoryRead.on('option:-cmd2json', function () {
13
+ logInfo(getCommandsJson(factoryRead));
14
+ process.exit();
15
+ });
16
+ factoryRead
17
+ .command('info')
18
+ .description('get factory base info')
19
+ .argument('<address>', 'factory address', stringToAddress)
20
+ .action(async (address) => {
21
+ const contract = await getFactoryContract(address);
22
+ const [dummyImplementation, ggvStrategyFactory, stvPoolFactory, stvStethPoolFactory, timelockFactory, vaultFactory, withdrawalQueueFactory, lazyOracle, steth, wsteth,] = await Promise.all([
23
+ callReadMethodSilent(contract, 'DUMMY_IMPLEMENTATION'),
24
+ callReadMethodSilent(contract, 'GGV_STRATEGY_FACTORY'),
25
+ callReadMethodSilent(contract, 'STV_POOL_FACTORY'),
26
+ callReadMethodSilent(contract, 'STV_STETH_POOL_FACTORY'),
27
+ callReadMethodSilent(contract, 'TIMELOCK_FACTORY'),
28
+ callReadMethodSilent(contract, 'VAULT_FACTORY'),
29
+ callReadMethodSilent(contract, 'WITHDRAWAL_QUEUE_FACTORY'),
30
+ callReadMethodSilent(contract, 'LAZY_ORACLE'),
31
+ callReadMethodSilent(contract, 'STETH'),
32
+ callReadMethodSilent(contract, 'WSTETH'),
33
+ ]);
34
+ logResult({
35
+ data: [
36
+ ['dummyImplementation', dummyImplementation],
37
+ ['ggvStrategyFactory', ggvStrategyFactory],
38
+ ['stvPoolFactory', stvPoolFactory],
39
+ ['stvStethPoolFactory', stvStethPoolFactory],
40
+ ['timelockFactory', timelockFactory],
41
+ ['vaultFactory', vaultFactory],
42
+ ['withdrawalQueueFactory', withdrawalQueueFactory],
43
+ ['lazyOracle', lazyOracle],
44
+ ['steth', steth],
45
+ ['wsteth', wsteth],
46
+ ],
47
+ });
48
+ });
49
+ generateReadCommands(FactoryAbi, getFactoryContract, factoryRead, readCommandConfig);
50
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../programs/defi-wrapper/contracts/factory/read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,GAAG,OAAO;KACxB,OAAO,CAAC,MAAM,CAAC;KACf,KAAK,CAAC,GAAG,CA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AC,qBAAqB,EAAE,mBAAmB,CAAC;YAC5C,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAC1C,CAAC,gBAAgB,EAAE,cAAc,CAAC;YAClC,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;YAC5C,CAAC,iBAAiB,EAAE,eAAe,CAAC;YACpC,CAAC,cAAc,EAAE,YAAY,CAAC;YAC9B,CAAC,wBAAwB,EAAE,sBAAsB,CAAC;YAClD,CAAC,YAAY,EAAE,UAAU,CAAC;YAC1B,CAAC,OAAO,EAAE,KAAK,CAAC;YAChB,CAAC,QAAQ,EAAE,MAAM,CAAC;SACnB;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,oBAAoB,CAClB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,iBAAiB,CAClB,CAAC"}
@@ -0,0 +1,144 @@
1
+ import { Option } from 'commander';
2
+ import { logInfo, logError, getCommandsJson, stringToAddress, callWriteMethodWithReceipt, confirmOperation, stringToNumber, stringToBoolean, } from '../../../../utils/index.js';
3
+ import { getFactoryContract } from '../../../../contracts/defi-wrapper/index.js';
4
+ import { getCreatePoolEventData, getReserveRatioGapBP, getBoolean, promtBaseVaultConfiguration, logCreatePoolEventData, finalizePoolCreation, prepareCreationConfigrationText, } from '../../../../features/index.js';
5
+ import { factory } from './main.js';
6
+ const factoryWrite = factory
7
+ .command('write')
8
+ .alias('w')
9
+ .description('write commands');
10
+ factoryWrite.addOption(new Option('-cmd2json'));
11
+ factoryWrite.on('option:-cmd2json', function () {
12
+ logInfo(getCommandsJson(factoryWrite));
13
+ process.exit();
14
+ });
15
+ // adds common options for all wrapper creation commands
16
+ const applyCommonOptions = (command) => {
17
+ return command
18
+ .option('-no, --nodeOperator <nodeOperator>', 'node operator address')
19
+ .option('-nom, --nodeOperatorManager <nodeOperatorManager>', 'node operator manager address')
20
+ .option('-nof , --nodeOperatorFeeRate <nodeOperatorFeeRate>', 'Node operator fee rate in basis points, for e.g. 100 == 1%', stringToNumber)
21
+ .option('-ce, --confirmExpiry <confirmExpiry>', 'confirm expiry in seconds', stringToNumber)
22
+ .option('-md, --minDelaySeconds <minDelaySeconds>', 'minimum delay in seconds', stringToNumber)
23
+ .option('-mwd, --minWithdrawalDelayTime <minWithdrawalDelayTime>', 'minimum withdrawal delay time in seconds', stringToNumber)
24
+ .option('-n, --name <name>', 'name of the pool shares')
25
+ .option('-s, --symbol <symbol>', 'symbol of the pool shares')
26
+ .option('-p, --proposer <proposer>', 'proposer address', stringToAddress)
27
+ .option('-e, --executor <executor>', 'executor address', stringToAddress)
28
+ .option('-ec, --emergencyCommittee <emergencyCommittee>', 'emergency committee address', stringToAddress);
29
+ };
30
+ applyCommonOptions(factoryWrite
31
+ .command('create-pool-ggv')
32
+ .description('initiates deployment of a GGV strategy pool')
33
+ .argument('<address>', 'factory address', stringToAddress))
34
+ .option('-rrg, --reserveRatioGapBP <reserveRatioGapBP>', 'reserve ratio gap in basis points', stringToNumber)
35
+ .action(async (address, { reserveRatioGapBP, ...baseOptions }) => {
36
+ const contract = await getFactoryContract(address);
37
+ const { vaultConfig, timelockConfig, commonPoolConfig, CONNECT_DEPOSIT } = await promtBaseVaultConfiguration(baseOptions);
38
+ const reserveRatioGapBPValue = await getReserveRatioGapBP(reserveRatioGapBP);
39
+ const confirmationMessage = `Are you sure you want to create a new pool GGV strategy with a configured wrapper?\n
40
+ ${prepareCreationConfigrationText(vaultConfig, timelockConfig, commonPoolConfig)}
41
+ reserveRatioGapBP: ${reserveRatioGapBPValue}\n`;
42
+ const confirm = await confirmOperation(confirmationMessage);
43
+ if (!confirm)
44
+ return;
45
+ const result = await callWriteMethodWithReceipt({
46
+ contract,
47
+ methodName: 'createPoolGGVStart',
48
+ payload: [
49
+ vaultConfig,
50
+ timelockConfig,
51
+ commonPoolConfig,
52
+ BigInt(reserveRatioGapBPValue),
53
+ ],
54
+ value: CONNECT_DEPOSIT,
55
+ });
56
+ if (!result.receipt || !result.tx) {
57
+ logInfo('Transaction has been sent');
58
+ return;
59
+ }
60
+ const eventData = await getCreatePoolEventData(result.receipt, result.tx);
61
+ await logCreatePoolEventData(eventData);
62
+ await finalizePoolCreation(contract, vaultConfig, timelockConfig, commonPoolConfig, eventData);
63
+ });
64
+ applyCommonOptions(factoryWrite
65
+ .command('create-pool-stv')
66
+ .description('initiates deployment of a STV staking pool')
67
+ .argument('<address>', 'factory address', stringToAddress))
68
+ .option('-al, --allowList <allowListEnabled>', 'is allowlist enabled (true/false)', stringToBoolean)
69
+ .action(async (address, { allowListEnabled, ...baseOptions }) => {
70
+ const contract = await getFactoryContract(address);
71
+ const { vaultConfig, timelockConfig, commonPoolConfig, CONNECT_DEPOSIT } = await promtBaseVaultConfiguration(baseOptions);
72
+ const allowListEnabledValue = await getBoolean(allowListEnabled, 'AllowList');
73
+ const confirmationMessage = `Are you sure you want to create a new STV pool with a configured wrapper?\n
74
+ ${prepareCreationConfigrationText(vaultConfig, timelockConfig, commonPoolConfig)}
75
+ allowListEnabled: ${allowListEnabledValue}\n`;
76
+ const confirm = await confirmOperation(confirmationMessage);
77
+ if (!confirm)
78
+ return;
79
+ const result = await callWriteMethodWithReceipt({
80
+ contract,
81
+ methodName: 'createPoolStvStart',
82
+ payload: [
83
+ vaultConfig,
84
+ timelockConfig,
85
+ commonPoolConfig,
86
+ allowListEnabledValue,
87
+ ],
88
+ value: CONNECT_DEPOSIT,
89
+ });
90
+ if (!result.receipt || !result.tx) {
91
+ logInfo('Transaction has been sent');
92
+ return;
93
+ }
94
+ const eventData = await getCreatePoolEventData(result.receipt, result.tx);
95
+ await logCreatePoolEventData(eventData);
96
+ if (!eventData.auxiliaryConfig ||
97
+ !eventData.strategyFactory ||
98
+ !eventData.strategyDeployBytes ||
99
+ !eventData.intermediate) {
100
+ logError('Missing required data for pool creation finalize');
101
+ return;
102
+ }
103
+ logInfo('Pool Creation Finalize');
104
+ await finalizePoolCreation(contract, vaultConfig, timelockConfig, commonPoolConfig, eventData);
105
+ });
106
+ applyCommonOptions(factoryWrite
107
+ .command('create-pool-stv-steth')
108
+ .description('initiates deployment of a STV-STETH pool with minting enabled')
109
+ .argument('<address>', 'factory address', stringToAddress))
110
+ .option('-rrg, --reserveRatioGapBP <reserveRatioGapBP>', 'reserve ratio gap in basis points', stringToNumber)
111
+ .option('-al, --allowList <allowListEnabled>', 'is allowlist enabled (true/false)', stringToBoolean)
112
+ .action(async (address, { reserveRatioGapBP, allowListEnabled, ...baseOptions }) => {
113
+ const contract = await getFactoryContract(address);
114
+ const { vaultConfig, timelockConfig, commonPoolConfig, CONNECT_DEPOSIT } = await promtBaseVaultConfiguration(baseOptions);
115
+ const allowListEnabledValue = await getBoolean(allowListEnabled, 'AllowList');
116
+ const reserveRatioGapBPValue = await getReserveRatioGapBP(reserveRatioGapBP);
117
+ const confirmationMessage = `Are you sure you want to create a new STV-STETH pool with minting enabled?\n
118
+ ${prepareCreationConfigrationText(vaultConfig, timelockConfig, commonPoolConfig)}
119
+ allowListEnabled: ${allowListEnabledValue}
120
+ reserveRatioGapBP: ${reserveRatioGapBPValue}\n`;
121
+ const confirm = await confirmOperation(confirmationMessage);
122
+ if (!confirm)
123
+ return;
124
+ const result = await callWriteMethodWithReceipt({
125
+ contract,
126
+ methodName: 'createPoolStvStETHStart',
127
+ payload: [
128
+ vaultConfig,
129
+ timelockConfig,
130
+ commonPoolConfig,
131
+ allowListEnabledValue,
132
+ BigInt(reserveRatioGapBPValue),
133
+ ],
134
+ value: CONNECT_DEPOSIT,
135
+ });
136
+ if (!result.receipt || !result.tx) {
137
+ logInfo('Transaction has been sent');
138
+ return;
139
+ }
140
+ const eventData = await getCreatePoolEventData(result.receipt, result.tx);
141
+ await logCreatePoolEventData(eventData);
142
+ await finalizePoolCreation(contract, vaultConfig, timelockConfig, commonPoolConfig, eventData);
143
+ });
144
+ //# sourceMappingURL=write.js.map