@raac/rpc 2.0.0-beta.1 → 2.0.0-beta.10

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 (684) hide show
  1. package/dist/RPCLibrary.js +134 -25
  2. package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +2 -2
  3. package/dist/artifacts/core/collectors/fee-streamer/RentStreamer.sol/RentStreamer.json +838 -0
  4. package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +8 -2
  5. package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +2 -2
  6. package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +2 -2
  7. package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +2 -2
  8. package/dist/artifacts/core/lockers/RAACMaturityVault.sol/RAACMaturityVault.json +2 -2
  9. package/dist/artifacts/core/oracles/RAACPrimeRateOracle.sol/RAACPrimeRateOracle.json +2 -2
  10. package/dist/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +62 -86
  11. package/dist/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +2 -2
  12. package/dist/artifacts/core/psm/PSMVault.sol/PSMVault.json +2303 -0
  13. package/dist/artifacts/core/psm/RateProvider.sol/RateProvider.json +444 -0
  14. package/dist/artifacts/core/tokens/RToken.sol/RToken.json +2 -2
  15. package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +69 -66
  16. package/dist/artifacts/mocks/core/tokens/ERC721Mock.sol/ERC721Mock.json +491 -0
  17. package/dist/artifacts/mocks/core/tokens/USDCTokenLimited.sol/USDCTokenLimited.json +558 -0
  18. package/dist/artifacts/zeno/Auction.sol/Auction.json +278 -120
  19. package/dist/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +31 -148
  20. package/dist/artifacts/zeno/Zeno.sol/Zeno.json +80 -45
  21. package/dist/artifacts/zeno/ZenoFactory.sol/ZenoFactory.json +11 -88
  22. package/dist/assets/getAsset.js +2 -2
  23. package/dist/assets/getSupply.js +7 -7
  24. package/dist/configs/chains/1.json +18 -0
  25. package/dist/configs/chains/11155111.json +64 -5
  26. package/dist/configs/chains/17000.json +4 -0
  27. package/dist/configs/chains/18453.json +4 -0
  28. package/dist/configs/chains/8453.json +33 -3
  29. package/dist/contracts/curve/common/_helpers.js +39 -0
  30. package/dist/contracts/curve/common/getPools.js +36 -0
  31. package/dist/contracts/curve/common/getVirtualPrice.js +26 -0
  32. package/dist/contracts/curve/common/index.js +18 -0
  33. package/dist/contracts/feeCollector/claimRewardFromPool.js +2 -2
  34. package/dist/contracts/findContract.js +12 -11
  35. package/dist/contracts/getContractAddress.js +2 -2
  36. package/dist/contracts/getTokenMetadata.js +31 -0
  37. package/dist/contracts/governance/_helpers.js +1 -22
  38. package/dist/contracts/governance/distributor/claimAll.js +2 -2
  39. package/dist/contracts/governance/distributor/claimForGauge.js +2 -2
  40. package/dist/contracts/governance/distributor/deposit.js +2 -2
  41. package/dist/contracts/governance/distributor/setController.js +2 -2
  42. package/dist/contracts/governance/distributor/setLastClaimedEpoch.js +2 -2
  43. package/dist/contracts/governance/distributor/setMaxClaimBound.js +2 -2
  44. package/dist/contracts/governance/distributor/withdrawDust.js +2 -2
  45. package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +2 -2
  46. package/dist/contracts/governance/gauge/claimRewardToken.js +2 -3
  47. package/dist/contracts/governance/gauge/pullRewardsFromDistributor.js +2 -2
  48. package/dist/contracts/governance/gauge/stake.js +2 -3
  49. package/dist/contracts/governance/gauge/updateUserRewards.js +2 -3
  50. package/dist/contracts/governance/gauge/withdraw.js +2 -3
  51. package/dist/contracts/governance/gaugeController/addGauge.js +2 -2
  52. package/dist/contracts/governance/gaugeController/batchVote.js +2 -2
  53. package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +2 -2
  54. package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +2 -2
  55. package/dist/contracts/governance/gaugeController/kick.js +2 -2
  56. package/dist/contracts/governance/gaugeController/removeGauge.js +2 -2
  57. package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +2 -2
  58. package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +2 -2
  59. package/dist/contracts/governance/gaugeController/setDistributor.js +2 -2
  60. package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +2 -2
  61. package/dist/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.js +2 -2
  62. package/dist/contracts/governance/gaugeController/setEmergencyPause.js +2 -2
  63. package/dist/contracts/governance/gaugeController/setMaxVoteBuckets.js +2 -2
  64. package/dist/contracts/governance/gaugeController/vote.js +2 -2
  65. package/dist/contracts/governance/gaugeSystems/_helpers.js +2 -2
  66. package/dist/contracts/governance/proposals/cancel.js +3 -4
  67. package/dist/contracts/governance/proposals/castVote.js +4 -4
  68. package/dist/contracts/governance/proposals/execute.js +3 -4
  69. package/dist/contracts/governance/proposals/getVoteReceipt.js +0 -1
  70. package/dist/contracts/governance/proposals/propose.js +3 -4
  71. package/dist/contracts/governance/proposals/setParameter.js +3 -4
  72. package/dist/contracts/governance/proposals/setTimelock.js +3 -4
  73. package/dist/contracts/housePrices/getLatestPrice.js +3 -3
  74. package/dist/contracts/housePrices/setOracle.js +3 -4
  75. package/dist/contracts/lockers/botLocker/addRewardTokens.js +21 -0
  76. package/dist/contracts/lockers/botLocker/distributeRewardToken.js +23 -0
  77. package/dist/contracts/lockers/botLocker/getConfig.js +29 -0
  78. package/dist/contracts/lockers/botLocker/getLocks.js +11 -1
  79. package/dist/contracts/lockers/botLocker/getRoles.js +22 -0
  80. package/dist/contracts/lockers/botLocker/getUnlockWindow.js +29 -0
  81. package/dist/contracts/lockers/botLocker/grantRole.js +38 -0
  82. package/dist/contracts/lockers/botLocker/hasRole.js +18 -0
  83. package/dist/contracts/lockers/botLocker/pause.js +24 -0
  84. package/dist/contracts/lockers/botLocker/rescueTokens.js +22 -0
  85. package/dist/contracts/lockers/liquidLocker/deposit.js +12 -4
  86. package/dist/contracts/lockers/liquidLocker/hasHarvestRole.js +15 -0
  87. package/dist/contracts/pmBlender/getReserveBalance.js +3 -3
  88. package/dist/contracts/pmBlender/getSupportedTokens.js +0 -1
  89. package/dist/contracts/pmBlender/previewDeposit.js +3 -3
  90. package/dist/contracts/pmBlender/previewSwap.js +3 -3
  91. package/dist/contracts/pmBlender/previewWithdraw.js +3 -3
  92. package/dist/contracts/pmMarket/getMarketConfig.js +3 -3
  93. package/dist/contracts/pmTreasury/getCollateralRatio.js +4 -2
  94. package/dist/contracts/pmTreasury/getCurrentNav.js +4 -2
  95. package/dist/contracts/pmTreasury/getLeverageRatio.js +4 -2
  96. package/dist/contracts/pmTreasury/getMaxMintablePMUSD.js +4 -2
  97. package/dist/contracts/pmTreasury/getMaxMintablePMUSDWithoutBaseToken.js +4 -2
  98. package/dist/contracts/pmTreasury/getMaxMintableXPM.js +4 -2
  99. package/dist/contracts/pmTreasury/getMaxRedeemablePMUSD.js +4 -2
  100. package/dist/contracts/pmTreasury/getMaxRedeemableXPM.js +4 -2
  101. package/dist/contracts/pmTreasury/getTotalBaseToken.js +4 -2
  102. package/dist/contracts/psm/_helpers.js +68 -0
  103. package/dist/contracts/psm/cancelExit.js +20 -0
  104. package/dist/contracts/psm/deposit.js +25 -0
  105. package/dist/contracts/psm/getVaultInfo.js +126 -0
  106. package/dist/contracts/psm/previewDeposit.js +21 -0
  107. package/dist/contracts/psm/previewProportionalSplit.js +19 -0
  108. package/dist/contracts/psm/previewRedeem.js +21 -0
  109. package/dist/contracts/psm/previewSwap.js +21 -0
  110. package/dist/contracts/psm/redeem.js +25 -0
  111. package/dist/contracts/psm/requestExit.js +20 -0
  112. package/dist/contracts/psm/swap.js +24 -0
  113. package/dist/contracts/rentStreamer/_helpers.js +19 -0
  114. package/dist/contracts/rentStreamer/getScheduled.js +19 -0
  115. package/dist/contracts/rentStreamer/getState.js +40 -0
  116. package/dist/contracts/rentStreamer/previewRelease.js +23 -0
  117. package/dist/contracts/rentStreamer/release.js +22 -0
  118. package/dist/contracts/rentStreamer/sync.js +21 -0
  119. package/dist/contracts/resolveName.js +1 -1
  120. package/dist/contracts/tokens/veRAAC/_helpers.js +0 -2
  121. package/dist/contracts/tokens/veRAAC/claimReward.js +3 -4
  122. package/dist/contracts/tokens/veRAAC/distributeRewards.js +3 -4
  123. package/dist/contracts/tokens/veRAAC/extend.js +3 -4
  124. package/dist/contracts/tokens/veRAAC/finalizeRagequit.js +3 -4
  125. package/dist/contracts/tokens/veRAAC/getRewardTokens.js +34 -0
  126. package/dist/contracts/tokens/veRAAC/getTotalSupply.js +0 -1
  127. package/dist/contracts/tokens/veRAAC/getTotalSupplyAt.js +1 -1
  128. package/dist/contracts/tokens/veRAAC/increase.js +3 -4
  129. package/dist/contracts/tokens/veRAAC/lock.js +3 -4
  130. package/dist/contracts/tokens/veRAAC/ragequitAll.js +3 -4
  131. package/dist/contracts/tokens/veRAAC/ragequitLock.js +3 -4
  132. package/dist/contracts/tokens/veRAAC/withdraw.js +3 -4
  133. package/dist/contracts/zeno/_helpers.js +43 -0
  134. package/dist/contracts/zeno/buy.js +27 -0
  135. package/dist/contracts/zeno/createAuction.js +30 -15
  136. package/dist/contracts/zeno/createZeno.js +23 -12
  137. package/dist/contracts/zeno/getAuctionState.js +45 -0
  138. package/dist/contracts/zeno/getAuctions.js +39 -34
  139. package/dist/contracts/zeno/getBondState.js +47 -0
  140. package/dist/contracts/zeno/getPrice.js +23 -0
  141. package/dist/contracts/zeno/getZenos.js +32 -16
  142. package/dist/contracts/zeno/grantRole.js +46 -0
  143. package/dist/contracts/zeno/pause.js +42 -0
  144. package/dist/contracts/zeno/priceAt.js +20 -0
  145. package/dist/contracts/zeno/quoteBuy.js +33 -0
  146. package/dist/contracts/zeno/redeem.js +44 -0
  147. package/dist/contracts/zeno/setAuction.js +25 -0
  148. package/dist/contracts/zeno/sweepSurplus.js +26 -0
  149. package/dist/generated/errors.json +3537 -0
  150. package/dist/index.js +1 -0
  151. package/dist/methods/approveToken.js +2 -4
  152. package/dist/methods/commons/checkAllowance.js +2 -3
  153. package/dist/methods/commons/estimateGasPrice.js +0 -1
  154. package/dist/methods/getAssetBalance.js +4 -4
  155. package/dist/nfts/approveNFT.js +3 -5
  156. package/dist/nfts/getAllTokens.js +3 -4
  157. package/dist/nfts/getApprovalForAll.js +3 -4
  158. package/dist/nfts/getBaseUri.js +3 -4
  159. package/dist/nfts/getHousePrice.js +3 -3
  160. package/dist/nfts/getMintFeePercentage.js +3 -3
  161. package/dist/nfts/getMintPrice.js +3 -3
  162. package/dist/nfts/getNFTApproval.js +3 -4
  163. package/dist/nfts/getNFTBalance.js +29 -0
  164. package/dist/nfts/getOwnerOfNFT.js +3 -5
  165. package/dist/nfts/getTokenURI.js +3 -4
  166. package/dist/nfts/getTokensByOwner.js +3 -4
  167. package/dist/nfts/getTotalPropertiesCount.js +3 -4
  168. package/dist/nfts/mint.js +3 -5
  169. package/dist/nfts/setApprovalForAll.js +3 -5
  170. package/dist/nfts/setBaseUri.js +3 -4
  171. package/dist/nfts/totalNFTSupply.js +3 -3
  172. package/dist/nfts/transferNFT.js +34 -0
  173. package/dist/oracles/houses/request.js +2 -15
  174. package/dist/oracles/houses/simulate.js +0 -3
  175. package/dist/oracles/prime-rate/request.js +2 -16
  176. package/dist/oracles/prime-rate/simulate.js +0 -4
  177. package/dist/pools/lendingPool/adapters/erc20/getERC20AdapterBalance.js +6 -6
  178. package/dist/pools/lendingPool/adapters/erc20/getERC20AdapterInfo.js +4 -2
  179. package/dist/pools/lendingPool/adapters/erc721/getERC721AdapterDeposits.js +4 -3
  180. package/dist/pools/lendingPool/adapters/erc721/getERC721AdapterInfo.js +4 -3
  181. package/dist/pools/lendingPool/borrowFromLendingPool.js +4 -2
  182. package/dist/pools/lendingPool/borrowFromLendingPoolWithInsurance.js +3 -8
  183. package/dist/pools/lendingPool/calculateInsuranceFee.js +4 -2
  184. package/dist/pools/lendingPool/closeLiquidation.js +4 -2
  185. package/dist/pools/lendingPool/depositAssetToLendingPool.js +4 -2
  186. package/dist/pools/lendingPool/depositToLendingPool.js +4 -6
  187. package/dist/pools/lendingPool/getAdapters.js +4 -2
  188. package/dist/pools/lendingPool/getEligibleUserDeposits.js +4 -2
  189. package/dist/pools/lendingPool/getHealthFactor.js +4 -2
  190. package/dist/pools/lendingPool/getHousePrice.js +3 -3
  191. package/dist/pools/lendingPool/getLendingPoolInfo.js +3 -2
  192. package/dist/pools/lendingPool/getLendingPoolTotalLiquidity.js +4 -2
  193. package/dist/pools/lendingPool/getParameters.js +4 -2
  194. package/dist/pools/lendingPool/getPositionDebt.js +4 -2
  195. package/dist/pools/lendingPool/getPositionScaledDebt.js +4 -2
  196. package/dist/pools/lendingPool/getPositionView.js +4 -2
  197. package/dist/pools/lendingPool/getPositionsScaledDebt.js +4 -2
  198. package/dist/pools/lendingPool/getRawUserDepositsInLendingPool.js +4 -2
  199. package/dist/pools/lendingPool/getUserCollateralValue.js +4 -2
  200. package/dist/pools/lendingPool/initializeLiquidation.js +4 -2
  201. package/dist/pools/lendingPool/openVaultPosition.js +4 -6
  202. package/dist/pools/lendingPool/repayToLendingPool.js +4 -2
  203. package/dist/pools/lendingPool/vaultOpened.js +4 -2
  204. package/dist/pools/lendingPool/withdrawAssetFromLendingPool.js +4 -2
  205. package/dist/pools/lendingPool/withdrawFromLendingPool.js +3 -4
  206. package/dist/pools/liquidityPool/getLiquidityPoolInfo.js +3 -3
  207. package/dist/pools/rwaVault/adapters/erc20/getERC20VaultAdapterAssetValue.js +2 -2
  208. package/dist/pools/rwaVault/adapters/erc20/getERC20VaultAdapterInfo.js +2 -2
  209. package/dist/pools/rwaVault/adapters/erc20/getERC20VaultAdapterTotalValue.js +2 -2
  210. package/dist/pools/rwaVault/adapters/erc721/getERC721VaultAdapterAssetValue.js +2 -2
  211. package/dist/pools/rwaVault/adapters/erc721/getERC721VaultAdapterDeposits.js +2 -2
  212. package/dist/pools/rwaVault/adapters/erc721/getERC721VaultAdapterInfo.js +2 -2
  213. package/dist/pools/rwaVault/adapters/erc721/getERC721VaultAdapterTotalValue.js +2 -2
  214. package/dist/pools/rwaVault/checkRedeemEligibility.js +46 -0
  215. package/dist/pools/rwaVault/depositToRWAVault.js +4 -4
  216. package/dist/pools/rwaVault/getAdapters.js +2 -2
  217. package/dist/pools/rwaVault/getNextRandomNFT.js +4 -2
  218. package/dist/pools/rwaVault/getRWAVaultInfo.js +4 -2
  219. package/dist/pools/rwaVault/previewDeposit.js +4 -2
  220. package/dist/pools/rwaVault/previewWithdraw.js +4 -2
  221. package/dist/pools/rwaVault/redeemNFTFromRWAVault.js +4 -4
  222. package/dist/pools/rwaVault/requestRandomSeed.js +4 -4
  223. package/dist/pools/stabilityPool/depositToStabilityPool.js +4 -4
  224. package/dist/pools/stabilityPool/getRawUserDepositsInStabilityPool.js +4 -2
  225. package/dist/pools/stabilityPool/getStabilityPoolInfo.js +4 -2
  226. package/dist/pools/stabilityPool/getStabilityPoolTotalDeposits.js +4 -2
  227. package/dist/pools/stabilityPool/getWithdrawRequestInfo.js +4 -2
  228. package/dist/pools/stabilityPool/getWithdrawTimelockConfig.js +25 -0
  229. package/dist/pools/stabilityPool/requestWithdraw.js +4 -4
  230. package/dist/pools/stabilityPool/withdrawFromStabilityPool.js +4 -4
  231. package/dist/prices/computeStakingAPY.js +12 -0
  232. package/dist/prices/getCurveLPPriceUSD.js +46 -0
  233. package/dist/prices/getPrices.js +10 -8
  234. package/dist/prices/getStakingTokenPriceUSD.js +25 -0
  235. package/dist/prices/getWrapperPriceUSD.js +33 -0
  236. package/dist/prices/tokenPricesUSD.js +22 -0
  237. package/dist/scripts/generateErrorCatalogue.js +237 -0
  238. package/dist/types/RPCLibrary.d.ts +113 -10
  239. package/dist/types/configs/chains/index.d.ts +36 -0
  240. package/dist/types/configs/index.d.ts +18 -0
  241. package/dist/types/contracts/curve/common/_helpers.d.ts +16 -0
  242. package/dist/types/contracts/curve/common/getPools.d.ts +30 -0
  243. package/dist/types/contracts/curve/common/getVirtualPrice.d.ts +13 -0
  244. package/dist/types/contracts/curve/common/index.d.ts +2 -0
  245. package/dist/types/contracts/findContract.d.ts +3 -1
  246. package/dist/types/contracts/getTokenMetadata.d.ts +13 -0
  247. package/dist/types/contracts/governance/_helpers.d.ts +0 -20
  248. package/dist/types/contracts/governance/proposals/castVote.d.ts +1 -2
  249. package/dist/types/contracts/lockers/botLocker/addRewardTokens.d.ts +11 -0
  250. package/dist/types/contracts/lockers/botLocker/distributeRewardToken.d.ts +13 -0
  251. package/dist/types/contracts/lockers/botLocker/getConfig.d.ts +20 -0
  252. package/dist/types/contracts/lockers/botLocker/getLocks.d.ts +4 -0
  253. package/dist/types/contracts/lockers/botLocker/getRoles.d.ts +20 -0
  254. package/dist/types/contracts/lockers/botLocker/getUnlockWindow.d.ts +24 -0
  255. package/dist/types/contracts/lockers/botLocker/grantRole.d.ts +20 -0
  256. package/dist/types/contracts/lockers/botLocker/hasRole.d.ts +12 -0
  257. package/dist/types/contracts/lockers/botLocker/pause.d.ts +6 -0
  258. package/dist/types/contracts/lockers/botLocker/rescueTokens.d.ts +12 -0
  259. package/dist/types/contracts/lockers/liquidLocker/hasHarvestRole.d.ts +8 -0
  260. package/dist/types/contracts/psm/_helpers.d.ts +18 -0
  261. package/dist/types/contracts/psm/cancelExit.d.ts +4 -0
  262. package/dist/types/contracts/psm/deposit.d.ts +9 -0
  263. package/dist/types/contracts/psm/getVaultInfo.d.ts +77 -0
  264. package/dist/types/contracts/psm/previewDeposit.d.ts +7 -0
  265. package/dist/types/contracts/psm/previewProportionalSplit.d.ts +9 -0
  266. package/dist/types/contracts/psm/previewRedeem.d.ts +7 -0
  267. package/dist/types/contracts/psm/previewSwap.d.ts +7 -0
  268. package/dist/types/contracts/psm/redeem.d.ts +9 -0
  269. package/dist/types/contracts/psm/requestExit.d.ts +4 -0
  270. package/dist/types/contracts/psm/swap.d.ts +8 -0
  271. package/dist/types/contracts/rentStreamer/_helpers.d.ts +4 -0
  272. package/dist/types/contracts/rentStreamer/getScheduled.d.ts +12 -0
  273. package/dist/types/contracts/rentStreamer/getState.d.ts +33 -0
  274. package/dist/types/contracts/rentStreamer/previewRelease.d.ts +20 -0
  275. package/dist/types/contracts/rentStreamer/release.d.ts +12 -0
  276. package/dist/types/contracts/rentStreamer/sync.d.ts +11 -0
  277. package/dist/types/contracts/tokens/veRAAC/getRewardTokens.d.ts +10 -0
  278. package/dist/types/contracts/zeno/_helpers.d.ts +17 -0
  279. package/dist/types/contracts/zeno/buy.d.ts +15 -0
  280. package/dist/types/contracts/zeno/createAuction.d.ts +15 -5
  281. package/dist/types/contracts/zeno/createZeno.d.ts +10 -1
  282. package/dist/types/contracts/zeno/getAuctionState.d.ts +45 -0
  283. package/dist/types/contracts/zeno/getAuctions.d.ts +12 -12
  284. package/dist/types/contracts/zeno/getBondState.d.ts +42 -0
  285. package/dist/types/contracts/zeno/getPrice.d.ts +12 -0
  286. package/dist/types/contracts/zeno/getZenos.d.ts +25 -2
  287. package/dist/types/contracts/zeno/grantRole.d.ts +22 -0
  288. package/dist/types/contracts/zeno/pause.d.ts +18 -0
  289. package/dist/types/contracts/zeno/priceAt.d.ts +20 -0
  290. package/dist/types/contracts/zeno/quoteBuy.d.ts +34 -0
  291. package/dist/types/contracts/zeno/redeem.d.ts +20 -0
  292. package/dist/types/contracts/zeno/setAuction.d.ts +13 -0
  293. package/dist/types/contracts/zeno/sweepSurplus.d.ts +14 -0
  294. package/dist/types/index.d.ts +1 -0
  295. package/dist/types/nfts/getNFTBalance.d.ts +13 -0
  296. package/dist/types/nfts/transferNFT.d.ts +15 -0
  297. package/dist/types/pools/lendingPool/adapters/erc20/getERC20AdapterBalance.d.ts +3 -3
  298. package/dist/types/pools/rwaVault/checkRedeemEligibility.d.ts +15 -0
  299. package/dist/types/pools/stabilityPool/getWithdrawTimelockConfig.d.ts +14 -0
  300. package/dist/types/prices/computeStakingAPY.d.ts +2 -0
  301. package/dist/types/prices/getCurveLPPriceUSD.d.ts +3 -0
  302. package/dist/types/prices/getPrices.d.ts +4 -8
  303. package/dist/types/prices/getStakingTokenPriceUSD.d.ts +16 -0
  304. package/dist/types/prices/getWrapperPriceUSD.d.ts +7 -0
  305. package/dist/types/prices/tokenPricesUSD.d.ts +7 -0
  306. package/dist/types/scripts/generateErrorCatalogue.d.ts +45 -0
  307. package/dist/types/typechain-types/@openzeppelin/contracts/index.d.ts +2 -0
  308. package/dist/types/typechain-types/@openzeppelin/contracts/interfaces/IERC1967.d.ts +65 -0
  309. package/dist/types/typechain-types/@openzeppelin/contracts/interfaces/index.d.ts +1 -0
  310. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.d.ts +36 -0
  311. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.d.ts +20 -0
  312. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/ERC1967/index.d.ts +2 -0
  313. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/Proxy.d.ts +20 -0
  314. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/beacon/IBeacon.d.ts +25 -0
  315. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/beacon/index.d.ts +1 -0
  316. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/index.d.ts +7 -0
  317. package/dist/types/typechain-types/{contracts/core/governance/gauges/VeBoostProxy.d.ts → @openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts} +24 -47
  318. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.d.ts +80 -0
  319. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.d.ts +51 -0
  320. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +2 -0
  321. package/dist/types/typechain-types/@openzeppelin/contracts/proxy/transparent/index.d.ts +3 -0
  322. package/dist/types/typechain-types/contracts/core/collectors/fee-streamer/RentStreamer.d.ts +422 -0
  323. package/dist/types/typechain-types/contracts/core/collectors/fee-streamer/index.d.ts +1 -0
  324. package/dist/types/typechain-types/contracts/core/collectors/index.d.ts +2 -0
  325. package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeController.d.ts +29 -2
  326. package/dist/types/typechain-types/contracts/core/governance/gauges/index.d.ts +0 -2
  327. package/dist/types/typechain-types/contracts/core/lockers/RAACBotLocker.d.ts +1 -9
  328. package/dist/types/typechain-types/contracts/core/lockers/RAACLiquidLocker.d.ts +47 -2
  329. package/dist/types/typechain-types/contracts/core/lockers/RAACMaturityVault.d.ts +24 -10
  330. package/dist/types/typechain-types/contracts/core/pools/LendingPool/LendingPool.d.ts +42 -43
  331. package/dist/types/typechain-types/contracts/core/pools/LendingPool/LendingPoolStorage.d.ts +7 -3
  332. package/dist/types/typechain-types/contracts/core/pools/LendingPool/LiquidationProxy.d.ts +7 -3
  333. package/dist/types/typechain-types/contracts/core/pools/LendingPool/VaultProxy.d.ts +7 -3
  334. package/dist/types/typechain-types/contracts/core/tokens/VeRAACToken.d.ts +59 -12
  335. package/dist/types/typechain-types/contracts/core/tokens/VeRAACTokenStorage.d.ts +47 -12
  336. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeController.d.ts +29 -2
  337. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/index.d.ts +0 -2
  338. package/dist/types/typechain-types/contracts/interfaces/core/lockers/IRAACBotLocker.d.ts +1 -9
  339. package/dist/types/typechain-types/contracts/interfaces/core/lockers/IRaacLiquidLocker.d.ts +82 -15
  340. package/dist/types/typechain-types/contracts/interfaces/core/pools/LendingPool/ILendingPool.d.ts +32 -6
  341. package/dist/types/typechain-types/contracts/interfaces/core/tokens/IDebtToken.d.ts +5 -1
  342. package/dist/types/typechain-types/contracts/interfaces/core/tokens/IveRAACToken.d.ts +47 -12
  343. package/dist/types/typechain-types/contracts/interfaces/zeno/IAuction.d.ts +43 -39
  344. package/dist/types/typechain-types/contracts/interfaces/zeno/IZENO.d.ts +28 -22
  345. package/dist/types/typechain-types/contracts/libraries/math/TimeWeightedAverage.d.ts +2 -36
  346. package/dist/types/typechain-types/contracts/mocks/core/governance/gauges/MockGaugeStub.d.ts +33 -0
  347. package/dist/types/typechain-types/contracts/mocks/core/governance/gauges/index.d.ts +1 -0
  348. package/dist/types/typechain-types/contracts/mocks/core/lockers/LockerSimMocks.sol/SimToken.d.ts +173 -0
  349. package/dist/types/typechain-types/contracts/mocks/core/lockers/LockerSimMocks.sol/SimVault.d.ts +53 -0
  350. package/dist/types/typechain-types/contracts/mocks/core/lockers/LockerSimMocks.sol/SimVe.d.ts +91 -0
  351. package/dist/types/typechain-types/contracts/mocks/core/lockers/LockerSimMocks.sol/index.d.ts +3 -0
  352. package/dist/types/typechain-types/contracts/mocks/core/lockers/index.d.ts +2 -0
  353. package/dist/types/typechain-types/contracts/mocks/core/pools/MockLendingPoolDebtToken.d.ts +32 -6
  354. package/dist/types/typechain-types/contracts/mocks/core/tokens/USDCTokenLimited.d.ts +238 -0
  355. package/dist/types/typechain-types/contracts/mocks/core/tokens/index.d.ts +1 -0
  356. package/dist/types/typechain-types/contracts/mocks/libraries/governance/PowerCheckpointMock.d.ts +6 -2
  357. package/dist/types/typechain-types/contracts/zeno/Auction.d.ts +200 -108
  358. package/dist/types/typechain-types/contracts/zeno/AuctionFactory.d.ts +21 -105
  359. package/dist/types/typechain-types/contracts/zeno/ZENO.d.ts +46 -40
  360. package/dist/types/typechain-types/contracts/zeno/ZENOFactory.d.ts +10 -57
  361. package/dist/types/typechain-types/factories/@openzeppelin/contracts/index.d.ts +1 -0
  362. package/dist/types/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC1967__factory.d.ts +42 -0
  363. package/dist/types/typechain-types/factories/@openzeppelin/contracts/interfaces/index.d.ts +1 -0
  364. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.d.ts +71 -0
  365. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils__factory.d.ts +50 -0
  366. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/ERC1967/index.d.ts +2 -0
  367. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/Proxy__factory.d.ts +10 -0
  368. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.d.ts +17 -0
  369. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/beacon/index.d.ts +1 -0
  370. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/index.d.ts +4 -0
  371. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts +115 -0
  372. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.d.ts +56 -0
  373. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts +102 -0
  374. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +2 -0
  375. package/dist/types/typechain-types/factories/@openzeppelin/contracts/proxy/transparent/index.d.ts +2 -0
  376. package/dist/types/typechain-types/factories/contracts/core/collectors/FeeCollector__factory.d.ts +1 -1
  377. package/dist/types/typechain-types/factories/contracts/core/collectors/fee-streamer/RentStreamer__factory.d.ts +665 -0
  378. package/dist/types/typechain-types/factories/contracts/core/collectors/fee-streamer/index.d.ts +1 -0
  379. package/dist/types/typechain-types/factories/contracts/core/collectors/index.d.ts +1 -0
  380. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeController__factory.d.ts +26 -1
  381. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeRewardsDistributor__factory.d.ts +1 -1
  382. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RAACGauge__factory.d.ts +1 -1
  383. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RWAGauge__factory.d.ts +1 -1
  384. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/index.d.ts +0 -2
  385. package/dist/types/typechain-types/factories/contracts/core/lockers/RAACBotLocker__factory.d.ts +1 -11
  386. package/dist/types/typechain-types/factories/contracts/core/lockers/RAACLiquidLocker__factory.d.ts +66 -1
  387. package/dist/types/typechain-types/factories/contracts/core/lockers/RAACMaturityVault__factory.d.ts +25 -9
  388. package/dist/types/typechain-types/factories/contracts/core/oracles/RAACPrimeRateOracle__factory.d.ts +1 -1
  389. package/dist/types/typechain-types/factories/contracts/core/pools/LendingPool/LendingPoolStorage__factory.d.ts +12 -2
  390. package/dist/types/typechain-types/factories/contracts/core/pools/LendingPool/LendingPool__factory.d.ts +43 -60
  391. package/dist/types/typechain-types/factories/contracts/core/pools/LendingPool/LiquidationProxy__factory.d.ts +12 -2
  392. package/dist/types/typechain-types/factories/contracts/core/pools/LendingPool/VaultProxy__factory.d.ts +12 -2
  393. package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/LiquidationStrategyProxy__factory.d.ts +1 -1
  394. package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/StabilityPoolStorage__factory.d.ts +1 -1
  395. package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/StabilityPool__factory.d.ts +1 -1
  396. package/dist/types/typechain-types/factories/contracts/core/tokens/DebtToken__factory.d.ts +1 -1
  397. package/dist/types/typechain-types/factories/contracts/core/tokens/RToken__factory.d.ts +1 -1
  398. package/dist/types/typechain-types/factories/contracts/core/tokens/VeRAACTokenStorage__factory.d.ts +47 -18
  399. package/dist/types/typechain-types/factories/contracts/core/tokens/VeRAACToken__factory.d.ts +58 -19
  400. package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeController__factory.d.ts +25 -0
  401. package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/index.d.ts +0 -2
  402. package/dist/types/typechain-types/factories/contracts/interfaces/core/lockers/IRAACBotLocker__factory.d.ts +0 -10
  403. package/dist/types/typechain-types/factories/contracts/interfaces/core/lockers/IRaacLiquidLocker__factory.d.ts +91 -6
  404. package/dist/types/typechain-types/factories/contracts/interfaces/core/pools/LendingPool/ILendingPool__factory.d.ts +30 -0
  405. package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/IDebtToken__factory.d.ts +10 -0
  406. package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/IveRAACToken__factory.d.ts +47 -18
  407. package/dist/types/typechain-types/factories/contracts/interfaces/zeno/IAuction__factory.d.ts +52 -30
  408. package/dist/types/typechain-types/factories/contracts/interfaces/zeno/IZENO__factory.d.ts +36 -8
  409. package/dist/types/typechain-types/factories/contracts/libraries/governance/BoostCalculator__factory.d.ts +1 -1
  410. package/dist/types/typechain-types/factories/contracts/libraries/governance/LockManager__factory.d.ts +1 -1
  411. package/dist/types/typechain-types/factories/contracts/libraries/governance/PowerCheckpoint__factory.d.ts +1 -1
  412. package/dist/types/typechain-types/factories/contracts/libraries/governance/RagequitLib__factory.d.ts +1 -1
  413. package/dist/types/typechain-types/factories/contracts/libraries/governance/RewardLib__factory.d.ts +1 -1
  414. package/dist/types/typechain-types/factories/contracts/libraries/math/TimeWeightedAverage__factory.d.ts +1 -36
  415. package/dist/types/typechain-types/factories/contracts/libraries/pools/LendingPoolFeeLibrary__factory.d.ts +1 -1
  416. package/dist/types/typechain-types/factories/contracts/libraries/pools/ReserveLibrary__factory.d.ts +1 -1
  417. package/dist/types/typechain-types/factories/contracts/mocks/core/governance/gauges/MockGaugeStub__factory.d.ts +42 -0
  418. package/dist/types/typechain-types/factories/contracts/mocks/core/governance/gauges/index.d.ts +1 -0
  419. package/dist/types/typechain-types/factories/contracts/mocks/core/governance/libraries/LockManagerMock__factory.d.ts +1 -1
  420. package/dist/types/typechain-types/factories/contracts/mocks/core/lockers/LockerSimMocks.sol/SimToken__factory.d.ts +306 -0
  421. package/dist/types/typechain-types/factories/contracts/mocks/core/lockers/LockerSimMocks.sol/SimVault__factory.d.ts +68 -0
  422. package/dist/types/typechain-types/factories/contracts/mocks/core/lockers/LockerSimMocks.sol/SimVe__factory.d.ts +149 -0
  423. package/dist/types/typechain-types/factories/contracts/mocks/core/lockers/LockerSimMocks.sol/index.d.ts +3 -0
  424. package/dist/types/typechain-types/factories/contracts/mocks/core/lockers/index.d.ts +1 -0
  425. package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/MockOracle__factory.d.ts +1 -1
  426. package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/TestRAACPrimeRateOracle__factory.d.ts +1 -1
  427. package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockLendingPoolDebtToken__factory.d.ts +31 -1
  428. package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/USDCTokenLimited__factory.d.ts +439 -0
  429. package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/index.d.ts +1 -0
  430. package/dist/types/typechain-types/factories/contracts/mocks/libraries/MockTimeUtils__factory.d.ts +1 -1
  431. package/dist/types/typechain-types/factories/contracts/mocks/libraries/governance/BoostCalculatorMock__factory.d.ts +1 -1
  432. package/dist/types/typechain-types/factories/contracts/mocks/libraries/governance/PowerCheckpointMock__factory.d.ts +5 -1
  433. package/dist/types/typechain-types/factories/contracts/mocks/libraries/governance/RagequitHarness__factory.d.ts +1 -1
  434. package/dist/types/typechain-types/factories/contracts/mocks/libraries/governance/RewardIntegralCalculatorMock.sol/MockRewardIntegralCalculator__factory.d.ts +1 -1
  435. package/dist/types/typechain-types/factories/contracts/mocks/libraries/math/TimeWeightedAverageMock__factory.d.ts +2 -9
  436. package/dist/types/typechain-types/factories/contracts/mocks/libraries/pools/ReserveLibraryMockCalculation__factory.d.ts +1 -1
  437. package/dist/types/typechain-types/factories/contracts/mocks/libraries/pools/ReserveLibraryMock__factory.d.ts +1 -1
  438. package/dist/types/typechain-types/factories/contracts/mocks/tests/VeRAACFuzzHelper__factory.d.ts +1 -1
  439. package/dist/types/typechain-types/factories/contracts/zeno/AuctionFactory__factory.d.ts +26 -118
  440. package/dist/types/typechain-types/factories/contracts/zeno/Auction__factory.d.ts +230 -106
  441. package/dist/types/typechain-types/factories/contracts/zeno/ZENOFactory__factory.d.ts +9 -68
  442. package/dist/types/typechain-types/factories/contracts/zeno/ZENO__factory.d.ts +66 -38
  443. package/dist/types/typechain-types/index.d.ts +28 -8
  444. package/dist/types/typechain-types/psm/PSMVault.d.ts +1503 -0
  445. package/dist/types/typechain-types/psm/RateProvider.d.ts +228 -0
  446. package/dist/types/typechain-types/psm/common.d.ts +46 -0
  447. package/dist/types/typechain-types/psm/factories/PSMVault__factory.d.ts +1795 -0
  448. package/dist/types/typechain-types/psm/factories/RateProvider__factory.d.ts +299 -0
  449. package/dist/types/typechain-types/psm/factories/imports.sol/PSMProxyAdmin__factory.d.ts +117 -0
  450. package/dist/types/typechain-types/psm/factories/imports.sol/PSMTransparentProxy__factory.d.ts +108 -0
  451. package/dist/types/typechain-types/psm/factories/imports.sol/index.d.ts +2 -0
  452. package/dist/types/typechain-types/psm/factories/index.d.ts +8 -0
  453. package/dist/types/typechain-types/psm/factories/interfaces/IBaseAssetNav__factory.d.ts +21 -0
  454. package/dist/types/typechain-types/psm/factories/interfaces/IRateProvider__factory.d.ts +65 -0
  455. package/dist/types/typechain-types/psm/factories/interfaces/IRebalancer__factory.d.ts +25 -0
  456. package/dist/types/typechain-types/{factories/contracts/interfaces/core/governance/gauges/IVeBoost__factory.d.ts → psm/factories/interfaces/ISavingsToken__factory.d.ts} +215 -192
  457. package/dist/types/typechain-types/psm/factories/interfaces/index.d.ts +6 -0
  458. package/dist/types/typechain-types/psm/factories/interfaces/v2/IRebalancerV2__factory.d.ts +21 -0
  459. package/dist/types/typechain-types/psm/factories/interfaces/v2/index.d.ts +1 -0
  460. package/dist/types/typechain-types/psm/factories/interfaces/v3/IRateProviderV3__factory.d.ts +65 -0
  461. package/dist/types/typechain-types/psm/factories/interfaces/v3/index.d.ts +1 -0
  462. package/dist/types/typechain-types/psm/factories/mocks/MockBaseAssetModule__factory.d.ts +450 -0
  463. package/dist/types/typechain-types/psm/factories/mocks/MockChainlinkFeed__factory.d.ts +106 -0
  464. package/dist/types/typechain-types/psm/factories/mocks/MockERC20__factory.d.ts +288 -0
  465. package/dist/types/typechain-types/psm/factories/mocks/MockFeeOnTransferERC20__factory.d.ts +356 -0
  466. package/dist/types/typechain-types/psm/factories/mocks/MockPmUSD__factory.d.ts +326 -0
  467. package/dist/types/typechain-types/psm/factories/mocks/MockProxy__factory.d.ts +108 -0
  468. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancer.sol/IMockMintable__factory.d.ts +21 -0
  469. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancer.sol/MockRebalancer__factory.d.ts +138 -0
  470. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancer.sol/index.d.ts +2 -0
  471. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancerV2.sol/IMockMintable__factory.d.ts +21 -0
  472. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancerV2.sol/MockRebalancerV2__factory.d.ts +134 -0
  473. package/dist/types/typechain-types/psm/factories/mocks/MockRebalancerV2.sol/index.d.ts +2 -0
  474. package/dist/types/typechain-types/psm/factories/mocks/MockSavingsToken__factory.d.ts +330 -0
  475. package/dist/types/typechain-types/psm/factories/mocks/index.d.ts +9 -0
  476. package/dist/types/typechain-types/psm/factories/utils/index.d.ts +1 -0
  477. package/dist/types/typechain-types/psm/factories/utils/zap/AladdinZap__factory.d.ts +322 -0
  478. package/dist/types/typechain-types/psm/factories/utils/zap/TokenZapLogic__factory.d.ts +73 -0
  479. package/dist/types/typechain-types/psm/factories/utils/zap/index.d.ts +3 -0
  480. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IBalancerPool__factory.d.ts +91 -0
  481. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IBalancerVault__factory.d.ts +261 -0
  482. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IConvexCRVDepositor__factory.d.ts +49 -0
  483. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveAPool.sol/ICurveA2Pool__factory.d.ts +305 -0
  484. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveAPool.sol/ICurveA3Pool__factory.d.ts +305 -0
  485. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveAPool.sol/ICurveA4Pool__factory.d.ts +305 -0
  486. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveAPool.sol/ICurveAPool__factory.d.ts +305 -0
  487. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveAPool.sol/index.d.ts +4 -0
  488. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase2Pool__factory.d.ts +39 -0
  489. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase3Pool__factory.d.ts +39 -0
  490. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase4Pool__factory.d.ts +39 -0
  491. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveBasePool.sol/ICurveBasePool__factory.d.ts +175 -0
  492. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveBasePool.sol/index.d.ts +4 -0
  493. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveCryptoPool.sol/ICurveCryptoPool__factory.d.ts +301 -0
  494. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveCryptoPool.sol/ICurveTriCryptoPool__factory.d.ts +165 -0
  495. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveCryptoPool.sol/IZapCurveMetaCryptoPool__factory.d.ts +181 -0
  496. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveCryptoPool.sol/index.d.ts +3 -0
  497. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveETHPool__factory.d.ts +155 -0
  498. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap3Pool__factory.d.ts +99 -0
  499. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap4Pool__factory.d.ts +99 -0
  500. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap__factory.d.ts +55 -0
  501. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveFactoryMetaPool__factory.d.ts +193 -0
  502. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryMetaPool.sol/index.d.ts +4 -0
  503. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain2Pool__factory.d.ts +183 -0
  504. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain3Pool__factory.d.ts +183 -0
  505. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain4Pool__factory.d.ts +183 -0
  506. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlainPool__factory.d.ts +147 -0
  507. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveFactoryPlainPool.sol/index.d.ts +4 -0
  508. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveMetaPool.sol/ICurveMetaPoolDeposit__factory.d.ts +141 -0
  509. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveMetaPool.sol/ICurveMetaPoolSwap__factory.d.ts +227 -0
  510. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveMetaPool.sol/index.d.ts +2 -0
  511. package/dist/types/typechain-types/{factories/contracts/interfaces/core/governance/gauges/IVeBoostProxy__factory.d.ts → psm/factories/utils/zap/interfaces/ICurvePoolRegistry__factory.d.ts} +13 -24
  512. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY2PoolDeposit__factory.d.ts +165 -0
  513. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY2PoolSwap__factory.d.ts +193 -0
  514. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY3PoolDeposit__factory.d.ts +165 -0
  515. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY3PoolSwap__factory.d.ts +193 -0
  516. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY4PoolDeposit__factory.d.ts +165 -0
  517. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveY4PoolSwap__factory.d.ts +193 -0
  518. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveYPoolDeposit__factory.d.ts +165 -0
  519. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/ICurveYPoolSwap__factory.d.ts +193 -0
  520. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ICurveYPool.sol/index.d.ts +8 -0
  521. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ILidoStETH__factory.d.ts +35 -0
  522. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/ILidoWstETH__factory.d.ts +83 -0
  523. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IUniswapV2Pair__factory.d.ts +95 -0
  524. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IUniswapV3Pool__factory.d.ts +115 -0
  525. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IUniswapV3Router__factory.d.ts +54 -0
  526. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IWETH__factory.d.ts +23 -0
  527. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/IZap__factory.d.ts +107 -0
  528. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/concentrator/IAladdinCRV__factory.d.ts +401 -0
  529. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/concentrator/IAladdinCompounder__factory.d.ts +350 -0
  530. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/concentrator/index.d.ts +2 -0
  531. package/dist/types/typechain-types/psm/factories/utils/zap/interfaces/index.d.ts +20 -0
  532. package/dist/types/typechain-types/psm/factories/v2/PSMVaultV2__factory.d.ts +1846 -0
  533. package/dist/types/typechain-types/psm/factories/v2/RebalancerV2.sol/IPSMVaultView__factory.d.ts +17 -0
  534. package/dist/types/typechain-types/psm/factories/v2/RebalancerV2.sol/IRateOracle__factory.d.ts +31 -0
  535. package/dist/types/typechain-types/psm/factories/v2/RebalancerV2.sol/IZap__factory.d.ts +33 -0
  536. package/dist/types/typechain-types/psm/factories/v2/RebalancerV2.sol/RebalancerV2__factory.d.ts +506 -0
  537. package/dist/types/typechain-types/psm/factories/v2/RebalancerV2.sol/index.d.ts +4 -0
  538. package/dist/types/typechain-types/psm/factories/v2/index.d.ts +2 -0
  539. package/dist/types/typechain-types/psm/factories/v3/PSMVaultV3__factory.d.ts +1955 -0
  540. package/dist/types/typechain-types/psm/factories/v3/RateProviderComposed__factory.d.ts +303 -0
  541. package/dist/types/typechain-types/psm/factories/v3/RateProviderDirect__factory.d.ts +293 -0
  542. package/dist/types/typechain-types/psm/factories/v3/index.d.ts +3 -0
  543. package/dist/types/typechain-types/psm/imports.sol/PSMProxyAdmin.d.ts +96 -0
  544. package/dist/types/typechain-types/psm/imports.sol/PSMTransparentProxy.d.ts +51 -0
  545. package/dist/types/typechain-types/psm/imports.sol/index.d.ts +2 -0
  546. package/dist/types/typechain-types/psm/index.d.ts +157 -0
  547. package/dist/types/typechain-types/psm/interfaces/IBaseAssetNav.d.ts +33 -0
  548. package/dist/types/typechain-types/psm/interfaces/IRateProvider.d.ts +75 -0
  549. package/dist/types/typechain-types/psm/interfaces/IRebalancer.d.ts +39 -0
  550. package/dist/types/typechain-types/psm/interfaces/ISavingsToken.d.ts +400 -0
  551. package/dist/types/typechain-types/psm/interfaces/index.d.ts +8 -0
  552. package/dist/types/typechain-types/psm/interfaces/v2/IRebalancerV2.d.ts +35 -0
  553. package/dist/types/typechain-types/psm/interfaces/v2/index.d.ts +1 -0
  554. package/dist/types/typechain-types/psm/interfaces/v3/IRateProviderV3.d.ts +75 -0
  555. package/dist/types/typechain-types/psm/interfaces/v3/index.d.ts +1 -0
  556. package/dist/types/typechain-types/psm/mocks/MockBaseAssetModule.d.ts +311 -0
  557. package/dist/types/typechain-types/psm/mocks/MockChainlinkFeed.d.ts +91 -0
  558. package/dist/types/typechain-types/psm/mocks/MockERC20.d.ts +179 -0
  559. package/dist/types/typechain-types/psm/mocks/MockFeeOnTransferERC20.d.ts +247 -0
  560. package/dist/types/typechain-types/psm/mocks/MockPmUSD.d.ts +213 -0
  561. package/dist/types/typechain-types/psm/mocks/MockProxy.d.ts +51 -0
  562. package/dist/types/typechain-types/psm/mocks/MockRebalancer.sol/IMockMintable.d.ts +35 -0
  563. package/dist/types/typechain-types/psm/mocks/MockRebalancer.sol/MockRebalancer.d.ts +125 -0
  564. package/dist/types/typechain-types/psm/mocks/MockRebalancer.sol/index.d.ts +2 -0
  565. package/dist/types/typechain-types/psm/mocks/MockRebalancerV2.sol/IMockMintable.d.ts +35 -0
  566. package/dist/types/typechain-types/psm/mocks/MockRebalancerV2.sol/MockRebalancerV2.d.ts +121 -0
  567. package/dist/types/typechain-types/psm/mocks/MockRebalancerV2.sol/index.d.ts +2 -0
  568. package/dist/types/typechain-types/psm/mocks/MockSavingsToken.d.ts +213 -0
  569. package/dist/types/typechain-types/psm/mocks/index.d.ts +11 -0
  570. package/dist/types/typechain-types/psm/utils/index.d.ts +2 -0
  571. package/dist/types/typechain-types/psm/utils/zap/AladdinZap.d.ts +276 -0
  572. package/dist/types/typechain-types/psm/utils/zap/TokenZapLogic.d.ts +59 -0
  573. package/dist/types/typechain-types/psm/utils/zap/index.d.ts +4 -0
  574. package/dist/types/typechain-types/psm/utils/zap/interfaces/IBalancerPool.d.ts +101 -0
  575. package/dist/types/typechain-types/psm/utils/zap/interfaces/IBalancerVault.d.ts +199 -0
  576. package/dist/types/typechain-types/psm/utils/zap/interfaces/IConvexCRVDepositor.d.ts +61 -0
  577. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveAPool.sol/ICurveA2Pool.d.ts +245 -0
  578. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveAPool.sol/ICurveA3Pool.d.ts +245 -0
  579. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveAPool.sol/ICurveA4Pool.d.ts +245 -0
  580. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveAPool.sol/ICurveAPool.d.ts +245 -0
  581. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveAPool.sol/index.d.ts +4 -0
  582. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase2Pool.d.ts +49 -0
  583. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase3Pool.d.ts +49 -0
  584. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveBasePool.sol/ICurveBase4Pool.d.ts +49 -0
  585. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveBasePool.sol/ICurveBasePool.d.ts +159 -0
  586. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveBasePool.sol/index.d.ts +4 -0
  587. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveCryptoPool.sol/ICurveCryptoPool.d.ts +249 -0
  588. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveCryptoPool.sol/ICurveTriCryptoPool.d.ts +153 -0
  589. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveCryptoPool.sol/IZapCurveMetaCryptoPool.d.ts +165 -0
  590. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveCryptoPool.sol/index.d.ts +3 -0
  591. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveETHPool.d.ts +135 -0
  592. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap.d.ts +55 -0
  593. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap3Pool.d.ts +87 -0
  594. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveDepositZap4Pool.d.ts +87 -0
  595. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryMetaPool.sol/ICurveFactoryMetaPool.d.ts +159 -0
  596. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryMetaPool.sol/index.d.ts +4 -0
  597. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain2Pool.d.ts +159 -0
  598. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain3Pool.d.ts +159 -0
  599. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlain4Pool.d.ts +159 -0
  600. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryPlainPool.sol/ICurveFactoryPlainPool.d.ts +131 -0
  601. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveFactoryPlainPool.sol/index.d.ts +4 -0
  602. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveMetaPool.sol/ICurveMetaPoolDeposit.d.ts +133 -0
  603. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveMetaPool.sol/ICurveMetaPoolSwap.d.ts +191 -0
  604. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveMetaPool.sol/index.d.ts +2 -0
  605. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurvePoolRegistry.d.ts +45 -0
  606. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY2PoolDeposit.d.ts +163 -0
  607. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY2PoolSwap.d.ts +179 -0
  608. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY3PoolDeposit.d.ts +163 -0
  609. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY3PoolSwap.d.ts +179 -0
  610. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY4PoolDeposit.d.ts +163 -0
  611. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveY4PoolSwap.d.ts +179 -0
  612. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveYPoolDeposit.d.ts +163 -0
  613. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/ICurveYPoolSwap.d.ts +179 -0
  614. package/dist/types/typechain-types/psm/utils/zap/interfaces/ICurveYPool.sol/index.d.ts +8 -0
  615. package/dist/types/typechain-types/psm/utils/zap/interfaces/ILidoStETH.d.ts +45 -0
  616. package/dist/types/typechain-types/psm/utils/zap/interfaces/ILidoWstETH.d.ts +89 -0
  617. package/dist/types/typechain-types/psm/utils/zap/interfaces/IUniswapV2Pair.d.ts +103 -0
  618. package/dist/types/typechain-types/psm/utils/zap/interfaces/IUniswapV3Pool.d.ts +113 -0
  619. package/dist/types/typechain-types/psm/utils/zap/interfaces/IUniswapV3Router.d.ts +55 -0
  620. package/dist/types/typechain-types/psm/utils/zap/interfaces/IWETH.d.ts +43 -0
  621. package/dist/types/typechain-types/psm/utils/zap/interfaces/IZap.d.ts +91 -0
  622. package/dist/types/typechain-types/psm/utils/zap/interfaces/concentrator/IAladdinCRV.d.ts +361 -0
  623. package/dist/types/typechain-types/psm/utils/zap/interfaces/concentrator/IAladdinCompounder.d.ts +290 -0
  624. package/dist/types/typechain-types/psm/utils/zap/interfaces/concentrator/index.d.ts +2 -0
  625. package/dist/types/typechain-types/psm/utils/zap/interfaces/index.d.ts +28 -0
  626. package/dist/types/typechain-types/psm/v2/PSMVaultV2.d.ts +1528 -0
  627. package/dist/types/typechain-types/psm/v2/RebalancerV2.sol/IPSMVaultView.d.ts +31 -0
  628. package/dist/types/typechain-types/psm/v2/RebalancerV2.sol/IRateOracle.d.ts +43 -0
  629. package/dist/types/typechain-types/psm/v2/RebalancerV2.sol/IZap.d.ts +39 -0
  630. package/dist/types/typechain-types/psm/v2/RebalancerV2.sol/RebalancerV2.d.ts +387 -0
  631. package/dist/types/typechain-types/psm/v2/RebalancerV2.sol/index.d.ts +4 -0
  632. package/dist/types/typechain-types/psm/v2/index.d.ts +3 -0
  633. package/dist/types/typechain-types/psm/v3/PSMVaultV3.d.ts +1631 -0
  634. package/dist/types/typechain-types/psm/v3/RateProviderComposed.d.ts +228 -0
  635. package/dist/types/typechain-types/psm/v3/RateProviderDirect.d.ts +218 -0
  636. package/dist/types/typechain-types/psm/v3/index.d.ts +3 -0
  637. package/dist/types/user/_helpers.d.ts +23 -0
  638. package/dist/types/user/computeEffectiveReturn.d.ts +67 -0
  639. package/dist/types/user/getUserClaimables.d.ts +55 -0
  640. package/dist/types/user/getUserCollateral.d.ts +12 -0
  641. package/dist/types/user/getUserDebt.d.ts +18 -0
  642. package/dist/types/user/getUserFarming.d.ts +64 -0
  643. package/dist/types/user/getUserGovernance.d.ts +20 -0
  644. package/dist/types/user/getUserPortfolio.d.ts +61 -0
  645. package/dist/types/user/getUserWalletBalances.d.ts +20 -0
  646. package/dist/types/user/index.d.ts +9 -0
  647. package/dist/types/utils/amount.d.ts +7 -0
  648. package/dist/types/utils/artifacts.d.ts +565 -126
  649. package/dist/types/utils/contracts.d.ts +38 -0
  650. package/dist/types/utils/errorDecoder.d.ts +29 -28
  651. package/dist/types/utils/rpcError.d.ts +52 -0
  652. package/dist/user/_helpers.js +22 -0
  653. package/dist/user/computeEffectiveReturn.js +33 -0
  654. package/dist/user/getUserClaimables.js +97 -0
  655. package/dist/user/getUserCollateral.js +29 -0
  656. package/dist/user/getUserDebt.js +32 -0
  657. package/dist/user/getUserFarming.js +100 -0
  658. package/dist/user/getUserGovernance.js +35 -0
  659. package/dist/user/getUserPortfolio.js +109 -0
  660. package/dist/user/getUserWalletBalances.js +30 -0
  661. package/dist/user/index.js +24 -0
  662. package/dist/utils/amount.js +10 -0
  663. package/dist/utils/artifacts.js +13 -0
  664. package/dist/utils/chain.js +2 -1
  665. package/dist/utils/config.js +0 -1
  666. package/dist/utils/contracts.js +5 -2
  667. package/dist/utils/errorDecoder.js +69 -117
  668. package/dist/utils/rpcError.js +159 -0
  669. package/dist/wallet/assets/approveAsset.js +10 -12
  670. package/dist/wallet/assets/burnAsset.js +14 -16
  671. package/dist/wallet/assets/getAllowance.js +4 -4
  672. package/dist/wallet/assets/getAsset.js +2 -2
  673. package/dist/wallet/assets/getBalance.js +4 -3
  674. package/dist/wallet/assets/mintAsset.js +14 -17
  675. package/dist/wallet/assets/transferAsset.js +7 -10
  676. package/package.json +4 -3
  677. package/dist/generated/errorMap.json +0 -3945
  678. package/dist/scripts/generateErrorMap.js +0 -180
  679. package/dist/types/scripts/generateErrorMap.d.ts +0 -1
  680. package/dist/types/typechain-types/contracts/core/governance/gauges/VeBoost.d.ts +0 -518
  681. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IVeBoost.d.ts +0 -311
  682. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IVeBoostProxy.d.ts +0 -50
  683. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/VeBoostProxy__factory.d.ts +0 -152
  684. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/VeBoost__factory.d.ts +0 -716
