@raac/rpc 1.0.2-beta.3 → 1.0.2-beta.5

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 (360) hide show
  1. package/{RPCLibrary.ts → RPCLibrary.js} +7 -121
  2. package/artifacts/core/collectors/FeeCollector.sol/FeeCollector.dbg.json +4 -0
  3. package/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +1743 -0
  4. package/artifacts/core/collectors/Treasury.sol/Treasury.dbg.json +4 -0
  5. package/artifacts/core/collectors/Treasury.sol/Treasury.json +481 -0
  6. package/artifacts/core/governance/boost/BoostController.sol/BoostController.dbg.json +4 -0
  7. package/artifacts/core/governance/boost/BoostController.sol/BoostController.json +905 -0
  8. package/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.dbg.json +4 -0
  9. package/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +1398 -0
  10. package/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.dbg.json +4 -0
  11. package/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +1435 -0
  12. package/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.dbg.json +4 -0
  13. package/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +1471 -0
  14. package/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.dbg.json +4 -0
  15. package/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +1471 -0
  16. package/artifacts/core/governance/proposals/Governance.sol/Governance.dbg.json +4 -0
  17. package/artifacts/core/governance/proposals/Governance.sol/Governance.json +1242 -0
  18. package/artifacts/core/governance/proposals/TimelockController.sol/TimelockController.dbg.json +4 -0
  19. package/artifacts/core/governance/proposals/TimelockController.sol/TimelockController.json +988 -0
  20. package/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.dbg.json +4 -0
  21. package/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json +1443 -0
  22. package/artifacts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.sol/RAACReleaseOrchestrator.dbg.json +4 -0
  23. package/artifacts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.sol/RAACReleaseOrchestrator.json +860 -0
  24. package/artifacts/core/oracles/BaseChainlinkFunctionsOracle.sol/BaseChainlinkFunctionsOracle.dbg.json +4 -0
  25. package/artifacts/core/oracles/BaseChainlinkFunctionsOracle.sol/BaseChainlinkFunctionsOracle.json +264 -0
  26. package/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.dbg.json +4 -0
  27. package/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json +279 -0
  28. package/artifacts/core/oracles/RAACHousePriceOracle.sol/RAACHousePriceOracle.dbg.json +4 -0
  29. package/artifacts/core/oracles/RAACHousePriceOracle.sol/RAACHousePriceOracle.json +335 -0
  30. package/artifacts/core/oracles/RAACPrimeRateOracle.sol/RAACPrimeRateOracle.dbg.json +4 -0
  31. package/artifacts/core/oracles/RAACPrimeRateOracle.sol/RAACPrimeRateOracle.json +350 -0
  32. package/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.dbg.json +4 -0
  33. package/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +2760 -0
  34. package/artifacts/core/pools/StabilityPool/NFTLiquidator.sol/NFTLiquidator.dbg.json +4 -0
  35. package/artifacts/core/pools/StabilityPool/NFTLiquidator.sol/NFTLiquidator.json +485 -0
  36. package/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.dbg.json +4 -0
  37. package/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +1146 -0
  38. package/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.dbg.json +4 -0
  39. package/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json +285 -0
  40. package/artifacts/core/tokens/DEToken.sol/DEToken.dbg.json +4 -0
  41. package/artifacts/core/tokens/DEToken.sol/DEToken.json +858 -0
  42. package/artifacts/core/tokens/DebtToken.sol/DebtToken.dbg.json +4 -0
  43. package/artifacts/core/tokens/DebtToken.sol/DebtToken.json +953 -0
  44. package/artifacts/core/tokens/IndexToken.sol/IndexToken.dbg.json +4 -0
  45. package/artifacts/core/tokens/IndexToken.sol/IndexToken.json +770 -0
  46. package/artifacts/core/tokens/LPToken.sol/LPToken.dbg.json +4 -0
  47. package/artifacts/core/tokens/LPToken.sol/LPToken.json +507 -0
  48. package/artifacts/core/tokens/RAACNFT.sol/RAACNFT.dbg.json +4 -0
  49. package/artifacts/core/tokens/RAACNFT.sol/RAACNFT.json +1472 -0
  50. package/artifacts/core/tokens/RAACToken.sol/RAACToken.dbg.json +4 -0
  51. package/artifacts/core/tokens/RAACToken.sol/RAACToken.json +832 -0
  52. package/artifacts/core/tokens/RToken.sol/RToken.dbg.json +4 -0
  53. package/artifacts/core/tokens/RToken.sol/RToken.json +1205 -0
  54. package/artifacts/core/tokens/veRAACToken.sol/veRAACToken.dbg.json +4 -0
  55. package/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +1616 -0
  56. package/artifacts/interfaces/IERC20.sol/IERC20.dbg.json +4 -0
  57. package/artifacts/interfaces/IERC20.sol/IERC20.json +194 -0
  58. package/artifacts/interfaces/IHousePrices.sol/IHousePrices.dbg.json +4 -0
  59. package/artifacts/interfaces/IHousePrices.sol/IHousePrices.json +30 -0
  60. package/artifacts/interfaces/INFTLiquidator.sol/INFTLiquidator.dbg.json +4 -0
  61. package/artifacts/interfaces/INFTLiquidator.sol/INFTLiquidator.json +86 -0
  62. package/artifacts/interfaces/IPoolManager.sol/IPoolManager.dbg.json +4 -0
  63. package/artifacts/interfaces/IPoolManager.sol/IPoolManager.json +57 -0
  64. package/artifacts/interfaces/IReserveAllocationLibraryMock.sol/IReserveAllocationLibraryMock.dbg.json +4 -0
  65. package/artifacts/interfaces/IReserveAllocationLibraryMock.sol/IReserveAllocationLibraryMock.json +246 -0
  66. package/artifacts/interfaces/IUSDC.sol/IUSDC.dbg.json +4 -0
  67. package/artifacts/interfaces/IUSDC.sol/IUSDC.json +194 -0
  68. package/artifacts/interfaces/IveRAACDistributor.sol/IveRAACDistributor.dbg.json +4 -0
  69. package/artifacts/interfaces/IveRAACDistributor.sol/IveRAACDistributor.json +100 -0
  70. package/artifacts/interfaces/core/collectors/IBaseCollector.sol/IBaseCollector.dbg.json +4 -0
  71. package/artifacts/interfaces/core/collectors/IBaseCollector.sol/IBaseCollector.json +45 -0
  72. package/artifacts/interfaces/core/collectors/IFeeCollector.sol/IFeeCollector.dbg.json +4 -0
  73. package/artifacts/interfaces/core/collectors/IFeeCollector.sol/IFeeCollector.json +922 -0
  74. package/artifacts/interfaces/core/collectors/ITreasury.sol/ITreasury.dbg.json +4 -0
  75. package/artifacts/interfaces/core/collectors/ITreasury.sol/ITreasury.json +214 -0
  76. package/artifacts/interfaces/core/governance/IBoostController.sol/IBoostController.dbg.json +4 -0
  77. package/artifacts/interfaces/core/governance/IBoostController.sol/IBoostController.json +378 -0
  78. package/artifacts/interfaces/core/governance/gauges/IGauge.sol/IGauge.dbg.json +4 -0
  79. package/artifacts/interfaces/core/governance/gauges/IGauge.sol/IGauge.json +394 -0
  80. package/artifacts/interfaces/core/governance/gauges/IGaugeController.sol/IGaugeController.dbg.json +4 -0
  81. package/artifacts/interfaces/core/governance/gauges/IGaugeController.sol/IGaugeController.json +577 -0
  82. package/artifacts/interfaces/core/governance/proposals/IGovernance.sol/IGovernance.dbg.json +4 -0
  83. package/artifacts/interfaces/core/governance/proposals/IGovernance.sol/IGovernance.json +1134 -0
  84. package/artifacts/interfaces/core/governance/proposals/ITimelockController.sol/ITimelockController.dbg.json +4 -0
  85. package/artifacts/interfaces/core/governance/proposals/ITimelockController.sol/ITimelockController.json +612 -0
  86. package/artifacts/interfaces/core/minters/RAACMinter/IRAACMinter.sol/IRAACMinter.dbg.json +4 -0
  87. package/artifacts/interfaces/core/minters/RAACMinter/IRAACMinter.sol/IRAACMinter.json +542 -0
  88. package/artifacts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator.sol/IReleaseOrchestrator.dbg.json +4 -0
  89. package/artifacts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator.sol/IReleaseOrchestrator.json +358 -0
  90. package/artifacts/interfaces/core/oracles/IBaseVRFv2Consumer.sol/IBaseVRFv2Consumer.dbg.json +4 -0
  91. package/artifacts/interfaces/core/oracles/IBaseVRFv2Consumer.sol/IBaseVRFv2Consumer.json +102 -0
  92. package/artifacts/interfaces/core/oracles/IRAACHousePrices.sol/IRAACHousePrices.dbg.json +4 -0
  93. package/artifacts/interfaces/core/oracles/IRAACHousePrices.sol/IRAACHousePrices.json +193 -0
  94. package/artifacts/interfaces/core/pools/ILiquidityPool.sol/ILiquidityPool.dbg.json +4 -0
  95. package/artifacts/interfaces/core/pools/ILiquidityPool.sol/ILiquidityPool.json +310 -0
  96. package/artifacts/interfaces/core/pools/LendingPool/ILendingPool.sol/ILendingPool.dbg.json +4 -0
  97. package/artifacts/interfaces/core/pools/LendingPool/ILendingPool.sol/ILendingPool.json +1500 -0
  98. package/artifacts/interfaces/core/pools/StabilityPool/IStabilityPool.sol/IStabilityPool.dbg.json +4 -0
  99. package/artifacts/interfaces/core/pools/StabilityPool/IStabilityPool.sol/IStabilityPool.json +622 -0
  100. package/artifacts/interfaces/core/tokens/IDEToken.sol/IDEToken.dbg.json +4 -0
  101. package/artifacts/interfaces/core/tokens/IDEToken.sol/IDEToken.json +333 -0
  102. package/artifacts/interfaces/core/tokens/IDebtToken.sol/IDebtToken.dbg.json +4 -0
  103. package/artifacts/interfaces/core/tokens/IDebtToken.sol/IDebtToken.json +507 -0
  104. package/artifacts/interfaces/core/tokens/IIndexToken.sol/IIndexToken.dbg.json +4 -0
  105. package/artifacts/interfaces/core/tokens/IIndexToken.sol/IIndexToken.json +299 -0
  106. package/artifacts/interfaces/core/tokens/IRAACNFT.sol/IRAACNFT.dbg.json +4 -0
  107. package/artifacts/interfaces/core/tokens/IRAACNFT.sol/IRAACNFT.json +816 -0
  108. package/artifacts/interfaces/core/tokens/IRAACToken.sol/IRAACToken.dbg.json +4 -0
  109. package/artifacts/interfaces/core/tokens/IRAACToken.sol/IRAACToken.json +567 -0
  110. package/artifacts/interfaces/core/tokens/IRToken.sol/IRToken.dbg.json +4 -0
  111. package/artifacts/interfaces/core/tokens/IRToken.sol/IRToken.json +641 -0
  112. package/artifacts/interfaces/core/tokens/IveRAACToken.sol/IveRAACToken.dbg.json +4 -0
  113. package/artifacts/interfaces/core/tokens/IveRAACToken.sol/IveRAACToken.json +560 -0
  114. package/artifacts/interfaces/core/vaults/IBaseVault.sol/IBaseVault.dbg.json +4 -0
  115. package/artifacts/interfaces/core/vaults/IBaseVault.sol/IBaseVault.json +185 -0
  116. package/artifacts/interfaces/curve/ICurveCrvUSDVault.sol/ICurveCrvUSDVault.dbg.json +4 -0
  117. package/artifacts/interfaces/curve/ICurveCrvUSDVault.sol/ICurveCrvUSDVault.json +250 -0
  118. package/artifacts/interfaces/zeno/IAuction.sol/IAuction.dbg.json +4 -0
  119. package/artifacts/interfaces/zeno/IAuction.sol/IAuction.json +162 -0
  120. package/artifacts/interfaces/zeno/IZENO.sol/IZENO.dbg.json +4 -0
  121. package/artifacts/interfaces/zeno/IZENO.sol/IZENO.json +321 -0
  122. package/artifacts/libraries/governance/BoostCalculator.sol/BoostCalculator.dbg.json +4 -0
  123. package/artifacts/libraries/governance/BoostCalculator.sol/BoostCalculator.json +51 -0
  124. package/artifacts/libraries/governance/Checkpoints.sol/Checkpoints.dbg.json +4 -0
  125. package/artifacts/libraries/governance/Checkpoints.sol/Checkpoints.json +69 -0
  126. package/artifacts/libraries/governance/LockManager.sol/LockManager.dbg.json +4 -0
  127. package/artifacts/libraries/governance/LockManager.sol/LockManager.json +123 -0
  128. package/artifacts/libraries/governance/PowerCheckpoint.sol/PowerCheckpoint.dbg.json +4 -0
  129. package/artifacts/libraries/governance/PowerCheckpoint.sol/PowerCheckpoint.json +70 -0
  130. package/artifacts/libraries/governance/RAACVoting.sol/RAACVoting.dbg.json +4 -0
  131. package/artifacts/libraries/governance/RAACVoting.sol/RAACVoting.json +102 -0
  132. package/artifacts/libraries/governance/VotingPowerLib.sol/VotingPowerLib.dbg.json +4 -0
  133. package/artifacts/libraries/governance/VotingPowerLib.sol/VotingPowerLib.json +76 -0
  134. package/artifacts/libraries/math/PercentageMath.sol/PercentageMath.dbg.json +4 -0
  135. package/artifacts/libraries/math/PercentageMath.sol/PercentageMath.json +10 -0
  136. package/artifacts/libraries/math/TimeWeightedAverage.sol/TimeWeightedAverage.dbg.json +4 -0
  137. package/artifacts/libraries/math/TimeWeightedAverage.sol/TimeWeightedAverage.json +142 -0
  138. package/artifacts/libraries/math/WadRayMath.sol/WadRayMath.dbg.json +4 -0
  139. package/artifacts/libraries/math/WadRayMath.sol/WadRayMath.json +10 -0
  140. package/artifacts/libraries/pools/DataTypes.sol/DataTypes.dbg.json +4 -0
  141. package/artifacts/libraries/pools/DataTypes.sol/DataTypes.json +10 -0
  142. package/artifacts/libraries/pools/ReserveLibrary.sol/ReserveLibrary.dbg.json +4 -0
  143. package/artifacts/libraries/pools/ReserveLibrary.sol/ReserveLibrary.json +153 -0
  144. package/artifacts/libraries/utils/StringUtils.sol/StringUtils.dbg.json +4 -0
  145. package/artifacts/libraries/utils/StringUtils.sol/StringUtils.json +16 -0
  146. package/artifacts/mocks/core/collectors/MockTreasury.sol/MockTreasury.dbg.json +4 -0
  147. package/artifacts/mocks/core/collectors/MockTreasury.sol/MockTreasury.json +255 -0
  148. package/artifacts/mocks/core/governance/gauges/MockBaseGauge.sol/MockBaseGauge.dbg.json +4 -0
  149. package/artifacts/mocks/core/governance/gauges/MockBaseGauge.sol/MockBaseGauge.json +1522 -0
  150. package/artifacts/mocks/core/governance/gauges/MockGaugeController.sol/MockGaugeController.dbg.json +4 -0
  151. package/artifacts/mocks/core/governance/gauges/MockGaugeController.sol/MockGaugeController.json +49 -0
  152. package/artifacts/mocks/core/governance/proposals/TimelockTestTarget.sol/TimelockTestTarget.dbg.json +4 -0
  153. package/artifacts/mocks/core/governance/proposals/TimelockTestTarget.sol/TimelockTestTarget.json +112 -0
  154. package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/IFunctionsRouter.dbg.json +4 -0
  155. package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/IFunctionsRouter.json +50 -0
  156. package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/MockFunctionsRouter.dbg.json +4 -0
  157. package/artifacts/mocks/core/oracles/MockFunctionsRouter.sol/MockFunctionsRouter.json +69 -0
  158. package/artifacts/mocks/core/oracles/MockOracle.sol/MockOracle.dbg.json +4 -0
  159. package/artifacts/mocks/core/oracles/MockOracle.sol/MockOracle.json +63 -0
  160. package/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.dbg.json +4 -0
  161. package/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json +774 -0
  162. package/artifacts/mocks/core/oracles/TestRAACHousePriceOracle.sol/TestRAACHousePriceOracle.dbg.json +4 -0
  163. package/artifacts/mocks/core/oracles/TestRAACHousePriceOracle.sol/TestRAACHousePriceOracle.json +358 -0
  164. package/artifacts/mocks/core/oracles/TestRAACPrimeRateOracle.sol/TestRAACPrimeRateOracle.dbg.json +4 -0
  165. package/artifacts/mocks/core/oracles/TestRAACPrimeRateOracle.sol/TestRAACPrimeRateOracle.json +373 -0
  166. package/artifacts/mocks/core/pools/MockLendingPool.sol/MockLendingPool.dbg.json +4 -0
  167. package/artifacts/mocks/core/pools/MockLendingPool.sol/MockLendingPool.json +241 -0
  168. package/artifacts/mocks/core/pools/MockLendingPoolCollector.sol/MockLendingPoolCollector.dbg.json +4 -0
  169. package/artifacts/mocks/core/pools/MockLendingPoolCollector.sol/MockLendingPoolCollector.json +288 -0
  170. package/artifacts/mocks/core/pools/MockLendingPoolDebtToken.sol/MockLendingPoolDebtToken.dbg.json +4 -0
  171. package/artifacts/mocks/core/pools/MockLendingPoolDebtToken.sol/MockLendingPoolDebtToken.json +1522 -0
  172. package/artifacts/mocks/core/pools/MockLiquidityPool.sol/MockLiquidityPool.dbg.json +4 -0
  173. package/artifacts/mocks/core/pools/MockLiquidityPool.sol/MockLiquidityPool.json +1019 -0
  174. package/artifacts/mocks/core/pools/MockPool.sol/MockPool.dbg.json +4 -0
  175. package/artifacts/mocks/core/pools/MockPool.sol/MockPool.json +93 -0
  176. package/artifacts/mocks/core/pools/MockStabilityPool.sol/MockStabilityPool.dbg.json +4 -0
  177. package/artifacts/mocks/core/pools/MockStabilityPool.sol/MockStabilityPool.json +126 -0
  178. package/artifacts/mocks/core/primitives/MockContract.sol/MockContract.dbg.json +4 -0
  179. package/artifacts/mocks/core/primitives/MockContract.sol/MockContract.json +37 -0
  180. package/artifacts/mocks/core/primitives/MockContractWithConfig.sol/MockContractWithConfig.dbg.json +4 -0
  181. package/artifacts/mocks/core/primitives/MockContractWithConfig.sol/MockContractWithConfig.json +52 -0
  182. package/artifacts/mocks/core/primitives/MockDistributableContract.sol/MockDistributableContract.dbg.json +4 -0
  183. package/artifacts/mocks/core/primitives/MockDistributableContract.sol/MockDistributableContract.json +73 -0
  184. package/artifacts/mocks/core/primitives/RAACHousePricesMock.sol/RAACHousePricesMock.dbg.json +4 -0
  185. package/artifacts/mocks/core/primitives/RAACHousePricesMock.sol/RAACHousePricesMock.json +67 -0
  186. package/artifacts/mocks/core/tokens/ERC20Mock.sol/ERC20Mock.dbg.json +4 -0
  187. package/artifacts/mocks/core/tokens/ERC20Mock.sol/ERC20Mock.json +353 -0
  188. package/artifacts/mocks/core/tokens/ERC721Mock.sol/ERC721Mock.dbg.json +4 -0
  189. package/artifacts/mocks/core/tokens/ERC721Mock.sol/ERC721Mock.json +491 -0
  190. package/artifacts/mocks/core/tokens/MockCollectableUnderlying.sol/MockCollectableUnderlying.dbg.json +4 -0
  191. package/artifacts/mocks/core/tokens/MockCollectableUnderlying.sol/MockCollectableUnderlying.json +568 -0
  192. package/artifacts/mocks/core/tokens/MockFeeCollectorToken.sol/MockFeeCollectorToken.dbg.json +4 -0
  193. package/artifacts/mocks/core/tokens/MockFeeCollectorToken.sol/MockFeeCollectorToken.json +515 -0
  194. package/artifacts/mocks/core/tokens/MockToken.sol/MockToken.dbg.json +4 -0
  195. package/artifacts/mocks/core/tokens/MockToken.sol/MockToken.json +426 -0
  196. package/artifacts/mocks/core/tokens/MockUSDC.sol/MockUSDC.dbg.json +4 -0
  197. package/artifacts/mocks/core/tokens/MockUSDC.sol/MockUSDC.json +348 -0
  198. package/artifacts/mocks/core/tokens/MockVeToken.sol/MockVeToken.dbg.json +4 -0
  199. package/artifacts/mocks/core/tokens/MockVeToken.sol/MockVeToken.json +905 -0
  200. package/artifacts/mocks/core/tokens/RAACMockERC20.sol/RAACMockERC20.dbg.json +4 -0
  201. package/artifacts/mocks/core/tokens/RAACMockERC20.sol/RAACMockERC20.json +422 -0
  202. package/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.dbg.json +4 -0
  203. package/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.json +479 -0
  204. package/artifacts/mocks/core/vaults/MockVault.sol/MockVault.dbg.json +4 -0
  205. package/artifacts/mocks/core/vaults/MockVault.sol/MockVault.json +672 -0
  206. package/artifacts/mocks/libraries/MockStringUtils.sol/MockStringUtils.dbg.json +4 -0
  207. package/artifacts/mocks/libraries/MockStringUtils.sol/MockStringUtils.json +35 -0
  208. package/artifacts/mocks/libraries/governance/BoostCalculatorMock.sol/BoostCalculatorMock.dbg.json +4 -0
  209. package/artifacts/mocks/libraries/governance/BoostCalculatorMock.sol/BoostCalculatorMock.json +431 -0
  210. package/artifacts/mocks/libraries/governance/CheckpointsMock.sol/CheckpointsMock.dbg.json +4 -0
  211. package/artifacts/mocks/libraries/governance/CheckpointsMock.sol/CheckpointsMock.json +144 -0
  212. package/artifacts/mocks/libraries/governance/LockManagerMock.sol/LockManagerMock.dbg.json +4 -0
  213. package/artifacts/mocks/libraries/governance/LockManagerMock.sol/LockManagerMock.json +237 -0
  214. package/artifacts/mocks/libraries/governance/PowerCheckpointMock.sol/PowerCheckpointMock.dbg.json +4 -0
  215. package/artifacts/mocks/libraries/governance/PowerCheckpointMock.sol/PowerCheckpointMock.json +221 -0
  216. package/artifacts/mocks/libraries/governance/RAACVotingMock.sol/RAACVotingMock.dbg.json +4 -0
  217. package/artifacts/mocks/libraries/governance/RAACVotingMock.sol/RAACVotingMock.json +95 -0
  218. package/artifacts/mocks/libraries/governance/VotingPowerMock.sol/VotingPowerMock.dbg.json +4 -0
  219. package/artifacts/mocks/libraries/governance/VotingPowerMock.sol/VotingPowerMock.json +442 -0
  220. package/artifacts/mocks/libraries/math/TimeWeightedAverageMock.sol/TimeWeightedAverageMock.dbg.json +4 -0
  221. package/artifacts/mocks/libraries/math/TimeWeightedAverageMock.sol/TimeWeightedAverageMock.json +309 -0
  222. package/artifacts/mocks/libraries/math/WadRayMathMock.sol/WadRayMathMock.dbg.json +4 -0
  223. package/artifacts/mocks/libraries/math/WadRayMathMock.sol/WadRayMathMock.json +188 -0
  224. package/artifacts/mocks/libraries/pools/ReserveLibraryMock.sol/ReserveLibraryMock.dbg.json +4 -0
  225. package/artifacts/mocks/libraries/pools/ReserveLibraryMock.sol/ReserveLibraryMock.json +339 -0
  226. package/artifacts/mocks/tests/MaliciousDeposit.sol/MaliciousDeposit.dbg.json +4 -0
  227. package/artifacts/mocks/tests/MaliciousDeposit.sol/MaliciousDeposit.json +52 -0
  228. package/artifacts/mocks/tests/MaliciousWithdraw.sol/MaliciousWithdraw.dbg.json +4 -0
  229. package/artifacts/mocks/tests/MaliciousWithdraw.sol/MaliciousWithdraw.json +52 -0
  230. package/artifacts/mocks/tests/VeRAACFuzzHelper.sol/VeRAACFuzzHelper.dbg.json +4 -0
  231. package/artifacts/mocks/tests/VeRAACFuzzHelper.sol/VeRAACFuzzHelper.json +88 -0
  232. package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/IVMTimeControl.dbg.json +4 -0
  233. package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/IVMTimeControl.json +24 -0
  234. package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/VotingPowerFuzzHelper.dbg.json +4 -0
  235. package/artifacts/mocks/tests/VotingPowerFuzzHelper.sol/VotingPowerFuzzHelper.json +129 -0
  236. package/artifacts/zeno/Auction.sol/Auction.dbg.json +4 -0
  237. package/artifacts/zeno/Auction.sol/Auction.json +393 -0
  238. package/artifacts/zeno/AuctionFactory.sol/AuctionFactory.dbg.json +4 -0
  239. package/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +307 -0
  240. package/artifacts/zeno/ZENO.sol/ZENO.dbg.json +4 -0
  241. package/artifacts/zeno/ZENO.sol/ZENO.json +620 -0
  242. package/artifacts/zeno/ZENOFactory.sol/ZENOFactory.dbg.json +4 -0
  243. package/artifacts/zeno/ZENOFactory.sol/ZENOFactory.json +275 -0
  244. package/assets/{getAsset.ts → getAsset.js} +6 -6
  245. package/assets/{getAssets.ts → getAssets.js} +2 -3
  246. package/assets/{getSupply.ts → getSupply.js} +5 -7
  247. package/configs/chains/index.js +13 -0
  248. package/configs/index.js +17 -0
  249. package/contracts/feeCollector/{claimRewardFromPool.ts → claimRewardFromPool.js} +4 -10
  250. package/contracts/{getContract.ts → getContract.js} +5 -6
  251. package/contracts/{getContractAddress.ts → getContractAddress.js} +4 -6
  252. package/contracts/housePrices/{getLatestPrice.ts → getLatestPrice.js} +6 -8
  253. package/contracts/housePrices/{setOracle.ts → setOracle.js} +6 -8
  254. package/contracts/indexToken/{getNextRandomNFT.ts → getNextRandomNFT.js} +5 -7
  255. package/contracts/indexToken/{redeemNFT.ts → redeemNFT.js} +5 -7
  256. package/contracts/zeno/{createAuction.ts → createAuction.js} +14 -16
  257. package/contracts/zeno/{createZeno.ts → createZeno.js} +8 -10
  258. package/contracts/zeno/{getAuctions.ts → getAuctions.js} +5 -7
  259. package/contracts/zeno/{getZenos.ts → getZenos.js} +5 -7
  260. package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +1743 -0
  261. package/dist/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json +1443 -0
  262. package/dist/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json +279 -0
  263. package/dist/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +2760 -0
  264. package/dist/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +1146 -0
  265. package/dist/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json +285 -0
  266. package/dist/artifacts/core/tokens/DEToken.sol/DEToken.json +858 -0
  267. package/dist/artifacts/core/tokens/IndexToken.sol/IndexToken.json +770 -0
  268. package/dist/artifacts/core/tokens/RAACNFT.sol/RAACNFT.json +1472 -0
  269. package/dist/artifacts/core/tokens/RAACToken.sol/RAACToken.json +832 -0
  270. package/dist/artifacts/core/tokens/RToken.sol/RToken.json +1205 -0
  271. package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +1616 -0
  272. package/dist/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json +774 -0
  273. package/dist/artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.json +479 -0
  274. package/dist/artifacts/zeno/Auction.sol/Auction.json +393 -0
  275. package/dist/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +307 -0
  276. package/dist/artifacts/zeno/Zeno.sol/Zeno.json +620 -0
  277. package/dist/artifacts/zeno/ZenoFactory.sol/ZenoFactory.json +275 -0
  278. package/methods/commons/{checkAllowance.ts → checkAllowance.js} +10 -12
  279. package/methods/commons/{estimateGasPrice.ts → estimateGasPrice.js} +5 -7
  280. package/minter/{get.ts → get.js} +6 -8
  281. package/minter/{getApy.ts → getApy.js} +5 -7
  282. package/minter/{tick.ts → tick.js} +5 -7
  283. package/nfts/{getAllTokens.ts → getAllTokens.js} +7 -9
  284. package/nfts/{getBaseUri.ts → getBaseUri.js} +5 -7
  285. package/nfts/{getHousePrice.ts → getHousePrice.js} +6 -8
  286. package/nfts/{getMintFeePercentage.ts → getMintFeePercentage.js} +4 -6
  287. package/nfts/{getMintPrice.ts → getMintPrice.js} +7 -9
  288. package/nfts/{getTokenURI.ts → getTokenURI.js} +7 -9
  289. package/nfts/{getTokensByOwner.ts → getTokensByOwner.js} +8 -10
  290. package/nfts/{getTotalPropertiesCount.ts → getTotalPropertiesCount.js} +5 -7
  291. package/nfts/{mint.ts → mint.js} +7 -9
  292. package/nfts/{setBaseUri.ts → setBaseUri.js} +4 -6
  293. package/nfts/{totalNFTSupply.ts → totalNFTSupply.js} +4 -6
  294. package/package.json +1 -1
  295. package/pools/lendingPool/{borrowFromLendingPool.ts → borrowFromLendingPool.js} +8 -10
  296. package/pools/lendingPool/{borrowFromLendingPoolWithInsurance.ts → borrowFromLendingPoolWithInsurance.js} +8 -10
  297. package/pools/lendingPool/{calculateInsuranceFee.ts → calculateInsuranceFee.js} +9 -11
  298. package/pools/lendingPool/{claimReward.ts → claimReward.js} +5 -7
  299. package/pools/lendingPool/{closeLiquidation.ts → closeLiquidation.js} +7 -9
  300. package/pools/lendingPool/{depositNFTToLendingPool.ts → depositNFTToLendingPool.js} +6 -8
  301. package/pools/lendingPool/{depositToLendingPool.ts → depositToLendingPool.js} +6 -8
  302. package/pools/lendingPool/{getAllUserData.ts → getAllUserData.js} +7 -14
  303. package/pools/lendingPool/{getEligibleUserDeposits.ts → getEligibleUserDeposits.js} +7 -9
  304. package/pools/lendingPool/{getHealthFactor.ts → getHealthFactor.js} +8 -10
  305. package/pools/lendingPool/{getHousePrice.ts → getHousePrice.js} +6 -8
  306. package/pools/lendingPool/{getLendingPoolInfo.ts → getLendingPoolInfo.js} +23 -31
  307. package/pools/lendingPool/{getLendingPoolTotalLiquidity.ts → getLendingPoolTotalLiquidity.js} +7 -10
  308. package/pools/lendingPool/{getPendingReward.ts → getPendingReward.js} +7 -9
  309. package/pools/lendingPool/{getPositionDebt.ts → getPositionDebt.js} +8 -10
  310. package/pools/lendingPool/{getPositionScaledDebt.ts → getPositionScaledDebt.js} +8 -10
  311. package/pools/lendingPool/{getPositionView.ts → getPositionView.js} +9 -11
  312. package/pools/lendingPool/{getPositionsScaledDebt.ts → getPositionsScaledDebt.js} +7 -9
  313. package/pools/lendingPool/{getRawUserDepositsInLendingPool.ts → getRawUserDepositsInLendingPool.js} +7 -9
  314. package/pools/lendingPool/{getUserCollateralValue.ts → getUserCollateralValue.js} +7 -9
  315. package/pools/lendingPool/{initializeLiquidation.ts → initializeLiquidation.js} +8 -10
  316. package/pools/lendingPool/{repayToLendingPool.ts → repayToLendingPool.js} +8 -10
  317. package/pools/lendingPool/{withdrawFromLendingPool.ts → withdrawFromLendingPool.js} +9 -10
  318. package/pools/lendingPool/{withdrawNFTFromLendingPool.ts → withdrawNFTFromLendingPool.js} +7 -9
  319. package/pools/stabilityPool/{calculateRAACRewards.ts → calculateRAACRewards.js} +6 -9
  320. package/pools/stabilityPool/configs/chains/index.js +17 -0
  321. package/pools/stabilityPool/configs/index.js +43 -0
  322. package/pools/stabilityPool/{depositNFTToStabilityPool.ts → depositNFTToStabilityPool.js} +6 -9
  323. package/pools/stabilityPool/{depositToStabilityPool.ts → depositToStabilityPool.js} +6 -8
  324. package/pools/stabilityPool/{getRawUserDepositsInStabilityPool.ts → getRawUserDepositsInStabilityPool.js} +7 -9
  325. package/pools/stabilityPool/{getStabilityPoolInfo.ts → getStabilityPoolInfo.js} +10 -12
  326. package/pools/stabilityPool/{getStabilityPoolTotalDeposits.ts → getStabilityPoolTotalDeposits.js} +6 -8
  327. package/pools/stabilityPool/methods/commons/estimateGasPrice.js +28 -0
  328. package/pools/stabilityPool/pools/stabilityPool/withdrawFromStabilityPool.js +34 -0
  329. package/pools/stabilityPool/utils/artifacts.js +74 -0
  330. package/pools/stabilityPool/utils/contracts.js +82 -0
  331. package/pools/stabilityPool/{withdrawFromStabilityPool.ts → withdrawFromStabilityPool.js} +6 -8
  332. package/ts-to-js.sh +42 -0
  333. package/utils/{artifacts.ts → artifacts.js} +1 -4
  334. package/utils/{contracts.ts → contracts.js} +16 -18
  335. package/wallet/assets/{approveAsset.ts → approveAsset.js} +7 -8
  336. package/wallet/assets/{burnAsset.ts → burnAsset.js} +7 -9
  337. package/wallet/assets/{getAllowance.ts → getAllowance.js} +9 -10
  338. package/wallet/assets/{getAsset.ts → getAsset.js} +6 -7
  339. package/wallet/assets/{getAssets.ts → getAssets.js} +5 -7
  340. package/wallet/assets/{getBalance.ts → getBalance.js} +8 -9
  341. package/wallet/assets/{mintAsset.ts → mintAsset.js} +8 -9
  342. package/wallet/assets/{transferAsset.ts → transferAsset.js} +10 -11
  343. package/configs/chains/index.ts +0 -17
  344. package/configs/index.ts +0 -51
  345. /package/configs/chains/{chain.d.ts → chain.d.js} +0 -0
  346. /package/configs/{createConfig.ts → createConfig.js} +0 -0
  347. /package/contracts/crvUSDToken/{getBalance.ts → getBalance.js} +0 -0
  348. /package/contracts/crvUSDToken/{getTotalSupply.ts → getTotalSupply.js} +0 -0
  349. /package/contracts/rcrvUSDToken/{getBalance.ts → getBalance.js} +0 -0
  350. /package/contracts/rcrvUSDToken/{getTotalSupply.ts → getTotalSupply.js} +0 -0
  351. /package/{custom-types.d.ts → custom-types.d.js} +0 -0
  352. /package/{index.ts → index.js} +0 -0
  353. /package/methods/{approveToken.ts → approveToken.js} +0 -0
  354. /package/methods/{getAssetBalance.ts → getAssetBalance.js} +0 -0
  355. /package/methods/{getAssetsBalance.ts → getAssetsBalance.js} +0 -0
  356. /package/pools/liquidityPool/{getLiquidityPoolInfo.ts → getLiquidityPoolInfo.js} +0 -0
  357. /package/scripts/{index.ts → index.js} +0 -0
  358. /package/tests/{test.ts → test.js} +0 -0
  359. /package/utils/{chain.ts → chain.js} +0 -0
  360. /package/utils/{config.ts → config.js} +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.configs = void 0;
