@gearbox-protocol/sdk 1.22.3 → 1.23.0

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 (283) hide show
  1. package/lib/apy/convexAPY.d.ts +10 -10
  2. package/lib/apy/convexAPY.js +100 -121
  3. package/lib/apy/curveAPY.d.ts +3 -4
  4. package/lib/apy/curveAPY.js +57 -111
  5. package/lib/apy/index.js +4 -6
  6. package/lib/apy/lidoAPY.d.ts +1 -2
  7. package/lib/apy/lidoAPY.js +14 -62
  8. package/lib/apy/yearnAPY.d.ts +2 -3
  9. package/lib/apy/yearnAPY.js +26 -82
  10. package/lib/contracts/contracts.js +9 -22
  11. package/lib/contracts/contractsRegister.js +39 -51
  12. package/lib/contracts/protocols.js +10 -11
  13. package/lib/core/adapter.js +9 -4
  14. package/lib/core/assets.d.ts +6 -7
  15. package/lib/core/assets.js +60 -70
  16. package/lib/core/chains.js +30 -80
  17. package/lib/core/constants.d.ts +9 -10
  18. package/lib/core/constants.js +9 -12
  19. package/lib/core/creditAccount.d.ts +20 -20
  20. package/lib/core/creditAccount.js +123 -134
  21. package/lib/core/creditAccount.spec.js +50 -52
  22. package/lib/core/creditManager.d.ts +26 -26
  23. package/lib/core/creditManager.js +172 -136
  24. package/lib/core/creditManager.spec.js +59 -61
  25. package/lib/core/creditSession.d.ts +12 -13
  26. package/lib/core/creditSession.js +120 -77
  27. package/lib/core/errors.d.ts +2 -3
  28. package/lib/core/errors.js +11 -27
  29. package/lib/core/eventOrTx.js +35 -73
  30. package/lib/core/events.d.ts +31 -24
  31. package/lib/core/events.js +702 -702
  32. package/lib/core/operations.js +11 -5
  33. package/lib/core/pool/data.d.ts +29 -29
  34. package/lib/core/pool/data.js +153 -112
  35. package/lib/core/pool/operation.d.ts +1 -2
  36. package/lib/core/pool/operation.js +23 -35
  37. package/lib/core/priceOracle.d.ts +6 -6
  38. package/lib/core/priceOracle.js +23 -29
  39. package/lib/core/rewardClaimer.d.ts +2 -2
  40. package/lib/core/rewardClaimer.js +5 -48
  41. package/lib/core/rewardConvex.js +54 -114
  42. package/lib/core/rewardConvex.spec.js +41 -43
  43. package/lib/core/strategy.d.ts +5 -6
  44. package/lib/core/strategy.js +67 -69
  45. package/lib/core/strategy.spec.js +32 -34
  46. package/lib/core/tokenDistributor.d.ts +1 -2
  47. package/lib/core/trade.d.ts +6 -6
  48. package/lib/core/trade.js +70 -115
  49. package/lib/core/transactions.d.ts +21 -22
  50. package/lib/core/transactions.js +285 -308
  51. package/lib/index.d.ts +0 -2
  52. package/lib/index.js +0 -2
  53. package/lib/oracles/oracles.d.ts +1 -2
  54. package/lib/oracles/priceFeeds.js +2 -3
  55. package/lib/parsers/ERC20Parser.js +20 -38
  56. package/lib/parsers/abstractParser.js +33 -31
  57. package/lib/parsers/addressProviderParser.js +12 -30
  58. package/lib/parsers/airdropDistributorParser.js +12 -30
  59. package/lib/parsers/convexBaseRewardPoolAdapterParser.js +24 -42
  60. package/lib/parsers/convexBaseRewardPoolAdapterParser.spec.js +11 -11
  61. package/lib/parsers/convexBoosterAdapterParser.js +26 -44
  62. package/lib/parsers/convexBoosterAdapterParser.spec.js +10 -10
  63. package/lib/parsers/convextRewardPoolParser.js +12 -30
  64. package/lib/parsers/creditFacadeParser.js +26 -45
  65. package/lib/parsers/creditFacadeParser.spec.js +13 -13
  66. package/lib/parsers/creditManagerParser.js +12 -30
  67. package/lib/parsers/curveAdapterParser.js +60 -78
  68. package/lib/parsers/curveAdapterParser.spec.js +20 -27
  69. package/lib/parsers/dataCompressorParser.js +12 -30
  70. package/lib/parsers/lidoAdapterParser.js +15 -33
  71. package/lib/parsers/lidoAdapterParser.spec.js +9 -9
  72. package/lib/parsers/lidoOracleParser.js +12 -30
  73. package/lib/parsers/lidoSTETHParser.js +19 -37
  74. package/lib/parsers/multicallParser.js +16 -34
  75. package/lib/parsers/offchainOracleParser.js +13 -31
  76. package/lib/parsers/poolParser.js +11 -29
  77. package/lib/parsers/priceOracleParser.js +13 -31
  78. package/lib/parsers/txParser.js +86 -96
  79. package/lib/parsers/uniV2AdapterParser.js +35 -55
  80. package/lib/parsers/uniV2AdapterParser.spec.js +15 -16
  81. package/lib/parsers/uniV3AdapterParser.js +56 -74
  82. package/lib/parsers/uniV3AdapterParser.spec.js +23 -24
  83. package/lib/parsers/wstETHAdapterParser.js +25 -43
  84. package/lib/parsers/wstETHAdapterParser.spec.js +11 -11
  85. package/lib/parsers/yearnAdapterParser.spec.js +17 -17
  86. package/lib/parsers/yearnV2AdapterParser.js +25 -43
  87. package/lib/pathfinder/core.d.ts +3 -4
  88. package/lib/pathfinder/pathOptions.js +52 -101
  89. package/lib/pathfinder/pathOptions.spec.js +55 -57
  90. package/lib/pathfinder/pathfinder.d.ts +3 -3
  91. package/lib/pathfinder/pathfinder.js +109 -202
  92. package/lib/pathfinder/pathfinder.spec.js +13 -13
  93. package/lib/strategies/convex.js +111 -123
  94. package/lib/strategies/creditFacade.js +34 -37
  95. package/lib/strategies/curve.js +74 -80
  96. package/lib/strategies/lido.js +26 -32
  97. package/lib/strategies/uniswapV2.js +21 -24
  98. package/lib/strategies/uniswapV3.js +33 -36
  99. package/lib/strategies/yearn.js +47 -59
  100. package/lib/tokens/balancer.js +3 -5
  101. package/lib/tokens/convex.js +14 -29
  102. package/lib/tokens/curveLP.js +22 -28
  103. package/lib/tokens/gear.js +1 -1
  104. package/lib/tokens/normal.js +3 -5
  105. package/lib/tokens/token.js +29 -35
  106. package/lib/tokens/tokenData.d.ts +0 -9
  107. package/lib/tokens/tokenData.js +17 -15
  108. package/lib/tokens/yearn.js +3 -5
  109. package/lib/types/factories/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface__factory.js +9 -12
  110. package/lib/types/factories/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface__factory.js +9 -12
  111. package/lib/types/factories/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface__factory.js +9 -12
  112. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IACL.sol/IACLEvents__factory.js +9 -12
  113. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IACL.sol/IACLExceptions__factory.js +9 -12
  114. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IACL.sol/IACL__factory.js +9 -12
  115. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAccountFactory.sol/IAccountFactoryEvents__factory.js +9 -12
  116. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAccountFactory.sol/IAccountFactoryGetters__factory.js +9 -12
  117. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAccountFactory.sol/IAccountFactory__factory.js +9 -12
  118. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAddressProvider.sol/IAddressProviderEvents__factory.js +9 -12
  119. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAddressProvider.sol/IAddressProvider__factory.js +9 -12
  120. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAirdropDistributor.sol/IAirdropDistributorEvents__factory.js +9 -12
  121. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IAirdropDistributor.sol/IAirdropDistributor__factory.js +9 -12
  122. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IContractsRegister.sol/IContractsRegisterEvents__factory.js +9 -12
  123. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IContractsRegister.sol/IContractsRegister__factory.js +9 -12
  124. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditAccount.sol/ICrediAccountExceptions__factory.js +9 -12
  125. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditAccount.sol/ICreditAccount__factory.js +9 -12
  126. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditConfigurator.sol/ICreditConfiguratorEvents__factory.js +9 -12
  127. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditConfigurator.sol/ICreditConfiguratorExceptions__factory.js +9 -12
  128. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditConfigurator.sol/ICreditConfigurator__factory.js +9 -12
  129. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditFacade.sol/ICreditFacadeEvents__factory.js +9 -12
  130. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExceptions__factory.js +9 -12
  131. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExtended__factory.js +9 -12
  132. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditFacade.sol/ICreditFacade__factory.js +9 -12
  133. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2Events__factory.js +9 -12
  134. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2Exceptions__factory.js +9 -12
  135. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2__factory.js +9 -12
  136. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDataCompressor.sol/IDataCompressorExceptions__factory.js +9 -12
  137. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDataCompressor.sol/IDataCompressor__factory.js +9 -12
  138. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDegenDistributor.sol/IDegenDistributorEvents__factory.js +9 -12
  139. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDegenDistributor.sol/IDegenDistributor__factory.js +9 -12
  140. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDegenNFT.sol/IDegenNFTEvents__factory.js +9 -12
  141. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDegenNFT.sol/IDegenNFTExceptions__factory.js +9 -12
  142. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDegenNFT.sol/IDegenNFT__factory.js +9 -12
  143. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDieselToken.sol/IDieselTokenExceptions__factory.js +9 -12
  144. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IDieselToken.sol/IDieselToken__factory.js +9 -12
  145. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IInterestRateModel__factory.js +9 -12
  146. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ILPPriceFeed.sol/ILPPriceFeedEvents__factory.js +9 -12
  147. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ILPPriceFeed.sol/ILPPriceFeedExceptions__factory.js +9 -12
  148. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/ILPPriceFeed.sol/ILPPriceFeed__factory.js +9 -12
  149. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPhantomERC20__factory.js +9 -12
  150. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPoolService.sol/IPoolServiceEvents__factory.js +9 -12
  151. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPoolService.sol/IPoolService__factory.js +9 -12
  152. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPriceFeedType__factory.js +9 -12
  153. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPriceOracle.sol/IPriceOracleV2Events__factory.js +9 -12
  154. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPriceOracle.sol/IPriceOracleV2Exceptions__factory.js +9 -12
  155. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPriceOracle.sol/IPriceOracleV2Ext__factory.js +9 -12
  156. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IPriceOracle.sol/IPriceOracleV2__factory.js +9 -12
  157. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IVersion__factory.js +9 -12
  158. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/IWETHGateway__factory.js +9 -12
  159. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/V1/ICreditFilter__factory.js +9 -12
  160. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/V1/ICreditManager__factory.js +9 -12
  161. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/adapters/IAdapter.sol/IAdapterExceptions__factory.js +9 -12
  162. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/adapters/IAdapter.sol/IAdapter__factory.js +9 -12
  163. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/adapters/IUniversalAdapter.sol/IUniversalAdapterExceptions__factory.js +9 -12
  164. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/adapters/IUniversalAdapter.sol/IUniversalAdapter__factory.js +9 -12
  165. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/interfaces/external/IWETH__factory.js +9 -12
  166. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/pool/PoolService__factory.js +27 -50
  167. package/lib/types/factories/@gearbox-protocol/core-v2/contracts/test/interfaces/ITokenTestSuite__factory.js +9 -12
  168. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IBaseRewardPool__factory.js +9 -12
  169. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IBooster__factory.js +9 -12
  170. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IClaimZap__factory.js +9 -12
  171. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IConvexToken__factory.js +9 -12
  172. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IRewards.sol/IBasicRewards__factory.js +9 -12
  173. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/IRewards.sol/IRewards__factory.js +9 -12
  174. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/ICrvDeposit__factory.js +9 -12
  175. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/ICurveGauge__factory.js +9 -12
  176. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/ICurveVoteEscrow__factory.js +9 -12
  177. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IDeposit__factory.js +9 -12
  178. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IFeeDistro__factory.js +9 -12
  179. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IMinter__factory.js +9 -12
  180. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IPools__factory.js +9 -12
  181. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IRegistry__factory.js +9 -12
  182. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IRewardFactory__factory.js +9 -12
  183. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IRewards__factory.js +9 -12
  184. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IStaker__factory.js +9 -12
  185. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IStashFactory__factory.js +9 -12
  186. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IStash__factory.js +9 -12
  187. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/ITokenFactory__factory.js +9 -12
  188. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/ITokenMinter__factory.js +9 -12
  189. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IVestedEscrow__factory.js +9 -12
  190. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IVoting__factory.js +9 -12
  191. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/convex/Interfaces.sol/IWalletChecker__factory.js +9 -12
  192. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurvePoolStETH__factory.js +9 -12
  193. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurvePool_2.sol/ICurvePool2Assets__factory.js +9 -12
  194. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurvePool_3.sol/ICurvePool3Assets__factory.js +9 -12
  195. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurvePool_4.sol/ICurvePool4Assets__factory.js +9 -12
  196. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurvePool__factory.js +9 -12
  197. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/curve/ICurveRegistry__factory.js +9 -12
  198. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/ILidoOracle__factory.js +9 -12
  199. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/IstETH.sol/IstETHGetters__factory.js +9 -12
  200. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/IstETH.sol/IstETH__factory.js +9 -12
  201. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/IwstETH.sol/IwstETHGetters__factory.js +9 -12
  202. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/IwstETH.sol/IwstETH__factory.js +9 -12
  203. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/lido/IwstETHGateway.sol/IwstETHGateWay__factory.js +9 -12
  204. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/uniswap/IQuoter__factory.js +9 -12
  205. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/uniswap/IUniswapV2Router01__factory.js +9 -12
  206. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/uniswap/IUniswapV2Router02__factory.js +9 -12
  207. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/uniswap/IUniswapV3.sol/ISwapRouter__factory.js +9 -12
  208. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/integrations/yearn/IYVault__factory.js +9 -12
  209. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/convex/IConvexV1BaseRewardPoolAdapter.sol/IConvexV1BaseRewardPoolAdapterErrors__factory.js +9 -12
  210. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/convex/IConvexV1BaseRewardPoolAdapter.sol/IConvexV1BaseRewardPoolAdapter__factory.js +9 -12
  211. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/convex/IConvexV1BoosterAdapter__factory.js +9 -12
  212. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/curve/ICurveV1Adapter.sol/ICurveV1AdapterExceptions__factory.js +9 -12
  213. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/curve/ICurveV1Adapter.sol/ICurveV1Adapter__factory.js +9 -12
  214. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/curve/ICurveV1_2AssetsAdapter__factory.js +9 -12
  215. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/curve/ICurveV1_3AssetsAdapter__factory.js +9 -12
  216. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/curve/ICurveV1_4AssetsAdapter__factory.js +9 -12
  217. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/lido/ILidoV1Adapter.sol/ILidoV1AdapterEvents__factory.js +9 -12
  218. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/lido/ILidoV1Adapter.sol/ILidoV1AdapterExceptions__factory.js +9 -12
  219. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/lido/ILidoV1Adapter.sol/ILidoV1Adapter__factory.js +9 -12
  220. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/lido/IwstETHV1Adapter__factory.js +9 -12
  221. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/uniswap/IUniswapPathChecker__factory.js +9 -12
  222. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/uniswap/IUniswapV2Adapter.sol/IUniswapV2AdapterExceptions__factory.js +9 -12
  223. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/uniswap/IUniswapV2Adapter.sol/IUniswapV2Adapter__factory.js +9 -12
  224. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/uniswap/IUniswapV3Adapter.sol/IUniswapV3AdapterExceptions__factory.js +9 -12
  225. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/uniswap/IUniswapV3Adapter.sol/IUniswapV3Adapter__factory.js +9 -12
  226. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/interfaces/yearn/IYearnV2Adapter__factory.js +9 -12
  227. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/test/config/SupportedContracts.sol/ISupportedContracts__factory.js +9 -12
  228. package/lib/types/factories/@gearbox-protocol/integrations-v2/contracts/test/mocks/integrations/LidoMock.sol/ILidoMockEvents__factory.js +9 -12
  229. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IClosePathResolver__factory.js +9 -12
  230. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IDepositor.sol/IDepositorOptions__factory.js +9 -12
  231. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IDepositor.sol/IDepositor__factory.js +9 -12
  232. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IGasPricer__factory.js +9 -12
  233. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/ILPWorker.sol/ILPWorkerOptions__factory.js +9 -12
  234. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/ILPWorker.sol/ILPWorker__factory.js +9 -12
  235. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IPathResolver__factory.js +9 -12
  236. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IRouterComponent__factory.js +9 -12
  237. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IRouter__factory.js +9 -12
  238. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/ISwapAggregator__factory.js +9 -12
  239. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/ISwapper__factory.js +9 -12
  240. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IWithdrawer.sol/IWithdrawerOptions__factory.js +9 -12
  241. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IWithdrawer.sol/IWithdrawer__factory.js +9 -12
  242. package/lib/types/factories/@gearbox-protocol/router/contracts/interfaces/IWrapper__factory.js +9 -12
  243. package/lib/types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.js +9 -12
  244. package/lib/types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.js +9 -12
  245. package/lib/types/factories/@openzeppelin/contracts/token/ERC721/IERC721Receiver__factory.js +9 -12
  246. package/lib/types/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.js +9 -12
  247. package/lib/types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata__factory.js +9 -12
  248. package/lib/types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.js +9 -12
  249. package/lib/types/factories/contracts/IGas__factory.js +9 -12
  250. package/lib/types/factories/contracts/IGnosisSafeSignatureValidator__factory.js +9 -12
  251. package/lib/types/factories/contracts/ITokenDistributor.sol/ITokenDistributorEvents__factory.js +9 -12
  252. package/lib/types/factories/contracts/ITokenDistributor.sol/ITokenDistributorExceptions__factory.js +9 -12
  253. package/lib/types/factories/contracts/ITokenDistributor.sol/ITokenDistributor__factory.js +9 -12
  254. package/lib/types/factories/contracts/support/IOffchainOracle__factory.js +9 -12
  255. package/lib/types/factories/contracts/support/MultiCall.sol/Multicall2__factory.js +27 -50
  256. package/lib/utils/errors.js +1 -1
  257. package/lib/utils/extracter.js +4 -4
  258. package/lib/utils/formatter.d.ts +8 -8
  259. package/lib/utils/formatter.js +73 -87
  260. package/lib/utils/loading.js +3 -3
  261. package/lib/utils/mappers.js +7 -34
  262. package/lib/utils/math.d.ts +10 -7
  263. package/lib/utils/math.js +22 -25
  264. package/lib/utils/multicall.js +32 -98
  265. package/lib/utils/price.d.ts +3 -4
  266. package/lib/utils/price.js +8 -20
  267. package/lib/utils/repeater.js +12 -53
  268. package/lib/utils/validate.js +2 -2
  269. package/lib/watchers/creditAccountWatcher.js +136 -237
  270. package/lib/watchers/creditAccountWatcher.spec.js +51 -68
  271. package/lib/watchers/creditManagerWatcher.js +21 -71
  272. package/lib/watchers/creditManagerWatcher.spec.js +20 -23
  273. package/package.json +2 -2
  274. package/lib/core/history.d.ts +0 -42
  275. package/lib/core/history.js +0 -2
  276. package/lib/core/wcOperation/abstractOperations.d.ts +0 -23
  277. package/lib/core/wcOperation/abstractOperations.js +0 -39
  278. package/lib/core/wcOperation/index.d.ts +0 -11
  279. package/lib/core/wcOperation/index.js +0 -30
  280. package/lib/core/wcOperation/operations.d.ts +0 -88
  281. package/lib/core/wcOperation/operations.js +0 -146
  282. package/lib/core/wcOperation/types.d.ts +0 -15
  283. package/lib/core/wcOperation/types.js +0 -2