@@ -1,38 +1,53 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FundingMode = void 0;
3
4
  const ethers_1 = require("ethers");
4
5
  const contracts_1 = require("../../utils/contracts");
5
6
  const artifacts_1 = require("../../utils/artifacts");
7
+ const rpcError_1 = require("../../utils/rpcError");
8
+ /** How an auction's ZENO is backed by the underlying asset. Mirrors `IAuction.FundingMode`. */
9
+ var FundingMode;
10
+ (function (FundingMode) {
11
+ /** The ZENO must already hold underlying for the full allocation. */
12
+ FundingMode[FundingMode["Prefilled"] = 0] = "Prefilled";
13
+ /** The issuer tops up the underlying before maturity. */
14
+ FundingMode[FundingMode["Float"] = 1] = "Float";
15
+ })(FundingMode || (exports.FundingMode = FundingMode = {}));
6
16
  /**
7
- * Creates a ZENO auction through the AuctionFactory.
17
+ * Creates a ZENO auction through the AuctionFactory. Only the factory owner can call this.
8
18
  * @param chainId The chain id.
9
19
  * @param zenoAddress The ZENO bond token sold.
10
- * @param usdcAddress The payment token bidders pay with.
11
- * @param businessAddress The issuer receiving the proceeds.
20
+ * @param tokenAddress The payment token bidders pay with.
21
+ * @param issuer The issuer receiving the proceeds.
12
22
  * @param auctionStartTime UNIX timestamp (seconds) the auction starts.
13
23
  * @param auctionEndTime UNIX timestamp (seconds) the auction ends.
14
24
  * @param startingPrice The Dutch auction starting price, in payment token base units per whole ZENO.
15
25
  * @param reservePrice The Dutch auction reserve price, in payment token base units per whole ZENO.
16
26
  * @param totalZenoAllocated The ZENO offered, in ZENO base units.
17
- * @param signer The signer sending the transaction.
27
+ * @param fundingMode How the ZENO is backed; `Prefilled` requires the ZENO to hold underlying for the full allocation.
28
+ * @param initialOwner The owner of the new auction.
29
+ * @param signer The factory owner.
30
+ * @returns The address of the new auction.
18
31
  */