7
+ // @ts-ignore
8
+ const _8453_json_1 = __importDefault(require("./8453.json")); // assert { type: "json" };
9
+ const _17000_json_1 = __importDefault(require("./17000.json")); // assert { type: "json" };
10
+ const _11155111_json_1 = __importDefault(require("./11155111.json")); // assert { type: "json" };
11
+ const chains = {
12
+ 8453: _8453_json_1.default,
13
+ 17000: _17000_json_1.default, // the interface is the same for all the chains, so taking this
14
+ 11155111: _11155111_json_1.default,
15
+ };
16
+ exports.default = chains;
17
+ exports.configs = chains;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ // let fs;
3
+ // let path;
4
+ // let fileURLToPath;
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getChainsConfig = getChainsConfig;
10
+ exports.getChainConfig = getChainConfig;
11
+ exports.setChainConfig = setChainConfig;
12
+ const index_1 = __importDefault(require("./chains/index"));
13
+ function getChainsConfig() {
14
+ // if (typeof window === 'undefined') {
15
+ // // Server-side logic
16
+ // const __filename = fileURLToPath(import.meta.url);
17
+ // const __dirname = path.dirname(__filename);
18
+ // const chainsDir = `${__dirname}/chains`;
19
+ // const chainsFiles = fs.readdirSync(chainsDir).filter(file => file.endsWith('.json'));
20
+ // const chains = {};
21
+ // for(const chainFileName of chainsFiles) {
22
+ // const chainId = chainFileName.split('.')[0];
23
+ // const chainConfig = fs.readFileSync(`${chainsDir}/${chainFileName}`, 'utf8');
24
+ // chains[chainId] = JSON.parse(chainConfig);
25
+ // }
26
+ // return chains;
27
+ // } else {
28
+ // const chainConfigs = {
29
+ // 8453: chain8453,
30
+ // };
31
+ // // Client-side logic via API ?
32
+ // return chainConfigs;
33
+ // }
34
+ return index_1.default;
35
+ }
36
+ function setChainConfig(chainId, config) {
37
+ index_1.default[chainId] = config;
38
+ }
39
+ function getChainConfig(chainId) {
40
+ const chains = getChainsConfig();
41
+ return chains[chainId];
42
+ }
43
+ exports.default = { getChainsConfig, getChainConfig, setChainConfig };
@@ -1,14 +1,11 @@
1
1
  import { ethers, Signer } from "ethers";