@@ -1,36 +1,18 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.EventEmergencyLiquidatorRemoved = exports.EventEmergencyLiquidatorAdded = exports.EventRemovedFromUpgradeable = exports.EventAddedToUpgradeable = exports.EventLimitPerBlockUpdated = exports.EventMaxEnabledTokensUpdated = exports.EventExpirationDateUpdated = exports.EventIncreaseDebtForbiddenModeChanged = exports.EventLTUpdated = exports.EventNewConfigurator = exports.EventCreditFacadeUpgraded = exports.EventFeesUpdated = exports.EventLimitsUpdated = exports.EventTokenAllowedV2 = exports.EventTransferOwnership = exports.EventUnPausableAdminRemoved = exports.EventUnPausableAdminAdded = exports.EventPausableAdminRemoved = exports.EventPausableAdminAdded = exports.EventUnPaused = exports.EventPaused = exports.EventTakeForever = exports.EventNewPriceFeed = exports.EventNewWithdrawFee = exports.EventNewExpectedLiquidityLimit = exports.EventBorrowForbidden = exports.EventNewCreditManagerConnected = exports.EventNewInterestRateModel = exports.EventTransferPluginAllowed = exports.EventPriceOracleUpdated = exports.EventNewFastCheckParameters = exports.EventContractForbidden = exports.EventContractAllowed = exports.EventTokenForbidden = exports.EventTokenAllowed = exports.EventCMNewParameters = exports.EventIncreaseBorrowAmount = exports.EventAddCollateral = exports.EventRepayCreditAccount = exports.EventLiquidateCreditAccount = exports.EventCloseCreditAccount = exports.EventOpenCreditAccount = exports.EventRemoveLiquidity = exports.EventAddLiquidity = exports.EventParser = void 0;
19
- var ethers_1 = require("ethers");
20
- var contractsRegister_1 = require("../contracts/contractsRegister");
21
- var token_1 = require("../tokens/token");
22
- var formatter_1 = require("../utils/formatter");
23
- var constants_1 = require("./constants");
24
- var eventOrTx_1 = require("./eventOrTx");
25
- var EventParser = /** @class */ (function () {
26
- function EventParser() {
27
- }
28
- EventParser.serialize = function (items) {
29
- return JSON.stringify(items.map(function (i) { return i.serialize(); }));
30
- };
3
+ exports.EventEmergencyLiquidatorRemoved = exports.EventEmergencyLiquidatorAdded = exports.EventRemovedFromUpgradeable = exports.EventAddedToUpgradeable = exports.EventLimitPerBlockUpdated = exports.EventMaxEnabledTokensUpdated = exports.EventExpirationDateUpdated = exports.EventIncreaseDebtForbiddenModeChanged = exports.EventLTUpdated = exports.EventNewConfigurator = exports.EventCreditFacadeUpgraded = exports.EventFeesUpdated = exports.EventLimitsUpdated = exports.EventTokenAllowedV2 = exports.EventTransferOwnership = exports.EventUnPausableAdminRemoved = exports.EventUnPausableAdminAdded = exports.EventPausableAdminRemoved = exports.EventPausableAdminAdded = exports.EventUnPaused = exports.EventPaused = exports.EventTakeForever = exports.EventNewPriceFeed = exports.EventNewWithdrawFee = exports.EventNewExpectedLiquidityLimit = exports.EventBorrowForbidden = exports.EventNewCreditManagerConnected = exports.EventNewInterestRateModel = exports.EventTransferPluginAllowed = exports.EventPriceOracleUpdated = exports.EventNewFastCheckParameters = exports.EventContractForbidden = exports.EventContractAllowed = exports.EventTokenForbidden = exports.EventTokenAllowed = exports.EventCMNewParameters = exports.EventDecreaseBorrowAmount = exports.EventIncreaseBorrowAmount = exports.EventAddCollateral = exports.EventRepayCreditAccount = exports.EventLiquidateCreditAccount = exports.EventCloseCreditAccount = exports.EventOpenCreditAccount = exports.EventRemoveLiquidity = exports.EventAddLiquidity = exports.EventParser = void 0;
4
+ const contractsRegister_1 = require("../contracts/contractsRegister");
5
+ const token_1 = require("../tokens/token");
6
+ const formatter_1 = require("../utils/formatter");
7
+ const constants_1 = require("./constants");
8
+ const eventOrTx_1 = require("./eventOrTx");
9
+ class EventParser {
10
+ static serialize(items) {
11
+ return JSON.stringify(items.map(i => i.serialize()));
12
+ }
31
13
  // eslint-disable-next-line complexity
32
- EventParser.deserialize = function (data) {
33
- var params = data.content;
14
+ static deserialize(data) {
15
+ const params = data.content;
34
16
  switch (data.type) {
35
17
  case "EventAddLiquidity":
36
18
  return new EventAddLiquidity(params);
@@ -48,6 +30,8 @@ var EventParser = /** @class */ (function () {
48
30
  return new EventAddCollateral(params);
49
31
  case "EventIncreaseBorrowAmount":
50
32
  return new EventIncreaseBorrowAmount(params);
33
+ case "EventDecreaseBorrowAmount":
34
+ return new EventDecreaseBorrowAmount(params);
51
35
  case "EventCMNewParameters":
52
36
  return new EventCMNewParameters(params);
53
37
  case "EventTokenAllowed":
@@ -121,777 +105,793 @@ var EventParser = /** @class */ (function () {
121
105
  case "EventEmergencyLiquidatorRemoved":
122
106
  return new EventEmergencyLiquidatorRemoved(params);
123
107
  default:
124
- throw new Error("Unknown transaction for parsing ".concat(data.type));
108
+ throw new Error(`Unknown transaction for parsing ${data.type}`);
125
109
  }
126
- };
127
- EventParser.deserializeArray = function (data) {
128
- return data.map(function (e) { return EventParser.deserialize(e); });
129
- };
130
- return EventParser;
131
- }());
110
+ }
111
+ static deserializeArray(data) {
112
+ return data.map(e => EventParser.deserialize(e));
113
+ }
114
+ }
132
115
  exports.EventParser = EventParser;
133
- var EventAddLiquidity = /** @class */ (function (_super) {
134
- __extends(EventAddLiquidity, _super);
135
- function EventAddLiquidity(opts) {
136
- var _this = _super.call(this, opts) || this;
137
- _this.amount = ethers_1.BigNumber.from(opts.amount);
138
- _this.underlyingToken = opts.underlyingToken;
139
- _this.pool = opts.pool;
140
- return _this;
141
- }
142
- EventAddLiquidity.prototype.toString = function () {
143
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
144
- return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), ": Deposit ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol);
145
- };
146
- return EventAddLiquidity;
147
- }(eventOrTx_1.EVMEvent));
116
+ class EventAddLiquidity extends eventOrTx_1.EVMEvent {
117
+ amount;
118
+ underlyingToken;
119
+ pool;
120
+ constructor(opts) {
121
+ super(opts);
122
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
123
+ this.underlyingToken = opts.underlyingToken;
124
+ this.pool = opts.pool;
125
+ }
126
+ toString() {
127
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
128
+ return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: Deposit ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol}`;
129
+ }
130
+ }
148
131
  exports.EventAddLiquidity = EventAddLiquidity;
149
- var EventRemoveLiquidity = /** @class */ (function (_super) {
150
- __extends(EventRemoveLiquidity, _super);
151
- function EventRemoveLiquidity(opts) {
152
- var _this = _super.call(this, opts) || this;
153
- _this.amount = ethers_1.BigNumber.from(opts.amount);
154
- _this.underlyingToken = opts.underlyingToken;
155
- _this.dieselToken = opts.dieselToken;
156
- _this.pool = opts.pool;
157
- return _this;
158
- }
159
- EventRemoveLiquidity.prototype.toString = function () {
160
- var _a = (0, token_1.extractTokenData)(this.dieselToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
161
- return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), ": withdraw ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol);
162
- };
163
- return EventRemoveLiquidity;
164
- }(eventOrTx_1.EVMEvent));
132
+ class EventRemoveLiquidity extends eventOrTx_1.EVMEvent {
133
+ amount;
134
+ underlyingToken;
135
+ dieselToken;
136
+ pool;
137
+ constructor(opts) {
138
+ super(opts);
139
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
140
+ this.underlyingToken = opts.underlyingToken;
141
+ this.dieselToken = opts.dieselToken;
142
+ this.pool = opts.pool;
143
+ }
144
+ toString() {
145
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.dieselToken);
146
+ return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)}: withdraw ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol}`;
147
+ }
148
+ }
165
149
  exports.EventRemoveLiquidity = EventRemoveLiquidity;
166
- var EventOpenCreditAccount = /** @class */ (function (_super) {
167
- __extends(EventOpenCreditAccount, _super);
168
- function EventOpenCreditAccount(opts) {
169
- var _this = _super.call(this, opts) || this;
170
- _this.amount = ethers_1.BigNumber.from(opts.amount);
171
- _this.underlyingToken = opts.underlyingToken;
172
- _this.leverage = opts.leverage;
173
- _this.creditManager = opts.creditManager;
174
- return _this;
175
- }
176
- EventOpenCreditAccount.prototype.toString = function () {
177
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
178
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": open ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol, " x ").concat(this.leverage.toFixed(2), " \u21D2 \n ").concat((0, formatter_1.formatBN)(this.amount
179
- .mul(Math.floor(this.leverage + constants_1.LEVERAGE_DECIMALS))
180
- .div(constants_1.LEVERAGE_DECIMALS), decimals + 2), " ").concat(symbol);
181
- };
182
- return EventOpenCreditAccount;
183
- }(eventOrTx_1.EVMEvent));
150
+ class EventOpenCreditAccount extends eventOrTx_1.EVMEvent {
151
+ amount;
152
+ underlyingToken;
153
+ creditManager;
154
+ constructor(opts) {
155
+ super(opts);
156
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
157
+ this.underlyingToken = opts.underlyingToken;
158
+ this.creditManager = opts.creditManager;
159
+ }
160
+ toString() {
161
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
162
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: opened with debt ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol}`;
163
+ }
164
+ }
184
165
  exports.EventOpenCreditAccount = EventOpenCreditAccount;
185
- var EventCloseCreditAccount = /** @class */ (function (_super) {
186
- __extends(EventCloseCreditAccount, _super);
187
- function EventCloseCreditAccount(opts) {
188
- var _this = _super.call(this, opts) || this;
189
- _this.amount = ethers_1.BigNumber.from(opts.amount);
190
- _this.underlyingToken = opts.underlyingToken;
191
- _this.creditManager = opts.creditManager;
192
- return _this;
193
- }
194
- EventCloseCreditAccount.prototype.toString = function () {
195
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
196
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": was closed and got ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol, " as remaining funds");
197
- };
198
- return EventCloseCreditAccount;
199
- }(eventOrTx_1.EVMEvent));
166
+ class EventCloseCreditAccount extends eventOrTx_1.EVMEvent {
167
+ underlyingToken;
168
+ creditManager;
169
+ constructor(opts) {
170
+ super(opts);
171
+ this.underlyingToken = opts.underlyingToken;
172
+ this.creditManager = opts.creditManager;
173
+ }
174
+ toString() {
175
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: was closed`;
176
+ }
177
+ }
200
178
  exports.EventCloseCreditAccount = EventCloseCreditAccount;
