@gearbox-protocol/sdk 1.22.4 → 1.23.1

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