19
- async function createAuction(chainId, zenoAddress, usdcAddress, businessAddress, auctionStartTime, auctionEndTime, startingPrice, reservePrice, totalZenoAllocated, signer) {
32
+ async function createAuction(chainId, zenoAddress, tokenAddress, issuer, auctionStartTime, auctionEndTime, startingPrice, reservePrice, totalZenoAllocated, fundingMode, initialOwner, signer) {
20
33
  if (!signer) {
21
34
  throw new Error("Wallet not connected");
22
35
  }
36
+ const auctionFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "auctionfactory");
23
37
  try {
24
- const auctionFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "auctionfactory");
25
- const auctionFactoryABI = (0, artifacts_1.getABI)("auctionfactory");
26
- const auctionFactoryContract = new ethers_1.ethers.Contract(auctionFactoryAddress, auctionFactoryABI, signer);
27
- const tx = await auctionFactoryContract.createAuction(zenoAddress, usdcAddress, businessAddress, auctionStartTime, auctionEndTime, startingPrice, reservePrice, totalZenoAllocated);
28
- await tx.wait();
29
- const auctionsCount = await auctionFactoryContract.getAuctionCount();
30
- const auctionAddress = await auctionFactoryContract.getAuction(auctionsCount - BigInt(1));
31
- console.log(`Zeno auction created at address: ${auctionAddress}`);
38
+ const auctionFactoryContract = new ethers_1.ethers.Contract(auctionFactoryAddress, (0, artifacts_1.getABI)("auctionfactory"), signer);
39
+ const tx = await auctionFactoryContract.createAuction(zenoAddress, tokenAddress, issuer, auctionStartTime, auctionEndTime, startingPrice, reservePrice, totalZenoAllocated, fundingMode, initialOwner);
40
+ const receipt = await tx.wait();
41
+ for (const log of receipt.logs) {
42
+ const parsed = auctionFactoryContract.interface.parseLog(log);
43
+ if (parsed?.name === "AuctionCreated") {
44
+ return parsed.args.auctionAddress;
45
+ }
46
+ }
47
+ throw new Error("AuctionCreated event not found in receipt");
32
48
  }
