@gearbox-protocol/sdk 14.12.0-next.15 → 14.12.0-next.16
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/dist/cjs/abi/ierc4626Adapter.js +264 -0
- package/dist/cjs/plugins/adapters/abi/actionAbi.js +1 -10
- package/dist/cjs/plugins/adapters/abi/adapters/erc4626ReferralAdapter.js +332 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iBalancerV3RouterAdapter.js +436 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iBalancerV3WrapperAdapter.js +183 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iCamelotV3Adapter.js +586 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iConvexV1BaseRewardPoolAdapter.js +385 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iCurveV1StableNgAdapter.js +708 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iCurveV1_2AssetsAdapter.js +708 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iCurveV1_3AssetsAdapter.js +708 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iCurveV1_4AssetsAdapter.js +708 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iDaiUsdsAdapter.js +206 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iFluidDexAdapter.js +183 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iInfinifiGatewayAdapter.js +473 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iInfinifiUnwindingGateway.js +482 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iKelpLrtDepositPool.js +333 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iKelpLrtWithdrawalManager.js +488 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iLidoV1Adapter.js +171 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iMellow4626VaultAdapter.js +269 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iMellowClaimerAdapter.js +350 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iMellowWrapperAdapter.js +225 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iMidasIssuanceVaultAdapter.js +262 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iMidasRedemptionVault.js +622 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iPendleRouterAdapter.js +1787 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iStakingRewardsAdapter.js +288 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iTraderJoeRouterAdapter.js +459 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iUniswapV2Adapter.js +290 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iUniswapV3Adapter.js +505 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iUniswapV4Adapter.js +534 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iUpshiftVaultAdapter.js +475 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iVelodromeV2RouterAdapter.js +327 -0
- package/dist/cjs/plugins/adapters/abi/adapters/index.js +84 -0
- package/dist/cjs/plugins/adapters/abi/adapters/iwstEthv1Adapter.js +183 -0
- package/dist/cjs/plugins/adapters/abi/adapters/mellowDvvAdapter.js +319 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +1 -42
- package/dist/cjs/plugins/adapters/abi/conctructorAbiPatterns.js +0 -16
- package/dist/cjs/plugins/adapters/abi/index.js +2 -2
- package/dist/cjs/plugins/adapters/abi/targetContractAbi.js +0 -293
- package/dist/cjs/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/CamelotV3AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +1 -1
- package/dist/cjs/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/DaiUsdsAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/ERC4626AdapterContract.js +11 -4
- package/dist/cjs/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/FluidDexAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/KelpLRTWithdrawalManagerAdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/LidoV1AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MellowClaimerAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MellowDVVAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MellowWrapperAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/PendleRouterAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/StakingRewardsAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/UniswapV2AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/UniswapV3AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/UniswapV4AdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +3 -3
- package/dist/cjs/plugins/adapters/contracts/VelodromeV2AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/WstETHV1AdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/index.js +0 -12
- package/dist/cjs/plugins/adapters/createAdapter.js +1 -10
- package/dist/cjs/plugins/adapters/types.js +1 -11
- package/dist/cjs/preview/index.js +5 -1
- package/dist/cjs/preview/parse/parseFacadeOperationCalldata.js +1 -2
- package/dist/cjs/preview/parse/parseOperationCalldata.js +3 -11
- package/dist/cjs/preview/parse/parsePoolOperationCalldata.js +1 -2
- package/dist/cjs/preview/parse/parseRWAFactoryOperationCalldata.js +5 -6
- package/dist/cjs/preview/prerequisites/AllowancePrerequisite.js +10 -27
- package/dist/cjs/preview/prerequisites/BalancePrerequisite.js +10 -26
- package/dist/cjs/preview/prerequisites/Prerequisite.js +1 -21
- package/dist/cjs/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +16 -32
- package/dist/cjs/preview/prerequisites/buildCollateralPrerequisites.js +1 -3
- package/dist/cjs/preview/prerequisites/buildPartialLiquidationPrerequisites.js +1 -3
- package/dist/cjs/preview/prerequisites/buildPoolPrerequisites.js +8 -19
- package/dist/cjs/preview/prerequisites/buildRWAPrerequisites.js +7 -5
- package/dist/cjs/preview/prerequisites/checkPrerequisites.js +10 -10
- package/dist/cjs/preview/prerequisites/helpers.js +2 -13
- package/dist/cjs/preview/preview/applyInnerOperations.js +13 -2
- package/dist/cjs/preview/preview/applyRWAWrapUnwrap.js +74 -0
- package/dist/cjs/preview/preview/index.js +2 -2
- package/dist/cjs/preview/preview/{previewCloseOrRepay.js → previewCloseOrRepayCreditAccount.js} +6 -6
- package/dist/cjs/preview/preview/previewOperation.js +3 -3
- package/dist/cjs/preview/preview/previewPoolOperation.js +6 -39
- package/dist/cjs/preview/simulate/simulatePoolOperation.js +2 -5
- package/dist/cjs/preview/types.js +16 -0
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -5
- package/dist/esm/abi/ierc4626Adapter.js +240 -0
- package/dist/esm/plugins/adapters/abi/actionAbi.js +1 -10
- package/dist/esm/plugins/adapters/abi/adapters/erc4626ReferralAdapter.js +308 -0
- package/dist/esm/plugins/adapters/abi/adapters/iBalancerV3RouterAdapter.js +412 -0
- package/dist/esm/plugins/adapters/abi/adapters/iBalancerV3WrapperAdapter.js +159 -0
- package/dist/esm/plugins/adapters/abi/adapters/iCamelotV3Adapter.js +562 -0
- package/dist/esm/plugins/adapters/abi/adapters/iConvexV1BaseRewardPoolAdapter.js +361 -0
- package/dist/esm/plugins/adapters/abi/adapters/iCurveV1StableNgAdapter.js +684 -0
- package/dist/esm/plugins/adapters/abi/adapters/iCurveV1_2AssetsAdapter.js +684 -0
- package/dist/esm/plugins/adapters/abi/adapters/iCurveV1_3AssetsAdapter.js +684 -0
- package/dist/esm/plugins/adapters/abi/adapters/iCurveV1_4AssetsAdapter.js +684 -0
- package/dist/esm/plugins/adapters/abi/adapters/iDaiUsdsAdapter.js +182 -0
- package/dist/esm/plugins/adapters/abi/adapters/iFluidDexAdapter.js +159 -0
- package/dist/esm/plugins/adapters/abi/adapters/iInfinifiGatewayAdapter.js +449 -0
- package/dist/esm/plugins/adapters/abi/adapters/iInfinifiUnwindingGateway.js +457 -0
- package/dist/esm/plugins/adapters/abi/adapters/iKelpLrtDepositPool.js +308 -0
- package/dist/esm/plugins/adapters/abi/adapters/iKelpLrtWithdrawalManager.js +463 -0
- package/dist/esm/plugins/adapters/abi/adapters/iLidoV1Adapter.js +147 -0
- package/dist/esm/plugins/adapters/abi/adapters/iMellow4626VaultAdapter.js +245 -0
- package/dist/esm/plugins/adapters/abi/adapters/iMellowClaimerAdapter.js +326 -0
- package/dist/esm/plugins/adapters/abi/adapters/iMellowWrapperAdapter.js +201 -0
- package/dist/esm/plugins/adapters/abi/adapters/iMidasIssuanceVaultAdapter.js +238 -0
- package/dist/esm/plugins/adapters/abi/adapters/iMidasRedemptionVault.js +597 -0
- package/dist/esm/plugins/adapters/abi/adapters/iPendleRouterAdapter.js +1763 -0
- package/dist/esm/plugins/adapters/abi/adapters/iStakingRewardsAdapter.js +264 -0
- package/dist/esm/plugins/adapters/abi/adapters/iTraderJoeRouterAdapter.js +435 -0
- package/dist/esm/plugins/adapters/abi/adapters/iUniswapV2Adapter.js +266 -0
- package/dist/esm/plugins/adapters/abi/adapters/iUniswapV3Adapter.js +481 -0
- package/dist/esm/plugins/adapters/abi/adapters/iUniswapV4Adapter.js +509 -0
- package/dist/esm/plugins/adapters/abi/adapters/iUpshiftVaultAdapter.js +450 -0
- package/dist/esm/plugins/adapters/abi/adapters/iVelodromeV2RouterAdapter.js +303 -0
- package/dist/esm/plugins/adapters/abi/adapters/index.js +32 -0
- package/dist/esm/plugins/adapters/abi/adapters/iwstEthv1Adapter.js +159 -0
- package/dist/esm/plugins/adapters/abi/adapters/mellowDvvAdapter.js +295 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +1 -44
- package/dist/esm/plugins/adapters/abi/conctructorAbiPatterns.js +0 -14
- package/dist/esm/plugins/adapters/abi/index.js +1 -1
- package/dist/esm/plugins/adapters/abi/targetContractAbi.js +0 -289
- package/dist/esm/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/CamelotV3AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/DaiUsdsAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +10 -3
- package/dist/esm/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/FluidDexAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/KelpLRTWithdrawalManagerAdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/LidoV1AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MellowClaimerAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MellowDVVAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MellowWrapperAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/PendleRouterAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/StakingRewardsAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/UniswapV2AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/UniswapV3AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/UniswapV4AdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +4 -4
- package/dist/esm/plugins/adapters/contracts/VelodromeV2AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/WstETHV1AdapterContract.js +1 -1
- package/dist/esm/plugins/adapters/contracts/index.js +0 -6
- package/dist/esm/plugins/adapters/createAdapter.js +1 -13
- package/dist/esm/plugins/adapters/types.js +1 -11
- package/dist/esm/preview/index.js +2 -0
- package/dist/esm/preview/parse/parseFacadeOperationCalldata.js +1 -2
- package/dist/esm/preview/parse/parseOperationCalldata.js +3 -11
- package/dist/esm/preview/parse/parsePoolOperationCalldata.js +1 -2
- package/dist/esm/preview/parse/parseRWAFactoryOperationCalldata.js +5 -6
- package/dist/esm/preview/prerequisites/AllowancePrerequisite.js +10 -27
- package/dist/esm/preview/prerequisites/BalancePrerequisite.js +10 -26
- package/dist/esm/preview/prerequisites/Prerequisite.js +1 -21
- package/dist/esm/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +16 -32
- package/dist/esm/preview/prerequisites/buildCollateralPrerequisites.js +1 -3
- package/dist/esm/preview/prerequisites/buildPartialLiquidationPrerequisites.js +1 -3
- package/dist/esm/preview/prerequisites/buildPoolPrerequisites.js +8 -19
- package/dist/esm/preview/prerequisites/buildRWAPrerequisites.js +7 -5
- package/dist/esm/preview/prerequisites/checkPrerequisites.js +9 -11
- package/dist/esm/preview/prerequisites/helpers.js +5 -14
- package/dist/esm/preview/preview/applyInnerOperations.js +17 -3
- package/dist/esm/preview/preview/applyRWAWrapUnwrap.js +50 -0
- package/dist/esm/preview/preview/index.js +1 -1
- package/dist/esm/preview/preview/{previewCloseOrRepay.js → previewCloseOrRepayCreditAccount.js} +2 -2
- package/dist/esm/preview/preview/previewOperation.js +3 -3
- package/dist/esm/preview/preview/previewPoolOperation.js +7 -42
- package/dist/esm/preview/simulate/simulateOperation.js +1 -4
- package/dist/esm/preview/simulate/simulatePoolOperation.js +2 -5
- package/dist/esm/preview/types.js +0 -0
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -1
- package/dist/types/abi/ierc4626Adapter.d.ts +179 -0
- package/dist/types/common-utils/utils/creditAccount/sort.d.ts +3 -3
- package/dist/types/common-utils/utils/strategies/eligibility/is-strategy-eligible.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/lists/get-available-and-disabled-strategies.d.ts +1 -1
- package/dist/types/dev/abi.d.ts +4 -4
- package/dist/types/dev/providers.d.ts +1 -1
- package/dist/types/permissionless/bindings/bytecode-repository.d.ts +9 -9
- package/dist/types/permissionless/bindings/treasury-splitter.d.ts +1 -1
- package/dist/types/plugins/adapters/abi/adapters/erc4626ReferralAdapter.d.ts +231 -0
- package/dist/types/plugins/adapters/abi/adapters/iBalancerV3RouterAdapter.d.ts +314 -0
- package/dist/types/plugins/adapters/abi/adapters/iBalancerV3WrapperAdapter.d.ts +117 -0
- package/dist/types/plugins/adapters/abi/adapters/iCamelotV3Adapter.d.ts +428 -0
- package/dist/types/plugins/adapters/abi/adapters/iConvexV1BaseRewardPoolAdapter.d.ts +271 -0
- package/dist/types/plugins/adapters/abi/adapters/iCurveV1StableNgAdapter.d.ts +519 -0
- package/dist/types/plugins/adapters/abi/adapters/iCurveV1_2AssetsAdapter.d.ts +519 -0
- package/dist/types/plugins/adapters/abi/adapters/iCurveV1_3AssetsAdapter.d.ts +519 -0
- package/dist/types/plugins/adapters/abi/adapters/iCurveV1_4AssetsAdapter.d.ts +519 -0
- package/dist/types/plugins/adapters/abi/adapters/iDaiUsdsAdapter.d.ts +135 -0
- package/dist/types/plugins/adapters/abi/adapters/iFluidDexAdapter.d.ts +119 -0
- package/dist/types/plugins/adapters/abi/adapters/iInfinifiGatewayAdapter.d.ts +338 -0
- package/dist/types/plugins/adapters/abi/adapters/iInfinifiUnwindingGateway.d.ts +346 -0
- package/dist/types/plugins/adapters/abi/adapters/iKelpLrtDepositPool.d.ts +233 -0
- package/dist/types/plugins/adapters/abi/adapters/iKelpLrtWithdrawalManager.d.ts +349 -0
- package/dist/types/plugins/adapters/abi/adapters/iLidoV1Adapter.d.ts +109 -0
- package/dist/types/plugins/adapters/abi/adapters/iMellow4626VaultAdapter.d.ts +183 -0
- package/dist/types/plugins/adapters/abi/adapters/iMellowClaimerAdapter.d.ts +247 -0
- package/dist/types/plugins/adapters/abi/adapters/iMellowWrapperAdapter.d.ts +151 -0
- package/dist/types/plugins/adapters/abi/adapters/iMidasIssuanceVaultAdapter.d.ts +180 -0
- package/dist/types/plugins/adapters/abi/adapters/iMidasRedemptionVault.d.ts +453 -0
- package/dist/types/plugins/adapters/abi/adapters/iPendleRouterAdapter.d.ts +1366 -0
- package/dist/types/plugins/adapters/abi/adapters/iStakingRewardsAdapter.d.ts +197 -0
- package/dist/types/plugins/adapters/abi/adapters/iTraderJoeRouterAdapter.d.ts +333 -0
- package/dist/types/plugins/adapters/abi/adapters/iUniswapV2Adapter.d.ts +202 -0
- package/dist/types/plugins/adapters/abi/adapters/iUniswapV3Adapter.d.ts +367 -0
- package/dist/types/plugins/adapters/abi/adapters/iUniswapV4Adapter.d.ts +390 -0
- package/dist/types/plugins/adapters/abi/adapters/iUpshiftVaultAdapter.d.ts +336 -0
- package/dist/types/plugins/adapters/abi/adapters/iVelodromeV2RouterAdapter.d.ts +232 -0
- package/dist/types/plugins/adapters/abi/adapters/index.d.ts +32 -0
- package/dist/types/plugins/adapters/abi/adapters/iwstEthv1Adapter.d.ts +117 -0
- package/dist/types/plugins/adapters/abi/adapters/mellowDvvAdapter.d.ts +221 -0
- package/dist/types/plugins/adapters/abi/conctructorAbiPatterns.d.ts +0 -26
- package/dist/types/plugins/adapters/abi/index.d.ts +1 -1
- package/dist/types/plugins/adapters/abi/targetContractAbi.d.ts +0 -476
- package/dist/types/plugins/adapters/contracts/BalancerV3RouterAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/CamelotV3AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/Curve2AssetsAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/Curve3AssetsAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/Curve4AssetsAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/CurveV1StableNGAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/DaiUsdsAdapterContract.d.ts +4 -4
- package/dist/types/plugins/adapters/contracts/ERC4626AdapterContract.d.ts +10 -4
- package/dist/types/plugins/adapters/contracts/ERC4626ReferralAdapterContract.d.ts +4 -4
- package/dist/types/plugins/adapters/contracts/FluidDexAdapterContract.d.ts +4 -4
- package/dist/types/plugins/adapters/contracts/InfinifiGatewayAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/KelpLRTWithdrawalManagerAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/LidoV1AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/MellowClaimerAdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/MellowDVVAdapterContract.d.ts +4 -4
- package/dist/types/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/MellowWrapperAdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/PendleRouterAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +4 -4
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/StakingRewardsAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/TraderJoeRouterAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/UniswapV2AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/UniswapV3AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/UniswapV4AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/UpshiftVaultAdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/VelodromeV2AdapterContract.d.ts +5 -5
- package/dist/types/plugins/adapters/contracts/WstETHV1AdapterContract.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/index.d.ts +0 -6
- package/dist/types/plugins/adapters/types.d.ts +20 -13
- package/dist/types/preview/index.d.ts +2 -0
- package/dist/types/preview/parse/parseFacadeOperationCalldata.d.ts +6 -7
- package/dist/types/preview/parse/parseOperationCalldata.d.ts +5 -18
- package/dist/types/preview/parse/parsePoolOperationCalldata.d.ts +7 -12
- package/dist/types/preview/parse/parseRWAFactoryOperationCalldata.d.ts +5 -14
- package/dist/types/preview/parse/types.d.ts +0 -25
- package/dist/types/preview/prerequisites/AllowancePrerequisite.d.ts +13 -11
- package/dist/types/preview/prerequisites/BalancePrerequisite.d.ts +13 -11
- package/dist/types/preview/prerequisites/Prerequisite.d.ts +6 -19
- package/dist/types/preview/prerequisites/RWAOpenRequirementsPrerequisite.d.ts +27 -18
- package/dist/types/preview/prerequisites/buildCollateralPrerequisites.d.ts +2 -2
- package/dist/types/preview/prerequisites/buildPartialLiquidationPrerequisites.d.ts +2 -2
- package/dist/types/preview/prerequisites/buildPoolPrerequisites.d.ts +2 -2
- package/dist/types/preview/prerequisites/buildRWAPrerequisites.d.ts +2 -2
- package/dist/types/preview/prerequisites/checkPrerequisites.d.ts +8 -16
- package/dist/types/preview/prerequisites/helpers.d.ts +3 -11
- package/dist/types/preview/prerequisites/types.d.ts +14 -72
- package/dist/types/preview/preview/applyInnerOperations.d.ts +11 -4
- package/dist/types/preview/preview/applyRWAWrapUnwrap.d.ts +13 -0
- package/dist/types/preview/preview/index.d.ts +1 -1
- package/dist/types/preview/preview/previewAdjustCreditAccount.d.ts +2 -1
- package/dist/types/preview/preview/{previewCloseOrRepay.d.ts → previewCloseOrRepayCreditAccount.d.ts} +3 -2
- package/dist/types/preview/preview/previewOpenCreditAccount.d.ts +2 -1
- package/dist/types/preview/preview/previewOperation.d.ts +2 -1
- package/dist/types/preview/preview/previewPoolOperation.d.ts +3 -3
- package/dist/types/preview/preview/types.d.ts +7 -60
- package/dist/types/preview/simulate/index.d.ts +1 -4
- package/dist/types/preview/simulate/simulateFacadeOperation.d.ts +3 -14
- package/dist/types/preview/simulate/simulateOperation.d.ts +4 -16
- package/dist/types/preview/simulate/simulatePoolOperation.d.ts +7 -3
- package/dist/types/preview/simulate/simulateRWAOperation.d.ts +3 -14
- package/dist/types/preview/simulate/types.d.ts +13 -30
- package/dist/types/preview/types.d.ts +52 -0
- package/dist/types/sdk/chain/chains.d.ts +8 -8
- package/dist/types/sdk/market/MarketConfiguratorContract.d.ts +5 -5
- package/dist/types/sdk/market/pricefeeds/PythPriceFeed.d.ts +1 -1
- package/package.json +11 -12
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterDeposit.js +0 -116
- package/dist/cjs/plugins/adapters/contracts/MellowDepositQueueAdapterContract.js +0 -76
- package/dist/cjs/plugins/adapters/contracts/MellowRedeemQueueAdapterContract.js +0 -68
- package/dist/cjs/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +0 -89
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterDeposit.js +0 -94
- package/dist/esm/plugins/adapters/contracts/MellowDepositQueueAdapterContract.js +0 -54
- package/dist/esm/plugins/adapters/contracts/MellowRedeemQueueAdapterContract.js +0 -46
- package/dist/esm/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +0 -69
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterDeposit.d.ts +0 -1045
- package/dist/types/plugins/adapters/contracts/MellowDepositQueueAdapterContract.d.ts +0 -26
- package/dist/types/plugins/adapters/contracts/MellowRedeemQueueAdapterContract.d.ts +0 -24
- package/dist/types/plugins/adapters/contracts/SecuritizeSwapAdapterContract.d.ts +0 -36
- /package/dist/cjs/plugins/adapters/abi/{iConvexV1BoosterAdapter.js → adapters/iConvexV1BoosterAdapter.js} +0 -0
- /package/dist/esm/plugins/adapters/abi/{iConvexV1BoosterAdapter.js → adapters/iConvexV1BoosterAdapter.js} +0 -0
- /package/dist/types/plugins/adapters/abi/{iConvexV1BoosterAdapter.d.ts → adapters/iConvexV1BoosterAdapter.d.ts} +0 -0
|
@@ -18,8 +18,7 @@ function buildPoolPrerequisites(tx, wallet) {
|
|
|
18
18
|
new BalancePrerequisite({
|
|
19
19
|
token: tx.tokenIn,
|
|
20
20
|
owner: wallet,
|
|
21
|
-
required: tx.assets
|
|
22
|
-
title: "Sufficient token balance"
|
|
21
|
+
required: tx.assets
|
|
23
22
|
})
|
|
24
23
|
];
|
|
25
24
|
}
|
|
@@ -27,27 +26,21 @@ function buildPoolPrerequisites(tx, wallet) {
|
|
|
27
26
|
token: tx.tokenIn,
|
|
28
27
|
owner: wallet,
|
|
29
28
|
spender: tx.zapper,
|
|
30
|
-
required: tx.assets
|
|
31
|
-
allowanceTitle: "Token approved to zapper",
|
|
32
|
-
balanceTitle: "Sufficient token balance"
|
|
29
|
+
required: tx.assets
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
return allowanceAndBalance({
|
|
36
33
|
token: tx.underlying,
|
|
37
34
|
owner: wallet,
|
|
38
35
|
spender: tx.pool,
|
|
39
|
-
required: tx.assets
|
|
40
|
-
allowanceTitle: "Token approved to pool",
|
|
41
|
-
balanceTitle: "Sufficient token balance"
|
|
36
|
+
required: tx.assets
|
|
42
37
|
});
|
|
43
38
|
case "Mint":
|
|
44
39
|
return allowanceAndBalance({
|
|
45
40
|
token: tx.underlying,
|
|
46
41
|
owner: wallet,
|
|
47
42
|
spender: tx.pool,
|
|
48
|
-
required: tx.shares
|
|
49
|
-
allowanceTitle: "Token approved to pool",
|
|
50
|
-
balanceTitle: "Sufficient token balance"
|
|
43
|
+
required: tx.shares
|
|
51
44
|
});
|
|
52
45
|
// Redeem and Withdraw both burn LP shares from `owner`; they only differ in
|
|
53
46
|
// which side (shares vs assets) the caller specifies.
|
|
@@ -57,15 +50,13 @@ function buildPoolPrerequisites(tx, wallet) {
|
|
|
57
50
|
new BalancePrerequisite({
|
|
58
51
|
token: tx.tokenIn,
|
|
59
52
|
owner: wallet,
|
|
60
|
-
required: tx.shares
|
|
61
|
-
title: "Sufficient share token balance"
|
|
53
|
+
required: tx.shares
|
|
62
54
|
}),
|
|
63
55
|
new AllowancePrerequisite({
|
|
64
56
|
token: tx.tokenIn,
|
|
65
57
|
owner: wallet,
|
|
66
58
|
spender: tx.zapper,
|
|
67
|
-
required: tx.shares
|
|
68
|
-
title: "Share token approved to zapper"
|
|
59
|
+
required: tx.shares
|
|
69
60
|
})
|
|
70
61
|
];
|
|
71
62
|
}
|
|
@@ -79,8 +70,7 @@ function lpSharePrerequisites(pool, owner, required, wallet) {
|
|
|
79
70
|
new BalancePrerequisite({
|
|
80
71
|
token: pool,
|
|
81
72
|
owner,
|
|
82
|
-
required
|
|
83
|
-
title: "Sufficient LP token balance"
|
|
73
|
+
required
|
|
84
74
|
})
|
|
85
75
|
];
|
|
86
76
|
if (!isAddressEqual(owner, wallet)) {
|
|
@@ -89,8 +79,7 @@ function lpSharePrerequisites(pool, owner, required, wallet) {
|
|
|
89
79
|
token: pool,
|
|
90
80
|
owner,
|
|
91
81
|
spender: wallet,
|
|
92
|
-
required
|
|
93
|
-
title: "LP token approved to caller"
|
|
82
|
+
required
|
|
94
83
|
})
|
|
95
84
|
);
|
|
96
85
|
}
|
|
@@ -18,12 +18,14 @@ function buildRWAPrerequisites(multicall, creditManager, providedArgs, ctx) {
|
|
|
18
18
|
continue;
|
|
19
19
|
}
|
|
20
20
|
prereqs.push(
|
|
21
|
-
new RWAOpenRequirementsPrerequisite(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
new RWAOpenRequirementsPrerequisite(
|
|
22
|
+
{
|
|
23
|
+
token,
|
|
24
|
+
creditManager,
|
|
25
|
+
factory: rwaFactory.address
|
|
26
|
+
},
|
|
25
27
|
providedArgs
|
|
26
|
-
|
|
28
|
+
)
|
|
27
29
|
);
|
|
28
30
|
}
|
|
29
31
|
return prereqs;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseOperationCalldata
|
|
3
|
-
} from "../parse/parseOperationCalldata.js";
|
|
1
|
+
import { parseOperationCalldata } from "../parse/index.js";
|
|
4
2
|
import { buildCollateralPrerequisites } from "./buildCollateralPrerequisites.js";
|
|
5
3
|
import { buildPartialLiquidationPrerequisites } from "./buildPartialLiquidationPrerequisites.js";
|
|
6
4
|
import { buildPoolPrerequisites } from "./buildPoolPrerequisites.js";
|
|
7
5
|
import { buildRWAPrerequisites } from "./buildRWAPrerequisites.js";
|
|
8
|
-
async function checkPrerequisites(input) {
|
|
9
|
-
const { sdk, sender: wallet
|
|
6
|
+
async function checkPrerequisites(input, options) {
|
|
7
|
+
const { sdk, sender: wallet } = input;
|
|
10
8
|
const tx = parseOperationCalldata(input);
|
|
11
|
-
const ctx = {
|
|
9
|
+
const ctx = {
|
|
10
|
+
sdk,
|
|
11
|
+
wallet,
|
|
12
|
+
blockNumber: options?.blockNumber
|
|
13
|
+
};
|
|
12
14
|
const prereqs = await buildPrerequisites(tx, ctx);
|
|
13
|
-
return Promise.all(
|
|
14
|
-
// Each prereq pairs its own kind with its detail, so the widened
|
|
15
|
-
// `verify` return is safe to narrow back to the discriminated union.
|
|
16
|
-
prereqs.map((p) => p.verify(ctx))
|
|
17
|
-
);
|
|
15
|
+
return Promise.all(prereqs.map((p) => p.verify(ctx)));
|
|
18
16
|
}
|
|
19
17
|
async function buildPrerequisites(tx, ctx) {
|
|
20
18
|
const { wallet } = ctx;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AllowancePrerequisite
|
|
3
|
+
} from "./AllowancePrerequisite.js";
|
|
2
4
|
import { BalancePrerequisite } from "./BalancePrerequisite.js";
|
|
3
5
|
function allowanceAndBalance(props) {
|
|
4
6
|
const { token, owner, spender, required } = props;
|
|
5
7
|
return [
|
|
6
|
-
new AllowancePrerequisite({
|
|
7
|
-
|
|
8
|
-
owner,
|
|
9
|
-
spender,
|
|
10
|
-
required,
|
|
11
|
-
title: props.allowanceTitle
|
|
12
|
-
}),
|
|
13
|
-
new BalancePrerequisite({
|
|
14
|
-
token,
|
|
15
|
-
owner,
|
|
16
|
-
required,
|
|
17
|
-
title: props.balanceTitle
|
|
18
|
-
})
|
|
8
|
+
new AllowancePrerequisite({ token, owner, spender, required }),
|
|
9
|
+
new BalancePrerequisite({ token, owner, required })
|
|
19
10
|
];
|
|
20
11
|
}
|
|
21
12
|
export {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AbstractAdapterContract,
|
|
3
|
+
ERC4626AdapterContract
|
|
4
|
+
} from "../../plugins/adapters/index.js";
|
|
2
5
|
import {
|
|
3
6
|
AssetsMap,
|
|
4
7
|
MAX_UINT256,
|
|
5
8
|
MIN_INT96
|
|
6
9
|
} from "../../sdk/index.js";
|
|
10
|
+
import { applyRWAWrapUnwrap } from "./applyRWAWrapUnwrap.js";
|
|
7
11
|
function makeInnerOperationsState() {
|
|
8
12
|
return {
|
|
9
13
|
balances: new AssetsMap(),
|
|
@@ -67,17 +71,20 @@ function applyInnerOperations(sdk, multicall, state) {
|
|
|
67
71
|
}
|
|
68
72
|
inBracket = false;
|
|
69
73
|
break;
|
|
70
|
-
case "Execute":
|
|
74
|
+
case "Execute": {
|
|
75
|
+
const adapter = sdk.getContract(op.adapter);
|
|
71
76
|
if (inBracket) {
|
|
72
|
-
const adapter = sdk.getContract(op.adapter);
|
|
73
77
|
if (!(adapter instanceof AbstractAdapterContract)) {
|
|
74
78
|
throw new Error(
|
|
75
79
|
`call to ${op.adapter} between storeExpectedBalances and compareBalances is not an adapter call`
|
|
76
80
|
);
|
|
77
81
|
}
|
|
78
82
|
adapter.previewBalanceChanges(state.balances, op.calldata);
|
|
83
|
+
} else if (isRWAShare(sdk, adapter)) {
|
|
84
|
+
applyRWAWrapUnwrap(adapter, op.calldata, state.balances);
|
|
79
85
|
}
|
|
80
86
|
break;
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
if (inBracket) {
|
|
@@ -86,6 +93,13 @@ function applyInnerOperations(sdk, multicall, state) {
|
|
|
86
93
|
);
|
|
87
94
|
}
|
|
88
95
|
}
|
|
96
|
+
function isRWAShare(sdk, adapter) {
|
|
97
|
+
if (adapter instanceof ERC4626AdapterContract) {
|
|
98
|
+
const meta = sdk.tokensMeta.get(adapter.share);
|
|
99
|
+
return !!meta && sdk.tokensMeta.isRWAUnderlying(meta);
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
89
103
|
function applyQuotaChanges(initialQuotas, changes) {
|
|
90
104
|
const final = initialQuotas.clone();
|
|
91
105
|
for (const { token, balance: change } of changes) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { decodeFunctionData } from "viem";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
3
|
+
function resolveWrapUnwrap(adapter, calldata, balances) {
|
|
4
|
+
const decoded = decodeFunctionData({
|
|
5
|
+
abi: ierc4626AdapterAbi,
|
|
6
|
+
data: calldata
|
|
7
|
+
});
|
|
8
|
+
const { asset, share } = adapter;
|
|
9
|
+
switch (decoded.functionName) {
|
|
10
|
+
case "deposit":
|
|
11
|
+
return { tokenIn: asset, tokenOut: share, amountIn: decoded.args[0] };
|
|
12
|
+
case "depositDiff": {
|
|
13
|
+
const [leftoverAmount] = decoded.args;
|
|
14
|
+
const running = balances.getOrZero(asset);
|
|
15
|
+
return {
|
|
16
|
+
tokenIn: asset,
|
|
17
|
+
tokenOut: share,
|
|
18
|
+
amountIn: running > leftoverAmount ? running - leftoverAmount : 0n
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
case "redeem":
|
|
22
|
+
return { tokenIn: share, tokenOut: asset, amountIn: decoded.args[0] };
|
|
23
|
+
case "redeemDiff": {
|
|
24
|
+
const [leftoverAmount] = decoded.args;
|
|
25
|
+
const running = balances.getOrZero(share);
|
|
26
|
+
return {
|
|
27
|
+
tokenIn: share,
|
|
28
|
+
tokenOut: asset,
|
|
29
|
+
amountIn: running > leftoverAmount ? running - leftoverAmount : 0n
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
default:
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function applyRWAWrapUnwrap(adapter, calldata, balances) {
|
|
37
|
+
const resolved = resolveWrapUnwrap(adapter, calldata, balances);
|
|
38
|
+
if (!resolved) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const { tokenIn, tokenOut, amountIn } = resolved;
|
|
42
|
+
if (amountIn === 0n) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
balances.dec(tokenIn, amountIn);
|
|
46
|
+
balances.inc(tokenOut, amountIn);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
applyRWAWrapUnwrap
|
|
50
|
+
};
|
|
@@ -2,6 +2,6 @@ export * from "./applyInnerOperations.js";
|
|
|
2
2
|
export * from "./detectCloseOrRepay.js";
|
|
3
3
|
export * from "./errors.js";
|
|
4
4
|
export * from "./previewAdjustCreditAccount.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./previewCloseOrRepayCreditAccount.js";
|
|
6
6
|
export * from "./previewOperation.js";
|
|
7
7
|
export * from "./types.js";
|
package/dist/esm/preview/preview/{previewCloseOrRepay.js → previewCloseOrRepayCreditAccount.js}
RENAMED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./applyInnerOperations.js";
|
|
9
9
|
import { classifyCloseOrRepay } from "./detectCloseOrRepay.js";
|
|
10
10
|
import { unwrapNativeCollateral } from "./unwrapNativeCollateral.js";
|
|
11
|
-
async function
|
|
11
|
+
async function previewCloseOrRepayCreditAccount(input, operation, permanent, options) {
|
|
12
12
|
const { sdk } = input;
|
|
13
13
|
const market = sdk.marketRegister.findByCreditManager(
|
|
14
14
|
operation.creditManager
|
|
@@ -72,5 +72,5 @@ async function replayMulticall(sdk, operation, options) {
|
|
|
72
72
|
return { ca, state };
|
|
73
73
|
}
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
previewCloseOrRepayCreditAccount
|
|
76
76
|
};
|
|
@@ -2,7 +2,7 @@ import { isPoolOperation, parseOperationCalldata } from "../parse/index.js";
|
|
|
2
2
|
import { isCloseOrRepay } from "./detectCloseOrRepay.js";
|
|
3
3
|
import { UnsupportedOperationError } from "./errors.js";
|
|
4
4
|
import { previewAdjustCreditAccount } from "./previewAdjustCreditAccount.js";
|
|
5
|
-
import {
|
|
5
|
+
import { previewCloseOrRepayCreditAccount } from "./previewCloseOrRepayCreditAccount.js";
|
|
6
6
|
import { previewOpenCreditAccount } from "./previewOpenCreditAccount.js";
|
|
7
7
|
import { previewPoolOperation } from "./previewPoolOperation.js";
|
|
8
8
|
async function previewOperation(input, options) {
|
|
@@ -14,11 +14,11 @@ async function previewOperation(input, options) {
|
|
|
14
14
|
return previewOpenCreditAccount(input, operation);
|
|
15
15
|
}
|
|
16
16
|
if (operation.operation === "CloseCreditAccount") {
|
|
17
|
-
return
|
|
17
|
+
return previewCloseOrRepayCreditAccount(input, operation, true, options);
|
|
18
18
|
}
|
|
19
19
|
if (operation.operation === "MultiCall" || operation.operation === "BotMulticall" || operation.operation === "RWAMulticall") {
|
|
20
20
|
if (isCloseOrRepay(operation.multicall)) {
|
|
21
|
-
return
|
|
21
|
+
return previewCloseOrRepayCreditAccount(input, operation, false, options);
|
|
22
22
|
}
|
|
23
23
|
return previewAdjustCreditAccount(input, operation, options);
|
|
24
24
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
simulatePoolOperation
|
|
3
|
-
} from "../simulate/index.js";
|
|
1
|
+
import { simulatePoolOperation } from "../simulate/index.js";
|
|
4
2
|
async function previewPoolOperation(input, operation, options) {
|
|
5
3
|
const { sdk, to, calldata } = input;
|
|
6
4
|
const { tokenIn, tokenOut } = operation;
|
|
@@ -8,45 +6,12 @@ async function previewPoolOperation(input, operation, options) {
|
|
|
8
6
|
{ sdk, operation, to, calldata },
|
|
9
7
|
options
|
|
10
8
|
);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const { error } = sim;
|
|
20
|
-
switch (operation.operation) {
|
|
21
|
-
case "Deposit":
|
|
22
|
-
return {
|
|
23
|
-
operation: "Deposit",
|
|
24
|
-
pool: operation.pool,
|
|
25
|
-
tokenIn: { token: tokenIn, balance: operation.assets },
|
|
26
|
-
tokenOut: { token: tokenOut, error }
|
|
27
|
-
};
|
|
28
|
-
case "Mint":
|
|
29
|
-
return {
|
|
30
|
-
operation: "Mint",
|
|
31
|
-
pool: operation.pool,
|
|
32
|
-
tokenIn: { token: tokenIn, error },
|
|
33
|
-
tokenOut: { token: tokenOut, balance: operation.shares }
|
|
34
|
-
};
|
|
35
|
-
case "Withdraw":
|
|
36
|
-
return {
|
|
37
|
-
operation: "Withdraw",
|
|
38
|
-
pool: operation.pool,
|
|
39
|
-
tokenIn: { token: tokenIn, error },
|
|
40
|
-
tokenOut: { token: tokenOut, balance: operation.assets }
|
|
41
|
-
};
|
|
42
|
-
case "Redeem":
|
|
43
|
-
return {
|
|
44
|
-
operation: "Redeem",
|
|
45
|
-
pool: operation.pool,
|
|
46
|
-
tokenIn: { token: tokenIn, balance: operation.shares },
|
|
47
|
-
tokenOut: { token: tokenOut, error }
|
|
48
|
-
};
|
|
49
|
-
}
|
|
9
|
+
return {
|
|
10
|
+
operation: operation.operation,
|
|
11
|
+
pool: operation.pool,
|
|
12
|
+
tokenIn: { token: tokenIn, balance: sim.amountIn },
|
|
13
|
+
tokenOut: { token: tokenOut, balance: sim.amountOut }
|
|
14
|
+
};
|
|
50
15
|
}
|
|
51
16
|
export {
|
|
52
17
|
previewPoolOperation
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isPoolOperation,
|
|
3
|
-
isRWAOperation
|
|
4
|
-
} from "../parse/index.js";
|
|
1
|
+
import { isPoolOperation, isRWAOperation } from "../parse/index.js";
|
|
5
2
|
import { simulateFacadeOperation } from "./simulateFacadeOperation.js";
|
|
6
3
|
import { simulatePoolOperation } from "./simulatePoolOperation.js";
|
|
7
4
|
import { simulateRWAOperation } from "./simulateRWAOperation.js";
|
|
@@ -52,14 +52,11 @@ async function simulatePoolOperation(input, options = {}) {
|
|
|
52
52
|
blockNumber,
|
|
53
53
|
...previewContract(operation)
|
|
54
54
|
});
|
|
55
|
-
return
|
|
56
|
-
status: "success",
|
|
57
|
-
...amountsInOut(operation, previewAmount)
|
|
58
|
-
};
|
|
55
|
+
return amountsInOut(operation, previewAmount);
|
|
59
56
|
} catch (cause) {
|
|
60
57
|
const error = asPreviewSimulationError(cause, "multicall");
|
|
61
58
|
logger?.error(error, "pool operation simulation failed");
|
|
62
|
-
|
|
59
|
+
throw error;
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
export {
|
|
File without changes
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ierc4626AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
1
|
import { encodeFunctionData, getContract } from "viem";
|
|
3
2
|
import {
|
|
4
3
|
iBotListV310Abi,
|
|
@@ -10,6 +9,7 @@ import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js
|
|
|
10
9
|
import { iWithdrawalCompressorV310Abi } from "../../abi/IWithdrawalCompressorV310.js";
|
|
11
10
|
import { iWithdrawalCompressorV311Abi } from "../../abi/IWithdrawalCompressorV311.js";
|
|
12
11
|
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
12
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
13
13
|
import { iRWAFactoryAbi } from "../../abi/rwa/iRWAFactory.js";
|
|
14
14
|
import { SDKConstruct } from "../base/index.js";
|
|
15
15
|
import { chains } from "../chain/chains.js";
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
export declare const ierc4626AdapterAbi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "asset";
|
|
5
|
+
readonly outputs: readonly [{
|
|
6
|
+
readonly name: "";
|
|
7
|
+
readonly internalType: "address";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
}];
|
|
10
|
+
readonly stateMutability: "view";
|
|
11
|
+
}, {
|
|
12
|
+
readonly type: "function";
|
|
13
|
+
readonly inputs: readonly [];
|
|
14
|
+
readonly name: "contractType";
|
|
15
|
+
readonly outputs: readonly [{
|
|
16
|
+
readonly name: "";
|
|
17
|
+
readonly internalType: "bytes32";
|
|
18
|
+
readonly type: "bytes32";
|
|
19
|
+
}];
|
|
20
|
+
readonly stateMutability: "view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly inputs: readonly [];
|
|
24
|
+
readonly name: "creditManager";
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly name: "";
|
|
27
|
+
readonly internalType: "address";
|
|
28
|
+
readonly type: "address";
|
|
29
|
+
}];
|
|
30
|
+
readonly stateMutability: "view";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "function";
|
|
33
|
+
readonly inputs: readonly [{
|
|
34
|
+
readonly name: "assets";
|
|
35
|
+
readonly internalType: "uint256";
|
|
36
|
+
readonly type: "uint256";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "";
|
|
39
|
+
readonly internalType: "address";
|
|
40
|
+
readonly type: "address";
|
|
41
|
+
}];
|
|
42
|
+
readonly name: "deposit";
|
|
43
|
+
readonly outputs: readonly [{
|
|
44
|
+
readonly name: "useSafePrices";
|
|
45
|
+
readonly internalType: "bool";
|
|
46
|
+
readonly type: "bool";
|
|
47
|
+
}];
|
|
48
|
+
readonly stateMutability: "nonpayable";
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly inputs: readonly [{
|
|
52
|
+
readonly name: "leftoverAmount";
|
|
53
|
+
readonly internalType: "uint256";
|
|
54
|
+
readonly type: "uint256";
|
|
55
|
+
}];
|
|
56
|
+
readonly name: "depositDiff";
|
|
57
|
+
readonly outputs: readonly [{
|
|
58
|
+
readonly name: "useSafePrices";
|
|
59
|
+
readonly internalType: "bool";
|
|
60
|
+
readonly type: "bool";
|
|
61
|
+
}];
|
|
62
|
+
readonly stateMutability: "nonpayable";
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
readonly inputs: readonly [{
|
|
66
|
+
readonly name: "shares";
|
|
67
|
+
readonly internalType: "uint256";
|
|
68
|
+
readonly type: "uint256";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "";
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}];
|
|
74
|
+
readonly name: "mint";
|
|
75
|
+
readonly outputs: readonly [{
|
|
76
|
+
readonly name: "useSafePrices";
|
|
77
|
+
readonly internalType: "bool";
|
|
78
|
+
readonly type: "bool";
|
|
79
|
+
}];
|
|
80
|
+
readonly stateMutability: "nonpayable";
|
|
81
|
+
}, {
|
|
82
|
+
readonly type: "function";
|
|
83
|
+
readonly inputs: readonly [{
|
|
84
|
+
readonly name: "shares";
|
|
85
|
+
readonly internalType: "uint256";
|
|
86
|
+
readonly type: "uint256";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "";
|
|
89
|
+
readonly internalType: "address";
|
|
90
|
+
readonly type: "address";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "";
|
|
93
|
+
readonly internalType: "address";
|
|
94
|
+
readonly type: "address";
|
|
95
|
+
}];
|
|
96
|
+
readonly name: "redeem";
|
|
97
|
+
readonly outputs: readonly [{
|
|
98
|
+
readonly name: "useSafePrices";
|
|
99
|
+
readonly internalType: "bool";
|
|
100
|
+
readonly type: "bool";
|
|
101
|
+
}];
|
|
102
|
+
readonly stateMutability: "nonpayable";
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
readonly inputs: readonly [{
|
|
106
|
+
readonly name: "leftoverAmount";
|
|
107
|
+
readonly internalType: "uint256";
|
|
108
|
+
readonly type: "uint256";
|
|
109
|
+
}];
|
|
110
|
+
readonly name: "redeemDiff";
|
|
111
|
+
readonly outputs: readonly [{
|
|
112
|
+
readonly name: "useSafePrices";
|
|
113
|
+
readonly internalType: "bool";
|
|
114
|
+
readonly type: "bool";
|
|
115
|
+
}];
|
|
116
|
+
readonly stateMutability: "nonpayable";
|
|
117
|
+
}, {
|
|
118
|
+
readonly type: "function";
|
|
119
|
+
readonly inputs: readonly [];
|
|
120
|
+
readonly name: "serialize";
|
|
121
|
+
readonly outputs: readonly [{
|
|
122
|
+
readonly name: "serializedData";
|
|
123
|
+
readonly internalType: "bytes";
|
|
124
|
+
readonly type: "bytes";
|
|
125
|
+
}];
|
|
126
|
+
readonly stateMutability: "view";
|
|
127
|
+
}, {
|
|
128
|
+
readonly type: "function";
|
|
129
|
+
readonly inputs: readonly [];
|
|
130
|
+
readonly name: "targetContract";
|
|
131
|
+
readonly outputs: readonly [{
|
|
132
|
+
readonly name: "";
|
|
133
|
+
readonly internalType: "address";
|
|
134
|
+
readonly type: "address";
|
|
135
|
+
}];
|
|
136
|
+
readonly stateMutability: "view";
|
|
137
|
+
}, {
|
|
138
|
+
readonly type: "function";
|
|
139
|
+
readonly inputs: readonly [];
|
|
140
|
+
readonly name: "vault";
|
|
141
|
+
readonly outputs: readonly [{
|
|
142
|
+
readonly name: "";
|
|
143
|
+
readonly internalType: "address";
|
|
144
|
+
readonly type: "address";
|
|
145
|
+
}];
|
|
146
|
+
readonly stateMutability: "view";
|
|
147
|
+
}, {
|
|
148
|
+
readonly type: "function";
|
|
149
|
+
readonly inputs: readonly [];
|
|
150
|
+
readonly name: "version";
|
|
151
|
+
readonly outputs: readonly [{
|
|
152
|
+
readonly name: "";
|
|
153
|
+
readonly internalType: "uint256";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}];
|
|
156
|
+
readonly stateMutability: "view";
|
|
157
|
+
}, {
|
|
158
|
+
readonly type: "function";
|
|
159
|
+
readonly inputs: readonly [{
|
|
160
|
+
readonly name: "assets";
|
|
161
|
+
readonly internalType: "uint256";
|
|
162
|
+
readonly type: "uint256";
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "";
|
|
165
|
+
readonly internalType: "address";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "";
|
|
169
|
+
readonly internalType: "address";
|
|
170
|
+
readonly type: "address";
|
|
171
|
+
}];
|
|
172
|
+
readonly name: "withdraw";
|
|
173
|
+
readonly outputs: readonly [{
|
|
174
|
+
readonly name: "useSafePrices";
|
|
175
|
+
readonly internalType: "bool";
|
|
176
|
+
readonly type: "bool";
|
|
177
|
+
}];
|
|
178
|
+
readonly stateMutability: "nonpayable";
|
|
179
|
+
}];
|
|
@@ -36,7 +36,7 @@ export declare function sortAssets<T extends Asset>(balances: Array<T>, prices:
|
|
|
36
36
|
*
|
|
37
37
|
* @returns Comparator result suitable for `Array.prototype.sort`.
|
|
38
38
|
*/
|
|
39
|
-
export declare function assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenDataSlice> | undefined, tokens2: Record<Address, TokenDataSlice> | undefined): 1 | 0 |
|
|
39
|
+
export declare function assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenDataSlice> | undefined, tokens2: Record<Address, TokenDataSlice> | undefined): -1 | 0 | 1;
|
|
40
40
|
/**
|
|
41
41
|
* Alphabetical comparator for token symbols (case-insensitive).
|
|
42
42
|
*
|
|
@@ -44,7 +44,7 @@ export declare function assetComparator<T extends Asset>(t1: T, t2: T, prices1:
|
|
|
44
44
|
* @param t2 Second token metadata.
|
|
45
45
|
* @returns `-1`, `0`, or `1` for ascending symbol order.
|
|
46
46
|
*/
|
|
47
|
-
export declare function tokensAbcComparator(t1?: TokenDataSlice, t2?: TokenDataSlice): 1 | 0 |
|
|
47
|
+
export declare function tokensAbcComparator(t1?: TokenDataSlice, t2?: TokenDataSlice): -1 | 0 | 1;
|
|
48
48
|
/**
|
|
49
49
|
* Descending numeric comparator for bigint amounts.
|
|
50
50
|
*
|
|
@@ -52,4 +52,4 @@ export declare function tokensAbcComparator(t1?: TokenDataSlice, t2?: TokenDataS
|
|
|
52
52
|
* @param t2 Second amount.
|
|
53
53
|
* @returns `-1` when `t1` should come before `t2`, otherwise `1`.
|
|
54
54
|
*/
|
|
55
|
-
export declare function amountAbcComparator(t1: bigint, t2: bigint): 1 |
|
|
55
|
+
export declare function amountAbcComparator(t1: bigint, t2: bigint): -1 | 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppChains, CuratorFilter, GearboxSDKFullState, NotValidatedStrategy, StrategyCreditManagerView } from "../types.js";
|
|
2
2
|
export declare function isStrategyEligible<CM extends StrategyCreditManagerView>(s: Pick<NotValidatedStrategy, "chainId" | "network" | "hideInProd" | "tokenOutAddress" | "showInMainApp">, allowedChains: AppChains, showHiddenStrategies: boolean, sdkStateByChain: Record<number, Pick<GearboxSDKFullState<CM>, "tokens"> | undefined> | undefined, curatorFilter: CuratorFilter): {
|
|
3
3
|
readonly isEligible: true;
|
|
4
|
-
readonly network: "
|
|
4
|
+
readonly network: "Arbitrum" | "Avalanche" | "BNB" | "Base" | "Berachain" | "Etherlink" | "Hemi" | "Lisk" | "Mainnet" | "MegaETH" | "Monad" | "Optimism" | "Plasma" | "Somnia" | "Sonic" | "WorldChain";
|
|
5
5
|
} | {
|
|
6
6
|
readonly isEligible: false;
|
|
7
7
|
readonly network: undefined;
|
package/dist/types/common-utils/utils/strategies/lists/get-available-and-disabled-strategies.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { CuratorFilter, StrategiesCMListByChain, Strategy, StrategyCreditMa
|
|
|
2
2
|
export declare function getAvailableAndDisabledStrategies<CM extends StrategyCreditManagerView>(list: Strategy[] | undefined | undefined, listCMs: StrategiesCMListByChain<CM> | undefined, curatorFilter: CuratorFilter | undefined): {
|
|
3
3
|
available: Error | import("../types.js").StrategyRecord | null;
|
|
4
4
|
disabled: import("../types.js").StrategyRecord;
|
|
5
|
-
availableList:
|
|
5
|
+
availableList: Strategy[] | Error | null;
|
|
6
6
|
disabledList: Strategy[];
|
|
7
7
|
};
|
package/dist/types/dev/abi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const iaclTraitAbi: readonly [{
|
|
2
2
|
readonly name: "acl";
|
|
3
|
-
readonly type:
|
|
3
|
+
readonly type: 'function';
|
|
4
4
|
readonly stateMutability: "view";
|
|
5
5
|
readonly inputs: readonly [];
|
|
6
6
|
readonly outputs: readonly [{
|
|
@@ -9,7 +9,7 @@ export declare const iaclTraitAbi: readonly [{
|
|
|
9
9
|
}];
|
|
10
10
|
export declare const iOwnableAbi: readonly [{
|
|
11
11
|
readonly name: "owner";
|
|
12
|
-
readonly type:
|
|
12
|
+
readonly type: 'function';
|
|
13
13
|
readonly stateMutability: "view";
|
|
14
14
|
readonly inputs: readonly [];
|
|
15
15
|
readonly outputs: readonly [{
|
|
@@ -18,7 +18,7 @@ export declare const iOwnableAbi: readonly [{
|
|
|
18
18
|
}];
|
|
19
19
|
export declare const iDegenNftv2Abi: readonly [{
|
|
20
20
|
readonly name: "minter";
|
|
21
|
-
readonly type:
|
|
21
|
+
readonly type: 'function';
|
|
22
22
|
readonly stateMutability: "view";
|
|
23
23
|
readonly inputs: readonly [];
|
|
24
24
|
readonly outputs: readonly [{
|
|
@@ -26,7 +26,7 @@ export declare const iDegenNftv2Abi: readonly [{
|
|
|
26
26
|
}];
|
|
27
27
|
}, {
|
|
28
28
|
readonly name: "mint";
|
|
29
|
-
readonly type:
|
|
29
|
+
readonly type: 'function';
|
|
30
30
|
readonly stateMutability: "nonpayable";
|
|
31
31
|
readonly inputs: readonly [{
|
|
32
32
|
readonly type: "address";
|