201
- var EventLiquidateCreditAccount = /** @class */ (function (_super) {
202
- __extends(EventLiquidateCreditAccount, _super);
203
- function EventLiquidateCreditAccount(opts) {
204
- var _this = _super.call(this, opts) || this;
205
- _this.amount = ethers_1.BigNumber.from(opts.amount);
206
- _this.underlyingToken = opts.underlyingToken;
207
- _this.creditManager = opts.creditManager;
208
- return _this;
209
- }
210
- EventLiquidateCreditAccount.prototype.toString = function () {
211
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
212
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": was liquidated. ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol, " were paid back as remaining funds");
213
- };
214
- return EventLiquidateCreditAccount;
215
- }(eventOrTx_1.EVMEvent));
179
+ class EventLiquidateCreditAccount extends eventOrTx_1.EVMEvent {
180
+ amount;
181
+ underlyingToken;
182
+ creditManager;
183
+ constructor(opts) {
184
+ super(opts);
185
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
186
+ this.underlyingToken = opts.underlyingToken;
187
+ this.creditManager = opts.creditManager;
188
+ }
189
+ toString() {
190
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
191
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: was liquidated. ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol} were paid back as remaining funds`;
192
+ }
193
+ }
216
194
  exports.EventLiquidateCreditAccount = EventLiquidateCreditAccount;
217
- var EventRepayCreditAccount = /** @class */ (function (_super) {
218
- __extends(EventRepayCreditAccount, _super);
219
- function EventRepayCreditAccount(opts) {
220
- var _this = _super.call(this, opts) || this;
221
- _this.underlyingToken = opts.underlyingToken;
222
- _this.creditManager = opts.creditManager;
223
- return _this;
224
- }
225
- EventRepayCreditAccount.prototype.toString = function () {
226
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": was repaid");
227
- };
228
- return EventRepayCreditAccount;
229
- }(eventOrTx_1.EVMEvent));
195
+ class EventRepayCreditAccount extends eventOrTx_1.EVMEvent {
196
+ underlyingToken;
197
+ creditManager;
198
+ constructor(opts) {
199
+ super(opts);
200
+ this.underlyingToken = opts.underlyingToken;
201
+ this.creditManager = opts.creditManager;
202
+ }
203
+ toString() {
204
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: was repaid`;
205
+ }
206
+ }
230
207
  exports.EventRepayCreditAccount = EventRepayCreditAccount;
231
- var EventAddCollateral = /** @class */ (function (_super) {
232
- __extends(EventAddCollateral, _super);
233
- function EventAddCollateral(opts) {
234
- var _this = _super.call(this, opts) || this;
235
- _this.amount = ethers_1.BigNumber.from(opts.amount);
236
- _this.addedToken = opts.addedToken;
237
- _this.creditManager = opts.creditManager;
238
- return _this;
239
- }
240
- EventAddCollateral.prototype.toString = function () {
241
- var _a = (0, token_1.extractTokenData)(this.addedToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
242
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": added ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol, " as collateral");
243
- };
244
- return EventAddCollateral;
245
- }(eventOrTx_1.EVMEvent));
208
+ class EventAddCollateral extends eventOrTx_1.EVMEvent {
209
+ amount;
210
+ addedToken;
211
+ creditManager;
212
+ constructor(opts) {
213
+ super(opts);
214
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
215
+ this.addedToken = opts.addedToken;
216
+ this.creditManager = opts.creditManager;
217
+ }
218
+ toString() {
219
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.addedToken);
220
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: added ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol} as collateral`;
221
+ }
222
+ }
246
223
  exports.EventAddCollateral = EventAddCollateral;
247
- var EventIncreaseBorrowAmount = /** @class */ (function (_super) {
248
- __extends(EventIncreaseBorrowAmount, _super);
249
- function EventIncreaseBorrowAmount(opts) {
250
- var _this = _super.call(this, opts) || this;
251
- _this.amount = ethers_1.BigNumber.from(opts.amount);
252
- _this.underlyingToken = opts.underlyingToken;
253
- _this.creditManager = opts.creditManager;
254
- return _this;
255
- }
256
- EventIncreaseBorrowAmount.prototype.toString = function () {
257
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
258
- return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": borrowed amount was increased for ").concat((0, formatter_1.formatBN)(this.amount, decimals), " ").concat(symbol);
259
- };
260
- return EventIncreaseBorrowAmount;
261
- }(eventOrTx_1.EVMEvent));
224
+ class EventIncreaseBorrowAmount extends eventOrTx_1.EVMEvent {
225
+ amount;
226
+ underlyingToken;
227
+ creditManager;
228
+ constructor(opts) {
229
+ super(opts);
230
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
231
+ this.underlyingToken = opts.underlyingToken;
232
+ this.creditManager = opts.creditManager;
233
+ }
234
+ toString() {
235
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
236
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was increased for ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol}`;
237
+ }
238
+ }
262
239
  exports.EventIncreaseBorrowAmount = EventIncreaseBorrowAmount;