33
49
  catch (error) {
34
- console.error("Error creating zeno auction:", error);
35
- throw new Error(`Failed to create zeno auction: ${error.message}`);
50
+ throw (0, rpcError_1.toRpcError)("zeno.createAuction", error, { chainId, address: auctionFactoryAddress });
36
51
  }
37
52
  }
38
53
  exports.default = createAuction;
@@ -3,24 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ethers_1 = require("ethers");
4
4
  const contracts_1 = require("../../utils/contracts");
5
5
  const artifacts_1 = require("../../utils/artifacts");
6
- async function createZeno(chainId, usdcAddress, maturityDate, signer) {
6
+ const rpcError_1 = require("../../utils/rpcError");
7
+ /**
8
+ * Creates a ZENO bond through the ZENOFactory. Only the factory owner can call this.
9
+ * @param chainId The chain id.
10
+ * @param tokenAddress The underlying asset the bond redeems for.
11
+ * @param maturityDate UNIX timestamp (seconds) the bond matures. Must be in the future.
12
+ * @param initialOwner The owner of the new bond, typically the auction or a multisig.
13
+ * @param signer The factory owner.
14
+ * @returns The address of the new ZENO bond.
15
+ */
16
+ async function createZeno(chainId, tokenAddress, maturityDate, initialOwner, signer) {
7
17
  if (!signer) {
8
18
  throw new Error("Wallet not connected");
9
19
  }
20
+ const zenoFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "zenofactory");
10
21
  try {
11
- const zenoFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "zenofactory");
12
- const zenoFactoryABI = (0, artifacts_1.getABI)("zenofactory");
13
- const zenoFactoryContract = new ethers_1.ethers.Contract(zenoFactoryAddress, zenoFactoryABI, signer);
14
- const tx = await zenoFactoryContract.createZENOContract(usdcAddress, maturityDate);
15
- await tx.wait();
16
- const zenosCount = await zenoFactoryContract.getZENOCount();
17
- const zenoAddress = await zenoFactoryContract.getZENO(zenosCount - BigInt(1));
18
- console.log(`Zeno created at address: ${zenoAddress}`);
19
- return zenoAddress;
22
+ const zenoFactoryContract = new ethers_1.ethers.Contract(zenoFactoryAddress, (0, artifacts_1.getABI)("zenofactory"), signer);
23
+ const tx = await zenoFactoryContract.createZENOContract(tokenAddress, maturityDate, initialOwner);
24
+ const receipt = await tx.wait();
25
+ for (const log of receipt.logs) {
26
+ const parsed = zenoFactoryContract.interface.parseLog(log);
27
+ if (parsed?.name === "ZENOCreated") {
28
+ return parsed.args.zenoAddress;
29
+ }
30
+ }
31
+ throw new Error("ZENOCreated event not found in receipt");
20
32
  }