2
- import { getContractAddress } from "../../utils/contracts";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
- import estimateGasPrice from "../../methods/commons/estimateGasPrice";
5
- import { ChainId } from "../../configs/chains/index";
6
- import { StabilityPool } from "../../typechain-types";
7
4
 
8
5
  async function depositNFTToStabilityPool(
9
- chainId: ChainId,
10
- tokenId: string,
11
- signer: Signer
6
+ chainId,
7
+ tokenId,
8
+ signer
12
9
  ) {
13
10
  if (!signer) {
14
11
  throw new Error("Wallet not connected");
@@ -21,7 +18,7 @@ async function depositNFTToStabilityPool(
21
18
  stabilityPoolAddress,
22
19
  abi,
23
20
  signer
24
- ) as any as StabilityPool;
21
+ );
25
22
 
26
23
  const RAACNFTAddress = getContractAddress(chainId, "raacnft");
27
24
  const raacNFTABI = getABI("raacnft");
@@ -58,7 +55,7 @@ async function depositNFTToStabilityPool(
58
55
  receipt?.hash
59
56
  );
60
57
  return receipt;
61
- } catch (error: any) {
58
+ } catch (error) {
62
59
  console.error(`Error depositing NFT to Stability Pool:`, error);
63
60
  throw new Error(`NFT Deposit to Stability Pool failed: ${error.message}`);
64
61
  }