263
- var EventCMNewParameters = /** @class */ (function (_super) {
264
- __extends(EventCMNewParameters, _super);
265
- function EventCMNewParameters(opts) {
266
- var _this = _super.call(this, opts) || this;
267
- _this.creditManager = opts.creditManager;
268
- _this.underlyingToken = opts.underlyingToken;
269
- _this.minAmount = ethers_1.BigNumber.from(opts.minAmount);
270
- _this.maxAmount = ethers_1.BigNumber.from(opts.maxAmount);
271
- _this.maxLeverage = opts.maxLeverage;
272
- _this.feeInterest = opts.feeInterest;
273
- _this.feeLiquidation = opts.feeLiquidation;
274
- _this.liquidationDiscount = opts.liquidationDiscount;
275
- _this.prevMinAmount = ethers_1.BigNumber.from(opts.prevMinAmount);
276
- _this.prevMaxAmount = ethers_1.BigNumber.from(opts.prevMaxAmount);
277
- _this.prevMaxLeverage = opts.prevMaxLeverage;
278
- _this.prevFeeInterest = opts.prevFeeInterest;
279
- _this.prevFeeLiquidation = opts.prevFeeLiquidation;
280
- _this.prevLiquidationDiscount = opts.prevLiquidationDiscount;
281
- return _this;
282
- }
283
- EventCMNewParameters.prototype.toString = function () {
284
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
285
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ");
240
+ class EventDecreaseBorrowAmount extends eventOrTx_1.EVMEvent {
241
+ amount;
242
+ underlyingToken;
243
+ creditManager;
244
+ constructor(opts) {
245
+ super(opts);
246
+ this.amount = (0, formatter_1.toBigInt)(opts.amount || 0);
247
+ this.underlyingToken = opts.underlyingToken;
248
+ this.creditManager = opts.creditManager;
249
+ }
250
+ toString() {
251
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
252
+ return `Credit account ${(0, contractsRegister_1.getContractName)(this.creditManager)}: borrowed amount was decreased for ${(0, formatter_1.formatBN)(this.amount, decimals)} ${symbol}`;
253
+ }
254
+ }
255
+ exports.EventDecreaseBorrowAmount = EventDecreaseBorrowAmount;
256
+ class EventCMNewParameters extends eventOrTx_1.EVMEvent {
257
+ creditManager;
258
+ underlyingToken;
259
+ minAmount;
260
+ maxAmount;
261
+ maxLeverage;
262
+ feeInterest;
263
+ feeLiquidation;
264
+ liquidationDiscount;
265
+ prevMinAmount;
266
+ prevMaxAmount;
267
+ prevMaxLeverage;
268
+ prevFeeInterest;
269
+ prevFeeLiquidation;
270
+ prevLiquidationDiscount;
271
+ constructor(opts) {
272
+ super(opts);
273
+ this.creditManager = opts.creditManager;
274
+ this.underlyingToken = opts.underlyingToken;
275
+ this.minAmount = (0, formatter_1.toBigInt)(opts.minAmount || 0);
276
+ this.maxAmount = (0, formatter_1.toBigInt)(opts.maxAmount || 0);
277
+ this.maxLeverage = opts.maxLeverage;
278
+ this.feeInterest = opts.feeInterest;
279
+ this.feeLiquidation = opts.feeLiquidation;
280
+ this.liquidationDiscount = opts.liquidationDiscount;
281
+ this.prevMinAmount = (0, formatter_1.toBigInt)(opts.prevMinAmount || 0);
282
+ this.prevMaxAmount = (0, formatter_1.toBigInt)(opts.prevMaxAmount || 0);
283
+ this.prevMaxLeverage = opts.prevMaxLeverage;
284
+ this.prevFeeInterest = opts.prevFeeInterest;
285
+ this.prevFeeLiquidation = opts.prevFeeLiquidation;
286
+ this.prevLiquidationDiscount = opts.prevLiquidationDiscount;
287
+ }
288
+ toString() {
289
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
290
+ let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
286
291
  if (this.minAmount !== this.prevMinAmount) {
287
- msg += "min amount: ".concat((0, formatter_1.formatBN)(this.prevMinAmount, decimals), " => ").concat((0, formatter_1.formatBN)(this.minAmount, decimals), " ").concat(symbol, ", ");
292
+ msg += `min amount: ${(0, formatter_1.formatBN)(this.prevMinAmount, decimals)} => ${(0, formatter_1.formatBN)(this.minAmount, decimals)} ${symbol}, `;
288
293
  }
289
294
  if (this.maxAmount !== this.prevMaxAmount) {
290
- msg += "max amount: ".concat((0, formatter_1.formatBN)(this.prevMaxAmount, decimals), " => ").concat((0, formatter_1.formatBN)(this.maxAmount, decimals), " ").concat(symbol, ", ");
295
+ msg += `max amount: ${(0, formatter_1.formatBN)(this.prevMaxAmount, decimals)} => ${(0, formatter_1.formatBN)(this.maxAmount, decimals)} ${symbol}, `;
291
296
  }
292
297
  if (this.maxLeverage !== this.prevMaxLeverage) {
293
- msg += "max leverage: ".concat(this.prevMaxLeverage / constants_1.LEVERAGE_DECIMALS + 1, " => ").concat(this.maxLeverage / constants_1.LEVERAGE_DECIMALS + 1, ", ");
298
+ msg += `max leverage: ${this.prevMaxLeverage / Number(constants_1.LEVERAGE_DECIMALS) + 1} => ${this.maxLeverage / Number(constants_1.LEVERAGE_DECIMALS) + 1}, `;
294
299
  }
295
300
  if (this.feeInterest !== this.prevFeeInterest) {
296
- msg += "interest fee: ".concat(this.prevFeeInterest / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeInterest / constants_1.PERCENTAGE_DECIMALS, "%, ");
301
+ msg += `interest fee: ${this.prevFeeInterest / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.feeInterest / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
297
302
  }
298
303
  if (this.feeLiquidation !== this.prevFeeLiquidation) {
299
- msg += "liquidation fee: ".concat(this.prevFeeLiquidation / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeLiquidation / constants_1.PERCENTAGE_DECIMALS, "%, ");
304
+ msg += `liquidation fee: ${this.prevFeeLiquidation / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.feeLiquidation / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
300
305
  }
301
306
  if (this.liquidationDiscount !== this.prevLiquidationDiscount) {
302
- msg += "liquidation premium: ".concat(constants_1.PERCENTAGE_DECIMALS - this.prevLiquidationDiscount / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(constants_1.PERCENTAGE_DECIMALS - this.liquidationDiscount / constants_1.PERCENTAGE_DECIMALS, "%, ");
307
+ msg += `liquidation premium: ${Number(constants_1.PERCENTAGE_DECIMALS) -
308
+ this.prevLiquidationDiscount / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${Number(constants_1.PERCENTAGE_DECIMALS) -
309
+ this.liquidationDiscount / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
303
310
  }
304
311
  return msg.slice(0, msg.length - 2);
305
- };
306
- return EventCMNewParameters;
307
- }(eventOrTx_1.EVMEvent));
312
+ }
313
+ }
308
314
  exports.EventCMNewParameters = EventCMNewParameters;
309
- var EventTokenAllowed = /** @class */ (function (_super) {
310
- __extends(EventTokenAllowed, _super);
311
- function EventTokenAllowed(opts) {
312
- var _this = _super.call(this, opts) || this;
313
- _this.creditManager = opts.creditManager;
314
- _this.token = opts.token;
315
- _this.liquidityThreshold = opts.liquidityThreshold;
316
- _this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
317
- _this.status = opts.status;
318
- return _this;
319
- }
320
- EventTokenAllowed.prototype.toString = function () {
321
- var symbol = (0, token_1.extractTokenData)(this.token)[0];
322
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated ");
315
+ class EventTokenAllowed extends eventOrTx_1.EVMEvent {
316
+ creditManager;
317
+ token;
318
+ liquidityThreshold;
319
+ prevLiquidationThreshold;
320
+ status;
321
+ constructor(opts) {
322
+ super(opts);
323
+ this.creditManager = opts.creditManager;
324
+ this.token = opts.token;
325
+ this.liquidityThreshold = opts.liquidityThreshold;
326
+ this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
327
+ this.status = opts.status;
328
+ }
329
+ toString() {
330
+ const [symbol] = (0, token_1.extractTokenData)(this.token);
331
+ const msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated `;
323
332
  switch (this.status) {
324
333
  case "NewToken":
325
- return "".concat(msg, ": New token allowed: ").concat(symbol, ", liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
334
+ return `${msg}: New token allowed: ${symbol}, liquidation threshold: ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
326
335
  case "Allowed":
327
- return "".concat(msg, ": ").concat(symbol, " is allowed now, liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
336
+ return `${msg}: ${symbol} is allowed now, liquidation threshold: ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
328
337
  case "LTUpdated":
329
- return "".concat(msg, ": ").concat(symbol, " liquidation threshold: ").concat((this.prevLiquidationThreshold || 0) / constants_1.PERCENTAGE_DECIMALS, " => ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
338
+ return `${msg}: ${symbol} liquidation threshold: ${(this.prevLiquidationThreshold || 0) / Number(constants_1.PERCENTAGE_DECIMALS)} => ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
330
339
  default:
331
340
  return "Error: TokenAllowedProps";
332
341
  }
333
- };
334
- return EventTokenAllowed;
335
- }(eventOrTx_1.EVMEvent));
342
+ }
343
+ }
336
344
  exports.EventTokenAllowed = EventTokenAllowed;
337
- var EventTokenForbidden = /** @class */ (function (_super) {
338
- __extends(EventTokenForbidden, _super);
339
- function EventTokenForbidden(opts) {
340
- var _this = _super.call(this, opts) || this;
341
- _this.creditManager = opts.creditManager;
342
- _this.token = opts.token;
343
- return _this;
344
- }
345
- EventTokenForbidden.prototype.toString = function () {
346
- var symbol = (0, token_1.extractTokenData)(this.token)[0];
347
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated ").concat(symbol, " forbidden");
348
- };
349
- return EventTokenForbidden;
350
- }(eventOrTx_1.EVMEvent));
345
+ class EventTokenForbidden extends eventOrTx_1.EVMEvent {
346
+ creditManager;
347
+ token;
348
+ constructor(opts) {
349
+ super(opts);
350
+ this.creditManager = opts.creditManager;
351
+ this.token = opts.token;
352
+ }
353
+ toString() {
354
+ const [symbol] = (0, token_1.extractTokenData)(this.token);
355
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated ${symbol} forbidden`;
356
+ }
357
+ }
351
358
  exports.EventTokenForbidden = EventTokenForbidden;
352
- var EventContractAllowed = /** @class */ (function (_super) {
353
- __extends(EventContractAllowed, _super);
354
- function EventContractAllowed(opts) {
355
- var _this = _super.call(this, opts) || this;
356
- _this.creditManager = opts.creditManager;
357
- _this.protocol = opts.protocol;
358
- _this.adapter = opts.adapter;
359
- _this.status = opts.status;
360
- return _this;
361
- }
362
- EventContractAllowed.prototype.toString = function () {
363
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated");
359
+ class EventContractAllowed extends eventOrTx_1.EVMEvent {
360
+ creditManager;
361
+ protocol;
362
+ adapter;
363
+ status;
364
+ constructor(opts) {
365
+ super(opts);
366
+ this.creditManager = opts.creditManager;
367
+ this.protocol = opts.protocol;
368
+ this.adapter = opts.adapter;
369
+ this.status = opts.status;
370
+ }
371
+ toString() {
372
+ const msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated`;
364
373
  switch (this.status) {
365
374
  case "Connected":
366
- return "".concat(msg, " : ").concat((0, contractsRegister_1.getContractName)(this.protocol), " was connected. Adapter at: ").concat(this.adapter);
375
+ return `${msg} : ${(0, contractsRegister_1.getContractName)(this.protocol)} was connected. Adapter at: ${this.adapter}`;
367
376
  case "AdapterUpdate":
368
- return "".concat(msg, " : ").concat((0, contractsRegister_1.getContractName)(this.protocol), " adapter was updated. New adapter: ").concat(this.adapter);
377
+ return `${msg} : ${(0, contractsRegister_1.getContractName)(this.protocol)} adapter was updated. New adapter: ${this.adapter}`;
369
378
  default:
370
379
  return "Error: EventContractAllowed";
371
380
  }
372
- };
373
- return EventContractAllowed;
374
- }(eventOrTx_1.EVMEvent));
381
+ }
382
+ }
375
383
  exports.EventContractAllowed = EventContractAllowed;
376
- var EventContractForbidden = /** @class */ (function (_super) {
377
- __extends(EventContractForbidden, _super);
378
- function EventContractForbidden(opts) {
379
- var _this = _super.call(this, opts) || this;
380
- _this.creditManager = opts.creditManager;
381
- _this.protocol = opts.protocol;
382
- return _this;
383
- }
384
- EventContractForbidden.prototype.toString = function () {
385
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ").concat((0, contractsRegister_1.getContractName)(this.protocol));
386
- };
387
- return EventContractForbidden;
388
- }(eventOrTx_1.EVMEvent));
384
+ class EventContractForbidden extends eventOrTx_1.EVMEvent {
385
+ creditManager;
386
+ protocol;
387
+ constructor(opts) {
388
+ super(opts);
389
+ this.creditManager = opts.creditManager;
390
+ this.protocol = opts.protocol;
391
+ }
392
+ toString() {
393
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: ${(0, contractsRegister_1.getContractName)(this.protocol)}`;
394
+ }
395
+ }
389
396
  exports.EventContractForbidden = EventContractForbidden;
390
- var EventNewFastCheckParameters = /** @class */ (function (_super) {
391
- __extends(EventNewFastCheckParameters, _super);
392
- function EventNewFastCheckParameters(opts) {
393
- var _this = _super.call(this, opts) || this;
394
- _this.creditManager = opts.creditManager;
395
- _this.chiThreshold = opts.chiThreshold;
396
- _this.fastCheckDelay = opts.fastCheckDelay;
397
- _this.prevChiThreshold = opts.prevChiThreshold;
398
- _this.prevFastCheckDelay = opts.prevFastCheckDelay;
399
- return _this;
400
- }
401
- EventNewFastCheckParameters.prototype.toString = function () {
402
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ");
397
+ class EventNewFastCheckParameters extends eventOrTx_1.EVMEvent {
398
+ creditManager;
399
+ chiThreshold;
400
+ fastCheckDelay;
401
+ prevChiThreshold;
402
+ prevFastCheckDelay;
403
+ constructor(opts) {
404
+ super(opts);
405
+ this.creditManager = opts.creditManager;
406
+ this.chiThreshold = opts.chiThreshold;
407
+ this.fastCheckDelay = opts.fastCheckDelay;
408
+ this.prevChiThreshold = opts.prevChiThreshold;
409
+ this.prevFastCheckDelay = opts.prevFastCheckDelay;
410
+ }
411
+ toString() {
412
+ let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
403
413
  if (this.chiThreshold !== this.prevChiThreshold) {
404
- msg += "Chi threshold: ".concat(this.prevChiThreshold, " => ").concat(this.chiThreshold, ", ");
414
+ msg += `Chi threshold: ${this.prevChiThreshold} => ${this.chiThreshold}, `;
405
415
  }
406
416
  if (this.fastCheckDelay !== this.prevFastCheckDelay) {
407
- msg += "fast check delay: ".concat(this.prevFastCheckDelay, " => ").concat(this.fastCheckDelay, ", ");
417
+ msg += `fast check delay: ${this.prevFastCheckDelay} => ${this.fastCheckDelay}, `;
408
418
  }
409
419
  return msg.slice(0, msg.length - 2);
410
- };
411
- return EventNewFastCheckParameters;
412
- }(eventOrTx_1.EVMEvent));
420
+ }
421
+ }
413
422
  exports.EventNewFastCheckParameters = EventNewFastCheckParameters;
414
- var EventPriceOracleUpdated = /** @class */ (function (_super) {
415
- __extends(EventPriceOracleUpdated, _super);
416
- function EventPriceOracleUpdated(opts) {
417
- var _this = _super.call(this, opts) || this;
418
- _this.creditManager = opts.creditManager;
419
- _this.priceOracle = opts.priceOracle;
420
- return _this;
421
- }
422
- EventPriceOracleUpdated.prototype.toString = function () {
423
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: price oracle was updated. New price oracle ").concat((0, contractsRegister_1.getContractName)(this.priceOracle));
424
- };
425
- return EventPriceOracleUpdated;
426
- }(eventOrTx_1.EVMEvent));
423
+ class EventPriceOracleUpdated extends eventOrTx_1.EVMEvent {
424
+ creditManager;
425
+ priceOracle;
426
+ constructor(opts) {
427
+ super(opts);
428
+ this.creditManager = opts.creditManager;
429
+ this.priceOracle = opts.priceOracle;
430
+ }
431
+ toString() {
432
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: price oracle was updated. New price oracle ${(0, contractsRegister_1.getContractName)(this.priceOracle)}`;
433
+ }
434
+ }
427
435
  exports.EventPriceOracleUpdated = EventPriceOracleUpdated;
428
- var EventTransferPluginAllowed = /** @class */ (function (_super) {
429
- __extends(EventTransferPluginAllowed, _super);
430
- function EventTransferPluginAllowed(opts) {
431
- var _this = _super.call(this, opts) || this;
432
- _this.creditManager = opts.creditManager;
433
- _this.plugin = opts.priceOracle;
434
- _this.state = opts.state;
435
- return _this;
436
- }
437
- EventTransferPluginAllowed.prototype.toString = function () {
438
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: transfer plugin ").concat((0, contractsRegister_1.getContractName)(this.plugin), " was ").concat(this.state ? "allowed" : "forbidden");
439
- };
440
- return EventTransferPluginAllowed;
441
- }(eventOrTx_1.EVMEvent));
436
+ class EventTransferPluginAllowed extends eventOrTx_1.EVMEvent {
437
+ creditManager;
438
+ plugin;
439
+ state;
440
+ constructor(opts) {
441
+ super(opts);
442
+ this.creditManager = opts.creditManager;
443
+ this.plugin = opts.priceOracle;
444
+ this.state = opts.state;
445
+ }
446
+ toString() {
447
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: transfer plugin ${(0, contractsRegister_1.getContractName)(this.plugin)} was ${this.state ? "allowed" : "forbidden"}`;
448
+ }
449
+ }
442
450
  exports.EventTransferPluginAllowed = EventTransferPluginAllowed;
443
- var EventNewInterestRateModel = /** @class */ (function (_super) {
444
- __extends(EventNewInterestRateModel, _super);
445
- function EventNewInterestRateModel(opts) {
446
- var _this = _super.call(this, opts) || this;
447
- _this.pool = opts.pool;
448
- _this.newInterestRateModel = opts.newInterestRateModel;
449
- return _this;
450
- }
451
- EventNewInterestRateModel.prototype.toString = function () {
452
- return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: interest rate model was updated. New model: ").concat((0, contractsRegister_1.getContractName)(this.newInterestRateModel));
453
- };
454
- return EventNewInterestRateModel;
455
- }(eventOrTx_1.EVMEvent));
451
+ class EventNewInterestRateModel extends eventOrTx_1.EVMEvent {
452
+ pool;
453
+ newInterestRateModel;
454
+ constructor(opts) {
455
+ super(opts);
456
+ this.pool = opts.pool;
457
+ this.newInterestRateModel = opts.newInterestRateModel;
458
+ }
459
+ toString() {
460
+ return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: interest rate model was updated. New model: ${(0, contractsRegister_1.getContractName)(this.newInterestRateModel)}`;
461
+ }
462
+ }
456
463
  exports.EventNewInterestRateModel = EventNewInterestRateModel;
457
- var EventNewCreditManagerConnected = /** @class */ (function (_super) {
458
- __extends(EventNewCreditManagerConnected, _super);
459
- function EventNewCreditManagerConnected(opts) {
460
- var _this = _super.call(this, opts) || this;
461
- _this.pool = opts.pool;
462
- _this.creditManager = opts.creditManager;
463
- return _this;
464
- }
465
- EventNewCreditManagerConnected.prototype.toString = function () {
466
- return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: new credit manager ").concat((0, contractsRegister_1.getContractName)(this.creditManager), " was connected");
467
- };
468
- return EventNewCreditManagerConnected;
469
- }(eventOrTx_1.EVMEvent));
464
+ class EventNewCreditManagerConnected extends eventOrTx_1.EVMEvent {
465
+ pool;
466
+ creditManager;
467
+ constructor(opts) {
468
+ super(opts);
469
+ this.pool = opts.pool;
470
+ this.creditManager = opts.creditManager;
471
+ }
472
+ toString() {
473
+ return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: new credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} was connected`;
474
+ }
475
+ }
470
476
  exports.EventNewCreditManagerConnected = EventNewCreditManagerConnected;
471
- var EventBorrowForbidden = /** @class */ (function (_super) {
472
- __extends(EventBorrowForbidden, _super);
473
- function EventBorrowForbidden(opts) {
474
- var _this = _super.call(this, opts) || this;
475
- _this.pool = opts.pool;
476
- _this.creditManager = opts.creditManager;
477
- return _this;
478
- }
479
- EventBorrowForbidden.prototype.toString = function () {
480
- return "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: credit manager ").concat((0, contractsRegister_1.getContractName)(this.creditManager), " was forbidden to borrow");
481
- };
482
- return EventBorrowForbidden;
483
- }(eventOrTx_1.EVMEvent));
477
+ class EventBorrowForbidden extends eventOrTx_1.EVMEvent {
478
+ pool;
479
+ creditManager;
480
+ constructor(opts) {
481
+ super(opts);
482
+ this.pool = opts.pool;
483
+ this.creditManager = opts.creditManager;
484
+ }
485
+ toString() {
486
+ return `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} was forbidden to borrow`;
487
+ }
488
+ }
484
489
  exports.EventBorrowForbidden = EventBorrowForbidden;
485
- var EventNewExpectedLiquidityLimit = /** @class */ (function (_super) {
486
- __extends(EventNewExpectedLiquidityLimit, _super);
487
- function EventNewExpectedLiquidityLimit(opts) {
488
- var _this = _super.call(this, opts) || this;
489
- _this.pool = opts.pool;
490
- _this.underlyingToken = opts.underlyingToken;
491
- _this.newLimit = ethers_1.BigNumber.from(opts.newLimit);
492
- _this.prevLimit = ethers_1.BigNumber.from(opts.oldLimit);
493
- return _this;
494
- }
495
- EventNewExpectedLiquidityLimit.prototype.toString = function () {
496
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
497
- return this.prevLimit.isZero()
498
- ? "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: expected liquidity limit was set to ").concat((0, formatter_1.formatBN)(this.newLimit, decimals), " ").concat(symbol)
499
- : "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: expected liquidity limit was ").concat(this.newLimit.gt(this.prevLimit) ? "increased" : "decreased", ": ").concat((0, formatter_1.formatBN)(this.prevLimit, decimals), " ").concat(symbol, " => ").concat((0, formatter_1.formatBN)(this.newLimit, decimals), " ").concat(symbol);
500
- };
501
- return EventNewExpectedLiquidityLimit;
502
- }(eventOrTx_1.EVMEvent));
490
+ class EventNewExpectedLiquidityLimit extends eventOrTx_1.EVMEvent {
491
+ pool;
492
+ underlyingToken;
493
+ newLimit;
494
+ prevLimit;
495
+ constructor(opts) {
496
+ super(opts);
497
+ this.pool = opts.pool;
498
+ this.underlyingToken = opts.underlyingToken;
499
+ this.newLimit = (0, formatter_1.toBigInt)(opts.newLimit || 0);
500
+ this.prevLimit = (0, formatter_1.toBigInt)(opts.oldLimit || 0);
501
+ }
502
+ toString() {
503
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
504
+ return this.prevLimit === 0n
505
+ ? `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was set to ${(0, formatter_1.formatBN)(this.newLimit, decimals)} ${symbol}`
506
+ : `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: expected liquidity limit was ${this.newLimit > this.prevLimit ? "increased" : "decreased"}: ${(0, formatter_1.formatBN)(this.prevLimit, decimals)} ${symbol} => ${(0, formatter_1.formatBN)(this.newLimit, decimals)} ${symbol}`;
507
+ }
508
+ }
503
509
  exports.EventNewExpectedLiquidityLimit = EventNewExpectedLiquidityLimit;
504
- var EventNewWithdrawFee = /** @class */ (function (_super) {
505
- __extends(EventNewWithdrawFee, _super);
506
- function EventNewWithdrawFee(opts) {
507
- var _this = _super.call(this, opts) || this;
508
- _this.pool = opts.pool;
509
- _this.underlyingToken = opts.underlyingToken;
510
- _this.newFee = Number(opts.newFee);
511
- _this.prevFee = Number(opts.oldFee);
512
- return _this;
513
- }
514
- EventNewWithdrawFee.prototype.toString = function () {
510
+ class EventNewWithdrawFee extends eventOrTx_1.EVMEvent {
511
+ pool;
512
+ underlyingToken;
513
+ newFee;
514
+ prevFee;
515
+ constructor(opts) {
516
+ super(opts);
517
+ this.pool = opts.pool;
518
+ this.underlyingToken = opts.underlyingToken;
519
+ this.newFee = Number(opts.newFee);
520
+ this.prevFee = Number(opts.oldFee);
521
+ }
522
+ toString() {
515
523
  return this.prevFee === 0
516
- ? "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was set to: ").concat(this.newFee / constants_1.PERCENTAGE_DECIMALS, "%")
517
- : "Pool ".concat((0, contractsRegister_1.getContractName)(this.pool), " updated: withdraw fee was ").concat(this.newFee > this.prevFee ? "increased" : "decreased", ": ").concat(this.prevFee / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.newFee / constants_1.PERCENTAGE_DECIMALS, "%");
518
- };
519
- return EventNewWithdrawFee;
520
- }(eventOrTx_1.EVMEvent));
524
+ ? `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: withdraw fee was set to: ${this.newFee / Number(constants_1.PERCENTAGE_DECIMALS)}%`
525
+ : `Pool ${(0, contractsRegister_1.getContractName)(this.pool)} updated: withdraw fee was ${this.newFee > this.prevFee ? "increased" : "decreased"}: ${this.prevFee / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.newFee / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
526
+ }
527
+ }
521
528
  exports.EventNewWithdrawFee = EventNewWithdrawFee;
522
- var EventNewPriceFeed = /** @class */ (function (_super) {
523
- __extends(EventNewPriceFeed, _super);
524
- function EventNewPriceFeed(opts) {
525
- var _this = _super.call(this, opts) || this;
526
- _this.token = opts.token;
527
- _this.priceFeed = opts.priceFeed;
528
- return _this;
529
- }
530
- EventNewPriceFeed.prototype.toString = function () {
531
- var symbol = (0, token_1.extractTokenData)(this.token)[0];
532
- return "PriceOracle: oracle for ".concat(symbol, " was updated to ").concat((0, contractsRegister_1.getContractName)(this.priceFeed));
533
- };
534
- return EventNewPriceFeed;
535
- }(eventOrTx_1.EVMEvent));
529
+ class EventNewPriceFeed extends eventOrTx_1.EVMEvent {
530
+ token;
531
+ priceFeed;
532
+ constructor(opts) {
533
+ super(opts);
534
+ this.token = opts.token;
535
+ this.priceFeed = opts.priceFeed;
536
+ }
537
+ toString() {
538
+ const [symbol] = (0, token_1.extractTokenData)(this.token);
539
+ return `PriceOracle: oracle for ${symbol} was updated to ${(0, contractsRegister_1.getContractName)(this.priceFeed)}`;
540
+ }
541
+ }
536
542
  exports.EventNewPriceFeed = EventNewPriceFeed;
537
- var EventTakeForever = /** @class */ (function (_super) {
538
- __extends(EventTakeForever, _super);
539
- function EventTakeForever(opts) {
540
- var _this = _super.call(this, opts) || this;
541
- _this.creditAccount = opts.creditAccount;
542
- _this.to = opts.to;
543
- return _this;
544
- }
545
- EventTakeForever.prototype.toString = function () {
546
- return "AccountFactory: account ".concat(this.creditAccount, " was taken forever and transferred to ").concat(this.to);
547
- };
548
- return EventTakeForever;
549
- }(eventOrTx_1.EVMEvent));
543
+ class EventTakeForever extends eventOrTx_1.EVMEvent {
544
+ creditAccount;
545
+ to;
546
+ constructor(opts) {
547
+ super(opts);
548
+ this.creditAccount = opts.creditAccount;
549
+ this.to = opts.to;
550
+ }
551
+ toString() {
552
+ return `AccountFactory: account ${this.creditAccount} was taken forever and transferred to ${this.to}`;
553
+ }
554
+ }
550
555
  exports.EventTakeForever = EventTakeForever;
551
- var EventPaused = /** @class */ (function (_super) {
552
- __extends(EventPaused, _super);
553
- function EventPaused(opts) {
554
- var _this = _super.call(this, opts) || this;
555
- _this.contract = opts.contract;
556
- return _this;
557
- }
558
- EventPaused.prototype.toString = function () {
559
- return "".concat((0, contractsRegister_1.getContractName)(this.contract), " was paused");
560
- };
561
- return EventPaused;
562
- }(eventOrTx_1.EVMEvent));
556
+ class EventPaused extends eventOrTx_1.EVMEvent {
557
+ contract;
558
+ constructor(opts) {
559
+ super(opts);
560
+ this.contract = opts.contract;
561
+ }
562
+ toString() {
563
+ return `${(0, contractsRegister_1.getContractName)(this.contract)} was paused`;
564
+ }
565
+ }
563
566
  exports.EventPaused = EventPaused;
564
- var EventUnPaused = /** @class */ (function (_super) {
565
- __extends(EventUnPaused, _super);
566
- function EventUnPaused(opts) {
567
- var _this = _super.call(this, opts) || this;
568
- _this.contract = opts.contract;
569
- return _this;
570
- }
571
- EventUnPaused.prototype.toString = function () {
572
- return "".concat((0, contractsRegister_1.getContractName)(this.contract), " was unpaused");
573
- };
574
- return EventUnPaused;
575
- }(eventOrTx_1.EVMEvent));
567
+ class EventUnPaused extends eventOrTx_1.EVMEvent {
568
+ contract;
569
+ constructor(opts) {
570
+ super(opts);
571
+ this.contract = opts.contract;
572
+ }
573
+ toString() {
574
+ return `${(0, contractsRegister_1.getContractName)(this.contract)} was unpaused`;
575
+ }
576
+ }
576
577
  exports.EventUnPaused = EventUnPaused;
577
- var EventPausableAdminAdded = /** @class */ (function (_super) {
578
- __extends(EventPausableAdminAdded, _super);
579
- function EventPausableAdminAdded(opts) {
580
- var _this = _super.call(this, opts) || this;
581
- _this.admin = opts.admin;
582
- return _this;
583
- }
584
- EventPausableAdminAdded.prototype.toString = function () {
585
- return "ACL: pausable admin ".concat(this.admin, " was added");
586
- };
587
- return EventPausableAdminAdded;
588
- }(eventOrTx_1.EVMEvent));
578
+ class EventPausableAdminAdded extends eventOrTx_1.EVMEvent {
579
+ admin;
580
+ constructor(opts) {
581
+ super(opts);
582
+ this.admin = opts.admin;
583
+ }
584
+ toString() {
585
+ return `ACL: pausable admin ${this.admin} was added`;
586
+ }
587
+ }
589
588
  exports.EventPausableAdminAdded = EventPausableAdminAdded;
590
- var EventPausableAdminRemoved = /** @class */ (function (_super) {
591
- __extends(EventPausableAdminRemoved, _super);
592
- function EventPausableAdminRemoved(opts) {
593
- var _this = _super.call(this, opts) || this;
594
- _this.admin = opts.admin;
595
- return _this;
596
- }
597
- EventPausableAdminRemoved.prototype.toString = function () {
598
- return "ACL: pausable admin ".concat(this.admin, " was removed");
599
- };
600
- return EventPausableAdminRemoved;
601
- }(eventOrTx_1.EVMEvent));
589
+ class EventPausableAdminRemoved extends eventOrTx_1.EVMEvent {
590
+ admin;
591
+ constructor(opts) {
592
+ super(opts);
593
+ this.admin = opts.admin;
594
+ }
595
+ toString() {
596
+ return `ACL: pausable admin ${this.admin} was removed`;
597
+ }
598
+ }
602
599
  exports.EventPausableAdminRemoved = EventPausableAdminRemoved;
603
- var EventUnPausableAdminAdded = /** @class */ (function (_super) {
604
- __extends(EventUnPausableAdminAdded, _super);
605
- function EventUnPausableAdminAdded(opts) {
606
- var _this = _super.call(this, opts) || this;
607
- _this.admin = opts.admin;
608
- return _this;
609
- }
610
- EventUnPausableAdminAdded.prototype.toString = function () {
611
- return "ACL: unpausable admin ".concat(this.admin, " was added");
612
- };
613
- return EventUnPausableAdminAdded;
614
- }(eventOrTx_1.EVMEvent));
600
+ class EventUnPausableAdminAdded extends eventOrTx_1.EVMEvent {
601
+ admin;
602
+ constructor(opts) {
603
+ super(opts);
604
+ this.admin = opts.admin;
605
+ }
606
+ toString() {
607
+ return `ACL: unpausable admin ${this.admin} was added`;
608
+ }
609
+ }
615
610
  exports.EventUnPausableAdminAdded = EventUnPausableAdminAdded;
616
- var EventUnPausableAdminRemoved = /** @class */ (function (_super) {
617
- __extends(EventUnPausableAdminRemoved, _super);
618
- function EventUnPausableAdminRemoved(opts) {
619
- var _this = _super.call(this, opts) || this;
620
- _this.admin = opts.admin;
621
- return _this;
622
- }
623
- EventUnPausableAdminRemoved.prototype.toString = function () {
624
- return "ACL: unpausable admin ".concat(this.admin, " was removed");
625
- };
626
- return EventUnPausableAdminRemoved;
627
- }(eventOrTx_1.EVMEvent));
611
+ class EventUnPausableAdminRemoved extends eventOrTx_1.EVMEvent {
612
+ admin;
613
+ constructor(opts) {
614
+ super(opts);
615
+ this.admin = opts.admin;
616
+ }
617
+ toString() {
618
+ return `ACL: unpausable admin ${this.admin} was removed`;
619
+ }
620
+ }
628
621
  exports.EventUnPausableAdminRemoved = EventUnPausableAdminRemoved;
629
622
  // ACL: Transfer ownership
630
- var EventTransferOwnership = /** @class */ (function (_super) {
631
- __extends(EventTransferOwnership, _super);
632
- function EventTransferOwnership(opts) {
633
- var _this = _super.call(this, opts) || this;
634
- _this.newOwner = opts.admin;
635
- return _this;
636
- }
637
- EventTransferOwnership.prototype.toString = function () {
638
- return "ACL: configurator was changed to ".concat(this.newOwner);
639
- };
640
- return EventTransferOwnership;
641
- }(eventOrTx_1.EVMEvent));
623
+ class EventTransferOwnership extends eventOrTx_1.EVMEvent {
624
+ newOwner;
625
+ constructor(opts) {
626
+ super(opts);
627
+ this.newOwner = opts.admin;
628
+ }
629
+ toString() {
630
+ return `ACL: configurator was changed to ${this.newOwner}`;
631
+ }
632
+ }
642
633
  exports.EventTransferOwnership = EventTransferOwnership;
643
- var EventTokenAllowedV2 = /** @class */ (function (_super) {
644
- __extends(EventTokenAllowedV2, _super);
645
- function EventTokenAllowedV2(opts) {
646
- var _this = _super.call(this, opts) || this;
647
- _this.creditManager = opts.creditManager;
648
- _this.token = opts.token;
649
- _this.liquidityThreshold = opts.liquidityThreshold;
650
- _this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
651
- _this.status = opts.status;
652
- return _this;
653
- }
654
- EventTokenAllowedV2.prototype.toString = function () {
655
- var symbol = (0, token_1.extractTokenData)(this.token)[0];
656
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated ");
634
+ class EventTokenAllowedV2 extends eventOrTx_1.EVMEvent {
635
+ creditManager;
636
+ token;
637
+ liquidityThreshold;
638
+ prevLiquidationThreshold;
639
+ status;
640
+ constructor(opts) {
641
+ super(opts);
642
+ this.creditManager = opts.creditManager;
643
+ this.token = opts.token;
644
+ this.liquidityThreshold = opts.liquidityThreshold;
645
+ this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
646
+ this.status = opts.status;
647
+ }
648
+ toString() {
649
+ const [symbol] = (0, token_1.extractTokenData)(this.token);
650
+ const msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated `;
657
651
  switch (this.status) {
658
652
  case "NewToken":
659
- return "".concat(msg, ": New token allowed: ").concat(symbol, ", liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
653
+ return `${msg}: New token allowed: ${symbol}, liquidation threshold: ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
660
654
  case "Allowed":
661
- return "".concat(msg, ": ").concat(symbol, " is allowed now, liquidation threshold: ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
655
+ return `${msg}: ${symbol} is allowed now, liquidation threshold: ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
662
656
  case "LTUpdated":
663
- return "".concat(msg, ": ").concat(symbol, " liquidation threshold: ").concat((this.prevLiquidationThreshold || 0) / constants_1.PERCENTAGE_DECIMALS, " => ").concat(this.liquidityThreshold / constants_1.PERCENTAGE_DECIMALS, "%");
657
+ return `${msg}: ${symbol} liquidation threshold: ${(this.prevLiquidationThreshold || 0) / Number(constants_1.PERCENTAGE_DECIMALS)} => ${this.liquidityThreshold / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
664
658
  default:
665
659
  return "Error: TokenAllowedV2Props";
666
660
  }
667
- };
668
- return EventTokenAllowedV2;
669
- }(eventOrTx_1.EVMEvent));
661
+ }
662
+ }
670
663
  exports.EventTokenAllowedV2 = EventTokenAllowedV2;
671
- var EventLimitsUpdated = /** @class */ (function (_super) {
672
- __extends(EventLimitsUpdated, _super);
673
- function EventLimitsUpdated(opts) {
674
- var _this = _super.call(this, opts) || this;
675
- _this.minBorrowedAmount = ethers_1.BigNumber.from(opts.minBorrowedAmount);
676
- _this.maxBorrowedAmount = ethers_1.BigNumber.from(opts.maxBorrowedAmount);
677
- _this.prevMinBorrowedAmount = ethers_1.BigNumber.from(opts.prevMinBorrowedAmount);
678
- _this.prevMaxBorrowedAmount = ethers_1.BigNumber.from(opts.prevMaxBorrowedAmount);
679
- _this.underlyingToken = opts.underlyingToken;
680
- _this.creditManager = opts.creditManager;
681
- return _this;
682
- }
683
- EventLimitsUpdated.prototype.toString = function () {
684
- var _a = (0, token_1.extractTokenData)(this.underlyingToken), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
685
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ");
664
+ class EventLimitsUpdated extends eventOrTx_1.EVMEvent {
665
+ minBorrowedAmount;
666
+ maxBorrowedAmount;
667
+ prevMinBorrowedAmount;
668
+ prevMaxBorrowedAmount;
669
+ underlyingToken;
670
+ creditManager;
671
+ constructor(opts) {
672
+ super(opts);
673
+ this.minBorrowedAmount = (0, formatter_1.toBigInt)(opts.minBorrowedAmount || 0);
674
+ this.maxBorrowedAmount = (0, formatter_1.toBigInt)(opts.maxBorrowedAmount || 0);
675
+ this.prevMinBorrowedAmount = (0, formatter_1.toBigInt)(opts.prevMinBorrowedAmount || 0);
676
+ this.prevMaxBorrowedAmount = (0, formatter_1.toBigInt)(opts.prevMaxBorrowedAmount || 0);
677
+ this.underlyingToken = opts.underlyingToken;
678
+ this.creditManager = opts.creditManager;
679
+ }
680
+ toString() {
681
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.underlyingToken);
682
+ let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
686
683
  if (this.minBorrowedAmount !== this.prevMinBorrowedAmount) {
687
- msg += "min amount: ".concat((0, formatter_1.formatBN)(this.prevMinBorrowedAmount, decimals), " => ").concat((0, formatter_1.formatBN)(this.minBorrowedAmount, decimals), " ").concat(symbol, ", ");
684
+ msg += `min amount: ${(0, formatter_1.formatBN)(this.prevMinBorrowedAmount, decimals)} => ${(0, formatter_1.formatBN)(this.minBorrowedAmount, decimals)} ${symbol}, `;
688
685
  }
689
686
  if (this.maxBorrowedAmount !== this.prevMaxBorrowedAmount) {
690
- msg += "max amount: ".concat((0, formatter_1.formatBN)(this.prevMaxBorrowedAmount, decimals), " => ").concat((0, formatter_1.formatBN)(this.maxBorrowedAmount, decimals), " ").concat(symbol, ", ");
687
+ msg += `max amount: ${(0, formatter_1.formatBN)(this.prevMaxBorrowedAmount, decimals)} => ${(0, formatter_1.formatBN)(this.maxBorrowedAmount, decimals)} ${symbol}, `;
691
688
  }
692
689
  return msg.slice(0, msg.length - 2);
693
- };
694
- return EventLimitsUpdated;
695
- }(eventOrTx_1.EVMEvent));
690
+ }
691
+ }
696
692
  exports.EventLimitsUpdated = EventLimitsUpdated;
697
- var EventFeesUpdated = /** @class */ (function (_super) {
698
- __extends(EventFeesUpdated, _super);
699
- function EventFeesUpdated(opts) {
700
- var _this = _super.call(this, opts) || this;
701
- _this.feeInterest = opts.feeInterest;
702
- _this.feeLiquidation = opts.feeLiquidation;
703
- _this.liquidationPremium = opts.liquidationPremium;
704
- _this.feeLiquidationExpired = opts.feeLiquidationExpired;
705
- _this.liquidationPremiumExpired = opts.liquidationPremiumExpired;
706
- _this.prevFeeInterest = opts.prevFeeInterest;
707
- _this.prevFeeLiquidation = opts.prevFeeLiquidation;
708
- _this.prevLiquidationPremium = opts.prevLiquidationPremium;
709
- _this.prevFeeLiquidationExpired = opts.prevFeeLiquidationExpired;
710
- _this.prevLiquidationPremiumExpired = opts.prevLiquidationPremiumExpired;
711
- _this.creditManager = opts.creditManager;
712
- return _this;
713
- }
714
- EventFeesUpdated.prototype.toString = function () {
715
- var msg = "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: ");
693
+ class EventFeesUpdated extends eventOrTx_1.EVMEvent {
694
+ feeInterest;
695
+ feeLiquidation;
696
+ liquidationPremium;
697
+ feeLiquidationExpired;
698
+ liquidationPremiumExpired;
699
+ prevFeeInterest;
700
+ prevFeeLiquidation;
701
+ prevLiquidationPremium;
702
+ prevFeeLiquidationExpired;
703
+ prevLiquidationPremiumExpired;
704
+ creditManager;
705
+ constructor(opts) {
706
+ super(opts);
707
+ this.feeInterest = opts.feeInterest;
708
+ this.feeLiquidation = opts.feeLiquidation;
709
+ this.liquidationPremium = opts.liquidationPremium;
710
+ this.feeLiquidationExpired = opts.feeLiquidationExpired;
711
+ this.liquidationPremiumExpired = opts.liquidationPremiumExpired;
712
+ this.prevFeeInterest = opts.prevFeeInterest;
713
+ this.prevFeeLiquidation = opts.prevFeeLiquidation;
714
+ this.prevLiquidationPremium = opts.prevLiquidationPremium;
715
+ this.prevFeeLiquidationExpired = opts.prevFeeLiquidationExpired;
716
+ this.prevLiquidationPremiumExpired = opts.prevLiquidationPremiumExpired;
717
+ this.creditManager = opts.creditManager;
718
+ }
719
+ toString() {
720
+ let msg = `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: `;
716
721
  if (this.feeInterest !== this.prevFeeInterest) {
717
- msg += "interest fee: ".concat(this.prevFeeInterest / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeInterest / constants_1.PERCENTAGE_DECIMALS, "%, ");
722
+ msg += `interest fee: ${this.prevFeeInterest / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.feeInterest / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
718
723
  }
719
724
  if (this.feeLiquidation !== this.prevFeeLiquidation) {
720
- msg += "liquidation fee: ".concat(this.prevFeeLiquidation / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.feeLiquidation / constants_1.PERCENTAGE_DECIMALS, "%, ");
725
+ msg += `liquidation fee: ${this.prevFeeLiquidation / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.feeLiquidation / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
721
726
  }
722
727
  if (this.liquidationPremium !== this.prevLiquidationPremium) {
723
- msg += "liquidation premium: ".concat(this.prevLiquidationPremium / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.liquidationPremium / constants_1.PERCENTAGE_DECIMALS, "%, ");
728
+ msg += `liquidation premium: ${this.prevLiquidationPremium / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.liquidationPremium / Number(constants_1.PERCENTAGE_DECIMALS)}%, `;
724
729
  }
725
730
  if (this.feeLiquidationExpired !== this.prevFeeLiquidationExpired) {
726
- msg += "liquidation expired: ".concat((0, formatter_1.formatDateTime)(this.prevFeeLiquidationExpired), " => ").concat((0, formatter_1.formatDateTime)(this.feeLiquidationExpired), ", ");
731
+ msg += `liquidation expired: ${(0, formatter_1.formatDateTime)(this.prevFeeLiquidationExpired)} => ${(0, formatter_1.formatDateTime)(this.feeLiquidationExpired)}, `;
727
732
  }
728
733
  if (this.liquidationPremiumExpired !== this.prevLiquidationPremiumExpired) {
729
- msg += "liquidation premium expired: ".concat((0, formatter_1.formatDateTime)(this.prevLiquidationPremiumExpired), " => ").concat((0, formatter_1.formatDateTime)(this.liquidationPremiumExpired), ", ");
734
+ msg += `liquidation premium expired: ${(0, formatter_1.formatDateTime)(this.prevLiquidationPremiumExpired)} => ${(0, formatter_1.formatDateTime)(this.liquidationPremiumExpired)}, `;
730
735
  }
731
736
  return msg.slice(0, msg.length - 2);
732
- };
733
- return EventFeesUpdated;
734
- }(eventOrTx_1.EVMEvent));
737
+ }
738
+ }
735
739
  exports.EventFeesUpdated = EventFeesUpdated;
736
- var EventCreditFacadeUpgraded = /** @class */ (function (_super) {
737
- __extends(EventCreditFacadeUpgraded, _super);
738
- function EventCreditFacadeUpgraded(opts) {
739
- var _this = _super.call(this, opts) || this;
740
- _this.newCreditFacade = opts.newCreditFacade;
741
- _this.prevCreditFacade = opts.prevCreditFacade;
742
- _this.creditManager = opts.creditManager;
743
- return _this;
744
- }
745
- EventCreditFacadeUpgraded.prototype.toString = function () {
746
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: Credit Facade ").concat(this.prevCreditFacade, " => ").concat(this.newCreditFacade);
747
- };
748
- return EventCreditFacadeUpgraded;
749
- }(eventOrTx_1.EVMEvent));
740
+ class EventCreditFacadeUpgraded extends eventOrTx_1.EVMEvent {
741
+ newCreditFacade;
742
+ prevCreditFacade;
743
+ creditManager;
744
+ constructor(opts) {
745
+ super(opts);
746
+ this.newCreditFacade = opts.newCreditFacade;
747
+ this.prevCreditFacade = opts.prevCreditFacade;
748
+ this.creditManager = opts.creditManager;
749
+ }
750
+ toString() {
751
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: Credit Facade ${this.prevCreditFacade} => ${this.newCreditFacade}`;
752
+ }
753
+ }
750
754
  exports.EventCreditFacadeUpgraded = EventCreditFacadeUpgraded;
751
- var EventNewConfigurator = /** @class */ (function (_super) {
752
- __extends(EventNewConfigurator, _super);
753
- function EventNewConfigurator(opts) {
754
- var _this = _super.call(this, opts) || this;
755
- _this.newConfigurator = opts.newConfigurator;
756
- _this.prevConfigurator = opts.prevConfigurator;
757
- _this.creditManager = opts.creditManager;
758
- return _this;
759
- }
760
- EventNewConfigurator.prototype.toString = function () {
761
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: Credit Configurator ").concat(this.prevConfigurator, " => ").concat(this.newConfigurator);
762
- };
763
- return EventNewConfigurator;
764
- }(eventOrTx_1.EVMEvent));
755
+ class EventNewConfigurator extends eventOrTx_1.EVMEvent {
756
+ newConfigurator;
757
+ prevConfigurator;
758
+ creditManager;
759
+ constructor(opts) {
760
+ super(opts);
761
+ this.newConfigurator = opts.newConfigurator;
762
+ this.prevConfigurator = opts.prevConfigurator;
763
+ this.creditManager = opts.creditManager;
764
+ }
765
+ toString() {
766
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: Credit Configurator ${this.prevConfigurator} => ${this.newConfigurator}`;
767
+ }
768
+ }
765
769
  exports.EventNewConfigurator = EventNewConfigurator;
766
- var EventLTUpdated = /** @class */ (function (_super) {
767
- __extends(EventLTUpdated, _super);
768
- function EventLTUpdated(opts) {
769
- var _this = _super.call(this, opts) || this;
770
- _this.creditManager = opts.creditManager;
771
- _this.lt = opts.lt;
772
- _this.prevLt = opts.prevLt;
773
- return _this;
774
- }
775
- EventLTUpdated.prototype.toString = function () {
776
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: liquidation fee: ").concat(this.prevLt / constants_1.PERCENTAGE_DECIMALS, "% => ").concat(this.lt / constants_1.PERCENTAGE_DECIMALS, "%");
777
- };
778
- return EventLTUpdated;
779
- }(eventOrTx_1.EVMEvent));
770
+ class EventLTUpdated extends eventOrTx_1.EVMEvent {
771
+ creditManager;
772
+ lt;
773
+ prevLt;
774
+ constructor(opts) {
775
+ super(opts);
776
+ this.creditManager = opts.creditManager;
777
+ this.lt = opts.lt;
778
+ this.prevLt = opts.prevLt;
779
+ }
780
+ toString() {
781
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: liquidation fee: ${this.prevLt / Number(constants_1.PERCENTAGE_DECIMALS)}% => ${this.lt / Number(constants_1.PERCENTAGE_DECIMALS)}%`;
782
+ }
783
+ }
780
784
  exports.EventLTUpdated = EventLTUpdated;
781
- var EventIncreaseDebtForbiddenModeChanged = /** @class */ (function (_super) {
782
- __extends(EventIncreaseDebtForbiddenModeChanged, _super);
783
- function EventIncreaseDebtForbiddenModeChanged(opts) {
784
- var _this = _super.call(this, opts) || this;
785
- _this.forbidden = opts.forbidden;
786
- _this.creditManager = opts.creditManager;
787
- return _this;
788
- }
789
- EventIncreaseDebtForbiddenModeChanged.prototype.toString = function () {
790
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), " updated: Increase Debt ").concat(this.forbidden ? "forbidden" : "allowed");
791
- };
792
- return EventIncreaseDebtForbiddenModeChanged;
793
- }(eventOrTx_1.EVMEvent));
785
+ class EventIncreaseDebtForbiddenModeChanged extends eventOrTx_1.EVMEvent {
786
+ forbidden;
787
+ creditManager;
788
+ constructor(opts) {
789
+ super(opts);
790
+ this.forbidden = opts.forbidden;
791
+ this.creditManager = opts.creditManager;
792
+ }
793
+ toString() {
794
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)} updated: Increase Debt ${this.forbidden ? "forbidden" : "allowed"}`;
795
+ }
796
+ }
794
797
  exports.EventIncreaseDebtForbiddenModeChanged = EventIncreaseDebtForbiddenModeChanged;
795
- var EventExpirationDateUpdated = /** @class */ (function (_super) {
796
- __extends(EventExpirationDateUpdated, _super);
797
- function EventExpirationDateUpdated(opts) {
798
- var _this = _super.call(this, opts) || this;
799
- _this.date = opts.date;
800
- _this.prevDate = opts.prevDate;
801
- _this.creditManager = opts.creditManager;
802
- return _this;
803
- }
804
- EventExpirationDateUpdated.prototype.toString = function () {
805
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Expiration Date Updated ").concat((0, formatter_1.formatDateTime)(this.prevDate), " => ").concat((0, formatter_1.formatDateTime)(this.date));
806
- };
807
- return EventExpirationDateUpdated;
808
- }(eventOrTx_1.EVMEvent));
798
+ class EventExpirationDateUpdated extends eventOrTx_1.EVMEvent {
799
+ date;
800
+ prevDate;
801
+ creditManager;
802
+ constructor(opts) {
803
+ super(opts);
804
+ this.date = opts.date;
805
+ this.prevDate = opts.prevDate;
806
+ this.creditManager = opts.creditManager;
807
+ }
808
+ toString() {
809
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Expiration Date Updated ${(0, formatter_1.formatDateTime)(this.prevDate)} => ${(0, formatter_1.formatDateTime)(this.date)}`;
810
+ }
811
+ }
809
812
  exports.EventExpirationDateUpdated = EventExpirationDateUpdated;
810
- var EventMaxEnabledTokensUpdated = /** @class */ (function (_super) {
811
- __extends(EventMaxEnabledTokensUpdated, _super);
812
- function EventMaxEnabledTokensUpdated(opts) {
813
- var _this = _super.call(this, opts) || this;
814
- _this.tokensEnabled = opts.tokensEnabled;
815
- _this.prevTokensEnabled = opts.prevTokensEnabled;
816
- _this.creditManager = opts.creditManager;
817
- return _this;
818
- }
819
- EventMaxEnabledTokensUpdated.prototype.toString = function () {
820
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Enabled Tokens Updated ").concat(this.tokensEnabled, " => ").concat(this.prevTokensEnabled);
821
- };
822
- return EventMaxEnabledTokensUpdated;
823
- }(eventOrTx_1.EVMEvent));
813
+ class EventMaxEnabledTokensUpdated extends eventOrTx_1.EVMEvent {
814
+ tokensEnabled;
815
+ prevTokensEnabled;
816
+ creditManager;
817
+ constructor(opts) {
818
+ super(opts);
819
+ this.tokensEnabled = opts.tokensEnabled;
820
+ this.prevTokensEnabled = opts.prevTokensEnabled;
821
+ this.creditManager = opts.creditManager;
822
+ }
823
+ toString() {
824
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Enabled Tokens Updated ${this.tokensEnabled} => ${this.prevTokensEnabled}`;
825
+ }
826
+ }
824
827
  exports.EventMaxEnabledTokensUpdated = EventMaxEnabledTokensUpdated;
825
- var EventLimitPerBlockUpdated = /** @class */ (function (_super) {
826
- __extends(EventLimitPerBlockUpdated, _super);
827
- function EventLimitPerBlockUpdated(opts) {
828
- var _this = _super.call(this, opts) || this;
829
- _this.limit = ethers_1.BigNumber.from(opts.limit);
830
- _this.prevLimit = ethers_1.BigNumber.from(opts.prevLimit);
831
- _this.token = opts.token;
832
- _this.creditManager = opts.creditManager;
833
- return _this;
834
- }
835
- EventLimitPerBlockUpdated.prototype.toString = function () {
836
- var _a = (0, token_1.extractTokenData)(this.token), symbol = _a[0], _b = _a[1], decimals = _b === void 0 ? 18 : _b;
837
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Limit Per Block Updated ").concat((0, formatter_1.formatBN)(this.prevLimit, decimals), " => ").concat((0, formatter_1.formatBN)(this.limit, decimals), " ").concat(symbol);
838
- };
839
- return EventLimitPerBlockUpdated;
840
- }(eventOrTx_1.EVMEvent));
828
+ class EventLimitPerBlockUpdated extends eventOrTx_1.EVMEvent {
829
+ limit;
830
+ prevLimit;
831
+ token;
832
+ creditManager;
833
+ constructor(opts) {
834
+ super(opts);
835
+ this.limit = (0, formatter_1.toBigInt)(opts.limit || 0);
836
+ this.prevLimit = (0, formatter_1.toBigInt)(opts.prevLimit || 0);
837
+ this.token = opts.token;
838
+ this.creditManager = opts.creditManager;
839
+ }
840
+ toString() {
841
+ const [symbol, decimals = 18] = (0, token_1.extractTokenData)(this.token);
842
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Limit Per Block Updated ${(0, formatter_1.formatBN)(this.prevLimit, decimals)} => ${(0, formatter_1.formatBN)(this.limit, decimals)} ${symbol}`;
843
+ }
844
+ }
841
845
  exports.EventLimitPerBlockUpdated = EventLimitPerBlockUpdated;
842
- var EventAddedToUpgradeable = /** @class */ (function (_super) {
843
- __extends(EventAddedToUpgradeable, _super);
844
- function EventAddedToUpgradeable(opts) {
845
- var _this = _super.call(this, opts) || this;
846
- _this.added = opts.added;
847
- _this.creditManager = opts.creditManager;
848
- return _this;
849
- }
850
- EventAddedToUpgradeable.prototype.toString = function () {
851
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Added To Upgradeable ").concat(this.added);
852
- };
853
- return EventAddedToUpgradeable;
854
- }(eventOrTx_1.EVMEvent));
846
+ class EventAddedToUpgradeable extends eventOrTx_1.EVMEvent {
847
+ added;
848
+ creditManager;
849
+ constructor(opts) {
850
+ super(opts);
851
+ this.added = opts.added;
852
+ this.creditManager = opts.creditManager;
853
+ }
854
+ toString() {
855
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Added To Upgradeable ${this.added}`;
856
+ }
857
+ }
855
858
  exports.EventAddedToUpgradeable = EventAddedToUpgradeable;
856
- var EventRemovedFromUpgradeable = /** @class */ (function (_super) {
857
- __extends(EventRemovedFromUpgradeable, _super);
858
- function EventRemovedFromUpgradeable(opts) {
859
- var _this = _super.call(this, opts) || this;
860
- _this.removed = opts.removed;
861
- _this.creditManager = opts.creditManager;
862
- return _this;
863
- }
864
- EventRemovedFromUpgradeable.prototype.toString = function () {
865
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Removed From Upgradeable ").concat(this.removed);
866
- };
867
- return EventRemovedFromUpgradeable;
868
- }(eventOrTx_1.EVMEvent));
859
+ class EventRemovedFromUpgradeable extends eventOrTx_1.EVMEvent {
860
+ removed;
861
+ creditManager;
862
+ constructor(opts) {
863
+ super(opts);
864
+ this.removed = opts.removed;
865
+ this.creditManager = opts.creditManager;
866
+ }
867
+ toString() {
868
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Removed From Upgradeable ${this.removed}`;
869
+ }
870
+ }
869
871
  exports.EventRemovedFromUpgradeable = EventRemovedFromUpgradeable;
870
- var EventEmergencyLiquidatorAdded = /** @class */ (function (_super) {
871
- __extends(EventEmergencyLiquidatorAdded, _super);
872
- function EventEmergencyLiquidatorAdded(opts) {
873
- var _this = _super.call(this, opts) || this;
874
- _this.added = opts.added;
875
- _this.creditManager = opts.creditManager;
876
- return _this;
877
- }
878
- EventEmergencyLiquidatorAdded.prototype.toString = function () {
879
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Emergency Liquidator Added ").concat(this.added);
880
- };
881
- return EventEmergencyLiquidatorAdded;
882
- }(eventOrTx_1.EVMEvent));
872
+ class EventEmergencyLiquidatorAdded extends eventOrTx_1.EVMEvent {
873
+ added;
874
+ creditManager;
875
+ constructor(opts) {
876
+ super(opts);
877
+ this.added = opts.added;
878
+ this.creditManager = opts.creditManager;
879
+ }
880
+ toString() {
881
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Emergency Liquidator Added ${this.added}`;
882
+ }
883
+ }
883
884
  exports.EventEmergencyLiquidatorAdded = EventEmergencyLiquidatorAdded;
884
- var EventEmergencyLiquidatorRemoved = /** @class */ (function (_super) {
885
- __extends(EventEmergencyLiquidatorRemoved, _super);
886
- function EventEmergencyLiquidatorRemoved(opts) {
887
- var _this = _super.call(this, opts) || this;
888
- _this.removed = opts.removed;
889
- _this.creditManager = opts.creditManager;
890
- return _this;
891
- }
892
- EventEmergencyLiquidatorRemoved.prototype.toString = function () {
893
- return "Credit manager ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Emergency Liquidator Removed ").concat(this.removed);
894
- };
895
- return EventEmergencyLiquidatorRemoved;
896
- }(eventOrTx_1.EVMEvent));
885
+ class EventEmergencyLiquidatorRemoved extends eventOrTx_1.EVMEvent {
886
+ removed;
887
+ creditManager;
888
+ constructor(opts) {
889
+ super(opts);
890
+ this.removed = opts.removed;
891
+ this.creditManager = opts.creditManager;
892
+ }
893
+ toString() {
894
+ return `Credit manager ${(0, contractsRegister_1.getContractName)(this.creditManager)}: Emergency Liquidator Removed ${this.removed}`;
895
+ }
896
+ }
897
897
  exports.EventEmergencyLiquidatorRemoved = EventEmergencyLiquidatorRemoved;