21
33
  catch (error) {
22
- console.error("Error creating zeno:", error);
23
- throw new Error(`Failed to create zeno: ${error.message}`);
34
+ throw (0, rpcError_1.toRpcError)("zeno.createZeno", error, { chainId, address: zenoFactoryAddress });
24
35
  }
25
36
  }
26
37
  exports.default = createZeno;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const amount_1 = require("../../utils/amount");
4
+ const rpcError_1 = require("../../utils/rpcError");
5
+ const _helpers_1 = require("./_helpers");
6
+ /**
7
+ * Reads one auction's terms and live state.
8
+ * @param chainId The chain id.
9
+ * @param auction The auction address.
10
+ * @param provider The provider to read with. Defaults to the chain's first configured RPC.
11
+ * @returns The auction's state.
12
+ */
13
+ async function getAuctionState(chainId, auction, provider) {
14
+ try {
15
+ const contract = (0, _helpers_1.getAuctionContract)(chainId, auction, provider);
16
+ const [details, paymentToken, paused, ended] = await Promise.all([
17
+ contract.getDetails(),
18
+ contract.token(),
19
+ contract.paused(),
20
+ contract.checkAuctionEnded(),
21
+ ]);
22
+ const underlying = await (0, _helpers_1.getZenoContract)(chainId, details.zenoAddress, contract.runner).underlyingAsset();
23
+ return {
24
+ auction: details.auctionAddress,
25
+ zeno: details.zenoAddress,
26
+ paymentToken,
27
+ issuer: details.issuer,
28
+ fundingMode: Number(details.fundingMode),
29
+ startTime: details.auctionStartTime,
30
+ endTime: details.auctionEndTime,
31
+ startingPrice: (0, amount_1.toTokenAmount)(chainId, paymentToken, details.startingPrice),
32
+ reservePrice: (0, amount_1.toTokenAmount)(chainId, paymentToken, details.reservePrice),
33
+ isFixedPrice: details.startingPrice === details.reservePrice,
34
+ price: (0, amount_1.toTokenAmount)(chainId, paymentToken, details.price),
35
+ totalAllocated: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalZENOAllocated),
36
+ totalRemaining: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalZENORemaining),
37
+ paused,
38
+ ended,
39
+ };
40
+ }
41
+ catch (error) {
42
+ throw (0, rpcError_1.toRpcError)("zeno.getAuctionState", error, { chainId, address: auction });
43
+ }
44
+ }
45
+ exports.default = getAuctionState;
@@ -1,51 +1,56 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const ethers_1 = require("ethers");
7
+ const chains_1 = __importDefault(require("../../configs/chains"));
4
8
  const contracts_1 = require("../../utils/contracts");
