@gearbox-protocol/sdk 3.0.0-next.5 → 3.0.0-next.51
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/contracts/IAirdropDistributor.sol +55 -0
- package/contracts/IDegenDistributor.sol +28 -0
- package/contracts/IOffchainOracle.sol +17 -0
- package/contracts/IWETHGateway.sol +33 -0
- package/contracts/IwstETHGateway.sol +24 -0
- package/contracts/index.sol +10 -3
- package/lib/apy/curveAPY.js +2 -1
- package/lib/apy/index.d.ts +2 -2
- package/lib/apy/yearnAPY.js +1 -1
- package/lib/config.d.ts +0 -1
- package/lib/config.js +1 -2
- package/lib/core/assets.d.ts +4 -4
- package/lib/core/assets.js +28 -17
- package/lib/core/creditAccount.d.ts +31 -6
- package/lib/core/creditAccount.js +101 -37
- package/lib/core/creditAccount.spec.js +693 -10
- package/lib/core/creditManager.d.ts +22 -8
- package/lib/core/creditManager.js +86 -30
- package/lib/core/events.js +14 -14
- package/lib/core/gauge.d.ts +26 -0
- package/lib/core/gauge.js +63 -0
- package/lib/core/gaugeMath.d.ts +40 -0
- package/lib/core/gaugeMath.js +108 -0
- package/lib/core/gaugeMath.spec.d.ts +1 -0
- package/lib/core/gaugeMath.spec.js +388 -0
- package/lib/core/{pool/data.d.ts → pool.d.ts} +18 -10
- package/lib/core/{pool/data.js → pool.js} +69 -24
- package/lib/core/strategy.js +2 -2
- package/lib/core/trade.d.ts +5 -23
- package/lib/core/trade.js +4 -61
- package/lib/core/transactions.d.ts +50 -3
- package/lib/core/transactions.js +136 -105
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/parsers/abstractParser.js +1 -2
- package/lib/parsers/creditFacadeParser.d.ts +2 -1
- package/lib/parsers/creditFacadeParser.js +17 -5
- package/lib/parsers/creditFacadeParser.spec.js +2 -3
- package/lib/parsers/curveAdapterParser.js +2 -3
- package/lib/parsers/txParser.d.ts +4 -4
- package/lib/parsers/txParser.js +9 -3
- package/lib/parsers/uniV2AdapterParser.js +2 -2
- package/lib/parsers/uniV3AdapterParser.js +3 -3
- package/lib/pathfinder/core.d.ts +4 -4
- package/lib/pathfinder/pathOptions.d.ts +2 -1
- package/lib/pathfinder/pathOptions.js +20 -1
- package/lib/pathfinder/pathOptions.spec.js +2 -2
- package/lib/pathfinder/pathfinder.js +4 -3
- package/lib/pathfinder/pathfinder.spec.js +3 -1
- package/lib/payload/creditAccount.d.ts +2 -2
- package/lib/payload/gauge.d.ts +12 -0
- package/lib/payload/pool.d.ts +6 -1
- package/lib/types/IAirdropDistributor.sol/IAirdropDistributor.d.ts +124 -0
- package/lib/types/IAirdropDistributor.sol/IAirdropDistributorEvents.d.ts +73 -0
- package/lib/types/IAirdropDistributor.sol/index.d.ts +2 -0
- package/lib/types/IContractsRegister.sol/IContractsRegister.d.ts +128 -0
- package/lib/types/IContractsRegister.sol/IContractsRegisterEvents.d.ts +50 -0
- package/lib/types/IContractsRegister.sol/index.d.ts +2 -0
- package/lib/types/IConvexToken.d.ts +9 -1
- package/lib/types/IConvexV1BaseRewardPoolAdapter.d.ts +17 -1
- package/lib/types/{IConvexV1BoosterAdapter.d.ts → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter.d.ts} +19 -4
- package/lib/types/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents.d.ts +43 -0
- package/lib/types/IConvexV1BoosterAdapter.sol/index.d.ts +2 -0
- package/lib/types/ICreditConfiguratorV3.sol/ICreditConfiguratorV3.d.ts +716 -0
- package/lib/types/ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events.d.ts +275 -0
- package/lib/types/ICreditConfiguratorV3.sol/index.d.ts +2 -0
- package/lib/types/ICreditFacadeV2.sol/ICreditFacadeV2Extended.d.ts +7 -11
- package/lib/types/ICreditFacadeV3.sol/ICreditFacadeV3.d.ts +165 -20
- package/lib/types/ICreditFacadeV3.sol/ICreditFacadeV3Events.d.ts +5 -7
- package/lib/types/ICreditFacadeV3Multicall.d.ts +35 -12
- package/lib/types/ICreditManagerV3.sol/ICreditManagerV3.d.ts +273 -39
- package/lib/types/IDataCompressorV2_10.d.ts +43 -9
- package/lib/types/IDataCompressorV3_00.d.ts +140 -10
- package/lib/types/IDegenDistributor.sol/IDegenDistributor.d.ts +96 -0
- package/lib/types/IDegenDistributor.sol/IDegenDistributorEvents.d.ts +53 -0
- package/lib/types/IDegenDistributor.sol/index.d.ts +2 -0
- package/lib/types/{draft-IERC20Permit.sol/IERC20Permit.d.ts → IERC20Permit.d.ts} +1 -1
- package/lib/types/IERC20ZapperDeposits.d.ts +117 -0
- package/lib/types/IETHZapperDeposits.d.ts +66 -0
- package/lib/types/IGasPricer.d.ts +44 -0
- package/lib/types/IGasPricer.js +2 -0
- package/lib/types/IGearStakingV3.sol/IGearStakingV3.d.ts +408 -0
- package/lib/types/IGearStakingV3.sol/IGearStakingV3.js +2 -0
- package/lib/types/IGearStakingV3.sol/IGearStakingV3Events.d.ts +117 -0
- package/lib/types/IGearStakingV3.sol/IGearStakingV3Events.js +2 -0
- package/lib/types/IGearStakingV3.sol/index.d.ts +2 -0
- package/lib/types/IGearStakingV3.sol/index.js +2 -0
- package/lib/types/{ILidoV1Adapter.sol/ILidoV1Adapter.d.ts → ILidoV1Adapter.d.ts} +5 -40
- package/lib/types/ILidoV1Adapter.js +2 -0
- package/lib/types/IOffchainOracle.d.ts +58 -0
- package/lib/types/IOffchainOracle.js +2 -0
- package/lib/types/IPoolV3.sol/IPoolV3.d.ts +43 -11
- package/lib/types/IPoolV3.sol/index.d.ts +0 -1
- package/lib/types/IRouter.d.ts +11 -1
- package/lib/types/IWETHGateway.d.ts +90 -0
- package/lib/types/IWETHGateway.js +2 -0
- package/lib/types/IZapper.d.ts +130 -0
- package/lib/types/IZapper.js +2 -0
- package/lib/types/IwstETHGateway.sol/IwstETHGateWay.d.ts +70 -0
- package/lib/types/IwstETHGateway.sol/IwstETHGateWay.js +2 -0
- package/lib/types/IwstETHGateway.sol/index.d.ts +1 -0
- package/lib/types/IwstETHGateway.sol/index.js +2 -0
- package/lib/types/factories/AddressProvider__factory.d.ts +1 -1
- package/lib/types/factories/AddressProvider__factory.js +1 -1
- package/lib/types/factories/Balances.sol/BalanceOps__factory.d.ts +1 -1
- package/lib/types/factories/Balances.sol/BalanceOps__factory.js +1 -1
- package/lib/types/factories/Claimable__factory.d.ts +1 -1
- package/lib/types/factories/Claimable__factory.js +1 -1
- package/lib/types/factories/Errors__factory.d.ts +1 -1
- package/lib/types/factories/Errors__factory.js +1 -1
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributorEvents__factory.d.ts +63 -0
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributorEvents__factory.js +88 -0
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributor__factory.d.ts +119 -0
- package/lib/types/factories/IAirdropDistributor.sol/IAirdropDistributor__factory.js +161 -0
- package/lib/types/factories/IAirdropDistributor.sol/index.d.ts +2 -0
- package/lib/types/factories/IAirdropDistributor.sol/index.js +10 -0
- package/lib/types/factories/IContractsRegister.sol/IContractsRegisterEvents__factory.d.ts +28 -0
- package/lib/types/factories/IContractsRegister.sol/IContractsRegisterEvents__factory.js +45 -0
- package/lib/types/factories/{IAToken__factory.d.ts → IContractsRegister.sol/IContractsRegister__factory.d.ts} +49 -113
- package/lib/types/factories/{IAToken__factory.js → IContractsRegister.sol/IContractsRegister__factory.js} +49 -130
- package/lib/types/factories/IContractsRegister.sol/index.d.ts +2 -0
- package/lib/types/factories/IContractsRegister.sol/index.js +10 -0
- package/lib/types/factories/IConvexToken__factory.d.ts +10 -0
- package/lib/types/factories/IConvexToken__factory.js +13 -0
- package/lib/types/factories/IConvexV1BaseRewardPoolAdapter__factory.d.ts +20 -0
- package/lib/types/factories/IConvexV1BaseRewardPoolAdapter__factory.js +26 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.d.ts +23 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents__factory.js +38 -0
- package/lib/types/factories/{IConvexV1BoosterAdapter__factory.d.ts → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.d.ts} +16 -1
- package/lib/types/factories/{IConvexV1BoosterAdapter__factory.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter__factory.js} +19 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/index.d.ts +2 -0
- package/lib/types/factories/IConvexV1BoosterAdapter.sol/index.js +10 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events__factory.d.ts +273 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events__factory.js +357 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3__factory.d.ts +605 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/ICreditConfiguratorV3__factory.js +785 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/index.d.ts +2 -0
- package/lib/types/factories/ICreditConfiguratorV3.sol/index.js +10 -0
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Extended__factory.d.ts +0 -4
- package/lib/types/factories/ICreditFacadeV2.sol/ICreditFacadeV2Extended__factory.js +0 -5
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.d.ts +1 -6
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3Events__factory.js +1 -7
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.d.ts +144 -13
- package/lib/types/factories/ICreditFacadeV3.sol/ICreditFacadeV3__factory.js +185 -15
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.d.ts +35 -5
- package/lib/types/factories/ICreditFacadeV3Multicall__factory.js +43 -5
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3__factory.d.ts +199 -25
- package/lib/types/factories/ICreditManagerV3.sol/ICreditManagerV3__factory.js +252 -28
- package/lib/types/factories/IDataCompressorV2_10__factory.d.ts +110 -12
- package/lib/types/factories/IDataCompressorV2_10__factory.js +138 -14
- package/lib/types/factories/IDataCompressorV3_00__factory.d.ts +400 -16
- package/lib/types/factories/IDataCompressorV3_00__factory.js +508 -19
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributorEvents__factory.d.ts +38 -0
- package/lib/types/factories/{AaveV2_WrappedAToken.sol/IWrappedATokenEvents__factory.js → IDegenDistributor.sol/IDegenDistributorEvents__factory.js} +13 -25
- package/lib/types/factories/IDegenDistributor.sol/IDegenDistributor__factory.d.ts +84 -0
- package/lib/types/factories/{IPoolV3.sol/IPoolBase__factory.js → IDegenDistributor.sol/IDegenDistributor__factory.js} +46 -41
- package/lib/types/factories/IDegenDistributor.sol/index.d.ts +2 -0
- package/lib/types/factories/IDegenDistributor.sol/index.js +10 -0
- package/lib/types/factories/{draft-IERC20Permit.sol/IERC20Permit__factory.d.ts → IERC20Permit__factory.d.ts} +1 -1
- package/lib/types/factories/IERC20ZapperDeposits__factory.d.ts +120 -0
- package/lib/types/factories/IERC20ZapperDeposits__factory.js +165 -0
- package/lib/types/factories/IETHZapperDeposits__factory.d.ts +40 -0
- package/lib/types/factories/IETHZapperDeposits__factory.js +62 -0
- package/lib/types/factories/IGasPricer__factory.d.ts +22 -0
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1AdapterEvents__factory.js → IGasPricer__factory.js} +14 -8
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3Events__factory.d.ts +113 -0
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3Events__factory.js +152 -0
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3__factory.d.ts +504 -0
- package/lib/types/factories/IGearStakingV3.sol/IGearStakingV3__factory.js +660 -0
- package/lib/types/factories/IGearStakingV3.sol/index.d.ts +2 -0
- package/lib/types/factories/IGearStakingV3.sol/index.js +10 -0
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1Adapter__factory.d.ts → ILidoV1Adapter__factory.d.ts} +1 -35
- package/lib/types/factories/{ILidoV1Adapter.sol/ILidoV1Adapter__factory.js → ILidoV1Adapter__factory.js} +0 -44
- package/lib/types/factories/IOffchainOracle__factory.d.ts +48 -0
- package/lib/types/factories/IOffchainOracle__factory.js +72 -0
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.d.ts +62 -14
- package/lib/types/factories/IPoolV3.sol/IPoolV3__factory.js +79 -17
- package/lib/types/factories/IPoolV3.sol/index.d.ts +0 -1
- package/lib/types/factories/IPoolV3.sol/index.js +1 -3
- package/lib/types/factories/IRouter__factory.d.ts +14 -0
- package/lib/types/factories/IRouter__factory.js +19 -0
- package/lib/types/factories/IWETHGateway__factory.d.ts +58 -0
- package/lib/types/factories/IWETHGateway__factory.js +83 -0
- package/lib/types/factories/{WERC20ZapperBase__factory.d.ts → IZapper__factory.d.ts} +57 -61
- package/lib/types/factories/{WERC20ZapperBase__factory.js → IZapper__factory.js} +65 -71
- package/lib/types/factories/{ZapperBase__factory.d.ts → IwstETHGateway.sol/IwstETHGateWay__factory.d.ts} +22 -34
- package/lib/types/factories/{ZapperBase__factory.js → IwstETHGateway.sol/IwstETHGateWay__factory.js} +22 -39
- package/lib/types/factories/IwstETHGateway.sol/index.d.ts +1 -0
- package/lib/types/factories/IwstETHGateway.sol/index.js +8 -0
- package/lib/types/factories/SafeERC20__factory.d.ts +1 -1
- package/lib/types/factories/SafeERC20__factory.js +1 -1
- package/lib/types/factories/index.d.ts +15 -12
- package/lib/types/factories/index.js +25 -23
- package/lib/types/index.d.ts +56 -38
- package/lib/types/index.js +42 -32
- package/lib/utils/formatter.d.ts +0 -3
- package/lib/utils/formatter.js +1 -67
- package/lib/utils/math.d.ts +2 -0
- package/lib/utils/math.js +2 -0
- package/lib/utils/types.d.ts +1 -0
- package/lib/watchers/creditAccountWatcher.d.ts +3 -2
- package/lib/watchers/creditAccountWatcher.js +19 -13
- package/lib/watchers/creditAccountWatcher.spec.js +18 -18
- package/lib/watchers/creditManagerWatcher.d.ts +5 -3
- package/lib/watchers/creditManagerWatcher.js +32 -10
- package/lib/watchers/creditManagerWatcher.spec.js +12 -4
- package/package.json +10 -9
- package/contracts/IRouter.sol +0 -100
- package/lib/core/pool/index.d.ts +0 -1
- package/lib/core/pool/index.js +0 -17
- package/lib/types/AaveV2_WrappedAToken.sol/IWrappedATokenEvents.d.ts +0 -60
- package/lib/types/AaveV2_WrappedAToken.sol/WrappedAToken.d.ts +0 -332
- package/lib/types/AaveV2_WrappedAToken.sol/index.d.ts +0 -2
- package/lib/types/ERC20.d.ts +0 -198
- package/lib/types/IAToken.d.ts +0 -182
- package/lib/types/ILendingPool.d.ts +0 -140
- package/lib/types/ILidoV1Adapter.sol/ILidoV1AdapterEvents.d.ts +0 -39
- package/lib/types/ILidoV1Adapter.sol/ILidoV1AdapterExceptions.d.ts +0 -27
- package/lib/types/ILidoV1Adapter.sol/index.d.ts +0 -3
- package/lib/types/IPoolV3.sol/IPoolBase.d.ts +0 -102
- package/lib/types/WATokenZapper.d.ts +0 -134
- package/lib/types/WERC20ZapperBase.d.ts +0 -134
- package/lib/types/WETHZapper.d.ts +0 -122
- package/lib/types/WstETHZapper.d.ts +0 -134
- package/lib/types/ZapperBase.d.ts +0 -70
- package/lib/types/draft-IERC20Permit.sol/index.d.ts +0 -1
- package/lib/types/factories/AaveV2_WrappedAToken.sol/IWrappedATokenEvents__factory.d.ts +0 -48
- package/lib/types/factories/AaveV2_WrappedAToken.sol/WrappedAToken__factory.d.ts +0 -397
- package/lib/types/factories/AaveV2_WrappedAToken.sol/WrappedAToken__factory.js +0 -535
- package/lib/types/factories/AaveV2_WrappedAToken.sol/index.d.ts +0 -2
- package/lib/types/factories/AaveV2_WrappedAToken.sol/index.js +0 -10
- package/lib/types/factories/ERC20__factory.d.ts +0 -239
- package/lib/types/factories/ERC20__factory.js +0 -328
- package/lib/types/factories/ILendingPool__factory.d.ts +0 -134
- package/lib/types/factories/ILendingPool__factory.js +0 -183
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterEvents__factory.d.ts +0 -18
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterExceptions__factory.d.ts +0 -12
- package/lib/types/factories/ILidoV1Adapter.sol/ILidoV1AdapterExceptions__factory.js +0 -24
- package/lib/types/factories/ILidoV1Adapter.sol/index.d.ts +0 -3
- package/lib/types/factories/ILidoV1Adapter.sol/index.js +0 -12
- package/lib/types/factories/IPoolV3.sol/IPoolBase__factory.d.ts +0 -80
- package/lib/types/factories/WATokenZapper__factory.d.ts +0 -161
- package/lib/types/factories/WATokenZapper__factory.js +0 -227
- package/lib/types/factories/WETHZapper__factory.d.ts +0 -138
- package/lib/types/factories/WETHZapper__factory.js +0 -198
- package/lib/types/factories/WstETHZapper__factory.d.ts +0 -161
- package/lib/types/factories/WstETHZapper__factory.js +0 -227
- package/lib/types/factories/draft-IERC20Permit.sol/index.d.ts +0 -1
- package/lib/types/factories/draft-IERC20Permit.sol/index.js +0 -8
- /package/lib/{types/AaveV2_WrappedAToken.sol/IWrappedATokenEvents.js → payload/gauge.js} +0 -0
- /package/lib/types/{AaveV2_WrappedAToken.sol/WrappedAToken.js → IAirdropDistributor.sol/IAirdropDistributor.js} +0 -0
- /package/lib/types/{AaveV2_WrappedAToken.sol/index.js → IAirdropDistributor.sol/IAirdropDistributorEvents.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol → IAirdropDistributor.sol}/index.js +0 -0
- /package/lib/types/{ERC20.js → IContractsRegister.sol/IContractsRegister.js} +0 -0
- /package/lib/types/{IAToken.js → IContractsRegister.sol/IContractsRegisterEvents.js} +0 -0
- /package/lib/types/{draft-IERC20Permit.sol → IContractsRegister.sol}/index.js +0 -0
- /package/lib/types/{IConvexV1BoosterAdapter.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapter.js} +0 -0
- /package/lib/types/{ILendingPool.js → IConvexV1BoosterAdapter.sol/IConvexV1BoosterAdapterEvents.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1Adapter.js → IConvexV1BoosterAdapter.sol/index.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1AdapterEvents.js → ICreditConfiguratorV3.sol/ICreditConfiguratorV3.js} +0 -0
- /package/lib/types/{ILidoV1Adapter.sol/ILidoV1AdapterExceptions.js → ICreditConfiguratorV3.sol/ICreditConfiguratorV3Events.js} +0 -0
- /package/lib/types/{IPoolV3.sol/IPoolBase.js → ICreditConfiguratorV3.sol/index.js} +0 -0
- /package/lib/types/{WATokenZapper.js → IDegenDistributor.sol/IDegenDistributor.js} +0 -0
- /package/lib/types/{WERC20ZapperBase.js → IDegenDistributor.sol/IDegenDistributorEvents.js} +0 -0
- /package/lib/types/{WETHZapper.js → IDegenDistributor.sol/index.js} +0 -0
- /package/lib/types/{draft-IERC20Permit.sol/IERC20Permit.js → IERC20Permit.js} +0 -0
- /package/lib/types/{WstETHZapper.js → IERC20ZapperDeposits.js} +0 -0
- /package/lib/types/{ZapperBase.js → IETHZapperDeposits.js} +0 -0
- /package/lib/types/factories/{draft-IERC20Permit.sol/IERC20Permit__factory.js → IERC20Permit__factory.js} +0 -0
|
@@ -4,17 +4,24 @@ exports.CreditFacadeParser = void 0;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const abstractParser_1 = require("./abstractParser");
|
|
6
6
|
class CreditFacadeParser extends abstractParser_1.AbstractParser {
|
|
7
|
-
|
|
7
|
+
version;
|
|
8
|
+
constructor(token, version) {
|
|
8
9
|
super(token);
|
|
9
|
-
this.
|
|
10
|
+
this.version = version;
|
|
11
|
+
this.ifc =
|
|
12
|
+
version === 300
|
|
13
|
+
? types_1.ICreditFacadeV3Multicall__factory.createInterface()
|
|
14
|
+
: types_1.ICreditFacadeV2Extended__factory.createInterface();
|
|
10
15
|
this.adapterName = "CreditFacade";
|
|
11
16
|
}
|
|
12
17
|
parse(calldata) {
|
|
13
18
|
const { functionFragment, functionName } = this.parseSelector(calldata);
|
|
14
19
|
switch (functionFragment.name) {
|
|
15
20
|
case "addCollateral": {
|
|
16
|
-
const
|
|
17
|
-
|
|
21
|
+
const r = this.decodeFunctionData(functionFragment, calldata);
|
|
22
|
+
const token = r[0];
|
|
23
|
+
const amount = r[1];
|
|
24
|
+
return `${functionName}(token: ${this.tokenSymbol(token)}, amount: ${this.formatAmount(amount)})`;
|
|
18
25
|
}
|
|
19
26
|
case "increaseDebt":
|
|
20
27
|
case "decreaseDebt": {
|
|
@@ -26,12 +33,17 @@ class CreditFacadeParser extends abstractParser_1.AbstractParser {
|
|
|
26
33
|
const [address] = this.decodeFunctionData(functionFragment, calldata);
|
|
27
34
|
return `${functionName}(token: ${this.tokenSymbol(address)})`;
|
|
28
35
|
}
|
|
36
|
+
case "updateQuota": {
|
|
37
|
+
const [address, quotaUpdate, minQuota] = this.decodeFunctionData(functionFragment, calldata);
|
|
38
|
+
return `${functionName}(token: ${this.tokenSymbol(address)}, quotaUpdate: ${this.formatAmount(quotaUpdate)}, minQuota: ${this.formatAmount(minQuota)})`;
|
|
39
|
+
}
|
|
29
40
|
case "revertIfReceivedLessThan": {
|
|
30
41
|
const [balances] = this.decodeFunctionData(functionFragment, calldata);
|
|
31
42
|
const balancesStr = balances
|
|
32
43
|
.map(b => {
|
|
44
|
+
const balance = "balance" in b ? b.balance : b.amount;
|
|
33
45
|
const symbol = this.tokenSymbol(b.token);
|
|
34
|
-
return `${symbol}: ${this.formatBN(
|
|
46
|
+
return `${symbol}: ${this.formatBN(balance, symbol)}`;
|
|
35
47
|
})
|
|
36
48
|
.join(", ");
|
|
37
49
|
return `${functionName}(${balancesStr})`;
|
|
@@ -6,14 +6,13 @@ const types_1 = require("../types");
|
|
|
6
6
|
const creditFacadeParser_1 = require("./creditFacadeParser");
|
|
7
7
|
describe("CreditFacadeParser test", () => {
|
|
8
8
|
it("all functions works well", () => {
|
|
9
|
-
let parser = new creditFacadeParser_1.CreditFacadeParser("DAI");
|
|
9
|
+
let parser = new creditFacadeParser_1.CreditFacadeParser("DAI", 1);
|
|
10
10
|
const ifc = types_1.ICreditFacadeV2Extended__factory.createInterface();
|
|
11
11
|
let parsed = parser.parse(ifc.encodeFunctionData("addCollateral", [
|
|
12
|
-
sdk_gov_1.DUMB_ADDRESS,
|
|
13
12
|
sdk_gov_1.tokenDataByNetwork.Mainnet.WBTC,
|
|
14
13
|
(sdk_gov_1.WAD * 444n) / 10n,
|
|
15
14
|
]));
|
|
16
|
-
(0, chai_1.expect)(parsed).to.be.eq("CreditFacade[DAI].addCollateral(
|
|
15
|
+
(0, chai_1.expect)(parsed).to.be.eq("CreditFacade[DAI].addCollateral(token: WBTC, amount: 44.40 [44400000000000000000])", "Incorrect parse addCollateral");
|
|
17
16
|
parsed = parser.parse(ifc.encodeFunctionData("increaseDebt", [(sdk_gov_1.WAD * 414n) / 10n]));
|
|
18
17
|
(0, chai_1.expect)(parsed).to.be.eq("CreditFacade[DAI].increaseDebt(amount: 41.40 [41400000000000000000])", "Incorrect parse increaseDebt");
|
|
19
18
|
parsed = parser.parse(ifc.encodeFunctionData("decreaseDebt", [(sdk_gov_1.WAD * 334n) / 10n]));
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CurveAdapterParser = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
const formatter_1 = require("../utils/formatter");
|
|
7
6
|
const abstractParser_1 = require("./abstractParser");
|
|
8
7
|
class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
9
8
|
lpToken;
|
|
@@ -54,7 +53,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
54
53
|
const jSym = functionFragment.name === "exchange_all_underlying"
|
|
55
54
|
? this.getUnderlyingTokenByIndex(j)
|
|
56
55
|
: this.getTokenByIndex(j);
|
|
57
|
-
return `${functionName}(i: ${iSym}, j: ${jSym}, rateMinRAY: ${(0,
|
|
56
|
+
return `${functionName}(i: ${iSym}, j: ${jSym}, rateMinRAY: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}`;
|
|
58
57
|
}
|
|
59
58
|
case "add_liquidity_one_coin": {
|
|
60
59
|
const [amount, i, minAmount] = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -64,7 +63,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
|
|
|
64
63
|
case "add_all_liquidity_one_coin":
|
|
65
64
|
case "remove_all_liquidity_one_coin": {
|
|
66
65
|
const [i, rateMinRAY] = this.decodeFunctionData(functionFragment, calldata);
|
|
67
|
-
return `${functionName}(i: ${this.getTokenByIndex(i)}, rateMinRAY: ${(0,
|
|
66
|
+
return `${functionName}(i: ${this.getTokenByIndex(i)}, rateMinRAY: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)})`;
|
|
68
67
|
}
|
|
69
68
|
case "add_liquidity": {
|
|
70
69
|
const [amounts, minAmount] = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NetworkType, SupportedContract, SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
|
-
import {
|
|
2
|
+
import { MultiCall } from "../pathfinder/core";
|
|
3
3
|
import { AbstractParser } from "./abstractParser";
|
|
4
4
|
import { IParser } from "./iParser";
|
|
5
5
|
export interface AdapterForParser {
|
|
@@ -19,15 +19,15 @@ export declare class TxParser {
|
|
|
19
19
|
args: any;
|
|
20
20
|
};
|
|
21
21
|
static getParseData(address: string): ParseData;
|
|
22
|
-
static parseMultiCall(calls: Array<
|
|
23
|
-
static parseToObjectMultiCall(calls: Array<
|
|
22
|
+
static parseMultiCall(calls: Array<MultiCall>): Array<string>;
|
|
23
|
+
static parseToObjectMultiCall(calls: Array<MultiCall>): {
|
|
24
24
|
address: string;
|
|
25
25
|
functionFragment: import("ethers/lib/utils").FunctionFragment;
|
|
26
26
|
args: any;
|
|
27
27
|
}[];
|
|
28
28
|
static addAdapters(adapters: Array<AdapterForParser>): void;
|
|
29
29
|
static addContracts(network: NetworkType): void;
|
|
30
|
-
static addCreditFacade(creditFacade: string, underlying: SupportedToken): void;
|
|
30
|
+
static addCreditFacade(creditFacade: string, underlying: SupportedToken, version: number): void;
|
|
31
31
|
static addTokens(network: NetworkType): void;
|
|
32
32
|
static addPriceOracle(address: string): void;
|
|
33
33
|
static addAddressProvider(address: string): void;
|
package/lib/parsers/txParser.js
CHANGED
|
@@ -22,7 +22,13 @@ class TxParser {
|
|
|
22
22
|
static parsers = {};
|
|
23
23
|
static parse(address, calldata) {
|
|
24
24
|
const parser = TxParser.getParser(address);
|
|
25
|
-
|
|
25
|
+
try {
|
|
26
|
+
return parser.parse(calldata);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
console.error(`Error while parsing ${address}`, parser, e);
|
|
30
|
+
return "Parsing error";
|
|
31
|
+
}
|
|
26
32
|
}
|
|
27
33
|
static parseToObject(address, calldata) {
|
|
28
34
|
const parser = TxParser.getParser(address);
|
|
@@ -61,8 +67,8 @@ class TxParser {
|
|
|
61
67
|
}
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
static addCreditFacade(creditFacade, underlying) {
|
|
65
|
-
TxParser._addParser(creditFacade, new creditFacadeParser_1.CreditFacadeParser(underlying));
|
|
70
|
+
static addCreditFacade(creditFacade, underlying, version) {
|
|
71
|
+
TxParser._addParser(creditFacade, new creditFacadeParser_1.CreditFacadeParser(underlying, version));
|
|
66
72
|
}
|
|
67
73
|
static addTokens(network) {
|
|
68
74
|
sdk_gov_1.TypedObjectUtils.entries(sdk_gov_1.tokenDataByNetwork[network]).forEach(([s, t]) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniswapV2AdapterParser = void 0;
|
|
4
|
+
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
|
-
const formatter_1 = require("../utils/formatter");
|
|
6
6
|
const abstractParser_1 = require("./abstractParser");
|
|
7
7
|
class UniswapV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
8
8
|
constructor(contract, isContract) {
|
|
@@ -41,7 +41,7 @@ class UniswapV2AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
41
41
|
}
|
|
42
42
|
case "swapAllTokensForTokens": {
|
|
43
43
|
const [rateMinRAY, path] = this.decodeFunctionData(functionFragment, calldata);
|
|
44
|
-
return `${functionName}(rate: ${(0,
|
|
44
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: [${path
|
|
45
45
|
.map(r => this.tokenSymbol(r))
|
|
46
46
|
.join(" => ")}])`;
|
|
47
47
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniswapV3AdapterParser = void 0;
|
|
4
|
+
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
|
-
const formatter_1 = require("../utils/formatter");
|
|
6
6
|
const abstractParser_1 = require("./abstractParser");
|
|
7
7
|
class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
8
8
|
constructor(contract, isContract) {
|
|
@@ -26,7 +26,7 @@ class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
26
26
|
const { params: { tokenIn, tokenOut, fee, rateMinRAY }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
27
27
|
const tokenInSym = this.tokenSymbol(tokenIn);
|
|
28
28
|
const tokenOutSym = this.tokenSymbol(tokenOut);
|
|
29
|
-
return `${functionName}(rate: ${(0,
|
|
29
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`;
|
|
30
30
|
}
|
|
31
31
|
case "exactInput": {
|
|
32
32
|
const { params: { amountIn, amountOutMinimum, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
@@ -38,7 +38,7 @@ class UniswapV3AdapterParser extends abstractParser_1.AbstractParser {
|
|
|
38
38
|
case "exactAllInput": {
|
|
39
39
|
const { params: { rateMinRAY, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
|
40
40
|
const pathStr = this.trackInputPath(path);
|
|
41
|
-
return `${functionName}(rate: ${(0,
|
|
41
|
+
return `${functionName}(rate: ${(0, sdk_gov_1.formatBN)(rateMinRAY, 27)}, path: ${pathStr}`;
|
|
42
42
|
}
|
|
43
43
|
case "exactOutput": {
|
|
44
44
|
const { params: { amountInMaximum, amountOut, path }, } = this.decodeFunctionData(functionFragment, calldata);
|
package/lib/pathfinder/core.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { ExcludeArrayProps } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { MultiCallStructOutput, SwapTaskStructOutput } from "../types/IRouter";
|
|
1
3
|
export declare enum SwapOperation {
|
|
2
4
|
EXACT_INPUT = 0,
|
|
3
5
|
EXACT_INPUT_ALL = 1,
|
|
4
6
|
EXACT_OUTPUT = 2
|
|
5
7
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
callData: string;
|
|
9
|
-
}
|
|
8
|
+
export type MultiCall = ExcludeArrayProps<MultiCallStructOutput>;
|
|
9
|
+
export type SwapTask = ExcludeArrayProps<SwapTaskStructOutput>;
|
|
10
10
|
export interface PathFinderResult {
|
|
11
11
|
amount: bigint;
|
|
12
12
|
calls: Array<MultiCall>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurveLPToken, NetworkType } from "@gearbox-protocol/sdk-gov";
|
|
1
|
+
import { BalancerLPToken, CurveLPToken, NetworkType } from "@gearbox-protocol/sdk-gov";
|
|
2
2
|
import { CaTokenBalance } from "../payload/creditAccount";
|
|
3
3
|
export interface PathOption {
|
|
4
4
|
target: string;
|
|
@@ -10,6 +10,7 @@ export type BalanceInterface = Pick<CaTokenBalance, "balance">;
|
|
|
10
10
|
export declare class PathOptionFactory {
|
|
11
11
|
static generatePathOptions(balances: Record<string, BalanceInterface>, loopsInTx: number): Array<PathOptionSerie>;
|
|
12
12
|
static getCurvePools(balances: Record<string, BalanceInterface>): Array<CurveLPToken>;
|
|
13
|
+
static getBalancerPools(balances: Record<string, BalanceInterface>): Array<BalancerLPToken>;
|
|
13
14
|
static next(path: PathOptionSerie): PathOptionSerie;
|
|
14
15
|
static detectNetwork(underlying: string): NetworkType;
|
|
15
16
|
}
|
|
@@ -5,8 +5,9 @@ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
|
5
5
|
class PathOptionFactory {
|
|
6
6
|
static generatePathOptions(balances, loopsInTx) {
|
|
7
7
|
const curvePools = PathOptionFactory.getCurvePools(balances);
|
|
8
|
+
const balancerPools = PathOptionFactory.getBalancerPools(balances);
|
|
8
9
|
const network = PathOptionFactory.detectNetwork(Object.keys(balances)[0]);
|
|
9
|
-
const
|
|
10
|
+
const curveInitPO = curvePools.map(symbol => {
|
|
10
11
|
return {
|
|
11
12
|
target: sdk_gov_1.tokenDataByNetwork[network][symbol],
|
|
12
13
|
option: 0,
|
|
@@ -14,6 +15,14 @@ class PathOptionFactory {
|
|
|
14
15
|
.tokens.length,
|
|
15
16
|
};
|
|
16
17
|
});
|
|
18
|
+
const balancerInitPO = balancerPools.map(symbol => {
|
|
19
|
+
return {
|
|
20
|
+
target: sdk_gov_1.tokenDataByNetwork[network][symbol],
|
|
21
|
+
option: 0,
|
|
22
|
+
totalOptions: sdk_gov_1.balancerLpTokens[symbol].underlying.length,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const initPO = [...curveInitPO, ...balancerInitPO];
|
|
17
26
|
const totalLoops = initPO.reduce((acc, item) => acc * item.totalOptions, 1);
|
|
18
27
|
const result = [];
|
|
19
28
|
let currentPo = [...initPO];
|
|
@@ -56,6 +65,16 @@ class PathOptionFactory {
|
|
|
56
65
|
]);
|
|
57
66
|
return Array.from(curveSet.values());
|
|
58
67
|
}
|
|
68
|
+
static getBalancerPools(balances) {
|
|
69
|
+
const result = [];
|
|
70
|
+
for (const [token, { balance }] of Object.entries(balances)) {
|
|
71
|
+
const symbol = sdk_gov_1.tokenSymbolByAddress[token.toLowerCase()];
|
|
72
|
+
if ((0, sdk_gov_1.isBalancerLPToken)(symbol) && (0, sdk_gov_1.toBigInt)(balance) > 1) {
|
|
73
|
+
result.push(symbol);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
59
78
|
static next(path) {
|
|
60
79
|
let newPath = [...path];
|
|
61
80
|
for (let i = path.length - 1; i >= 0; i--) {
|
|
@@ -61,7 +61,7 @@ describe("PathOptionFactory test", () => {
|
|
|
61
61
|
[sdk_gov_1.tokenDataByNetwork.Mainnet["3Crv"]]: { balance: 200n },
|
|
62
62
|
[sdk_gov_1.tokenDataByNetwork.Mainnet.USDC]: { balance: 200n },
|
|
63
63
|
[sdk_gov_1.tokenDataByNetwork.Mainnet.FRAX3CRV]: { balance: 200n },
|
|
64
|
-
[sdk_gov_1.tokenDataByNetwork.Mainnet
|
|
64
|
+
[sdk_gov_1.tokenDataByNetwork.Mainnet["50OHM_50DAI"]]: { balance: 200n },
|
|
65
65
|
};
|
|
66
66
|
const result = pathOptions_1.PathOptionFactory.generatePathOptions(balances, 4);
|
|
67
67
|
const expected = [
|
|
@@ -76,7 +76,7 @@ describe("PathOptionFactory test", () => {
|
|
|
76
76
|
totalOptions: 2,
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
target: sdk_gov_1.tokenDataByNetwork.Mainnet
|
|
79
|
+
target: sdk_gov_1.tokenDataByNetwork.Mainnet["50OHM_50DAI"],
|
|
80
80
|
option: 0,
|
|
81
81
|
totalOptions: 2,
|
|
82
82
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PathFinder = void 0;
|
|
4
4
|
const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
|
|
5
|
+
const ethers_1 = require("ethers");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
const pathOptions_1 = require("./pathOptions");
|
|
7
8
|
const MAX_GAS_PER_ROUTE = 200e6;
|
|
@@ -12,7 +13,7 @@ class PathFinder {
|
|
|
12
13
|
static connectors = [
|
|
13
14
|
"USDC",
|
|
14
15
|
"WETH",
|
|
15
|
-
"
|
|
16
|
+
"USDT",
|
|
16
17
|
"FRAX",
|
|
17
18
|
];
|
|
18
19
|
_connectors;
|
|
@@ -32,8 +33,8 @@ class PathFinder {
|
|
|
32
33
|
tokenOut: sdk_gov_1.tokenDataByNetwork[this.network][tokenOut] ||
|
|
33
34
|
tokenOut,
|
|
34
35
|
connectors,
|
|
35
|
-
amount: amount,
|
|
36
|
-
slippage,
|
|
36
|
+
amount: ethers_1.BigNumber.from(amount),
|
|
37
|
+
slippage: ethers_1.BigNumber.from(slippage),
|
|
37
38
|
externalSlippage: false,
|
|
38
39
|
};
|
|
39
40
|
const results = await this.pathFinder.callStatic.findAllSwaps(swapTask, {
|
|
@@ -28,11 +28,13 @@ describe("PathFinder test", () => {
|
|
|
28
28
|
[sdk_gov_1.tokenDataByNetwork.Mainnet.WETH.toLowerCase()]: true,
|
|
29
29
|
[sdk_gov_1.tokenDataByNetwork.Mainnet.DAI.toLowerCase()]: true,
|
|
30
30
|
[sdk_gov_1.tokenDataByNetwork.Mainnet.FRAX.toLowerCase()]: true,
|
|
31
|
+
[sdk_gov_1.tokenDataByNetwork.Mainnet.USDT.toLowerCase()]: true,
|
|
31
32
|
};
|
|
32
33
|
(0, chai_1.expect)(pf.getAvailableConnectors(allowedTokens)).to.be.deep.equal([
|
|
33
34
|
sdk_gov_1.tokenDataByNetwork.Mainnet.USDC.toLowerCase(),
|
|
34
35
|
sdk_gov_1.tokenDataByNetwork.Mainnet.WETH.toLowerCase(),
|
|
35
|
-
|
|
36
|
+
// tokenDataByNetwork.Mainnet.DAI.toLowerCase(),
|
|
37
|
+
sdk_gov_1.tokenDataByNetwork.Mainnet.USDT.toLowerCase(),
|
|
36
38
|
sdk_gov_1.tokenDataByNetwork.Mainnet.FRAX.toLowerCase(),
|
|
37
39
|
]);
|
|
38
40
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcludeArrayProps } from "@gearbox-protocol/sdk-gov";
|
|
2
2
|
import { CreditAccountDataStructOutput, ScheduledWithdrawalStructOutput, TokenBalanceStructOutput } from "../types/IDataCompressorV3_00";
|
|
3
|
-
import { BigintifyProps } from "../utils/types";
|
|
3
|
+
import { BigintifyProps, PartialKeys } from "../utils/types";
|
|
4
4
|
export type CaTokenBalance = BigintifyProps<ExcludeArrayProps<TokenBalanceStructOutput>>;
|
|
5
5
|
export type ScheduledWithdrawal = BigintifyProps<ExcludeArrayProps<ScheduledWithdrawalStructOutput>>;
|
|
6
|
-
export type CreditAccountDataPayload = ExcludeArrayProps<CreditAccountDataStructOutput>;
|
|
6
|
+
export type CreditAccountDataPayload = PartialKeys<ExcludeArrayProps<CreditAccountDataStructOutput>, "accruedInterest" | "accruedFees" | "healthFactor" | "totalValue">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AwaitedRes, ExcludeArrayProps } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { IGearStakingV3 } from "../types";
|
|
3
|
+
import { GaugeInfoStructOutput, GaugeQuotaParamsStructOutput } from "../types/IDataCompressorV3_00";
|
|
4
|
+
import { BigintifyProps } from "../utils/types";
|
|
5
|
+
export type GaugeQuotaParams = BigintifyProps<ExcludeArrayProps<GaugeQuotaParamsStructOutput>>;
|
|
6
|
+
export type GaugeDataPayload = ExcludeArrayProps<GaugeInfoStructOutput>;
|
|
7
|
+
export interface GaugeStakingDataPayload {
|
|
8
|
+
availableBalance: AwaitedRes<IGearStakingV3["availableBalance"]>;
|
|
9
|
+
totalBalance: AwaitedRes<IGearStakingV3["balanceOf"]>;
|
|
10
|
+
epoch: AwaitedRes<IGearStakingV3["getCurrentEpoch"]>;
|
|
11
|
+
withdrawableAmounts: AwaitedRes<IGearStakingV3["getWithdrawableAmounts"]>;
|
|
12
|
+
}
|
package/lib/payload/pool.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ExcludeArrayProps } from "@gearbox-protocol/sdk-gov";
|
|
2
2
|
import { BigNumberish } from "ethers";
|
|
3
|
+
import { ZapperInfoStructOutput } from "../types/IDataCompressorV2_10";
|
|
3
4
|
import { LinearModelStructOutput, PoolDataStructOutput } from "../types/IDataCompressorV3_00";
|
|
4
|
-
export type PoolDataPayload = ExcludeArrayProps<PoolDataStructOutput
|
|
5
|
+
export type PoolDataPayload = Omit<ExcludeArrayProps<PoolDataStructOutput>, "zappers"> & {
|
|
6
|
+
zappers: Array<PoolZapper>;
|
|
7
|
+
supplyAPY7D: number | undefined;
|
|
8
|
+
};
|
|
5
9
|
export type LinearModel = Omit<ExcludeArrayProps<LinearModelStructOutput>, "version"> & {
|
|
6
10
|
version: number;
|
|
7
11
|
};
|
|
12
|
+
export type PoolZapper = ExcludeArrayProps<ZapperInfoStructOutput>;
|
|
8
13
|
export interface ChartsPoolDataPayload {
|
|
9
14
|
addr: string;
|
|
10
15
|
dieselToken: string;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
|
+
import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "../common";
|
|
5
|
+
export interface IAirdropDistributorInterface extends utils.Interface {
|
|
6
|
+
functions: {
|
|
7
|
+
"claim(uint256,address,uint256,bytes32[])": FunctionFragment;
|
|
8
|
+
"claimed(address)": FunctionFragment;
|
|
9
|
+
"merkleRoot()": FunctionFragment;
|
|
10
|
+
"token()": FunctionFragment;
|
|
11
|
+
};
|
|
12
|
+
getFunction(nameOrSignatureOrTopic: "claim" | "claimed" | "merkleRoot" | "token"): FunctionFragment;
|
|
13
|
+
encodeFunctionData(functionFragment: "claim", values: [
|
|
14
|
+
PromiseOrValue<BigNumberish>,
|
|
15
|
+
PromiseOrValue<string>,
|
|
16
|
+
PromiseOrValue<BigNumberish>,
|
|
17
|
+
PromiseOrValue<BytesLike>[]
|
|
18
|
+
]): string;
|
|
19
|
+
encodeFunctionData(functionFragment: "claimed", values: [PromiseOrValue<string>]): string;
|
|
20
|
+
encodeFunctionData(functionFragment: "merkleRoot", values?: undefined): string;
|
|
21
|
+
encodeFunctionData(functionFragment: "token", values?: undefined): string;
|
|
22
|
+
decodeFunctionResult(functionFragment: "claim", data: BytesLike): Result;
|
|
23
|
+
decodeFunctionResult(functionFragment: "claimed", data: BytesLike): Result;
|
|
24
|
+
decodeFunctionResult(functionFragment: "merkleRoot", data: BytesLike): Result;
|
|
25
|
+
decodeFunctionResult(functionFragment: "token", data: BytesLike): Result;
|
|
26
|
+
events: {
|
|
27
|
+
"Claimed(address,uint256,bool)": EventFragment;
|
|
28
|
+
"RootUpdated(bytes32,bytes32)": EventFragment;
|
|
29
|
+
"TokenAllocated(address,uint8,uint256)": EventFragment;
|
|
30
|
+
};
|
|
31
|
+
getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment;
|
|
32
|
+
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
|
33
|
+
getEvent(nameOrSignatureOrTopic: "TokenAllocated"): EventFragment;
|
|
34
|
+
}
|
|
35
|
+
export interface ClaimedEventObject {
|
|
36
|
+
account: string;
|
|
37
|
+
amount: BigNumber;
|
|
38
|
+
historic: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type ClaimedEvent = TypedEvent<[
|
|
41
|
+
string,
|
|
42
|
+
BigNumber,
|
|
43
|
+
boolean
|
|
44
|
+
], ClaimedEventObject>;
|
|
45
|
+
export type ClaimedEventFilter = TypedEventFilter<ClaimedEvent>;
|
|
46
|
+
export interface RootUpdatedEventObject {
|
|
47
|
+
oldRoot: string;
|
|
48
|
+
newRoot: string;
|
|
49
|
+
}
|
|
50
|
+
export type RootUpdatedEvent = TypedEvent<[
|
|
51
|
+
string,
|
|
52
|
+
string
|
|
53
|
+
], RootUpdatedEventObject>;
|
|
54
|
+
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
|
55
|
+
export interface TokenAllocatedEventObject {
|
|
56
|
+
account: string;
|
|
57
|
+
campaignId: number;
|
|
58
|
+
amount: BigNumber;
|
|
59
|
+
}
|
|
60
|
+
export type TokenAllocatedEvent = TypedEvent<[
|
|
61
|
+
string,
|
|
62
|
+
number,
|
|
63
|
+
BigNumber
|
|
64
|
+
], TokenAllocatedEventObject>;
|
|
65
|
+
export type TokenAllocatedEventFilter = TypedEventFilter<TokenAllocatedEvent>;
|
|
66
|
+
export interface IAirdropDistributor extends BaseContract {
|
|
67
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
68
|
+
attach(addressOrName: string): this;
|
|
69
|
+
deployed(): Promise<this>;
|
|
70
|
+
interface: IAirdropDistributorInterface;
|
|
71
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
72
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
73
|
+
listeners(eventName?: string): Array<Listener>;
|
|
74
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
75
|
+
removeAllListeners(eventName?: string): this;
|
|
76
|
+
off: OnEvent<this>;
|
|
77
|
+
on: OnEvent<this>;
|
|
78
|
+
once: OnEvent<this>;
|
|
79
|
+
removeListener: OnEvent<this>;
|
|
80
|
+
functions: {
|
|
81
|
+
claim(index: PromiseOrValue<BigNumberish>, account: PromiseOrValue<string>, totalAmount: PromiseOrValue<BigNumberish>, merkleProof: PromiseOrValue<BytesLike>[], overrides?: Overrides & {
|
|
82
|
+
from?: PromiseOrValue<string>;
|
|
83
|
+
}): Promise<ContractTransaction>;
|
|
84
|
+
claimed(user: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
85
|
+
merkleRoot(overrides?: CallOverrides): Promise<[string]>;
|
|
86
|
+
token(overrides?: CallOverrides): Promise<[string]>;
|
|
87
|
+
};
|
|
88
|
+
claim(index: PromiseOrValue<BigNumberish>, account: PromiseOrValue<string>, totalAmount: PromiseOrValue<BigNumberish>, merkleProof: PromiseOrValue<BytesLike>[], overrides?: Overrides & {
|
|
89
|
+
from?: PromiseOrValue<string>;
|
|
90
|
+
}): Promise<ContractTransaction>;
|
|
91
|
+
claimed(user: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
|
|
92
|
+
merkleRoot(overrides?: CallOverrides): Promise<string>;
|
|
93
|
+
token(overrides?: CallOverrides): Promise<string>;
|
|
94
|
+
callStatic: {
|
|
95
|
+
claim(index: PromiseOrValue<BigNumberish>, account: PromiseOrValue<string>, totalAmount: PromiseOrValue<BigNumberish>, merkleProof: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<void>;
|
|
96
|
+
claimed(user: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
|
|
97
|
+
merkleRoot(overrides?: CallOverrides): Promise<string>;
|
|
98
|
+
token(overrides?: CallOverrides): Promise<string>;
|
|
99
|
+
};
|
|
100
|
+
filters: {
|
|
101
|
+
"Claimed(address,uint256,bool)"(account?: PromiseOrValue<string> | null, amount?: null, historic?: PromiseOrValue<boolean> | null): ClaimedEventFilter;
|
|
102
|
+
Claimed(account?: PromiseOrValue<string> | null, amount?: null, historic?: PromiseOrValue<boolean> | null): ClaimedEventFilter;
|
|
103
|
+
"RootUpdated(bytes32,bytes32)"(oldRoot?: null, newRoot?: PromiseOrValue<BytesLike> | null): RootUpdatedEventFilter;
|
|
104
|
+
RootUpdated(oldRoot?: null, newRoot?: PromiseOrValue<BytesLike> | null): RootUpdatedEventFilter;
|
|
105
|
+
"TokenAllocated(address,uint8,uint256)"(account?: PromiseOrValue<string> | null, campaignId?: PromiseOrValue<BigNumberish> | null, amount?: null): TokenAllocatedEventFilter;
|
|
106
|
+
TokenAllocated(account?: PromiseOrValue<string> | null, campaignId?: PromiseOrValue<BigNumberish> | null, amount?: null): TokenAllocatedEventFilter;
|
|
107
|
+
};
|
|
108
|
+
estimateGas: {
|
|
109
|
+
claim(index: PromiseOrValue<BigNumberish>, account: PromiseOrValue<string>, totalAmount: PromiseOrValue<BigNumberish>, merkleProof: PromiseOrValue<BytesLike>[], overrides?: Overrides & {
|
|
110
|
+
from?: PromiseOrValue<string>;
|
|
111
|
+
}): Promise<BigNumber>;
|
|
112
|
+
claimed(user: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
|
|
113
|
+
merkleRoot(overrides?: CallOverrides): Promise<BigNumber>;
|
|
114
|
+
token(overrides?: CallOverrides): Promise<BigNumber>;
|
|
115
|
+
};
|
|
116
|
+
populateTransaction: {
|
|
117
|
+
claim(index: PromiseOrValue<BigNumberish>, account: PromiseOrValue<string>, totalAmount: PromiseOrValue<BigNumberish>, merkleProof: PromiseOrValue<BytesLike>[], overrides?: Overrides & {
|
|
118
|
+
from?: PromiseOrValue<string>;
|
|
119
|
+
}): Promise<PopulatedTransaction>;
|
|
120
|
+
claimed(user: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
121
|
+
merkleRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
122
|
+
token(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, BytesLike, Signer, utils } from "ethers";
|
|
2
|
+
import type { EventFragment } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "../common";
|
|
5
|
+
export interface IAirdropDistributorEventsInterface extends utils.Interface {
|
|
6
|
+
functions: {};
|
|
7
|
+
events: {
|
|
8
|
+
"Claimed(address,uint256,bool)": EventFragment;
|
|
9
|
+
"RootUpdated(bytes32,bytes32)": EventFragment;
|
|
10
|
+
"TokenAllocated(address,uint8,uint256)": EventFragment;
|
|
11
|
+
};
|
|
12
|
+
getEvent(nameOrSignatureOrTopic: "Claimed"): EventFragment;
|
|
13
|
+
getEvent(nameOrSignatureOrTopic: "RootUpdated"): EventFragment;
|
|
14
|
+
getEvent(nameOrSignatureOrTopic: "TokenAllocated"): EventFragment;
|
|
15
|
+
}
|
|
16
|
+
export interface ClaimedEventObject {
|
|
17
|
+
account: string;
|
|
18
|
+
amount: BigNumber;
|
|
19
|
+
historic: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type ClaimedEvent = TypedEvent<[
|
|
22
|
+
string,
|
|
23
|
+
BigNumber,
|
|
24
|
+
boolean
|
|
25
|
+
], ClaimedEventObject>;
|
|
26
|
+
export type ClaimedEventFilter = TypedEventFilter<ClaimedEvent>;
|
|
27
|
+
export interface RootUpdatedEventObject {
|
|
28
|
+
oldRoot: string;
|
|
29
|
+
newRoot: string;
|
|
30
|
+
}
|
|
31
|
+
export type RootUpdatedEvent = TypedEvent<[
|
|
32
|
+
string,
|
|
33
|
+
string
|
|
34
|
+
], RootUpdatedEventObject>;
|
|
35
|
+
export type RootUpdatedEventFilter = TypedEventFilter<RootUpdatedEvent>;
|
|
36
|
+
export interface TokenAllocatedEventObject {
|
|
37
|
+
account: string;
|
|
38
|
+
campaignId: number;
|
|
39
|
+
amount: BigNumber;
|
|
40
|
+
}
|
|
41
|
+
export type TokenAllocatedEvent = TypedEvent<[
|
|
42
|
+
string,
|
|
43
|
+
number,
|
|
44
|
+
BigNumber
|
|
45
|
+
], TokenAllocatedEventObject>;
|
|
46
|
+
export type TokenAllocatedEventFilter = TypedEventFilter<TokenAllocatedEvent>;
|
|
47
|
+
export interface IAirdropDistributorEvents extends BaseContract {
|
|
48
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
49
|
+
attach(addressOrName: string): this;
|
|
50
|
+
deployed(): Promise<this>;
|
|
51
|
+
interface: IAirdropDistributorEventsInterface;
|
|
52
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
53
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
54
|
+
listeners(eventName?: string): Array<Listener>;
|
|
55
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
56
|
+
removeAllListeners(eventName?: string): this;
|
|
57
|
+
off: OnEvent<this>;
|
|
58
|
+
on: OnEvent<this>;
|
|
59
|
+
once: OnEvent<this>;
|
|
60
|
+
removeListener: OnEvent<this>;
|
|
61
|
+
functions: {};
|
|
62
|
+
callStatic: {};
|
|
63
|
+
filters: {
|
|
64
|
+
"Claimed(address,uint256,bool)"(account?: PromiseOrValue<string> | null, amount?: null, historic?: PromiseOrValue<boolean> | null): ClaimedEventFilter;
|
|
65
|
+
Claimed(account?: PromiseOrValue<string> | null, amount?: null, historic?: PromiseOrValue<boolean> | null): ClaimedEventFilter;
|
|
66
|
+
"RootUpdated(bytes32,bytes32)"(oldRoot?: null, newRoot?: PromiseOrValue<BytesLike> | null): RootUpdatedEventFilter;
|
|
67
|
+
RootUpdated(oldRoot?: null, newRoot?: PromiseOrValue<BytesLike> | null): RootUpdatedEventFilter;
|
|
68
|
+
"TokenAllocated(address,uint8,uint256)"(account?: PromiseOrValue<string> | null, campaignId?: PromiseOrValue<BigNumberish> | null, amount?: null): TokenAllocatedEventFilter;
|
|
69
|
+
TokenAllocated(account?: PromiseOrValue<string> | null, campaignId?: PromiseOrValue<BigNumberish> | null, amount?: null): TokenAllocatedEventFilter;
|
|
70
|
+
};
|
|
71
|
+
estimateGas: {};
|
|
72
|
+
populateTransaction: {};
|
|
73
|
+
}
|