@@ -1,14 +1,12 @@
1
1
  import { ethers, Signer } from "ethers";
2
- import { getContractAddress } from "../../utils/contracts";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
4
  import estimateGasPrice from "../../methods/commons/estimateGasPrice";
5
- import { ChainId } from "../../configs/chains/index";
6
- import { StabilityPool } from "../../typechain-types";
7
5
 
8
6
  async function depositToStabilityPool(
9
- chainId: ChainId,
10
- amount: string,
11
- signer: Signer
7
+ chainId,
8
+ amount,
9
+ signer
12
10
  ) {
13
11
  if (!signer) {
14
12
  throw new Error("Wallet not connected");
@@ -21,7 +19,7 @@ async function depositToStabilityPool(
21
19
  stabilityPoolAddress,
22
20
  abi,
23
21
  signer
24
- ) as any as StabilityPool;
22
+ );
25
23
 
26
24
  const amountInWei = ethers.parseEther(amount);
27
25
  const { maxFeePerGas } = await estimateGasPrice(signer);
@@ -38,7 +36,7 @@ async function depositToStabilityPool(
38
36
  receipt?.hash
39
37
  );
40
38
  return receipt;
41
- } catch (error: any) {
39
+ } catch (error) {
42
40
  console.error(`Error depositing to Stability Pool:`, error);
43
41
  throw new Error(`Deposit to Stability Pool failed: ${error.message}`);
44
42
  }