5
9
  const artifacts_1 = require("../../utils/artifacts");
6
10
  const amount_1 = require("../../utils/amount");
11
+ const rpcError_1 = require("../../utils/rpcError");
12
+ const _helpers_1 = require("./_helpers");
7
13
  /**
8
14
  * Lists every auction created by the AuctionFactory.
9
15
  * @param chainId The chain id.
10
- * @param signer The signer to read with.
11
- * @returns One record per auction. Price and bid amounts use the auction's payment token, ZENO amounts the ZENO
12
- * token; decimals and symbols come from the chain config registry and fall back to 18 when the token is not listed.
16
+ * @param provider The provider to read with. Defaults to the chain's first configured RPC.
17
+ * @returns One record per auction. Price amounts use the auction's payment token, ZENO amounts the ZENO's underlying,
18
+ * whose decimals ZENO shares; decimals and symbols come from the chain config registry and fall back to 18 when the
19
+ * token is not listed.
13
20
  */
14
- async function getAuctions(chainId, signer) {
15
- if (!signer) {
16
- throw new Error("Wallet not connected");
21
+ async function getAuctions(chainId, provider) {
22
+ if (!provider) {
23
+ provider = new ethers_1.ethers.JsonRpcProvider(chains_1.default[chainId].rpcs[0]);
17
24
  }
25
+ const auctionFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "auctionfactory");
18
26
  try {
19
- const auctionFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "auctionfactory");
20
- const auctionFactoryABI = (0, artifacts_1.getABI)("auctionfactory");
21
- const auctionFactoryContract = new ethers_1.ethers.Contract(auctionFactoryAddress, auctionFactoryABI, signer);
22
- const auctionsCount = await auctionFactoryContract.getAuctionCount();
23
- const auctions = [];
24
- for (let i = 0; i < auctionsCount; i++) {
25
- const auction = await auctionFactoryContract.getAuctionDetails(i);
26
- const auctionContract = new ethers_1.ethers.Contract(auction.auctionAddress, (0, artifacts_1.getABI)("auction"), signer);
27
- const paymentToken = await auctionContract.token();
28
- auctions.push({
29
- auctionAddress: auction.auctionAddress,
30
- zenoAddress: auction.zenoAddress,
31
- businessAddress: auction.businessAddress,
32
- auctionStartTime: auction.auctionStartTime,
33
- auctionEndTime: auction.auctionEndTime,
34
- startingPrice: (0, amount_1.toTokenAmount)(chainId, paymentToken, auction.startingPrice),
35
- reservePrice: (0, amount_1.toTokenAmount)(chainId, paymentToken, auction.reservePrice),
36
- price: (0, amount_1.toTokenAmount)(chainId, paymentToken, auction.price),
37
- totalZENOAllocated: (0, amount_1.toTokenAmount)(chainId, auction.zenoAddress, auction.totalZENOAllocated),
38
- totalZENORemaining: (0, amount_1.toTokenAmount)(chainId, auction.zenoAddress, auction.totalZENORemaining),
39
- lastBidTime: auction.lastBidTime,
40
- lastBidder: auction.lastBidder,
41
- lastBidAmount: (0, amount_1.toTokenAmount)(chainId, paymentToken, auction.lastBidAmount),
42
- });
43
- }
44
- return auctions;
27
+ const auctionFactoryContract = new ethers_1.ethers.Contract(auctionFactoryAddress, (0, artifacts_1.getABI)("auctionfactory"), provider);
28
+ const auctionAddresses = await auctionFactoryContract.getAuctions();
29
+ return await Promise.all(auctionAddresses.map(async (address) => {
30
+ const auctionContract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("auction"), provider);
31
+ const [details, tokenAddress] = await Promise.all([
32
+ auctionContract.getDetails(),
33
+ auctionContract.token(),
34
+ ]);
35
+ const underlying = await (0, _helpers_1.getZenoContract)(chainId, details.zenoAddress, provider).underlyingAsset();
36
+ return {
37
+ auctionAddress: details.auctionAddress,
38
+ zenoAddress: details.zenoAddress,
39
+ tokenAddress,
40
+ issuer: details.issuer,
41
+ auctionStartTime: details.auctionStartTime,
42
+ auctionEndTime: details.auctionEndTime,
43
+ startingPrice: (0, amount_1.toTokenAmount)(chainId, tokenAddress, details.startingPrice),
44
+ reservePrice: (0, amount_1.toTokenAmount)(chainId, tokenAddress, details.reservePrice),
45
+ price: (0, amount_1.toTokenAmount)(chainId, tokenAddress, details.price),
46
+ totalZENOAllocated: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalZENOAllocated),
47
+ totalZENORemaining: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalZENORemaining),
48
+ fundingMode: Number(details.fundingMode),
49
+ };
50
+ }));
45
51
  }
