@gearbox-protocol/sdk 3.0.0-next.103 → 3.0.0-next.104
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/core/creditManager.d.ts +1 -0
- package/lib/core/creditManager.js +5 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/lib/parsers/ERC20Parser.js +1 -1
- package/lib/parsers/aaveV2LendingPoolAdapterParser.d.ts +7 -0
- package/lib/parsers/aaveV2LendingPoolAdapterParser.js +21 -0
- package/lib/parsers/aaveV2WrappedATokenAdapterParser.d.ts +7 -0
- package/lib/parsers/aaveV2WrappedATokenAdapterParser.js +21 -0
- package/lib/parsers/abstractParser.d.ts +7 -5
- package/lib/parsers/abstractParser.js +3 -0
- package/lib/parsers/addressProviderParser.js +1 -1
- package/lib/parsers/balancerV2VaultParser.d.ts +7 -0
- package/lib/parsers/balancerV2VaultParser.js +34 -0
- package/lib/parsers/compoundV2CTokenAdapterParser.d.ts +7 -0
- package/lib/parsers/compoundV2CTokenAdapterParser.js +21 -0
- package/lib/parsers/convexBaseRewardPoolAdapterParser.js +1 -1
- package/lib/parsers/convexBoosterAdapterParser.js +1 -1
- package/lib/parsers/convextRewardPoolParser.js +1 -1
- package/lib/parsers/creditFacadeParser.js +1 -1
- package/lib/parsers/creditManagerParser.js +1 -1
- package/lib/parsers/curveAdapterParser.js +1 -1
- package/lib/parsers/erc626AdapterParser.d.ts +7 -0
- package/lib/parsers/erc626AdapterParser.js +21 -0
- package/lib/parsers/lidoAdapterParser.js +1 -1
- package/lib/parsers/lidoSTETHParser.js +1 -1
- package/lib/parsers/poolParser.js +1 -1
- package/lib/parsers/priceOracleParser.js +1 -1
- package/lib/parsers/txParser.d.ts +17 -11
- package/lib/parsers/txParser.js +36 -5
- package/lib/parsers/uniV2AdapterParser.js +1 -1
- package/lib/parsers/uniV3AdapterParser.js +1 -1
- package/lib/parsers/wstETHAdapterParser.js +1 -1
- package/lib/parsers/yearnV2AdapterParser.js +1 -1
- package/lib/pathfinder/index.d.ts +4 -0
- package/lib/pathfinder/index.js +20 -0
- package/lib/pathfinder/utils.d.ts +35 -0
- package/lib/pathfinder/utils.js +182 -0
- package/lib/types/contracts/index.d.ts +2 -0
- package/lib/types/contracts/interfaces/IGasPricer.d.ts +44 -0
- package/lib/types/contracts/interfaces/IGasPricer.js +2 -0
- package/lib/types/contracts/interfaces/index.d.ts +1 -0
- package/lib/types/contracts/interfaces/index.js +2 -0
- package/lib/types/factories/AddressProvider__factory.d.ts +111 -111
- package/lib/types/factories/AddressProvider__factory.js +119 -119
- package/lib/types/factories/Balances.sol/BalanceOps__factory.d.ts +3 -3
- package/lib/types/factories/Balances.sol/BalanceOps__factory.js +3 -3
- package/lib/types/factories/CalldataExtractor__factory.d.ts +34 -34
- package/lib/types/factories/CalldataExtractor__factory.js +37 -37
- package/lib/types/factories/Claimable__factory.d.ts +28 -28
- package/lib/types/factories/Claimable__factory.js +32 -32
- package/lib/types/factories/ERC20__factory.d.ts +89 -89
- package/lib/types/factories/ERC20__factory.js +99 -99
- package/lib/types/factories/Errors__factory.d.ts +99 -99
- package/lib/types/factories/Errors__factory.js +99 -99
- package/lib/types/factories/FarmAccounting__factory.d.ts +6 -6
- package/lib/types/factories/FarmAccounting__factory.js +6 -6
- package/lib/types/factories/IAaveV2_LendingPoolAdapter__factory.d.ts +42 -42
- package/lib/types/factories/IAaveV2_LendingPoolAdapter__factory.js +42 -42
- package/lib/types/factories/IAaveV2_WrappedATokenAdapter__factory.d.ts +70 -70
- package/lib/types/factories/IAaveV2_WrappedATokenAdapter__factory.js +70 -70
- package/lib/types/factories/IAdapter__factory.d.ts +15 -15
- package/lib/types/factories/IAdapter__factory.js +15 -15
- package/lib/types/factories/IAddressProvider.sol/IAddressProviderEvents__factory.d.ts +7 -7
- package/lib/types/factories/IAddressProvider.sol/IAddressProviderEvents__factory.js +7 -7
- package/lib/types/factories/IAddressProvider.sol/IAddressProvider__factory.d.ts +48 -48
- package/lib/types/factories/IAddressProvider.sol/IAddressProvider__factory.js +52 -52
- package/lib/types/factories/IAddressProviderV3.sol/IAddressProviderV3Events__factory.d.ts +9 -9
- package/lib/types/factories/IAddressProviderV3.sol/IAddressProviderV3Events__factory.js +9 -9
- package/lib/types/factories/IAddressProviderV3.sol/IAddressProviderV3__factory.d.ts +37 -37
- package/lib/types/factories/IAddressProviderV3.sol/IAddressProviderV3__factory.js +42 -42
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributorEvents__factory.d.ts +25 -25
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributorEvents__factory.js +25 -25
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributor__factory.d.ts +71 -71
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributor__factory.js +85 -85
- package/lib/types/factories/IBalancerV2Vault.sol/IBalancerV2VaultGetters__factory.d.ts +19 -19
- package/lib/types/factories/IBalancerV2Vault.sol/IBalancerV2VaultGetters__factory.js +19 -19
- package/lib/types/factories/IBalancerV2Vault.sol/IBalancerV2Vault__factory.d.ts +106 -106
- package/lib/types/factories/IBalancerV2Vault.sol/IBalancerV2Vault__factory.js +106 -106
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapterEvents__factory.d.ts +7 -7
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapterEvents__factory.js +7 -7
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapterExceptions__factory.d.ts +2 -2
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapterExceptions__factory.js +2 -2
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapter__factory.d.ts +161 -161
- package/lib/types/factories/IBalancerV2VaultAdapter.sol/IBalancerV2VaultAdapter__factory.js +166 -166
- package/lib/types/factories/IBaseRewardPool__factory.d.ts +114 -114
- package/lib/types/factories/IBaseRewardPool__factory.js +114 -114
- package/lib/types/factories/IBotListV3.sol/IBotListV3Events__factory.d.ts +38 -38
- package/lib/types/factories/IBotListV3.sol/IBotListV3Events__factory.js +43 -43
- package/lib/types/factories/IBotListV3.sol/IBotListV3__factory.d.ts +152 -152
- package/lib/types/factories/IBotListV3.sol/IBotListV3__factory.js +170 -170
- package/lib/types/factories/ICompoundV2_CTokenAdapter.sol/ICompoundV2_CTokenAdapter__factory.d.ts +60 -60
- package/lib/types/factories/ICompoundV2_CTokenAdapter.sol/ICompoundV2_CTokenAdapter__factory.js +63 -63
- package/lib/types/factories/ICompoundV2_CTokenAdapter.sol/ICompoundV2_Exceptions__factory.d.ts +3 -3
- package/lib/types/factories/ICompoundV2_CTokenAdapter.sol/ICompoundV2_Exceptions__factory.js +3 -3
- package/lib/types/factories/IContractsRegister.sol/IContractsRegisterEvents__factory.d.ts +10 -10
- package/lib/types/factories/IContractsRegister.sol/IContractsRegisterEvents__factory.js +10 -10
- package/lib/types/factories/IContractsRegister.sol/IContractsRegister__factory.d.ts +51 -51
- package/lib/types/factories/IContractsRegister.sol/IContractsRegister__factory.js +57 -57
- package/lib/types/factories/IControllerTimelockV3.sol/IControllerTimelockV3Events__factory.d.ts +30 -30
- package/lib/types/factories/IControllerTimelockV3.sol/IControllerTimelockV3Events__factory.js +30 -30
- package/lib/types/factories/IControllerTimelockV3.sol/IControllerTimelockV3__factory.d.ts +165 -165
- package/lib/types/factories/IControllerTimelockV3.sol/IControllerTimelockV3__factory.js +182 -182
- package/lib/types/factories/IConvexToken__factory.d.ts +86 -86
- package/lib/types/factories/IConvexToken__factory.js +96 -96
- package/lib/types/factories/IConvexV1BaseRewardPoolAdapter__factory.d.ts +80 -80
- package/lib/types/factories/IConvexV1BaseRewardPoolAdapter__factory.js +80 -80
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.d.ts +7 -7
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.js +7 -7
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.d.ts +62 -62
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.js +66 -66
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2Events__factory.d.ts +121 -121
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2Events__factory.js +127 -127
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2Exceptions__factory.d.ts +18 -18
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2Exceptions__factory.js +18 -18
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2__factory.d.ts +376 -376
- package/lib/types/factories/ICreditConfiguratorV2.sol/ICreditConfiguratorV2__factory.js +417 -417
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events__factory.d.ts +118 -118
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events__factory.js +127 -127
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3__factory.d.ts +395 -395
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3__factory.js +420 -420
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Events__factory.d.ts +107 -107
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Events__factory.js +118 -118
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Exceptions__factory.d.ts +65 -65
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Exceptions__factory.js +65 -65
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Extended__factory.d.ts +23 -23
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Extended__factory.js +23 -23
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2V2__factory.d.ts +5 -5
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2V2__factory.js +5 -5
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2__factory.d.ts +601 -601
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2__factory.js +749 -749
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.d.ts +72 -72
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.js +80 -80
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.d.ts +288 -288
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.js +397 -397
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.d.ts +59 -59
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.js +59 -59
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2Events__factory.d.ts +11 -11
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2Events__factory.js +12 -12
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2Exceptions__factory.d.ts +26 -26
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2Exceptions__factory.js +26 -26
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2__factory.d.ts +252 -252
- package/lib/types/factories/ICreditManagerV2.sol/ICreditManagerV2__factory.js +272 -272
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3Events__factory.d.ts +5 -5
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3Events__factory.js +5 -5
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3__factory.d.ts +294 -294
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3__factory.js +297 -297
- package/lib/types/factories/ICurvePool_2.sol/ICurvePool2Assets__factory.d.ts +191 -191
- package/lib/types/factories/ICurvePool_2.sol/ICurvePool2Assets__factory.js +191 -191
- package/lib/types/factories/ICurvePool_3.sol/ICurvePool3Assets__factory.d.ts +191 -191
- package/lib/types/factories/ICurvePool_3.sol/ICurvePool3Assets__factory.js +191 -191
- package/lib/types/factories/ICurvePool_4.sol/ICurvePool4Assets__factory.d.ts +191 -191
- package/lib/types/factories/ICurvePool_4.sol/ICurvePool4Assets__factory.js +191 -191
- package/lib/types/factories/ICurvePool__factory.d.ts +159 -159
- package/lib/types/factories/ICurvePool__factory.js +159 -159
- package/lib/types/factories/ICurveV1Adapter__factory.d.ts +169 -169
- package/lib/types/factories/ICurveV1Adapter__factory.js +169 -169
- package/lib/types/factories/ICurveV1_2AssetsAdapter__factory.d.ts +187 -187
- package/lib/types/factories/ICurveV1_2AssetsAdapter__factory.js +187 -187
- package/lib/types/factories/ICurveV1_3AssetsAdapter__factory.d.ts +187 -187
- package/lib/types/factories/ICurveV1_3AssetsAdapter__factory.js +187 -187
- package/lib/types/factories/ICurveV1_4AssetsAdapter__factory.d.ts +187 -187
- package/lib/types/factories/ICurveV1_4AssetsAdapter__factory.js +187 -187
- package/lib/types/factories/IDaiLikePermit__factory.d.ts +10 -10
- package/lib/types/factories/IDaiLikePermit__factory.js +10 -10
- package/lib/types/factories/IDataCompressorV2_10__factory.d.ts +334 -334
- package/lib/types/factories/IDataCompressorV2_10__factory.js +334 -334
- package/lib/types/factories/IDataCompressorV3_00__factory.d.ts +454 -454
- package/lib/types/factories/IDataCompressorV3_00__factory.js +454 -454
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributorEvents__factory.d.ts +14 -14
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributorEvents__factory.js +14 -14
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributor__factory.d.ts +43 -43
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributor__factory.js +51 -51
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2Events__factory.d.ts +15 -15
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2Events__factory.js +15 -15
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2Exceptions__factory.d.ts +8 -8
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2Exceptions__factory.js +8 -8
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2__factory.d.ts +180 -180
- package/lib/types/factories/IDegenNFTV2.sol/IDegenNFTV2__factory.js +208 -208
- package/lib/types/factories/IERC165__factory.d.ts +4 -4
- package/lib/types/factories/IERC165__factory.js +4 -4
- package/lib/types/factories/IERC20Metadata__factory.d.ts +76 -76
- package/lib/types/factories/IERC20Metadata__factory.js +86 -86
- package/lib/types/factories/IERC20Permit__factory.d.ts +16 -16
- package/lib/types/factories/IERC20Permit__factory.js +16 -16
- package/lib/types/factories/IERC20ZapperDeposits__factory.d.ts +30 -30
- package/lib/types/factories/IERC20ZapperDeposits__factory.js +30 -30
- package/lib/types/factories/IERC20__factory.d.ts +67 -67
- package/lib/types/factories/IERC20__factory.js +77 -77
- package/lib/types/factories/IERC4626Adapter__factory.d.ts +60 -60
- package/lib/types/factories/IERC4626Adapter__factory.js +60 -60
- package/lib/types/factories/IERC4626__factory.d.ts +198 -198
- package/lib/types/factories/IERC4626__factory.js +221 -221
- package/lib/types/factories/IERC721Metadata__factory.d.ts +114 -114
- package/lib/types/factories/IERC721Metadata__factory.js +129 -129
- package/lib/types/factories/IERC721__factory.d.ts +104 -104
- package/lib/types/factories/IERC721__factory.js +119 -119
- package/lib/types/factories/IETHZapperDeposits__factory.d.ts +9 -9
- package/lib/types/factories/IETHZapperDeposits__factory.js +9 -9
- package/lib/types/factories/IFarmingPool__factory.d.ts +134 -134
- package/lib/types/factories/IFarmingPool__factory.js +152 -152
- package/lib/types/factories/IGaugeV3.sol/IGaugeV3Events__factory.d.ts +46 -46
- package/lib/types/factories/IGaugeV3.sol/IGaugeV3Events__factory.js +50 -50
- package/lib/types/factories/IGaugeV3.sol/IGaugeV3__factory.d.ts +172 -172
- package/lib/types/factories/IGaugeV3.sol/IGaugeV3__factory.js +200 -200
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3Events__factory.d.ts +48 -48
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3Events__factory.js +49 -49
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3__factory.d.ts +225 -225
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3__factory.js +253 -253
- package/lib/types/factories/IInterestRateModel__factory.d.ts +8 -8
- package/lib/types/factories/IInterestRateModel__factory.js +8 -8
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeedEvents__factory.d.ts +11 -11
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeedEvents__factory.js +12 -12
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeedExceptions__factory.d.ts +10 -10
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeedExceptions__factory.js +10 -10
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeed__factory.d.ts +107 -107
- package/lib/types/factories/ILPPriceFeed.sol/ILPPriceFeed__factory.js +119 -119
- package/lib/types/factories/ILidoV1Adapter__factory.d.ts +40 -40
- package/lib/types/factories/ILidoV1Adapter__factory.js +40 -40
- package/lib/types/factories/ILinearInterestRateModelV3__factory.d.ts +25 -25
- package/lib/types/factories/ILinearInterestRateModelV3__factory.js +25 -25
- package/lib/types/factories/IOffchainOracle__factory.d.ts +11 -11
- package/lib/types/factories/IOffchainOracle__factory.js +11 -11
- package/lib/types/factories/IPermit2__factory.d.ts +33 -33
- package/lib/types/factories/IPermit2__factory.js +33 -33
- package/lib/types/factories/IPoolQuotaKeeperV3.sol/IPoolQuotaKeeperV3Events__factory.d.ts +44 -44
- package/lib/types/factories/IPoolQuotaKeeperV3.sol/IPoolQuotaKeeperV3Events__factory.js +45 -45
- package/lib/types/factories/IPoolQuotaKeeperV3.sol/IPoolQuotaKeeperV3__factory.d.ts +190 -190
- package/lib/types/factories/IPoolQuotaKeeperV3.sol/IPoolQuotaKeeperV3__factory.js +216 -216
- package/lib/types/factories/IPoolService.sol/IPoolServiceEvents__factory.d.ts +66 -66
- package/lib/types/factories/IPoolService.sol/IPoolServiceEvents__factory.js +72 -72
- package/lib/types/factories/IPoolService.sol/IPoolService__factory.d.ts +235 -235
- package/lib/types/factories/IPoolService.sol/IPoolService__factory.js +286 -286
- package/lib/types/factories/IPoolV3.sol/IPoolV3Events__factory.d.ts +65 -65
- package/lib/types/factories/IPoolV3.sol/IPoolV3Events__factory.js +68 -68
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.d.ts +574 -574
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.js +696 -696
- package/lib/types/factories/IPriceFeed.sol/IPriceFeed__factory.d.ts +22 -22
- package/lib/types/factories/IPriceFeed.sol/IPriceFeed__factory.js +22 -22
- package/lib/types/factories/IPriceFeed.sol/IUpdatablePriceFeed__factory.d.ts +28 -28
- package/lib/types/factories/IPriceFeed.sol/IUpdatablePriceFeed__factory.js +28 -28
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Events__factory.d.ts +6 -6
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Events__factory.js +7 -7
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Exceptions__factory.d.ts +6 -6
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Exceptions__factory.js +6 -6
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Ext__factory.d.ts +71 -71
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2Ext__factory.js +78 -78
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2__factory.d.ts +68 -68
- package/lib/types/factories/IPriceOracle.sol/IPriceOracleV2__factory.js +75 -75
- package/lib/types/factories/IPriceOracleBase__factory.d.ts +27 -27
- package/lib/types/factories/IPriceOracleBase__factory.js +27 -27
- package/lib/types/factories/IPriceOracleV3.sol/IPriceOracleV3Events__factory.d.ts +28 -28
- package/lib/types/factories/IPriceOracleV3.sol/IPriceOracleV3Events__factory.js +31 -31
- package/lib/types/factories/IPriceOracleV3.sol/IPriceOracleV3__factory.d.ts +139 -139
- package/lib/types/factories/IPriceOracleV3.sol/IPriceOracleV3__factory.js +156 -156
- package/lib/types/factories/IRouterV3__factory.d.ts +178 -178
- package/lib/types/factories/IRouterV3__factory.js +191 -191
- package/lib/types/factories/IRouter__factory.d.ts +159 -159
- package/lib/types/factories/IRouter__factory.js +172 -172
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2AdapterEvents__factory.d.ts +8 -8
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2AdapterEvents__factory.js +9 -9
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2AdapterExceptions__factory.d.ts +2 -2
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2AdapterExceptions__factory.js +2 -2
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2Adapter__factory.d.ts +78 -78
- package/lib/types/factories/IUniswapV2Adapter.sol/IUniswapV2Adapter__factory.js +84 -84
- package/lib/types/factories/IUniswapV3.sol/ISwapRouter__factory.d.ts +50 -50
- package/lib/types/factories/IUniswapV3.sol/ISwapRouter__factory.js +50 -50
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3AdapterEvents__factory.d.ts +10 -10
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3AdapterEvents__factory.js +11 -11
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3AdapterExceptions__factory.d.ts +2 -2
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3AdapterExceptions__factory.js +2 -2
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3Adapter__factory.d.ts +138 -138
- package/lib/types/factories/IUniswapV3Adapter.sol/IUniswapV3Adapter__factory.js +145 -145
- package/lib/types/factories/IVersion__factory.d.ts +3 -3
- package/lib/types/factories/IVersion__factory.js +3 -3
- package/lib/types/factories/IVotingContractV3__factory.d.ts +10 -10
- package/lib/types/factories/IVotingContractV3__factory.js +10 -10
- package/lib/types/factories/IWETHGateway__factory.d.ts +14 -14
- package/lib/types/factories/IWETHGateway__factory.js +14 -14
- package/lib/types/factories/IWETH__factory.d.ts +102 -102
- package/lib/types/factories/IWETH__factory.js +120 -120
- package/lib/types/factories/IYVault__factory.d.ts +112 -112
- package/lib/types/factories/IYVault__factory.js +122 -122
- package/lib/types/factories/IYearnV2Adapter__factory.d.ts +63 -63
- package/lib/types/factories/IYearnV2Adapter__factory.js +63 -63
- package/lib/types/factories/IZapperRegister__factory.d.ts +20 -20
- package/lib/types/factories/IZapperRegister__factory.js +22 -22
- package/lib/types/factories/IZapper__factory.d.ts +34 -34
- package/lib/types/factories/IZapper__factory.js +34 -34
- package/lib/types/factories/IstETH.sol/IstETHGetters__factory.d.ts +97 -97
- package/lib/types/factories/IstETH.sol/IstETHGetters__factory.js +107 -107
- package/lib/types/factories/IstETH.sol/IstETH__factory.d.ts +101 -101
- package/lib/types/factories/IstETH.sol/IstETH__factory.js +111 -111
- package/lib/types/factories/IwstETH.sol/IwstETHGetters__factory.d.ts +93 -93
- package/lib/types/factories/IwstETH.sol/IwstETHGetters__factory.js +103 -103
- package/lib/types/factories/IwstETH.sol/IwstETH__factory.d.ts +101 -101
- package/lib/types/factories/IwstETH.sol/IwstETH__factory.js +111 -111
- package/lib/types/factories/IwstETHGateway.sol/IwstETHGateWay__factory.d.ts +14 -14
- package/lib/types/factories/IwstETHGateway.sol/IwstETHGateWay__factory.js +15 -15
- package/lib/types/factories/IwstETHV1Adapter__factory.d.ts +44 -44
- package/lib/types/factories/IwstETHV1Adapter__factory.js +44 -44
- package/lib/types/factories/NumericArrayLib__factory.d.ts +2 -2
- package/lib/types/factories/NumericArrayLib__factory.js +2 -2
- package/lib/types/factories/Ownable__factory.d.ts +23 -23
- package/lib/types/factories/Ownable__factory.js +27 -27
- package/lib/types/factories/RedstoneConstants__factory.d.ts +19 -19
- package/lib/types/factories/RedstoneConstants__factory.js +19 -19
- package/lib/types/factories/RedstoneConsumerBase__factory.d.ts +101 -101
- package/lib/types/factories/RedstoneConsumerBase__factory.js +123 -123
- package/lib/types/factories/RedstoneConsumerNumericBase__factory.d.ts +101 -101
- package/lib/types/factories/RedstoneConsumerNumericBase__factory.js +123 -123
- package/lib/types/factories/RedstoneDefaultsLib__factory.d.ts +8 -8
- package/lib/types/factories/RedstoneDefaultsLib__factory.js +8 -8
- package/lib/types/factories/RedstonePriceFeed.sol/IRedstonePriceFeedEvents__factory.d.ts +5 -5
- package/lib/types/factories/RedstonePriceFeed.sol/IRedstonePriceFeedEvents__factory.js +5 -5
- package/lib/types/factories/RedstonePriceFeed.sol/IRedstonePriceFeedExceptions__factory.d.ts +10 -10
- package/lib/types/factories/RedstonePriceFeed.sol/IRedstonePriceFeedExceptions__factory.js +10 -10
- package/lib/types/factories/RedstonePriceFeed.sol/RedstonePriceFeed__factory.d.ts +193 -193
- package/lib/types/factories/RedstonePriceFeed.sol/RedstonePriceFeed__factory.js +220 -220
- package/lib/types/factories/SafeERC20__factory.d.ts +14 -14
- package/lib/types/factories/SafeERC20__factory.js +14 -14
- package/lib/types/factories/contracts/index.d.ts +1 -0
- package/lib/types/factories/contracts/index.js +30 -0
- package/lib/types/factories/contracts/interfaces/IGasPricer__factory.d.ts +22 -0
- package/lib/types/factories/contracts/interfaces/index.d.ts +1 -0
- package/lib/types/factories/contracts/interfaces/index.js +8 -0
- package/lib/types/factories/index.d.ts +2 -1
- package/lib/types/factories/index.js +4 -4
- package/lib/types/factories/{IGasPricer__factory.d.ts → interfaces/IGasPricer__factory.d.ts} +5 -5
- package/lib/types/factories/interfaces/IGasPricer__factory.js +38 -0
- package/lib/types/factories/interfaces/index.d.ts +1 -0
- package/lib/types/factories/interfaces/index.js +8 -0
- package/lib/types/index.d.ts +18 -14
- package/lib/types/index.js +25 -25
- package/lib/types/{IGasPricer.d.ts → interfaces/IGasPricer.d.ts} +1 -1
- package/lib/types/interfaces/IGasPricer.js +2 -0
- package/lib/types/interfaces/index.d.ts +1 -0
- package/lib/types/interfaces/index.js +2 -0
- package/package.json +4 -4
- package/lib/types/{IGasPricer.js → contracts/index.js} +0 -0
- package/lib/types/factories/{IGasPricer__factory.js → contracts/interfaces/IGasPricer__factory.js} +4 -4
|
@@ -32,6 +32,7 @@ export declare class CreditManagerData {
|
|
|
32
32
|
readonly collateralTokens: Array<string>;
|
|
33
33
|
readonly supportedTokens: Record<string, true>;
|
|
34
34
|
readonly adapters: Record<string, string>;
|
|
35
|
+
readonly contractsByAdapter: Record<string, string>;
|
|
35
36
|
readonly liquidationThresholds: Record<string, bigint>;
|
|
36
37
|
readonly quotas: Record<string, QuotaInfo>;
|
|
37
38
|
readonly interestModel: LinearModel;
|
|
@@ -34,6 +34,7 @@ class CreditManagerData {
|
|
|
34
34
|
collateralTokens = [];
|
|
35
35
|
supportedTokens = {};
|
|
36
36
|
adapters;
|
|
37
|
+
contractsByAdapter;
|
|
37
38
|
liquidationThresholds;
|
|
38
39
|
quotas;
|
|
39
40
|
interestModel;
|
|
@@ -75,6 +76,10 @@ class CreditManagerData {
|
|
|
75
76
|
a.targetContract.toLowerCase(),
|
|
76
77
|
a.adapter.toLowerCase(),
|
|
77
78
|
]));
|
|
79
|
+
this.contractsByAdapter = Object.fromEntries(payload.adapters.map(a => [
|
|
80
|
+
a.adapter.toLowerCase(),
|
|
81
|
+
a.targetContract.toLowerCase(),
|
|
82
|
+
]));
|
|
78
83
|
this.liquidationThresholds = payload.liquidationThresholds.reduce((acc, threshold, index) => {
|
|
79
84
|
const address = payload.collateralTokens[index];
|
|
80
85
|
if (address)
|
package/lib/index.d.ts
CHANGED
|
@@ -17,9 +17,7 @@ export * from "./core/tokenDistributor";
|
|
|
17
17
|
export * from "./core/trade";
|
|
18
18
|
export * from "./core/transactions";
|
|
19
19
|
export * from "./parsers/txParser";
|
|
20
|
-
export * from "./pathfinder
|
|
21
|
-
export * from "./pathfinder/pathfinder";
|
|
22
|
-
export * from "./pathfinder/v1/pathfinderv1";
|
|
20
|
+
export * from "./pathfinder";
|
|
23
21
|
export * from "./payload/creditAccount";
|
|
24
22
|
export * from "./payload/creditManager";
|
|
25
23
|
export * from "./payload/creditSession";
|
package/lib/index.js
CHANGED
|
@@ -34,9 +34,7 @@ __exportStar(require("./core/tokenDistributor"), exports);
|
|
|
34
34
|
__exportStar(require("./core/trade"), exports);
|
|
35
35
|
__exportStar(require("./core/transactions"), exports);
|
|
36
36
|
__exportStar(require("./parsers/txParser"), exports);
|
|
37
|
-
__exportStar(require("./pathfinder
|
|
38
|
-
__exportStar(require("./pathfinder/pathfinder"), exports);
|
|
39
|
-
__exportStar(require("./pathfinder/v1/pathfinderv1"), exports);
|
|
37
|
+
__exportStar(require("./pathfinder"), exports);
|
|
40
38
|
__exportStar(require("./payload/creditAccount"), exports);
|
|
41
39
|
__exportStar(require("./payload/creditManager"), exports);
|
|
42
40
|
__exportStar(require("./payload/creditSession"), exports);
|
|
@@ -29,7 +29,7 @@ class ERC20Parser extends abstractParser_1.AbstractParser {
|
|
|
29
29
|
return `${functionName}(${spender}, [${(0, sdk_gov_1.toBigInt)(amount).toString()}])`;
|
|
30
30
|
}
|
|
31
31
|
default:
|
|
32
|
-
return
|
|
32
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { AbstractParser } from "./abstractParser";
|
|
3
|
+
import { IParser } from "./iParser";
|
|
4
|
+
export declare class AaveV2LendingPoolAdapterParser extends AbstractParser implements IParser {
|
|
5
|
+
constructor(contract: SupportedContract, isContract: boolean);
|
|
6
|
+
parse(calldata: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AaveV2LendingPoolAdapterParser = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const abstractParser_1 = require("./abstractParser");
|
|
6
|
+
class AaveV2LendingPoolAdapterParser extends abstractParser_1.AbstractParser {
|
|
7
|
+
constructor(contract, isContract) {
|
|
8
|
+
super(contract);
|
|
9
|
+
this.ifc = types_1.IAaveV2_LendingPoolAdapter__factory.createInterface();
|
|
10
|
+
if (!isContract)
|
|
11
|
+
this.adapterName = "AaveV2_LendingPoolAdapter";
|
|
12
|
+
}
|
|
13
|
+
parse(calldata) {
|
|
14
|
+
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
15
|
+
switch (functionFragment.name) {
|
|
16
|
+
default:
|
|
17
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AaveV2LendingPoolAdapterParser = AaveV2LendingPoolAdapterParser;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { AbstractParser } from "./abstractParser";
|
|
3
|
+
import { IParser } from "./iParser";
|
|
4
|
+
export declare class AaveV2WrappedATokenAdapterParser extends AbstractParser implements IParser {
|
|
5
|
+
constructor(contract: SupportedContract, isContract: boolean);
|
|
6
|
+
parse(calldata: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AaveV2WrappedATokenAdapterParser = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const abstractParser_1 = require("./abstractParser");
|
|
6
|
+
class AaveV2WrappedATokenAdapterParser extends abstractParser_1.AbstractParser {
|
|
7
|
+
constructor(contract, isContract) {
|
|
8
|
+
super(contract);
|
|
9
|
+
this.ifc = types_1.IAaveV2_WrappedATokenAdapter__factory.createInterface();
|
|
10
|
+
if (!isContract)
|
|
11
|
+
this.adapterName = "AaveV2_WrappedATokenAdapter";
|
|
12
|
+
}
|
|
13
|
+
parse(calldata) {
|
|
14
|
+
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
15
|
+
switch (functionFragment.name) {
|
|
16
|
+
default:
|
|
17
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AaveV2WrappedATokenAdapterParser = AaveV2WrappedATokenAdapterParser;
|
|
@@ -5,6 +5,11 @@ interface ParseSelectorResult {
|
|
|
5
5
|
functionFragment: FunctionFragment;
|
|
6
6
|
functionName: string;
|
|
7
7
|
}
|
|
8
|
+
export interface ParsedObject {
|
|
9
|
+
address: string;
|
|
10
|
+
functionFragment: FunctionFragment;
|
|
11
|
+
args: Result;
|
|
12
|
+
}
|
|
8
13
|
export declare class AbstractParser {
|
|
9
14
|
readonly contract: string;
|
|
10
15
|
protected ifc: utils.Interface;
|
|
@@ -15,10 +20,7 @@ export declare class AbstractParser {
|
|
|
15
20
|
encodeFunctionResult(functionFragment: FunctionFragment | string, data: Array<any>): string;
|
|
16
21
|
tokenSymbol(address: string): SupportedToken;
|
|
17
22
|
formatBN(amount: BigNumberish, token: SupportedToken): string;
|
|
18
|
-
parseToObject(address: string, calldata: string):
|
|
19
|
-
|
|
20
|
-
functionFragment: FunctionFragment;
|
|
21
|
-
args: Result;
|
|
22
|
-
};
|
|
23
|
+
parseToObject(address: string, calldata: string): ParsedObject;
|
|
24
|
+
reportUnknownFragment(functionName: string, functionFragment: FunctionFragment, calldata: string): string;
|
|
23
25
|
}
|
|
24
26
|
export {};
|
|
@@ -40,5 +40,8 @@ class AbstractParser {
|
|
|
40
40
|
args,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
+
reportUnknownFragment(functionName, functionFragment, calldata) {
|
|
44
|
+
return `${functionName}: Unknown operation ${functionFragment.name} with calldata ${calldata}`;
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
exports.AbstractParser = AbstractParser;
|
|
@@ -20,7 +20,7 @@ class AddressProviderParser extends abstractParser_1.AbstractParser {
|
|
|
20
20
|
return `${functionName}()`;
|
|
21
21
|
}
|
|
22
22
|
default:
|
|
23
|
-
return
|
|
23
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { AbstractParser } from "./abstractParser";
|
|
3
|
+
import { IParser } from "./iParser";
|
|
4
|
+
export declare class BalancerV2VaultParser extends AbstractParser implements IParser {
|
|
5
|
+
constructor(contract: SupportedContract, isContract: boolean);
|
|
6
|
+
parse(calldata: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BalancerV2VaultParser = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const abstractParser_1 = require("./abstractParser");
|
|
6
|
+
class BalancerV2VaultParser extends abstractParser_1.AbstractParser {
|
|
7
|
+
constructor(contract, isContract) {
|
|
8
|
+
super(contract);
|
|
9
|
+
this.ifc = types_1.IBalancerV2VaultAdapter__factory.createInterface();
|
|
10
|
+
if (!isContract)
|
|
11
|
+
this.adapterName = "BalancerV2Vault";
|
|
12
|
+
}
|
|
13
|
+
parse(calldata) {
|
|
14
|
+
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
15
|
+
switch (functionFragment.name) {
|
|
16
|
+
case "batchSwap": {
|
|
17
|
+
return `${functionName}(undefined)`;
|
|
18
|
+
}
|
|
19
|
+
case "swapDiff": {
|
|
20
|
+
const d = this.decodeFunctionData(functionFragment, calldata);
|
|
21
|
+
const { assetIn = "", assetOut = "", leftoverAmount = 0, } = (d?.[0] || {});
|
|
22
|
+
return `${functionName}(${this.tokenSymbol(assetIn)} => ${this.tokenSymbol(assetOut)} ${this.formatBN(leftoverAmount, this.tokenSymbol(assetIn))}}`;
|
|
23
|
+
}
|
|
24
|
+
case "swap": {
|
|
25
|
+
const d = this.decodeFunctionData(functionFragment, calldata);
|
|
26
|
+
const { assetIn = "", assetOut = "", amount = 0, } = (d?.[0] || {});
|
|
27
|
+
return `${functionName}(${this.tokenSymbol(assetIn)} => ${this.tokenSymbol(assetOut)} ${this.formatBN(amount, this.tokenSymbol(assetIn))}}`;
|
|
28
|
+
}
|
|
29
|
+
default:
|
|
30
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BalancerV2VaultParser = BalancerV2VaultParser;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { AbstractParser } from "./abstractParser";
|
|
3
|
+
import { IParser } from "./iParser";
|
|
4
|
+
export declare class CompoundV2CTokenAdapterParser extends AbstractParser implements IParser {
|
|
5
|
+
constructor(contract: SupportedContract, isContract: boolean);
|
|
6
|
+
parse(calldata: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompoundV2CTokenAdapterParser = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const abstractParser_1 = require("./abstractParser");
|
|
6
|
+
class CompoundV2CTokenAdapterParser extends abstractParser_1.AbstractParser {
|
|
7
|
+
constructor(contract, isContract) {
|
|
8
|
+
super(contract);
|
|
9
|
+
this.ifc = types_1.ICompoundV2_CTokenAdapter__factory.createInterface();
|
|
10
|
+
if (!isContract)
|
|
11
|
+
this.adapterName = "CompoundV2_CTokenAdapter";
|
|
12
|
+
}
|
|
13
|
+
parse(calldata) {
|
|
14
|
+
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
15
|
+
switch (functionFragment.name) {
|
|
16
|
+
default:
|
|
17
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CompoundV2CTokenAdapterParser = CompoundV2CTokenAdapterParser;
|
|
@@ -37,7 +37,7 @@ class ConvexBaseRewardPoolAdapterParser extends abstractParser_1.AbstractParser
|
|
|
37
37
|
case "totalSupply":
|
|
38
38
|
return `${functionName}()`;
|
|
39
39
|
default:
|
|
40
|
-
return
|
|
40
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
formatAmount(amount) {
|
|
@@ -31,7 +31,7 @@ class ConvexBoosterAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
31
31
|
return `${functionName}(pid: ${this.formatPid(pid)}, leftoverAmount: ${this.formatAmount(leftoverAmount, pid)})`;
|
|
32
32
|
}
|
|
33
33
|
default:
|
|
34
|
-
return
|
|
34
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
formatAmount(amount, pid) {
|
|
@@ -14,7 +14,7 @@ class ConvexRewardPoolParser extends abstractParser_1.AbstractParser {
|
|
|
14
14
|
case "rewardRate":
|
|
15
15
|
return `${functionName}()`;
|
|
16
16
|
default:
|
|
17
|
-
return
|
|
17
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -76,7 +76,7 @@ class CreditFacadeParser extends abstractParser_1.AbstractParser {
|
|
|
76
76
|
return `${functionName}(token: ${this.tokenSymbol(token)}, reserve: ${reserve}, data: ${data})`;
|
|
77
77
|
}
|
|
78
78
|
default:
|
|
79
|
-
return
|
|
79
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
formatAmount(amount) {
|
|
@@ -18,7 +18,7 @@ class CreditManagerParser extends abstractParser_1.AbstractParser {
|
|
|
18
18
|
return `${functionName}()`;
|
|
19
19
|
}
|
|
20
20
|
default:
|
|
21
|
-
return
|
|
21
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -101,7 +101,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
101
101
|
return `${functionName}(account: ${account}, to: ${to})`;
|
|
102
102
|
}
|
|
103
103
|
default:
|
|
104
|
-
return
|
|
104
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
getTokenByIndex(index) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { AbstractParser } from "./abstractParser";
|
|
3
|
+
import { IParser } from "./iParser";
|
|
4
|
+
export declare class ERC4626AdapterParser extends AbstractParser implements IParser {
|
|
5
|
+
constructor(contract: SupportedContract, isContract: boolean);
|
|
6
|
+
parse(calldata: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERC4626AdapterParser = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const abstractParser_1 = require("./abstractParser");
|
|
6
|
+
class ERC4626AdapterParser extends abstractParser_1.AbstractParser {
|
|
7
|
+
constructor(contract, isContract) {
|
|
8
|
+
super(contract);
|
|
9
|
+
this.ifc = types_1.IERC4626Adapter__factory.createInterface();
|
|
10
|
+
if (!isContract)
|
|
11
|
+
this.adapterName = "ERC4626Adapter";
|
|
12
|
+
}
|
|
13
|
+
parse(calldata) {
|
|
14
|
+
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
15
|
+
switch (functionFragment.name) {
|
|
16
|
+
default:
|
|
17
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ERC4626AdapterParser = ERC4626AdapterParser;
|
|
@@ -22,7 +22,7 @@ class LidoAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
22
22
|
return `${functionName}(leftoverAmount: ${this.formatBN(leftoverAmount, "STETH")})`;
|
|
23
23
|
}
|
|
24
24
|
default:
|
|
25
|
-
return
|
|
25
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -29,7 +29,7 @@ class LidoSTETHParser extends abstractParser_1.AbstractParser {
|
|
|
29
29
|
return `${functionName}(${spender}, [${(0, sdk_gov_1.toBigInt)(amount).toString()}])`;
|
|
30
30
|
}
|
|
31
31
|
default:
|
|
32
|
-
return
|
|
32
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -12,7 +12,7 @@ class PoolParser extends abstractParser_1.AbstractParser {
|
|
|
12
12
|
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
13
13
|
switch (functionFragment.name) {
|
|
14
14
|
default:
|
|
15
|
-
return
|
|
15
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -16,7 +16,7 @@ class PriceOracleParser extends abstractParser_1.AbstractParser {
|
|
|
16
16
|
return `${functionName}(${this.tokenSymbol(token)})`;
|
|
17
17
|
}
|
|
18
18
|
default:
|
|
19
|
-
return
|
|
19
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -12,19 +12,25 @@ interface ParseData {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class TxParser {
|
|
14
14
|
protected static parsers: Record<string, IParser & AbstractParser>;
|
|
15
|
-
static parse(address: string, calldata: string): string;
|
|
15
|
+
static parse(address: string, calldata: string): string | null;
|
|
16
16
|
static parseToObject(address: string, calldata: string): {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
callObject: {
|
|
18
|
+
address: string;
|
|
19
|
+
functionFragment: import("ethers/lib/utils").FunctionFragment;
|
|
20
|
+
args: any;
|
|
21
|
+
};
|
|
22
|
+
parser: IParser & AbstractParser;
|
|
23
|
+
} | null;
|
|
21
24
|
static getParseData(address: string): ParseData;
|
|
22
|
-
static parseMultiCall(calls: Array<MultiCall>):
|
|
23
|
-
static parseToObjectMultiCall(calls: Array<MultiCall>): {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
static parseMultiCall(calls: Array<MultiCall>): (string | null)[];
|
|
26
|
+
static parseToObjectMultiCall(calls: Array<MultiCall>): ({
|
|
27
|
+
callObject: {
|
|
28
|
+
address: string;
|
|
29
|
+
functionFragment: import("ethers/lib/utils").FunctionFragment;
|
|
30
|
+
args: any;
|
|
31
|
+
};
|
|
32
|
+
parser: IParser & AbstractParser;
|
|
33
|
+
} | null)[];
|
|
28
34
|
static addAdapters(adapters: Array<AdapterForParser>): void;
|
|
29
35
|
static addContracts(network: NetworkType): void;
|
|
30
36
|
static addCreditFacade(creditFacade: string, underlying: SupportedToken, version: number): void;
|
package/lib/parsers/txParser.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TxParser = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
|
+
const aaveV2LendingPoolAdapterParser_1 = require("./aaveV2LendingPoolAdapterParser");
|
|
6
|
+
const aaveV2WrappedATokenAdapterParser_1 = require("./aaveV2WrappedATokenAdapterParser");
|
|
5
7
|
const addressProviderParser_1 = require("./addressProviderParser");
|
|
8
|
+
const balancerV2VaultParser_1 = require("./balancerV2VaultParser");
|
|
9
|
+
const compoundV2CTokenAdapterParser_1 = require("./compoundV2CTokenAdapterParser");
|
|
6
10
|
const convexBaseRewardPoolAdapterParser_1 = require("./convexBaseRewardPoolAdapterParser");
|
|
7
11
|
const convexBoosterAdapterParser_1 = require("./convexBoosterAdapterParser");
|
|
8
12
|
const convextRewardPoolParser_1 = require("./convextRewardPoolParser");
|
|
@@ -10,6 +14,7 @@ const creditFacadeParser_1 = require("./creditFacadeParser");
|
|
|
10
14
|
const creditManagerParser_1 = require("./creditManagerParser");
|
|
11
15
|
const curveAdapterParser_1 = require("./curveAdapterParser");
|
|
12
16
|
const ERC20Parser_1 = require("./ERC20Parser");
|
|
17
|
+
const erc626AdapterParser_1 = require("./erc626AdapterParser");
|
|
13
18
|
const lidoAdapterParser_1 = require("./lidoAdapterParser");
|
|
14
19
|
const lidoSTETHParser_1 = require("./lidoSTETHParser");
|
|
15
20
|
const poolParser_1 = require("./poolParser");
|
|
@@ -21,18 +26,28 @@ const yearnV2AdapterParser_1 = require("./yearnV2AdapterParser");
|
|
|
21
26
|
class TxParser {
|
|
22
27
|
static parsers = {};
|
|
23
28
|
static parse(address, calldata) {
|
|
24
|
-
|
|
29
|
+
let parser;
|
|
25
30
|
try {
|
|
26
|
-
|
|
31
|
+
parser = TxParser.getParser(address);
|
|
32
|
+
const callStr = parser.parse(calldata);
|
|
33
|
+
return callStr;
|
|
27
34
|
}
|
|
28
35
|
catch (e) {
|
|
29
36
|
console.error(`Error while parsing ${address}`, parser, e);
|
|
30
|
-
return
|
|
37
|
+
return null;
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
static parseToObject(address, calldata) {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
let parser;
|
|
42
|
+
try {
|
|
43
|
+
parser = TxParser.getParser(address);
|
|
44
|
+
const callObject = parser.parseToObject(address, calldata);
|
|
45
|
+
return { callObject, parser };
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.error(`Error while parsing ${address}`, parser, e);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
36
51
|
}
|
|
37
52
|
static getParseData(address) {
|
|
38
53
|
const parser = TxParser.getParser(address);
|
|
@@ -138,6 +153,22 @@ class TxParser {
|
|
|
138
153
|
case "LIDO_WSTETH_V1":
|
|
139
154
|
TxParser._addParser(addressLC, new wstETHAdapterParser_1.WstETHAdapterParser(contract, isContract));
|
|
140
155
|
break;
|
|
156
|
+
case "AAVE_V2_LENDING_POOL":
|
|
157
|
+
TxParser._addParser(addressLC, new aaveV2LendingPoolAdapterParser_1.AaveV2LendingPoolAdapterParser(contract, isContract));
|
|
158
|
+
break;
|
|
159
|
+
case "AAVE_V2_WRAPPED_ATOKEN":
|
|
160
|
+
TxParser._addParser(addressLC, new aaveV2WrappedATokenAdapterParser_1.AaveV2WrappedATokenAdapterParser(contract, isContract));
|
|
161
|
+
break;
|
|
162
|
+
case "BALANCER_VAULT":
|
|
163
|
+
TxParser._addParser(addressLC, new balancerV2VaultParser_1.BalancerV2VaultParser(contract, isContract));
|
|
164
|
+
break;
|
|
165
|
+
case "COMPOUND_V2_CERC20":
|
|
166
|
+
case "COMPOUND_V2_CETHER":
|
|
167
|
+
TxParser._addParser(addressLC, new compoundV2CTokenAdapterParser_1.CompoundV2CTokenAdapterParser(contract, isContract));
|
|
168
|
+
break;
|
|
169
|
+
case "ERC4626_VAULT":
|
|
170
|
+
TxParser._addParser(addressLC, new erc626AdapterParser_1.ERC4626AdapterParser(contract, isContract));
|
|
171
|
+
break;
|
|
141
172
|
}
|
|
142
173
|
}
|
|
143
174
|
static _addParser(address, parser) {
|
|
@@ -47,7 +47,7 @@ class UniswapV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
47
47
|
.join(" => ")}])`;
|
|
48
48
|
}
|
|
49
49
|
default:
|
|
50
|
-
return
|
|
50
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -58,7 +58,7 @@ class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
58
58
|
return `${functionName}(amountInMaximum: ${amountInMaximumStr}, amountOut: ${amountOutStr}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`;
|
|
59
59
|
}
|
|
60
60
|
default:
|
|
61
|
-
return
|
|
61
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
trackInputPath(path) {
|
|
@@ -45,7 +45,7 @@ class WstETHAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
45
45
|
return `${functionName}(${spender}, [${(0, sdk_gov_1.toBigInt)(amount).toString()}])`;
|
|
46
46
|
}
|
|
47
47
|
default:
|
|
48
|
-
return
|
|
48
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -50,7 +50,7 @@ class YearnV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
50
50
|
return `${functionName}(account: ${account}, to: ${to})`;
|
|
51
51
|
}
|
|
52
52
|
default:
|
|
53
|
-
return
|
|
53
|
+
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./core"), exports);
|
|
18
|
+
__exportStar(require("./pathfinder"), exports);
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
|
20
|
+
__exportStar(require("./v1/pathfinderv1"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { providers, utils } from "ethers";
|
|
2
|
+
import { MultiCall } from "./core";
|
|
3
|
+
export interface FeeInfo {
|
|
4
|
+
type: KnownFeeTypes;
|
|
5
|
+
value: bigint;
|
|
6
|
+
}
|
|
7
|
+
type KnownFeeTypes = "curve" | "lido" | "uniswap_v2" | "uniswap_v3" | "balancer";
|
|
8
|
+
export declare const BALANCER_VAULT_ABI: {
|
|
9
|
+
inputs: never[];
|
|
10
|
+
name: string;
|
|
11
|
+
outputs: {
|
|
12
|
+
internalType: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
stateMutability: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[];
|
|
19
|
+
export declare const BALANCER_VAULT_INTERFACE: utils.Interface;
|
|
20
|
+
interface FindPathFeesProps {
|
|
21
|
+
calls: Array<MultiCall>;
|
|
22
|
+
provider: providers.Provider;
|
|
23
|
+
contractsByAdapter: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export declare class PathFinderUtils {
|
|
26
|
+
static findPathFees({ calls, provider, contractsByAdapter, }: FindPathFeesProps): Promise<FeeInfo[]>;
|
|
27
|
+
private static getUniswapV2Fee;
|
|
28
|
+
private static getUniswapV3Fee;
|
|
29
|
+
private static getCurveFeeCall;
|
|
30
|
+
private static getCurveFee;
|
|
31
|
+
private static getBalancerFeeCall;
|
|
32
|
+
private static getBalancerFee;
|
|
33
|
+
private static getLidoFee;
|
|
34
|
+
}
|
|
35
|
+
export {};
|