@@ -1,14 +1,12 @@
1
- import { ethers, Provider } from "ethers";
2
- import { getContractAddress } from "../../contracts/getContractAddress";
1
+ import { ethers } from "ethers";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
- import { ChainId } from "../../configs/chains/index";
5
- import { StabilityPool } from "../../typechain-types";
6
4
 
7
5
  // Get the amount of RToken RAW deposit in the lending pool, without the accured interest
8
6
  async function getRawUserDepositInStabilityPool(
9
- chainId: ChainId,
10
- address: string,
11
- provider: Provider
7
+ chainId,
8
+ address,
9
+ provider
12
10
  ) {
13
11
  try {
14
12
  const stabilityPoolAddress = getContractAddress(chainId, "stabilitypool");
@@ -17,7 +15,7 @@ async function getRawUserDepositInStabilityPool(
17
15
  stabilityPoolAddress,
18
16
  stabilityPoolABI,
19
17
  provider
20
- ) as any as StabilityPool;
18
+ );
21
19
 
22
20
  const value = await stabilityPoolContract.getUserDeposit(address);
23
21
 
@@ -26,7 +24,7 @@ async function getRawUserDepositInStabilityPool(
26
24
  );
27
25
 
28
26
  return value;
29
- } catch (error: any) {
27
+ } catch (error) {
30
28
  console.error("Error in getRawUserDepositInStabilityPool:", error);
31
29
  throw error;
32
30
  }