46
52
  catch (error) {
47
- console.error("Error getting auctions:", error);
48
- throw new Error(`Failed to get auctions: ${error.message}`);
53
+ throw (0, rpcError_1.toRpcError)("zeno.getAuctions", error, { chainId, address: auctionFactoryAddress });
49
54
  }
50
55
  }
51
56
  exports.default = getAuctions;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ethers_1 = require("ethers");
4
+ const amount_1 = require("../../utils/amount");
5
+ const rpcError_1 = require("../../utils/rpcError");
6
+ const _helpers_1 = require("./_helpers");
7
+ /**
8
+ * Reads a ZENO bond's live state: supply, collateral and whether it can be redeemed. Collateral is read here rather
9
+ * than indexed, because top-ups are plain transfers on the underlying that no ZENO event records.
10
+ * @param chainId The chain id.
11
+ * @param zeno The ZENO bond address.
12
+ * @param provider The provider to read with. Defaults to the chain's first configured RPC.
13
+ * @returns The bond's state.
14
+ */
15
+ async function getBondState(chainId, zeno, provider) {
16
+ try {
17
+ const contract = (0, _helpers_1.getZenoContract)(chainId, zeno, provider);
18
+ const [details, underlying, auction, totalSupply, sweepableSurplus, isRedeemable] = await Promise.all([
19
+ contract.getDetails(),
20
+ contract.underlyingAsset(),
21
+ contract.auction(),
22
+ contract.totalSupply(),
23
+ contract.sweepableSurplus(),
24
+ contract.isRedeemable(),
25
+ ]);
26
+ const collateral = await new ethers_1.ethers.Contract(underlying, _helpers_1.ERC20_ABI, contract.runner).balanceOf(zeno);
27
+ return {
28
+ zeno: details.zenoAddress,
29
+ name: details.name,
30
+ symbol: details.symbol,
31
+ underlying,
32
+ auction: (0, _helpers_1.addressOrNull)(auction),
33
+ maturityDate: details.maturityDate,
34
+ isRedeemable,
35
+ totalMinted: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalMinted, details.symbol),
36
+ totalSupply: (0, _helpers_1.toZenoAmount)(chainId, underlying, totalSupply, details.symbol),
37
+ totalRedeemed: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalRedeemed, details.symbol),
38
+ collateral: (0, amount_1.toTokenAmount)(chainId, underlying, collateral),
39
+ sweepableSurplus: (0, amount_1.toTokenAmount)(chainId, underlying, sweepableSurplus),
40
+ isFunded: collateral >= totalSupply,
41
+ };
42
+ }
43
+ catch (error) {
44
+ throw (0, rpcError_1.toRpcError)("zeno.getBondState", error, { chainId, address: zeno });
45
+ }
46
+ }
47
+ exports.default = getBondState;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const amount_1 = require("../../utils/amount");
4
+ const rpcError_1 = require("../../utils/rpcError");
5
+ const _helpers_1 = require("./_helpers");
6
+ /**
7
+ * Reads an auction's current price. Read it right before `buy` to size `minZenoOut`: a Dutch price falls every block.
8
+ * @param chainId The chain id.
9
+ * @param auction The auction address.
10
+ * @param provider The provider to read with. Defaults to the chain's first configured RPC.
11
+ * @returns The price in payment token base units per whole ZENO.
12
+ */
13
+ async function getPrice(chainId, auction, provider) {
14
+ try {
15
+ const contract = (0, _helpers_1.getAuctionContract)(chainId, auction, provider);
16
+ const [price, paymentToken] = await Promise.all([contract.getPrice(), contract.token()]);
17
+ return (0, amount_1.toTokenAmount)(chainId, paymentToken, price);
18
+ }
19
+ catch (error) {
20
+ throw (0, rpcError_1.toRpcError)("zeno.getPrice", error, { chainId, address: auction });
21
+ }
22
+ }
23
+ exports.default = getPrice;
@@ -1,28 +1,44 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const ethers_1 = require("ethers");
7
+ const chains_1 = __importDefault(require("../../configs/chains"));
4
8
  const contracts_1 = require("../../utils/contracts");
5
9
  const artifacts_1 = require("../../utils/artifacts");
6
- async function getZenos(chainId, signer) {
7
- if (!signer) {
8
- throw new Error("Wallet not connected");
10
+ const rpcError_1 = require("../../utils/rpcError");
11
+ const _helpers_1 = require("./_helpers");
12
+ /**
13
+ * Lists every ZENO bond created by the ZENOFactory.
14
+ * @param chainId The chain id.
15
+ * @param provider The provider to read with. Defaults to the chain's first configured RPC.
16
+ * @returns One record per bond. ZENO shares its underlying's decimals, so amounts take the underlying's from the chain
17
+ * config registry and fall back to 18 when it is not listed.
18
+ */
19
+ async function getZenos(chainId, provider) {
20
+ if (!provider) {
21
+ provider = new ethers_1.ethers.JsonRpcProvider(chains_1.default[chainId].rpcs[0]);
9
22
  }
23
+ const zenoFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "zenofactory");
10
24
  try {
11
- const zenoFactoryAddress = (0, contracts_1.getContractAddress)(chainId, "zenofactory");
12
- const zenoFactoryABI = (0, artifacts_1.getABI)("zenofactory");
13
- const zenoFactoryContract = new ethers_1.ethers.Contract(zenoFactoryAddress, zenoFactoryABI, signer);
14
- const zenosCount = await zenoFactoryContract.getZENOCount();
15
- const zenos = [];
16
- for (let i = 0; i < zenosCount; i++) {
17
- const zeno = await zenoFactoryContract.getZENODetails(i);
18
- zenos.push(zeno);
19
- }
20
- console.log(`Zenos: ${zenos}`);
21
- return zenos;
25
+ const zenoFactoryContract = new ethers_1.ethers.Contract(zenoFactoryAddress, (0, artifacts_1.getABI)("zenofactory"), provider);
26
+ const zenoAddresses = await zenoFactoryContract.getZENOs();
27
+ return await Promise.all(zenoAddresses.map(async (address) => {
28
+ const zenoContract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("zeno"), provider);
29
+ const [details, underlying] = await Promise.all([zenoContract.getDetails(), zenoContract.underlyingAsset()]);
30
+ return {
31
+ zenoAddress: details.zenoAddress,
32
+ maturityDate: details.maturityDate,
33
+ name: details.name,
34
+ symbol: details.symbol,
35
+ totalMinted: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalMinted, details.symbol),
36
+ totalRedeemed: (0, _helpers_1.toZenoAmount)(chainId, underlying, details.totalRedeemed, details.symbol),
37
+ };
38
+ }));
22
39
  }
