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