@@ -1,13 +1,11 @@
1
- import { ethers, Provider } from "ethers";
2
- import { getContractAddress } from "../../utils/contracts";
1
+ import { ethers } from "ethers";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
- import { ChainId } from "../../configs/chains/index";
5
- import { StabilityPool } from "../../typechain-types";
6
4
 
7
5
  async function getStabilityPoolInfo(
8
- chainId: ChainId,
9
- address: string,
10
- provider: Provider
6
+ chainId,
7
+ address,
8
+ provider
11
9
  ) {
12
10
  try {
13
11
  const stabilityPoolAddress = getContractAddress(chainId, "stabilitypool");
@@ -16,9 +14,9 @@ async function getStabilityPoolInfo(
16
14
  stabilityPoolAddress,
17
15
  abi,
18
16
  provider
19
- ) as any as StabilityPool;
17
+ );
20
18
 
21
- const handleError = (operation: string) => (error: any) => {
19
+ const handleError = (operation) => (error) => {
22
20
  if (error.code === "BAD_DATA") {
23
21
  console.log(
24
22
  `BAD_DATA from getStabilityPoolInfo - ${operation}:`,
@@ -68,12 +66,12 @@ async function getStabilityPoolInfo(
68
66
 
69
67
  // Fetch RAAC Minter information if needed for APY calculation
70
68
  const raacMinterAddress = getContractAddress(chainId, "raacminter");
71
- let apy: bigint = 0n;
69
+ let apy = 0n;
72
70
 
73
71
  if (raacMinterAddress && raacMinterAddress !== ethers.ZeroAddress) {
74
72
  const raacMinterABI = getABI("raacminter");
75
73
  const raacMinterContract = new ethers.Contract(
76
- raacMinterAddress as string,
74
+ raacMinterAddress,
77
75
  raacMinterABI,
78
76
  provider
79
77
  );
@@ -102,7 +100,7 @@ async function getStabilityPoolInfo(
102
100
  };
103
101
 
104
102
  return result;
105
- } catch (error: any) {
103
+ } catch (error) {
106
104
  console.error("Error fetching stability pool info:", error);
107
105
  throw error;
108
106
  }
@@ -1,12 +1,10 @@
1
- import { BrowserProvider, ethers, Provider } from "ethers";
2
- import { getContractAddress } from "../../utils/contracts";
1
+ import { ethers } from "ethers";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
- import { ChainId } from "../../configs/chains/index";
5
- import { StabilityPool } from "../../typechain-types";
6
4
 
7
5
  async function getStabilityPoolTotalDeposits(
8
- chainId: ChainId,
9
- provider: Provider
6
+ chainId,
7
+ provider
10
8
  ) {
11
9
  try {
12
10
  const stabilityPoolAddress = getContractAddress(chainId, "stabilitypool");
@@ -15,10 +13,10 @@ async function getStabilityPoolTotalDeposits(
15
13
  stabilityPoolAddress,
16
14
  abi,
17
15
  provider
18
- ) as any as StabilityPool;
16
+ );
19
17
  const totalDeposits = await stabilityPoolContract.getTotalDeposits();
20
18
  return totalDeposits;
21
- } catch (error: any) {
19
+ } catch (error) {
22
20
  console.error("Error fetching total deposits:", error);
23
21
  throw error;
24
22
  }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.estimateGasPrice = void 0;
4
+ const estimateGasPrice = async (signer) => {
5
+ const provider = signer.provider;
6
+ try {
7
+ const feeData = await provider.getFeeData();
8
+ const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
9
+ // Fix for maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two
10
+ const maxFeePerGas = maxPriorityFeePerGas && feeData.maxFeePerGas &&
11
+ feeData.maxFeePerGas < maxPriorityFeePerGas ?
12
+ maxPriorityFeePerGas : feeData.maxFeePerGas;
13
+ return {
14
+ maxFeePerGas,
15
+ maxPriorityFeePerGas,
16
+ };
17
+ }
18
+ catch (error) {
19
+ console.log("Error getting gas price", error);
20
+ if (provider === null || provider === void 0 ? void 0 : provider.getGasPrice) {
21
+ const gasPrice = await provider.getGasPrice();
22
+ return { gasPrice };
23
+ }
24
+ return { gasPrice: 0 };
25
+ }
26
+ };
27
+ exports.estimateGasPrice = estimateGasPrice;
28
+ exports.default = exports.estimateGasPrice;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ethers_1 = require("ethers");
7
+ const contracts_1 = require("../../utils/contracts");
8
+ const artifacts_1 = require("../../utils/artifacts");
9
+ const estimateGasPrice_1 = __importDefault(require("../../methods/commons/estimateGasPrice"));
10
+ async function withdrawFromStabilityPool(chainId, amount, signer) {
11
+ if (!signer) {
12
+ throw new Error("Wallet not connected");
13
+ }
14
+ try {
15
+ const stabilityPoolAddress = (0, contracts_1.getContractAddress)(chainId, "stabilitypool");
16
+ const abi = (0, artifacts_1.getABI)("stabilitypool");
17
+ const stabilityPoolContract = new ethers_1.ethers.Contract(stabilityPoolAddress, abi, signer);
18
+ const amountInWei = ethers_1.ethers.parseEther(amount);
19
+ const { maxFeePerGas } = await (0, estimateGasPrice_1.default)(signer);
20
+ const tx = await stabilityPoolContract.withdraw(amountInWei.toString(), {
21
+ maxFeePerGas,
22
+ nonce: await signer.getNonce(),
23
+ });
24
+ console.log(`Withdrawal transaction sent to Stability Pool:`, tx.hash);
25
+ const receipt = await tx.wait();
26
+ console.log(`Withdrawn ${amount} from Stability Pool successfully:`, receipt === null || receipt === void 0 ? void 0 : receipt.hash);
27
+ return receipt;
28
+ }
29
+ catch (error) {
30
+ console.error(`Error withdrawing from Stability Pool:`, error);
31
+ throw new Error(`Withdrawal from Stability Pool failed: ${error.message}`);
32
+ }
33
+ }
34
+ exports.default = withdrawFromStabilityPool;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ABIS = exports.getABI = void 0;
7
+ const crvUSDToken_json_1 = __importDefault(require("../artifacts/mocks/core/tokens/crvUSDToken.sol/crvUSDToken.json")); // assert { type: "json" };
8
+ const veRAACToken_json_1 = __importDefault(require("../artifacts/core/tokens/veRAACToken.sol/veRAACToken.json")); // assert { type: "json" };
9
+ const RToken_json_1 = __importDefault(require("../artifacts/core/tokens/RToken.sol/RToken.json")); // assert { type: "json" };
10
+ const LendingPool_json_1 = __importDefault(require("../artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json")); // assert { type: "json" };
11
+ const StabilityPool_json_1 = __importDefault(require("../artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json")); // assert { type: "json" };
12
+ // import LiquidityPoolArtifact from "../artifacts/LiquidityPool/LiquidityPool.sol/LiquidityPool.json"; // assert { type: "json" };
13
+ const RAACNFT_json_1 = __importDefault(require("../artifacts/core/tokens/RAACNFT.sol/RAACNFT.json")); // assert { type: "json" };
14
+ const DEToken_json_1 = __importDefault(require("../artifacts/core/tokens/DEToken.sol/DEToken.json")); // assert { type: "json" };
15
+ const RAACToken_json_1 = __importDefault(require("../artifacts/core/tokens/RAACToken.sol/RAACToken.json")); // assert { type: "json" };
16
+ const RAACMinter_json_1 = __importDefault(require("../artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json")); // assert { type: "json" };
17
+ const RAACHousePrices_json_1 = __importDefault(require("../artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json")); // assert { type: "json" };
18
+ const AuctionFactory_json_1 = __importDefault(require("../artifacts/zeno/AuctionFactory.sol/AuctionFactory.json")); // assert { type: "json" };
19
+ const Auction_json_1 = __importDefault(require("../artifacts/zeno/Auction.sol/Auction.json")); // assert { type: "json" };
20
+ const ZenoFactory_json_1 = __importDefault(require("../artifacts/zeno/ZenoFactory.sol/ZenoFactory.json")); // assert { type: "json" };
21
+ const Zeno_json_1 = __importDefault(require("../artifacts/zeno/Zeno.sol/Zeno.json")); // assert { type: "json" };
22
+ const FeeCollector_json_1 = __importDefault(require("../artifacts/core/collectors/FeeCollector.sol/FeeCollector.json")); // assert { type: "json" };
23
+ const IndexToken_json_1 = __importDefault(require("../artifacts/core/tokens/IndexToken.sol/IndexToken.json")); // assert { type: "json" };
24
+ const MockVRFCoordinatorV2_json_1 = __importDefault(require("../artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json")); // assert { type: "json" };
25
+ const BaseVRFv2Consumer_json_1 = __importDefault(require("../artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json")); // assert { type: "json" };
26
+ const CRVUSD_ABI = crvUSDToken_json_1.default.abi;
27
+ const RToken_json_2 = __importDefault(require("../artifacts/core/tokens/RToken.sol/RToken.json")); // assert { type: "json" }; // TODO: Isnt this same as rcrvusd?
28
+ const RTOKEN_ABI = RToken_json_2.default.abi;
29
+ const VERAAC_ABI = veRAACToken_json_1.default.abi;
30
+ const RCRVUSD_ABI = RToken_json_1.default.abi;
31
+ const DETOKEN_ABI = DEToken_json_1.default.abi;
32
+ const RAACLENDINGPOOL_ABI = LendingPool_json_1.default.abi;
33
+ const RAACSTABILITYPOOL_ABI = StabilityPool_json_1.default.abi;
34
+ // const LIQUIDITYPOOL_ABI = LiquidityPoolArtifact.abi;
35
+ const RAACMINTER_ABI = RAACMinter_json_1.default.abi;
36
+ const RAACNFT_ABI = RAACNFT_json_1.default.abi;
37
+ const RAACToken_ABI = RAACToken_json_1.default.abi;
38
+ const RAACHOUSEPRICES_ABI = RAACHousePrices_json_1.default.abi;
39
+ const FEECOLLECTOR_ABI = FeeCollector_json_1.default.abi;
40
+ const ABIS = {
41
+ // Tokens
42
+ crvusd: CRVUSD_ABI,
43
+ // RAAC
44
+ raacnft: RAACNFT_ABI,
45
+ raactoken: RAACToken_ABI,
46
+ veraac: VERAAC_ABI,
47
+ // Pools tokens
48
+ rcrvusd: RCRVUSD_ABI,
49
+ rtoken: RTOKEN_ABI,
50
+ detoken: DETOKEN_ABI,
51
+ // Pools
52
+ lendingpool: RAACLENDINGPOOL_ABI,
53
+ stabilitypool: RAACSTABILITYPOOL_ABI,
54
+ // liquiditypool: LIQUIDITYPOOL_ABI,
55
+ raacminter: RAACMINTER_ABI,
56
+ // contracts
57
+ // contracts#raacHousePrices
58
+ raachouseprices: RAACHOUSEPRICES_ABI,
59
+ feecollector: FEECOLLECTOR_ABI,
60
+ // contracts#auction
61
+ auction: Auction_json_1.default.abi,
62
+ auctionfactory: AuctionFactory_json_1.default.abi,
63
+ zeno: Zeno_json_1.default.abi,
64
+ zenofactory: ZenoFactory_json_1.default.abi,
65
+ indextoken: IndexToken_json_1.default.abi,
66
+ mockvrfcoordinator: MockVRFCoordinatorV2_json_1.default.abi,
67
+ vrfconsumer: BaseVRFv2Consumer_json_1.default.abi,
68
+ eth: [],
69
+ };
70
+ exports.ABIS = ABIS;
71
+ const getABI = (name) => {
72
+ return ABIS[name];
73
+ };
74
+ exports.getABI = getABI;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getContractAddress = exports.getContract = exports.getConfig = exports.setOverrideConfig = exports.getConfigs = void 0;
4
+ const configs_1 = require("../configs");
5
+ const chains_1 = require("../configs/chains");
6
+ const artifacts_1 = require("./artifacts");
7
+ const ethers_1 = require("ethers");
8
+ let _config;
9
+ let _configs;
10
+ const getConfigs = () => {
11
+ if (!_configs) {
12
+ _configs = (0, configs_1.getChainsConfig)();
13
+ }
14
+ return _configs;
15
+ };
16
+ exports.getConfigs = getConfigs;
17
+ const setOverrideConfig = (chainId, newConfig) => {
18
+ if (!_configs) {
19
+ _configs = (0, exports.getConfigs)();
20
+ }
21
+ // FIXME: configs is not defined here.
22
+ if (!chains_1.configs[chainId]) {
23
+ // @ts-ignore
24
+ chains_1.configs[chainId] = {};
25
+ }
26
+ chains_1.configs[chainId] = {
27
+ ...chains_1.configs[chainId],
28
+ ...newConfig,
29
+ contracts: {
30
+ ...chains_1.configs[chainId].contracts,
31
+ ...newConfig.contracts,
32
+ },
33
+ };
34
+ };
35
+ exports.setOverrideConfig = setOverrideConfig;
36
+ const getConfig = (chainId) => {
37
+ const configs = (0, exports.getConfigs)();
38
+ if (!configs[chainId]) {
39
+ throw new Error(`Unsupported chain ID: ${chainId}. Has ${JSON.stringify(Object.keys(configs))}`);
40
+ }
41
+ return configs[chainId];
42
+ };
43
+ exports.getConfig = getConfig;
44
+ const getContract = (chainId, contractName, provider) => {
45
+ const normalizedContractName = contractName.toLowerCase();
46
+ const address = (0, exports.getContractAddress)(chainId, normalizedContractName);
47
+ const abi = (0, artifacts_1.getABI)(normalizedContractName);
48
+ return new ethers_1.ethers.Contract(address, abi, provider);
49
+ };
50
+ exports.getContract = getContract;
51
+ const getContractAddress = (chainId, contractName) => {
52
+ var _a;
53
+ const normalizedContractName = contractName.toLowerCase();
54
+ const config = (0, exports.getConfig)(chainId);
55
+ if (!config) {
56
+ throw new Error(`Unsupported chain ID: ${chainId}`);
57
+ }
58
+ const chainKeys = ["contracts", "assets", "pools", "nfts"];
59
+ const keys = Object.keys(config).filter((key) => chainKeys.includes(key));
60
+ let address = null;
61
+ for (const key of keys) {
62
+ if (config[key] && config[key][normalizedContractName]) {
63
+ address = (_a = config[key][normalizedContractName]) === null || _a === void 0 ? void 0 : _a.contract;
64
+ break;
65
+ }
66
+ }
67
+ if (!address) {
68
+ const hasIds = keys
69
+ .map((key) => `${key}: ${Object.keys(config[key]).join(", ")}`)
70
+ .join("\n");
71
+ throw new Error(`Contract ${normalizedContractName} not found for chain ID: ${chainId}.\nHas:\n${hasIds}`);
72
+ }
73
+ return address;
74
+ };
75
+ exports.getContractAddress = getContractAddress;
76
+ exports.default = {
77
+ getContract: exports.getContract,
78
+ getContractAddress: exports.getContractAddress,
79
+ setOverrideConfig: exports.setOverrideConfig,
80
+ getConfig: exports.getConfig,
81
+ getConfigs: exports.getConfigs,
82
+ };
@@ -1,14 +1,12 @@
1
1
  import { ethers, Signer } from "ethers";
2
- import { getContractAddress } from "../../utils/contracts";
2
+ import getContractAddress from "../../contracts/getContractAddress";
3
3
  import { getABI } from "../../utils/artifacts";
4
4
  import estimateGasPrice from "../../methods/commons/estimateGasPrice";
5
- import { ChainId } from "../../configs/chains/index";
6
- import { StabilityPool } from "../../typechain-types";
7
5
 
8
6
  async function withdrawFromStabilityPool(
9
- chainId: ChainId,
10
- amount: string,
11
- signer: Signer
7
+ chainId,
8
+ amount,
9
+ signer
12
10
  ) {
13
11
  if (!signer) {
14
12
  throw new Error("Wallet not connected");
@@ -21,7 +19,7 @@ async function withdrawFromStabilityPool(
21
19
  stabilityPoolAddress,
22
20
  abi,
23
21
  signer
24
- ) as any as StabilityPool;
22
+ );
25
23
 
26
24
  const amountInWei = ethers.parseEther(amount);
27
25
  const { maxFeePerGas } = await estimateGasPrice(signer);
@@ -38,7 +36,7 @@ async function withdrawFromStabilityPool(
38
36
  receipt?.hash
39
37
  );
40
38
  return receipt;
41
- } catch (error: any) {
39
+ } catch (error) {
42
40
  console.error(`Error withdrawing from Stability Pool:`, error);
43
41
  throw new Error(`Withdrawal from Stability Pool failed: ${error.message}`);
44
42
  }
package/ts-to-js.sh ADDED
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+
3
+ # Script to find all TypeScript (.ts) files and transform them to JavaScript (.js)
4
+ # Author: RAAC
5
+ # Usage: ./ts-to-js.sh
6
+
7
+ # Set up error handling
8
+ set -e
9
+
10
+ echo "Starting TypeScript to JavaScript transformation..."
11
+
12
+ # Find all .ts files (excluding node_modules, dist, and typechain-types directories)
13
+ TS_FILES=$(find . -type f -name "*.ts" ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/typechain-types/*")
14
+
15
+ # Check if any TypeScript files were found
16
+ if [ -z "$TS_FILES" ]; then
17
+ echo "No TypeScript files found."
18
+ exit 0
19
+ fi
20
+
21
+ # Count the number of files to process
22
+ FILE_COUNT=$(echo "$TS_FILES" | wc -l)
23
+ echo "Found $FILE_COUNT TypeScript files to process."
24
+
25
+ # Process each TypeScript file
26
+ for TS_FILE in $TS_FILES; do
27
+ echo "Processing $TS_FILE..."
28
+
29
+ # Get the directory and filename without extension
30
+ DIR=$(dirname "$TS_FILE")
31
+ FILENAME=$(basename "$TS_FILE" .ts)
32
+
33
+ # Create the JavaScript file by copying and renaming
34
+ cp "$TS_FILE" "$DIR/$FILENAME.js"
35
+
36
+ # Remove the TypeScript file
37
+ rm "$TS_FILE"
38
+
39
+ echo "✓ Generated $DIR/$FILENAME.js"
40
+ done
41
+
42
+ echo "Transformation complete. $FILE_COUNT files processed."
@@ -65,10 +65,7 @@ const ABIS = {
65
65
  eth: [],
66
66
  };
67
67
 
68
- export type AssetType = keyof typeof ABIS | string;
69
- export type ContractType = keyof typeof ABIS;
70
-
71
- const getABI = (name: keyof typeof ABIS) => {
68
+ const getABI = (name) => {
72
69
  return ABIS[name];
73
70
  };
74
71
 
@@ -1,11 +1,10 @@
1
- import { getChainsConfig, getChainConfig } from "../configs";
2
- import { ChainId, configs } from "../configs/chains";
3
- import { Chain } from "../configs/chains/chain";
4
- import { ABIS, ContractType, getABI } from "./artifacts";
5
- import { ethers, Provider } from "ethers";
1
+ import { getChainsConfig } from "../configs";
2
+ import { configs } from "../configs/chains";
3
+ import { getABI } from "./artifacts";
4
+ import { ethers } from "ethers";
6
5
 
7
6
  let _config;
8
- let _configs: ReturnType<typeof getChainsConfig>;
7
+ let _configs = getChainsConfig();
9
8
 
10
9
  export const getConfigs = () => {
11
10
  if (!_configs) {
@@ -14,7 +13,7 @@ export const getConfigs = () => {
14
13
  return _configs;
15
14
  };
16
15
 
17
- export const setOverrideConfig = (chainId: ChainId, newConfig: any) => {
16
+ export const setOverrideConfig = (chainId, newConfig) => {
18
17
  if (!_configs) {
19
18
  _configs = getConfigs();
20
19
  }
@@ -33,7 +32,7 @@ export const setOverrideConfig = (chainId: ChainId, newConfig: any) => {
33
32
  };
34
33
  };
35
34
 
36
- export const getConfig = (chainId: ChainId) => {
35
+ export const getConfig = (chainId) => {
37
36
  const configs = getConfigs();
38
37
  if (!configs[chainId]) {
39
38
  throw new Error(
@@ -46,31 +45,30 @@ export const getConfig = (chainId: ChainId) => {
46
45
  };
47
46
 
48
47
  export const getContract = (
49
- chainId: ChainId,
50
- contractName: ContractType,
51
- provider: Provider
48
+ chainId,
49
+ contractName,
50
+ provider
52
51
  ) => {
53
- const normalizedContractName =
54
- contractName.toLowerCase() as keyof typeof ABIS;
52
+ const normalizedContractName = contractName.toLowerCase();
55
53
  const address = getContractAddress(chainId, normalizedContractName);
56
54
  const abi = getABI(normalizedContractName);
57
55
  return new ethers.Contract(address, abi, provider);
58
56
  };
59
57
 
60
- export const getContractAddress = (chainId: ChainId, contractName: string) => {
58
+ export const getContractAddress = (chainId, contractName) => {
61
59
  const normalizedContractName = contractName.toLowerCase();
62
60
  const config = getConfig(chainId);
63
61
  if (!config) {
64
62
  throw new Error(`Unsupported chain ID: ${chainId}`);
65
63
  }
66
- const chainKeys = ["contracts", "assets", "pools", "nfts"] as (keyof Chain)[];
67
- const keys = (Object.keys(config) as (keyof Chain)[]).filter((key) =>
64
+ const chainKeys = ["contracts", "assets", "pools", "nfts"];
65
+ const keys = Object.keys(config).filter((key) =>
68
66
  chainKeys.includes(key)
69
67
  );
70
68
  let address = null;
71
69
  for (const key of keys) {
72
- if (config[key] && (config[key] as any)[normalizedContractName]) {
73
- address = (config[key] as any)[normalizedContractName]?.contract;
70
+ if (config[key] && config[key][normalizedContractName]) {
71
+ address = config[key][normalizedContractName]?.contract;
74
72
  break;
75
73
  }
76
74
  }