23
40
  catch (error) {
24
- console.error("Error getting zenos:", error);
25
- throw new Error(`Failed to get zenos: ${error.message}`);
41
+ throw (0, rpcError_1.toRpcError)("zeno.getZenos", error, { chainId, address: zenoFactoryAddress });
26
42
  }
27
43
  }
28
44
  exports.default = getZenos;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.grantRole = grantRole;
4
+ exports.revokeRole = revokeRole;
5
+ const rpcError_1 = require("../../utils/rpcError");
6
+ const _helpers_1 = require("./_helpers");
7
+ /**
8
+ * Grants an auction role, e.g. PAUSER_ROLE to a guardian bot. DEFAULT_ADMIN_ROLE only.
9
+ * @param chainId The chain id.
10
+ * @param auction The auction address.
11
+ * @param role The bytes32 role identifier: `keccak256("PAUSER_ROLE")`, or the zero hash for DEFAULT_ADMIN_ROLE.
12
+ * @param account The address to grant it to.
13
+ * @param signer A DEFAULT_ADMIN_ROLE holder.
14
+ * @returns The transaction receipt.
15
+ */
16
+ async function grantRole(chainId, auction, role, account, signer) {
17
+ if (!signer)
18
+ throw new Error("Signer is required");
19
+ try {
20
+ const tx = await (0, _helpers_1.getAuctionContract)(chainId, auction, signer).grantRole(role, account);
21
+ return await tx.wait();
22
+ }
23
+ catch (error) {
24
+ throw (0, rpcError_1.toRpcError)("zeno.grantRole", error, { chainId, address: auction });
25
+ }
26
+ }
27
+ /**
28
+ * Revokes an auction role. DEFAULT_ADMIN_ROLE only.
29
+ * @param chainId The chain id.
30
+ * @param auction The auction address.
31
+ * @param role The bytes32 role identifier: `keccak256("PAUSER_ROLE")`, or the zero hash for DEFAULT_ADMIN_ROLE.
32
+ * @param account The address to revoke it from.
33
+ * @param signer A DEFAULT_ADMIN_ROLE holder.
34
+ * @returns The transaction receipt.
35
+ */
36
+ async function revokeRole(chainId, auction, role, account, signer) {
37
+ if (!signer)
38
+ throw new Error("Signer is required");
39
+ try {
40
+ const tx = await (0, _helpers_1.getAuctionContract)(chainId, auction, signer).revokeRole(role, account);
41
+ return await tx.wait();
42
+ }
43
+ catch (error) {
44
+ throw (0, rpcError_1.toRpcError)("zeno.revokeRole", error, { chainId, address: auction });
45
+ }
46
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pause = pause;
4
+ exports.unpause = unpause;
5
+ const rpcError_1 = require("../../utils/rpcError");
6
+ const _helpers_1 = require("./_helpers");
7
+ /**
8
+ * Halts `buy` on an auction. PAUSER_ROLE only. A Dutch price keeps falling while paused.
9
+ * @param chainId The chain id.
10
+ * @param auction The auction address.
11
+ * @param signer A PAUSER_ROLE holder.
12
+ * @returns The transaction receipt.
13
+ */
14
+ async function pause(chainId, auction, signer) {
15
+ if (!signer)
16
+ throw new Error("Signer is required");
17
+ try {
18
+ const tx = await (0, _helpers_1.getAuctionContract)(chainId, auction, signer).pause();
19
+ return await tx.wait();
20
+ }
21
+ catch (error) {
22
+ throw (0, rpcError_1.toRpcError)("zeno.pause", error, { chainId, address: auction });
23
+ }
24
+ }
25
+ /**
26
+ * Resumes `buy` on an auction. DEFAULT_ADMIN_ROLE only, so a compromised pauser cannot reopen buying.
27
+ * @param chainId The chain id.
28
+ * @param auction The auction address.
29
+ * @param signer A DEFAULT_ADMIN_ROLE holder.
30
+ * @returns The transaction receipt.
31
+ */
32
+ async function unpause(chainId, auction, signer) {
33
+ if (!signer)
34
+ throw new Error("Signer is required");
35
+ try {
36
+ const tx = await (0, _helpers_1.getAuctionContract)(chainId, auction, signer).unpause();
37
+ return await tx.wait();
38
+ }
39
+ catch (error) {
40
+ throw (0, rpcError_1.toRpcError)("zeno.unpause", error, { chainId, address: auction });
41
+ }
42
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.priceAt = void 0;
4
+ /**
5
+ * An auction's price at `now`, computed locally without an RPC call. Mirrors `Auction.getPrice()` exactly, truncating
6
+ * division included: the starting price before the window, the reserve from `endTime` on, a linear fall between.
7
+ *
8
+ * @param terms The auction's price terms, e.g. from `getAuctionState` or the subgraph's `BondAuction`.
9
+ * @param now UNIX timestamp (seconds). Use the latest block timestamp to match the contract exactly.
10
+ * @returns The price in payment token base units per whole ZENO.
11
+ */
12
+ const priceAt = (terms, now) => {
13
+ if (now < terms.startTime)
14
+ return terms.startingPrice;
15
+ if (now >= terms.endTime)
16
+ return terms.reservePrice;
17
+ return (terms.startingPrice -
18
+ ((terms.startingPrice - terms.reservePrice) * (now - terms.startTime)) / (terms.endTime - terms.startTime));
19
+ };
20
+ exports.priceAt = priceAt;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.quoteBuy = void 0;
4
+ const BPS = 10000n;
5
+ /**
6
+ * What a buy mints, computed locally without an RPC call with `Auction.buy`'s integer maths:
7
+ * `zenoOut = paymentAmount * 10^zenoDecimals / price`, truncated.
8
+ *
9
+ * A Dutch price only falls, so a buy mined after the quote mints at least `zenoOut`; `minZenoOut` guards against a
10
+ * fixed price or a stale quote. The same fall means a payment at exactly `maxPayment` can revert a block later, so
11
+ * leave headroom when buying out the remainder.
12
+ *
13
+ * @param input The price, payment, ZENO decimals, remaining supply and slippage tolerance.
14
+ * @returns The ZENO out, the `minZenoOut` to send, and the payment ceiling.
15
+ */
16
+ const quoteBuy = (input) => {
17
+ if (input.price <= 0n)
18
+ throw new Error("Price must be positive");
19
+ const slippageBps = input.slippageBps ?? 0n;
20
+ if (slippageBps < 0n || slippageBps > BPS)
21
+ throw new Error("Slippage must be between 0 and 10000 bps");
22
+ const scale = 10n ** BigInt(input.zenoDecimals);
23
+ const zenoOut = (input.paymentAmount * scale) / input.price;
24
+ // floor(p * scale / price) <= remaining <=> p * scale < (remaining + 1) * price
25
+ const maxPayment = ((input.totalRemaining + 1n) * input.price - 1n) / scale;
26
+ return {
27
+ zenoOut,
28
+ minZenoOut: (zenoOut * (BPS - slippageBps)) / BPS,
29
+ maxPayment,
30
+ exceedsRemaining: input.paymentAmount > maxPayment,
31
+ };
32
+ };
33
+ exports.quoteBuy = quoteBuy;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.redeem = redeem;
4
+ exports.redeemAll = redeemAll;
5
+ const rpcError_1 = require("../../utils/rpcError");
6
+ const _helpers_1 = require("./_helpers");
7
+ /**
8
+ * Redeems ZENO 1:1 for the underlying. Reverts before maturity, and while the bond's collateral is short of its
9
+ * outstanding supply (`getBondState(...).isFunded`).
10
+ * @param chainId The chain id.
11
+ * @param zeno The ZENO bond address.
12
+ * @param amount ZENO to redeem, in base units.
13
+ * @param signer The holder, who receives the underlying.
14
+ * @returns The transaction receipt.
15
+ */
16
+ async function redeem(chainId, zeno, amount, signer) {
17
+ if (!signer)
18
+ throw new Error("Signer is required");
19
+ try {
20
+ const tx = await (0, _helpers_1.getZenoContract)(chainId, zeno, signer).redeem(amount);
21
+ return await tx.wait();
22
+ }
23
+ catch (error) {
24
+ throw (0, rpcError_1.toRpcError)("zeno.redeem", error, { chainId, address: zeno });
25
+ }
26
+ }
27
+ /**
28
+ * Redeems the signer's whole ZENO balance for the underlying. Same conditions as `redeem`.
29
+ * @param chainId The chain id.
30
+ * @param zeno The ZENO bond address.
31
+ * @param signer The holder, who receives the underlying.
32
+ * @returns The transaction receipt.
33
+ */
34
+ async function redeemAll(chainId, zeno, signer) {
35
+ if (!signer)
36
+ throw new Error("Signer is required");
37
+ try {
38
+ const tx = await (0, _helpers_1.getZenoContract)(chainId, zeno, signer).redeemAll();
39
+ return await tx.wait();
40
+ }
41
+ catch (error) {
42
+ throw (0, rpcError_1.toRpcError)("zeno.redeemAll", error, { chainId, address: zeno });
43
+ }
44
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rpcError_1 = require("../../utils/rpcError");
4
+ const _helpers_1 = require("./_helpers");
5
+ /**
6
+ * Binds a ZENO to the auction that sells it. One-shot, ZENO owner only; reverts unless the auction's `zeno()` points
7
+ * back at this ZENO. Until it is set, the auction's buys revert.
8
+ * @param chainId The chain id.
9
+ * @param zeno The ZENO bond address.
10
+ * @param auction The auction created for it.
11
+ * @param signer The ZENO owner.
12
+ * @returns The transaction receipt.
13
+ */
14
+ async function setAuction(chainId, zeno, auction, signer) {
15
+ if (!signer)
16
+ throw new Error("Signer is required");
17
+ try {
18
+ const tx = await (0, _helpers_1.getZenoContract)(chainId, zeno, signer).setAuction(auction);
19
+ return await tx.wait();
20
+ }
21
+ catch (error) {
22
+ throw (0, rpcError_1.toRpcError)("zeno.setAuction", error, { chainId, address: zeno });
23
+ }
24
+ }
25
+ exports.default = setAuction;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rpcError_1 = require("../../utils/rpcError");
4
+ const _helpers_1 = require("./_helpers");
5
+ /**
6
+ * Sweeps underlying held above the ZENO's outstanding supply: unsold prefill, overpayments and post-maturity residue.
7
+ * ZENO owner only, and only once the bound auction has ended. `getBondState(...).sweepableSurplus` is the most it takes.
8
+ * @param chainId The chain id.
9
+ * @param zeno The ZENO bond address.
10
+ * @param to The recipient of the underlying.
11
+ * @param amount Underlying to sweep, in base units.
12
+ * @param signer The ZENO owner.
13
+ * @returns The transaction receipt.
14
+ */
15
+ async function sweepSurplus(chainId, zeno, to, amount, signer) {
16
+ if (!signer)
17
+ throw new Error("Signer is required");
18
+ try {
19
+ const tx = await (0, _helpers_1.getZenoContract)(chainId, zeno, signer).sweepSurplus(to, amount);
20
+ return await tx.wait();
21
+ }
22
+ catch (error) {
23
+ throw (0, rpcError_1.toRpcError)("zeno.sweepSurplus", error, { chainId, address: zeno });
24
+ }
25
+ }
26
+ exports.default = sweepSurplus;