@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/strategies/convex.js
CHANGED
|
@@ -1,64 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConvexStrategies = exports.ConvexClaimZapMulticaller = exports.ConvexPoolMulticaller = exports.ConvexBoosterMulticaller = exports.ConvexClaimZapCalls = exports.ConvexPoolCalls = exports.ConvexBoosterCalls = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
ConvexBoosterCalls.deposit = function (pid, amount, stake) {
|
|
4
|
+
const contracts_1 = require("../contracts/contracts");
|
|
5
|
+
const token_1 = require("../tokens/token");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const curve_1 = require("./curve");
|
|
8
|
+
const uniswapV2_1 = require("./uniswapV2");
|
|
9
|
+
class ConvexBoosterCalls {
|
|
10
|
+
static deposit(pid, amount, stake) {
|
|
13
11
|
return types_1.IBooster__factory.createInterface().encodeFunctionData("deposit", [
|
|
14
12
|
pid,
|
|
15
13
|
amount,
|
|
16
14
|
stake,
|
|
17
15
|
]);
|
|
18
|
-
}
|
|
19
|
-
|
|
16
|
+
}
|
|
17
|
+
static depositAll(pid, stake) {
|
|
20
18
|
return types_1.IBooster__factory.createInterface().encodeFunctionData("depositAll", [pid, stake]);
|
|
21
|
-
}
|
|
22
|
-
|
|
19
|
+
}
|
|
20
|
+
static withdraw(pid, amount) {
|
|
23
21
|
return types_1.IBooster__factory.createInterface().encodeFunctionData("withdraw", [
|
|
24
22
|
pid,
|
|
25
23
|
amount,
|
|
26
24
|
]);
|
|
27
|
-
}
|
|
28
|
-
|
|
25
|
+
}
|
|
26
|
+
static withdrawAll(pid) {
|
|
29
27
|
return types_1.IBooster__factory.createInterface().encodeFunctionData("withdrawAll", [pid]);
|
|
30
|
-
};
|
|
31
|
-
return ConvexBoosterCalls;
|
|
32
|
-
}());
|
|
33
|
-
exports.ConvexBoosterCalls = ConvexBoosterCalls;
|
|
34
|
-
var ConvexPoolCalls = /** @class */ (function () {
|
|
35
|
-
function ConvexPoolCalls() {
|
|
36
28
|
}
|
|
37
|
-
|
|
29
|
+
}
|
|
30
|
+
exports.ConvexBoosterCalls = ConvexBoosterCalls;
|
|
31
|
+
class ConvexPoolCalls {
|
|
32
|
+
static stake(amount) {
|
|
38
33
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("stake", [amount]);
|
|
39
|
-
}
|
|
40
|
-
|
|
34
|
+
}
|
|
35
|
+
static stakeAll() {
|
|
41
36
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("stakeAll");
|
|
42
|
-
}
|
|
43
|
-
|
|
37
|
+
}
|
|
38
|
+
static withdraw(amount, claim) {
|
|
44
39
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("withdraw", [amount, claim]);
|
|
45
|
-
}
|
|
46
|
-
|
|
40
|
+
}
|
|
41
|
+
static withdrawAll(claim) {
|
|
47
42
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("withdrawAll", [claim]);
|
|
48
|
-
}
|
|
49
|
-
|
|
43
|
+
}
|
|
44
|
+
static withdrawAndUnwrap(amount, claim) {
|
|
50
45
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("withdrawAndUnwrap", [amount, claim]);
|
|
51
|
-
}
|
|
52
|
-
|
|
46
|
+
}
|
|
47
|
+
static withdrawAllAndUnwrap(claim) {
|
|
53
48
|
return types_1.IConvexV1BaseRewardPoolAdapter__factory.createInterface().encodeFunctionData("withdrawAllAndUnwrap", [claim]);
|
|
54
|
-
};
|
|
55
|
-
return ConvexPoolCalls;
|
|
56
|
-
}());
|
|
57
|
-
exports.ConvexPoolCalls = ConvexPoolCalls;
|
|
58
|
-
var ConvexClaimZapCalls = /** @class */ (function () {
|
|
59
|
-
function ConvexClaimZapCalls() {
|
|
60
49
|
}
|
|
61
|
-
|
|
50
|
+
}
|
|
51
|
+
exports.ConvexPoolCalls = ConvexPoolCalls;
|
|
52
|
+
class ConvexClaimZapCalls {
|
|
53
|
+
static claimRewards(rewardContracts, extraRewardContracts, tokenRewardContracts, tokenRewardTokens, depositCrvMaxAmount, minAmountOut, depositCvxMaxAmount, spendCvxAmount, options) {
|
|
62
54
|
return types_1.IClaimZap__factory.createInterface().encodeFunctionData("claimRewards", [
|
|
63
55
|
rewardContracts,
|
|
64
56
|
extraRewardContracts,
|
|
@@ -70,163 +62,159 @@ var ConvexClaimZapCalls = /** @class */ (function () {
|
|
|
70
62
|
spendCvxAmount,
|
|
71
63
|
options,
|
|
72
64
|
]);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
76
67
|
exports.ConvexClaimZapCalls = ConvexClaimZapCalls;
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
class ConvexBoosterMulticaller {
|
|
69
|
+
_address;
|
|
70
|
+
constructor(address) {
|
|
79
71
|
this._address = address;
|
|
80
72
|
}
|
|
81
|
-
|
|
73
|
+
static connect(address) {
|
|
82
74
|
return new ConvexBoosterMulticaller(address);
|
|
83
|
-
}
|
|
84
|
-
|
|
75
|
+
}
|
|
76
|
+
deposit(pid, amount, stake) {
|
|
85
77
|
return {
|
|
86
78
|
target: this._address,
|
|
87
79
|
callData: ConvexBoosterCalls.deposit(pid, amount, stake),
|
|
88
80
|
};
|
|
89
|
-
}
|
|
90
|
-
|
|
81
|
+
}
|
|
82
|
+
depositAll(pid, stake) {
|
|
91
83
|
return {
|
|
92
84
|
target: this._address,
|
|
93
85
|
callData: ConvexBoosterCalls.depositAll(pid, stake),
|
|
94
86
|
};
|
|
95
|
-
}
|
|
96
|
-
|
|
87
|
+
}
|
|
88
|
+
withdraw(pid, amount) {
|
|
97
89
|
return {
|
|
98
90
|
target: this._address,
|
|
99
91
|
callData: ConvexBoosterCalls.withdraw(pid, amount),
|
|
100
92
|
};
|
|
101
|
-
}
|
|
102
|
-
|
|
93
|
+
}
|
|
94
|
+
withdrawAll(pid) {
|
|
103
95
|
return {
|
|
104
96
|
target: this._address,
|
|
105
97
|
callData: ConvexBoosterCalls.withdrawAll(pid),
|
|
106
98
|
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
}());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
110
101
|
exports.ConvexBoosterMulticaller = ConvexBoosterMulticaller;
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
class ConvexPoolMulticaller {
|
|
103
|
+
_address;
|
|
104
|
+
constructor(address) {
|
|
113
105
|
this._address = address;
|
|
114
106
|
}
|
|
115
|
-
|
|
107
|
+
static connect(address) {
|
|
116
108
|
return new ConvexPoolMulticaller(address);
|
|
117
|
-
}
|
|
118
|
-
|
|
109
|
+
}
|
|
110
|
+
stake(amount) {
|
|
119
111
|
return {
|
|
120
112
|
target: this._address,
|
|
121
113
|
callData: ConvexPoolCalls.stake(amount),
|
|
122
114
|
};
|
|
123
|
-
}
|
|
124
|
-
|
|
115
|
+
}
|
|
116
|
+
stakeAll() {
|
|
125
117
|
return {
|
|
126
118
|
target: this._address,
|
|
127
119
|
callData: ConvexPoolCalls.stakeAll(),
|
|
128
120
|
};
|
|
129
|
-
}
|
|
130
|
-
|
|
121
|
+
}
|
|
122
|
+
withdraw(amount, claim) {
|
|
131
123
|
return {
|
|
132
124
|
target: this._address,
|
|
133
125
|
callData: ConvexPoolCalls.withdraw(amount, claim),
|
|
134
126
|
};
|
|
135
|
-
}
|
|
136
|
-
|
|
127
|
+
}
|
|
128
|
+
withdrawAll(claim) {
|
|
137
129
|
return {
|
|
138
130
|
target: this._address,
|
|
139
131
|
callData: ConvexPoolCalls.withdrawAll(claim),
|
|
140
132
|
};
|
|
141
|
-
}
|
|
142
|
-
|
|
133
|
+
}
|
|
134
|
+
withdrawAndUnwrap(amount, claim) {
|
|
143
135
|
return {
|
|
144
136
|
target: this._address,
|
|
145
137
|
callData: ConvexPoolCalls.withdrawAndUnwrap(amount, claim),
|
|
146
138
|
};
|
|
147
|
-
}
|
|
148
|
-
|
|
139
|
+
}
|
|
140
|
+
withdrawAllAndUnwrap(claim) {
|
|
149
141
|
return {
|
|
150
142
|
target: this._address,
|
|
151
143
|
callData: ConvexPoolCalls.withdrawAllAndUnwrap(claim),
|
|
152
144
|
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
}());
|
|
145
|
+
}
|
|
146
|
+
}
|
|
156
147
|
exports.ConvexPoolMulticaller = ConvexPoolMulticaller;
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
class ConvexClaimZapMulticaller {
|
|
149
|
+
_address;
|
|
150
|
+
constructor(address) {
|
|
159
151
|
this._address = address;
|
|
160
152
|
}
|
|
161
|
-
|
|
153
|
+
static connect(address) {
|
|
162
154
|
return new ConvexClaimZapMulticaller(address);
|
|
163
|
-
}
|
|
164
|
-
|
|
155
|
+
}
|
|
156
|
+
claimRewards(rewardContracts, extraRewardContracts, tokenRewardContracts, tokenRewardTokens, depositCrvMaxAmount, minAmountOut, depositCvxMaxAmount, spendCvxAmount, options) {
|
|
165
157
|
return {
|
|
166
158
|
target: this._address,
|
|
167
159
|
callData: ConvexClaimZapCalls.claimRewards(rewardContracts, extraRewardContracts, tokenRewardContracts, tokenRewardTokens, depositCrvMaxAmount, minAmountOut, depositCvxMaxAmount, spendCvxAmount, options),
|
|
168
160
|
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
}());
|
|
161
|
+
}
|
|
162
|
+
}
|
|
172
163
|
exports.ConvexClaimZapMulticaller = ConvexClaimZapMulticaller;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
var curveLpTokenData = token_1.supportedTokens[curveLpToken];
|
|
183
|
-
var curvePool = curveLpTokenData.pool;
|
|
164
|
+
class ConvexStrategies {
|
|
165
|
+
static underlyingToStakedConvex(data, network, convexPool, underlyingAmount) {
|
|
166
|
+
let calls = [];
|
|
167
|
+
const convexParams = contracts_1.contractParams[convexPool];
|
|
168
|
+
const { stakedToken } = convexParams;
|
|
169
|
+
const stakedTokenParams = token_1.supportedTokens[stakedToken];
|
|
170
|
+
const curveLpToken = stakedTokenParams.underlying;
|
|
171
|
+
const curveLpTokenData = token_1.supportedTokens[curveLpToken];
|
|
172
|
+
const curvePool = curveLpTokenData.pool;
|
|
184
173
|
calls = curve_1.CurveStrategies.underlyingToCurveLP(data, network, curvePool, underlyingAmount);
|
|
185
174
|
calls.push(ConvexBoosterMulticaller.connect(data.adapters[contracts_1.contractsByNetwork[network].CONVEX_BOOSTER.toLowerCase()]).depositAll(stakedTokenParams.pid, true));
|
|
186
175
|
return calls;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
176
|
+
}
|
|
177
|
+
static stakedConvexToUnderlying(data, network, convexPool, convexLpAmount, sellRewards) {
|
|
178
|
+
const calls = [];
|
|
179
|
+
const convexParams = contracts_1.contractParams[convexPool];
|
|
180
|
+
const { stakedToken } = convexParams;
|
|
181
|
+
const stakedTokenParams = token_1.supportedTokens[stakedToken];
|
|
182
|
+
const curveLpToken = stakedTokenParams.underlying;
|
|
183
|
+
const curveLpTokenData = token_1.supportedTokens[curveLpToken];
|
|
184
|
+
const curvePool = curveLpTokenData.pool;
|
|
196
185
|
calls.push(ConvexPoolMulticaller.connect(data.adapters[contracts_1.contractsByNetwork[network][convexPool].toLowerCase()]).withdrawAndUnwrap(convexLpAmount, true));
|
|
197
|
-
calls.push
|
|
186
|
+
calls.push(...curve_1.CurveStrategies.allCurveLPToUnderlying(data, network, curvePool));
|
|
198
187
|
if (sellRewards) {
|
|
199
|
-
calls.push
|
|
188
|
+
calls.push(...ConvexStrategies.sellRewards(data, network, convexPool));
|
|
200
189
|
}
|
|
201
190
|
return calls;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
191
|
+
}
|
|
192
|
+
static allStakedConvexToUnderlying(data, network, convexPool, sellRewards) {
|
|
193
|
+
const calls = [];
|
|
194
|
+
const convexParams = contracts_1.contractParams[convexPool];
|
|
195
|
+
const { stakedToken } = convexParams;
|
|
196
|
+
const stakedTokenParams = token_1.supportedTokens[stakedToken];
|
|
197
|
+
const curveLpToken = stakedTokenParams.underlying;
|
|
198
|
+
const curveLpTokenData = token_1.supportedTokens[curveLpToken];
|
|
199
|
+
const curvePool = curveLpTokenData.pool;
|
|
211
200
|
calls.push(ConvexPoolMulticaller.connect(data.adapters[contracts_1.contractsByNetwork[network][convexPool].toLowerCase()]).withdrawAllAndUnwrap(true));
|
|
212
|
-
calls.push
|
|
201
|
+
calls.push(...curve_1.CurveStrategies.allCurveLPToUnderlying(data, network, curvePool));
|
|
213
202
|
if (sellRewards) {
|
|
214
|
-
calls.push
|
|
203
|
+
calls.push(...ConvexStrategies.sellRewards(data, network, convexPool));
|
|
215
204
|
}
|
|
216
205
|
return calls;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
206
|
+
}
|
|
207
|
+
static sellRewards(data, network, convexPool) {
|
|
208
|
+
const calls = [];
|
|
209
|
+
const convexParams = contracts_1.contractParams[convexPool];
|
|
221
210
|
calls.push(uniswapV2_1.UniswapV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network].UNISWAP_V2_ROUTER.toLowerCase()]).swapAllTokensForTokens(0, [token_1.tokenDataByNetwork[network].CRV, data.underlyingToken], Math.floor(new Date().getTime() / 1000) + 3600), uniswapV2_1.UniswapV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network].UNISWAP_V2_ROUTER.toLowerCase()]).swapAllTokensForTokens(0, [token_1.tokenDataByNetwork[network].CVX, data.underlyingToken], Math.floor(new Date().getTime() / 1000) + 3600));
|
|
222
|
-
convexParams.extraRewards.forEach(
|
|
211
|
+
convexParams.extraRewards.forEach(extraReward => {
|
|
223
212
|
uniswapV2_1.UniswapV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network].UNISWAP_V2_ROUTER.toLowerCase()]).swapAllTokensForTokens(0, [
|
|
224
213
|
token_1.tokenDataByNetwork[network][extraReward.rewardToken],
|
|
225
214
|
data.underlyingToken,
|
|
226
215
|
], Math.floor(new Date().getTime() / 1000) + 3600);
|
|
227
216
|
});
|
|
228
217
|
return calls;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
}());
|
|
218
|
+
}
|
|
219
|
+
}
|
|
232
220
|
exports.ConvexStrategies = ConvexStrategies;
|
|
@@ -1,74 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreditFacadeMulticaller = exports.CreditFacadeCalls = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
CreditFacadeCalls.addCollateral = function (onBehalfOf, token, amount) {
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
class CreditFacadeCalls {
|
|
6
|
+
static addCollateral(onBehalfOf, token, amount) {
|
|
9
7
|
return types_1.ICreditFacade__factory.createInterface().encodeFunctionData("addCollateral", [onBehalfOf, token, amount]);
|
|
10
|
-
}
|
|
11
|
-
|
|
8
|
+
}
|
|
9
|
+
static increaseDebt(amount) {
|
|
12
10
|
return types_1.ICreditFacade__factory.createInterface().encodeFunctionData("increaseDebt", [amount]);
|
|
13
|
-
}
|
|
14
|
-
|
|
11
|
+
}
|
|
12
|
+
static decreaseDebt(amount) {
|
|
15
13
|
return types_1.ICreditFacade__factory.createInterface().encodeFunctionData("decreaseDebt", [amount]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return types_1.ICreditFacadeExtended__factory.createInterface().encodeFunctionData("revertIfReceivedLessThan", [[{ token
|
|
19
|
-
}
|
|
20
|
-
|
|
14
|
+
}
|
|
15
|
+
static revertIfBalanceLessThan(token, minBalance) {
|
|
16
|
+
return types_1.ICreditFacadeExtended__factory.createInterface().encodeFunctionData("revertIfReceivedLessThan", [[{ token, balance: minBalance }]]);
|
|
17
|
+
}
|
|
18
|
+
static disableToken(token) {
|
|
21
19
|
return types_1.ICreditFacadeExtended__factory.createInterface().encodeFunctionData("disableToken", [token]);
|
|
22
|
-
}
|
|
23
|
-
|
|
20
|
+
}
|
|
21
|
+
static enableToken(token) {
|
|
24
22
|
return types_1.ICreditFacade__factory.createInterface().encodeFunctionData("enableToken", [token]);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
28
25
|
exports.CreditFacadeCalls = CreditFacadeCalls;
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
class CreditFacadeMulticaller {
|
|
27
|
+
_address;
|
|
28
|
+
constructor(address) {
|
|
31
29
|
this._address = address;
|
|
32
30
|
}
|
|
33
|
-
|
|
31
|
+
static connect(address) {
|
|
34
32
|
return new CreditFacadeMulticaller(address);
|
|
35
|
-
}
|
|
36
|
-
|
|
33
|
+
}
|
|
34
|
+
addCollateral(onBehalfOf, token, amount) {
|
|
37
35
|
return {
|
|
38
36
|
target: this._address,
|
|
39
37
|
callData: CreditFacadeCalls.addCollateral(onBehalfOf, token, amount),
|
|
40
38
|
};
|
|
41
|
-
}
|
|
42
|
-
|
|
39
|
+
}
|
|
40
|
+
increaseDebt(amount) {
|
|
43
41
|
return {
|
|
44
42
|
target: this._address,
|
|
45
43
|
callData: CreditFacadeCalls.increaseDebt(amount),
|
|
46
44
|
};
|
|
47
|
-
}
|
|
48
|
-
|
|
45
|
+
}
|
|
46
|
+
decreaseDebt(amount) {
|
|
49
47
|
return {
|
|
50
48
|
target: this._address,
|
|
51
49
|
callData: CreditFacadeCalls.decreaseDebt(amount),
|
|
52
50
|
};
|
|
53
|
-
}
|
|
54
|
-
|
|
51
|
+
}
|
|
52
|
+
revertIfBalanceLessThan(token, minBalance) {
|
|
55
53
|
return {
|
|
56
54
|
target: this._address,
|
|
57
55
|
callData: CreditFacadeCalls.revertIfBalanceLessThan(token, minBalance),
|
|
58
56
|
};
|
|
59
|
-
}
|
|
60
|
-
|
|
57
|
+
}
|
|
58
|
+
disableToken(token) {
|
|
61
59
|
return {
|
|
62
60
|
target: this._address,
|
|
63
61
|
callData: CreditFacadeCalls.disableToken(token),
|
|
64
62
|
};
|
|
65
|
-
}
|
|
66
|
-
|
|
63
|
+
}
|
|
64
|
+
enableToken(token) {
|
|
67
65
|
return {
|
|
68
66
|
target: this._address,
|
|
69
67
|
callData: CreditFacadeCalls.enableToken(token),
|
|
70
68
|
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
74
71
|
exports.CreditFacadeMulticaller = CreditFacadeMulticaller;
|