@gearbox-protocol/sdk 17.12.2 → 17.13.0-next.10
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/dev/index.js +2 -0
- package/dist/cjs/dev/lowerHealthFactor.js +32 -0
- package/dist/cjs/dev/ltUtils.js +3 -2
- package/dist/cjs/model/analytics.schema.js +71 -7
- package/dist/cjs/model/errors/index.js +4 -0
- package/dist/cjs/model/errors/liquidation-errors.js +9 -0
- package/dist/cjs/model/errors/operation-errors.js +27 -0
- package/dist/cjs/model/index.js +9 -1
- package/dist/cjs/model/liquidations.schema.js +5 -3
- package/dist/cjs/model/opportunities.schema.js +1 -1
- package/dist/cjs/model/positions.schema.js +3 -0
- package/dist/cjs/offchain/analytics/OffchainAnalyticsPositions.js +8 -0
- package/dist/cjs/onchain/accounts/CreditAccountsServiceV310.js +0 -37
- package/dist/cjs/onchain/accounts/index.js +3 -0
- package/dist/cjs/onchain/accounts/intents/index.js +1 -0
- package/dist/cjs/onchain/accounts/intents/operations.js +1 -1
- package/dist/cjs/onchain/accounts/intents/plan.js +21 -0
- package/dist/cjs/onchain/accounts/intents/realize.js +29 -7
- package/dist/cjs/onchain/accounts/intents/resolveQuotaUpdate.js +149 -0
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +1 -0
- package/dist/cjs/onchain/accounts/intents/tests/update-quota.fixtures.js +102 -0
- package/dist/cjs/onchain/accounts/intents/utils/index.js +1 -0
- package/dist/cjs/onchain/accounts/intents/utils/quotas-for-update.js +28 -10
- package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +175 -5
- package/dist/cjs/onchain/accounts/liquidations/MultichainLiquidationsService.js +28 -0
- package/dist/cjs/onchain/accounts/liquidations/constants.js +1 -1
- package/dist/cjs/onchain/accounts/liquidations/index.js +3 -0
- package/dist/cjs/onchain/accounts/liquidations/partialLiquidation.js +70 -0
- package/dist/cjs/onchain/base/TokensMeta.js +15 -0
- package/dist/cjs/onchain/constants/index.js +1 -0
- package/dist/cjs/onchain/constants/math.js +6 -0
- package/dist/cjs/onchain/index.js +15 -1
- package/dist/cjs/onchain/market/credit/CreditSuite.js +0 -60
- package/dist/cjs/onchain/market/credit/collateralUtils.js +3 -2
- package/dist/cjs/onchain/market/index.js +1 -1
- package/dist/cjs/onchain/market/math.js +34 -12
- package/dist/cjs/onchain/pools/PoolService.js +1 -0
- package/dist/cjs/onchain/positions/PositionsService.js +1 -0
- package/dist/cjs/onchain/positions/calcHealthFactor.js +1 -1
- package/dist/cjs/onchain/preview/preview/CreditAccountState.js +4 -2
- package/dist/cjs/onchain/validation/bundles/checkCreditOperation.js +2 -0
- package/dist/cjs/onchain/validation/bundles/checkLiquidationEligibility.js +8 -1
- package/dist/cjs/onchain/validation/bundles/checkLiquidationFunding.js +2 -1
- package/dist/cjs/onchain/validation/bundles/checkQuotaUpdates.js +45 -0
- package/dist/cjs/onchain/validation/bundles/index.js +2 -0
- package/dist/cjs/onchain/validation/checkLiquidation.js +2 -1
- package/dist/cjs/onchain/validation/checks/checkMaxQuota.js +18 -0
- package/dist/cjs/onchain/validation/checks/checkPartiallyLiquidatable.js +13 -0
- package/dist/cjs/onchain/validation/checks/checkQuotaActive.js +10 -0
- package/dist/cjs/onchain/validation/checks/checkQuotaChange.js +18 -0
- package/dist/cjs/onchain/validation/checks/index.js +8 -0
- package/dist/cjs/onchain/validation/index.js +10 -0
- package/dist/cjs/sdk/liquidations/LiquidationsNamespace.js +14 -0
- package/dist/cjs/sdk/prepare/PrepareApi.js +67 -0
- package/dist/cjs/sdk/rewards/merkl-api.js +1 -1
- package/dist/cjs/sdk/rewards/turtle-api.js +1 -1
- package/dist/esm/dev/index.js +2 -1
- package/dist/esm/dev/lowerHealthFactor.js +31 -0
- package/dist/esm/dev/ltUtils.js +3 -2
- package/dist/esm/dev/mint/index.js +1 -2
- package/dist/esm/model/analytics.schema.js +69 -9
- package/dist/esm/model/errors/index.js +3 -3
- package/dist/esm/model/errors/liquidation-errors.js +9 -1
- package/dist/esm/model/errors/operation-errors.js +25 -1
- package/dist/esm/model/index.js +5 -5
- package/dist/esm/model/liquidations.schema.js +5 -3
- package/dist/esm/model/opportunities.schema.js +1 -1
- package/dist/esm/model/positions.schema.js +3 -0
- package/dist/esm/offchain/analytics/OffchainAnalyticsPositions.js +9 -1
- package/dist/esm/offchain/notices/index.js +1 -2
- package/dist/esm/offchain/opportunities/index.js +1 -2
- package/dist/esm/offchain/positions/index.js +1 -2
- package/dist/esm/onchain/abi/index.js +1 -2
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +0 -37
- package/dist/esm/onchain/accounts/index.js +2 -1
- package/dist/esm/onchain/accounts/intents/index.js +2 -1
- package/dist/esm/onchain/accounts/intents/operations.js +1 -1
- package/dist/esm/onchain/accounts/intents/plan.js +22 -2
- package/dist/esm/onchain/accounts/intents/realize.js +29 -7
- package/dist/esm/onchain/accounts/intents/resolveQuotaUpdate.js +148 -0
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +1 -0
- package/dist/esm/onchain/accounts/intents/tests/update-quota.fixtures.js +92 -0
- package/dist/esm/onchain/accounts/intents/utils/index.js +2 -2
- package/dist/esm/onchain/accounts/intents/utils/quotas-for-update.js +28 -11
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +175 -5
- package/dist/esm/onchain/accounts/liquidations/MultichainLiquidationsService.js +28 -0
- package/dist/esm/onchain/accounts/liquidations/constants.js +1 -1
- package/dist/esm/onchain/accounts/liquidations/index.js +2 -1
- package/dist/esm/onchain/accounts/liquidations/partialLiquidation.js +68 -0
- package/dist/esm/onchain/base/TokensMeta.js +15 -0
- package/dist/esm/onchain/constants/index.js +2 -2
- package/dist/esm/onchain/constants/math.js +6 -1
- package/dist/esm/onchain/index.js +9 -3
- package/dist/esm/onchain/market/adapters/abi/midas/index.js +1 -2
- package/dist/esm/onchain/market/credit/CreditSuite.js +2 -62
- package/dist/esm/onchain/market/credit/collateralUtils.js +3 -2
- package/dist/esm/onchain/market/index.js +2 -2
- package/dist/esm/onchain/market/math.js +34 -12
- package/dist/esm/onchain/pools/PoolService.js +1 -0
- package/dist/esm/onchain/pools/index.js +1 -2
- package/dist/esm/onchain/positions/PositionsService.js +1 -0
- package/dist/esm/onchain/positions/calcHealthFactor.js +1 -1
- package/dist/esm/onchain/preview/preview/CreditAccountState.js +4 -2
- package/dist/esm/onchain/utils/internal/index.js +1 -2
- package/dist/esm/onchain/validation/bundles/checkCreditOperation.js +2 -0
- package/dist/esm/onchain/validation/bundles/checkLiquidationEligibility.js +8 -1
- package/dist/esm/onchain/validation/bundles/checkLiquidationFunding.js +2 -1
- package/dist/esm/onchain/validation/bundles/checkQuotaUpdates.js +44 -0
- package/dist/esm/onchain/validation/bundles/index.js +2 -1
- package/dist/esm/onchain/validation/checkLiquidation.js +2 -1
- package/dist/esm/onchain/validation/checks/checkMaxQuota.js +17 -0
- package/dist/esm/onchain/validation/checks/checkPartiallyLiquidatable.js +12 -0
- package/dist/esm/onchain/validation/checks/checkQuotaActive.js +9 -0
- package/dist/esm/onchain/validation/checks/checkQuotaChange.js +17 -0
- package/dist/esm/onchain/validation/checks/index.js +5 -1
- package/dist/esm/onchain/validation/index.js +6 -1
- package/dist/esm/permissionless/api/chains/index.js +1 -2
- package/dist/esm/permissionless/api/oracles/index.js +1 -2
- package/dist/esm/permissionless/api/transactions/index.js +1 -2
- package/dist/esm/permissionless/bindings/router/index.js +1 -2
- package/dist/esm/permissionless/core/index.js +1 -2
- package/dist/esm/plugins/accounts/index.js +1 -2
- package/dist/esm/plugins/accounts-counter/index.js +1 -2
- package/dist/esm/plugins/bots/abi/index.js +1 -2
- package/dist/esm/sdk/analytics/index.js +1 -2
- package/dist/esm/sdk/execute/index.js +1 -2
- package/dist/esm/sdk/liquidations/LiquidationsNamespace.js +14 -0
- package/dist/esm/sdk/liquidations/index.js +1 -2
- package/dist/esm/sdk/opportunities/index.js +1 -2
- package/dist/esm/sdk/positions/index.js +1 -2
- package/dist/esm/sdk/prepare/PrepareApi.js +67 -0
- package/dist/esm/sdk/preview/index.js +1 -2
- package/dist/esm/sdk/rewards/merkl-api.js +1 -1
- package/dist/esm/sdk/rewards/turtle-api.js +1 -1
- package/dist/types/abi/310/configure/creditSuiteParams.d.ts +4 -5
- package/dist/types/abi/310/configure/iCreditConfigureActions.d.ts +2 -3
- package/dist/types/abi/310/configure/iPoolConfigureActions.d.ts +2 -3
- package/dist/types/abi/310/configure/iPriceOracleConfigureActions.d.ts +2 -3
- package/dist/types/abi/310/crossChainMultisig.d.ts +2 -3
- package/dist/types/abi/310/generated.d.ts +15 -16
- package/dist/types/abi/310/iBytecodeRepository.d.ts +2 -3
- package/dist/types/abi/310/iLinearInterestRateModelV310.d.ts +2 -3
- package/dist/types/abi/310/iMarketConfiguratorFactory.d.ts +2 -3
- package/dist/types/abi/310/iPriceFeedStore.d.ts +2 -3
- package/dist/types/abi/310/iTreasurySplitter.d.ts +2 -3
- package/dist/types/abi/310/instanceManager.d.ts +2 -3
- package/dist/types/abi/AccountMigrator.d.ts +2 -3
- package/dist/types/abi/ILiquidationCompressorV313.d.ts +2 -3
- package/dist/types/abi/IWithdrawalCompressorV310.d.ts +2 -3
- package/dist/types/abi/IWithdrawalCompressorV311.d.ts +2 -3
- package/dist/types/abi/IWithdrawalCompressorV313.d.ts +2 -3
- package/dist/types/abi/compressors/creditAccountCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/creditSuiteCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/defillamaCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/gaugeCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/liquidationCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/marketCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/peripheryCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/priceFeedCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/rewardsCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/rwaCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/rwa/onDemandRWAUnderlyingSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/rwa/securitizeRWAFactorySubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/infinifiWithdrawalSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/kelpLRTWithdrawalSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/mellowFlexibleDepositSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/mellowFlexibleRedeemSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/subcompressors/withdrawal/upshiftWithdrawalSubcompressor.d.ts +2 -3
- package/dist/types/abi/compressors/tokenCompressor.d.ts +2 -3
- package/dist/types/abi/compressors/withdrawalCompressor.d.ts +2 -3
- package/dist/types/abi/errors.d.ts +11 -12
- package/dist/types/abi/governance/batchesChain.d.ts +2 -3
- package/dist/types/abi/governance/governor.d.ts +2 -3
- package/dist/types/abi/governance/iTimeLock.d.ts +2 -3
- package/dist/types/abi/helpers/redemptionLogger.d.ts +2 -3
- package/dist/types/abi/iAirdropDistributor.d.ts +2 -3
- package/dist/types/abi/iBaseRewardPool.d.ts +2 -3
- package/dist/types/abi/iCurvePool.d.ts +2 -3
- package/dist/types/abi/iDefaultAccountFactoryV3.d.ts +2 -3
- package/dist/types/abi/iDegenNFTV2.d.ts +2 -3
- package/dist/types/abi/iERC20.d.ts +2 -3
- package/dist/types/abi/iERC20Permit.d.ts +2 -3
- package/dist/types/abi/iERC20Zapper.d.ts +2 -3
- package/dist/types/abi/iERC20ZapperDeposits.d.ts +2 -3
- package/dist/types/abi/iETHZapper.d.ts +2 -3
- package/dist/types/abi/iETHZapperDeposits.d.ts +2 -3
- package/dist/types/abi/iExpirable.d.ts +2 -3
- package/dist/types/abi/iFarmingPool.d.ts +2 -3
- package/dist/types/abi/iInterestRateModel.d.ts +2 -3
- package/dist/types/abi/iMulticall3.d.ts +2 -3
- package/dist/types/abi/iOffchainOracle.d.ts +2 -3
- package/dist/types/abi/iPausable.d.ts +2 -3
- package/dist/types/abi/iPhantomToken.d.ts +2 -3
- package/dist/types/abi/iPriceFeed.d.ts +2 -3
- package/dist/types/abi/iRedemptionLoggerV310.d.ts +2 -3
- package/dist/types/abi/iStateSerializer.d.ts +2 -3
- package/dist/types/abi/iUpdatablePriceFeed.d.ts +2 -3
- package/dist/types/abi/iVersion.d.ts +2 -3
- package/dist/types/abi/iZapper.d.ts +2 -3
- package/dist/types/abi/ierc4626Adapter.d.ts +2 -3
- package/dist/types/abi/mellow.d.ts +6 -7
- package/dist/types/abi/migration.d.ts +3 -4
- package/dist/types/abi/router/balancerV2Worker.d.ts +2 -3
- package/dist/types/abi/router/balancerV3Worker.d.ts +2 -3
- package/dist/types/abi/router/balancerV3WrapperWorker.d.ts +2 -3
- package/dist/types/abi/router/camelotV3Worker.d.ts +2 -3
- package/dist/types/abi/router/convexWorker.d.ts +2 -3
- package/dist/types/abi/router/curveWorker.d.ts +2 -3
- package/dist/types/abi/router/daiUsdsWorker.d.ts +2 -3
- package/dist/types/abi/router/equalizerRouterWorker.d.ts +2 -3
- package/dist/types/abi/router/erc4626Worker.d.ts +2 -3
- package/dist/types/abi/router/fluidDexWorker.d.ts +2 -3
- package/dist/types/abi/router/gearboxRouter.d.ts +2 -3
- package/dist/types/abi/router/infinifiWorker.d.ts +2 -3
- package/dist/types/abi/router/infraredVaultWorker.d.ts +2 -3
- package/dist/types/abi/router/kelpLRTDepositPoolWorker.d.ts +2 -3
- package/dist/types/abi/router/kodiakWorker.d.ts +2 -3
- package/dist/types/abi/router/lidoWorker.d.ts +2 -3
- package/dist/types/abi/router/mellow4626Worker.d.ts +2 -3
- package/dist/types/abi/router/mellowDVVWorker.d.ts +2 -3
- package/dist/types/abi/router/mellowVaultWorker.d.ts +2 -3
- package/dist/types/abi/router/midasWorker.d.ts +2 -3
- package/dist/types/abi/router/pendleRouterWorker.d.ts +2 -3
- package/dist/types/abi/router/routingManager.d.ts +2 -3
- package/dist/types/abi/router/securitizeOnrampWorker.d.ts +2 -3
- package/dist/types/abi/router/stakingRewardsWorker.d.ts +2 -3
- package/dist/types/abi/router/traderJoeWorker.d.ts +2 -3
- package/dist/types/abi/router/uniswapV2Worker.d.ts +2 -3
- package/dist/types/abi/router/uniswapV3Worker.d.ts +2 -3
- package/dist/types/abi/router/uniswapV4Worker.d.ts +2 -3
- package/dist/types/abi/router/upshiftWorker.d.ts +2 -3
- package/dist/types/abi/router/velodromeV2Worker.d.ts +2 -3
- package/dist/types/abi/router/wstETHWorker.d.ts +2 -3
- package/dist/types/abi/router/yearnV2Worker.d.ts +2 -3
- package/dist/types/abi/rwa/iDSRegistryService.d.ts +2 -3
- package/dist/types/abi/rwa/iDSToken.d.ts +2 -3
- package/dist/types/abi/rwa/iMidasAccessControl.d.ts +2 -3
- package/dist/types/abi/rwa/iMidasDegenNFT.d.ts +2 -3
- package/dist/types/abi/rwa/iMidasLiquidatorV311.d.ts +2 -3
- package/dist/types/abi/rwa/iRWACompressor.d.ts +2 -3
- package/dist/types/abi/rwa/iRWAFactory.d.ts +2 -3
- package/dist/types/abi/rwa/iRWAGateway.d.ts +2 -3
- package/dist/types/abi/rwa/iRWAUnderlying.d.ts +2 -3
- package/dist/types/abi/rwa/iSecuritizeDegenNFT.d.ts +2 -3
- package/dist/types/abi/rwa/iSecuritizeLiquidatorV311.d.ts +2 -3
- package/dist/types/abi/rwa/iSecuritizeRWAFactory.d.ts +2 -3
- package/dist/types/dev/AccountOpener.d.ts +9 -9
- package/dist/types/dev/EthCallSpy.d.ts +6 -7
- package/dist/types/dev/RevolverTransport.d.ts +12 -12
- package/dist/types/dev/abi.d.ts +6 -7
- package/dist/types/dev/calcLiquidatableLTs.d.ts +2 -3
- package/dist/types/dev/claimFromFaucet.d.ts +2 -2
- package/dist/types/dev/create2.d.ts +10 -11
- package/dist/types/dev/createAnvilClient.d.ts +13 -14
- package/dist/types/dev/detectChain.d.ts +2 -3
- package/dist/types/dev/index.d.ts +2 -1
- package/dist/types/dev/isOutOfSyncError.d.ts +2 -3
- package/dist/types/dev/isRateLimitError.d.ts +2 -3
- package/dist/types/dev/isTransientError.d.ts +2 -3
- package/dist/types/dev/kycUtils.d.ts +13 -14
- package/dist/types/dev/logSplitterTransport.d.ts +10 -10
- package/dist/types/dev/lowerHealthFactor.d.ts +34 -0
- package/dist/types/dev/ltUtils.d.ts +3 -4
- package/dist/types/dev/midasUtils.d.ts +8 -9
- package/dist/types/dev/migrateFaucet.d.ts +2 -3
- package/dist/types/dev/mint/AbstractMinter.d.ts +2 -3
- package/dist/types/dev/mint/DealMinter.d.ts +2 -3
- package/dist/types/dev/mint/DirectMinter.d.ts +2 -3
- package/dist/types/dev/mint/FallbackMinter.d.ts +2 -3
- package/dist/types/dev/mint/TransferMinter.d.ts +2 -3
- package/dist/types/dev/mint/factory.d.ts +2 -3
- package/dist/types/dev/mint/types.d.ts +2 -3
- package/dist/types/dev/mode-parity/compareOpportunities.d.ts +8 -8
- package/dist/types/dev/mode-parity/comparePositions.d.ts +12 -13
- package/dist/types/dev/mode-parity/compareRules.d.ts +6 -7
- package/dist/types/dev/mode-parity/fieldDiff.d.ts +29 -30
- package/dist/types/dev/mode-parity/scriptUtils.d.ts +18 -19
- package/dist/types/dev/providers.d.ts +10 -11
- package/dist/types/dev/replaceStorage.d.ts +3 -4
- package/dist/types/dev/resilientTransport.d.ts +6 -7
- package/dist/types/dev/securitizeUtils.d.ts +6 -6
- package/dist/types/dev/transports.d.ts +2 -3
- package/dist/types/dev/types.d.ts +4 -5
- package/dist/types/dev/verifyTestnet.d.ts +4 -5
- package/dist/types/dev/withdrawalAbi.d.ts +9 -10
- package/dist/types/dev/withdrawalUtils.d.ts +3 -4
- package/dist/types/history/assembleOperations.d.ts +3 -4
- package/dist/types/history/classifyMulticallOperations.d.ts +3 -4
- package/dist/types/history/mapOperations.d.ts +3 -4
- package/dist/types/history/parseCreditAccountTransaction.d.ts +3 -4
- package/dist/types/history/populateContractsRegister.d.ts +4 -5
- package/dist/types/history/toLegacyOperation.d.ts +6 -7
- package/dist/types/history/trace/errors.d.ts +6 -7
- package/dist/types/history/trace/extractAdapterCallTraces.d.ts +2 -3
- package/dist/types/history/trace/extractTransfers.d.ts +4 -4
- package/dist/types/history/trace/findFacadeCalls.d.ts +2 -3
- package/dist/types/history/trace/types.d.ts +3 -4
- package/dist/types/history/types.d.ts +13 -13
- package/dist/types/model/analytics.d.ts +66 -13
- package/dist/types/model/analytics.schema.d.ts +182 -39
- package/dist/types/model/charts.d.ts +29 -29
- package/dist/types/model/charts.schema.d.ts +16 -17
- package/dist/types/model/compare.schema.d.ts +9 -10
- package/dist/types/model/curators.d.ts +3 -4
- package/dist/types/model/curators.schema.d.ts +3 -4
- package/dist/types/model/delayed-intent.schema.d.ts +2 -3
- package/dist/types/model/delayed-intents.d.ts +9 -10
- package/dist/types/model/errors/base.d.ts +2 -3
- package/dist/types/model/errors/index.d.ts +3 -3
- package/dist/types/model/errors/liquidation-errors.d.ts +20 -8
- package/dist/types/model/errors/operation-errors.d.ts +76 -39
- package/dist/types/model/errors/oracle-errors.d.ts +3 -4
- package/dist/types/model/errors/prepare-errors.d.ts +21 -22
- package/dist/types/model/errors/preview-errors.d.ts +9 -10
- package/dist/types/model/filters.d.ts +6 -7
- package/dist/types/model/filters.schema.d.ts +5 -6
- package/dist/types/model/index.d.ts +6 -6
- package/dist/types/model/liquidations.d.ts +37 -18
- package/dist/types/model/liquidations.schema.d.ts +12 -10
- package/dist/types/model/notices.d.ts +4 -5
- package/dist/types/model/notices.schema.d.ts +3 -4
- package/dist/types/model/opportunities.d.ts +32 -33
- package/dist/types/model/opportunities.schema.d.ts +26 -27
- package/dist/types/model/positions.d.ts +34 -30
- package/dist/types/model/positions.schema.d.ts +102 -23
- package/dist/types/model/previews.d.ts +21 -21
- package/dist/types/model/primitives.d.ts +12 -13
- package/dist/types/model/primitives.schema.d.ts +11 -12
- package/dist/types/model/response.d.ts +8 -9
- package/dist/types/model/response.schema.d.ts +7 -8
- package/dist/types/model/result.d.ts +8 -9
- package/dist/types/model/rewards.d.ts +4 -5
- package/dist/types/model/rwa.d.ts +20 -21
- package/dist/types/model/rwa.schema.d.ts +3 -4
- package/dist/types/model/withdrawals.d.ts +5 -6
- package/dist/types/model/withdrawals.schema.d.ts +5 -6
- package/dist/types/offchain/AbstractOffchainNamespace.d.ts +4 -5
- package/dist/types/offchain/GearboxAPI.d.ts +2 -3
- package/dist/types/offchain/analytics/OffchainAnalytics.d.ts +2 -3
- package/dist/types/offchain/analytics/OffchainAnalyticsPositions.d.ts +6 -4
- package/dist/types/offchain/analytics/types.d.ts +17 -5
- package/dist/types/offchain/errors/OffchainInvalidJsonError.d.ts +2 -3
- package/dist/types/offchain/errors/OffchainNotConfiguredError.d.ts +2 -3
- package/dist/types/offchain/errors/OffchainNotImplementedError.d.ts +2 -3
- package/dist/types/offchain/errors/OffchainRequestFailedError.d.ts +2 -3
- package/dist/types/offchain/errors/OffchainStatusError.d.ts +2 -3
- package/dist/types/offchain/errors/OffchainTransportError.d.ts +3 -4
- package/dist/types/offchain/errors/OffchainValidationError.d.ts +2 -3
- package/dist/types/offchain/errors/backendMessage.d.ts +2 -3
- package/dist/types/offchain/errors/errorCause.d.ts +3 -4
- package/dist/types/offchain/errors/readResponseBody.d.ts +2 -3
- package/dist/types/offchain/notices/OffchainNotices.d.ts +2 -3
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +2 -3
- package/dist/types/offchain/opportunities/types.d.ts +3 -4
- package/dist/types/offchain/positions/OffchainPositions.d.ts +2 -3
- package/dist/types/offchain/positions/types.d.ts +3 -4
- package/dist/types/offchain/types.d.ts +2 -3
- package/dist/types/onchain/MultichainSDK.d.ts +7 -8
- package/dist/types/onchain/OnchainSDK.d.ts +8 -9
- package/dist/types/onchain/abi/oracles.d.ts +27 -28
- package/dist/types/onchain/accounts/CreditAccountsServiceV310.d.ts +3 -12
- package/dist/types/onchain/accounts/bots/AccountBotsService.d.ts +2 -3
- package/dist/types/onchain/accounts/bots/PeripheryCompressorV310Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/bots/abi.d.ts +2 -3
- package/dist/types/onchain/accounts/bots/types.d.ts +13 -14
- package/dist/types/onchain/accounts/credit-account-compressor/CreditAccountCompressor.d.ts +2 -3
- package/dist/types/onchain/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/credit-account-compressor/types.d.ts +11 -12
- package/dist/types/onchain/accounts/index.d.ts +5 -4
- package/dist/types/onchain/accounts/intents/borrow.d.ts +6 -7
- package/dist/types/onchain/accounts/intents/collateral-valuation.d.ts +4 -5
- package/dist/types/onchain/accounts/intents/guards.d.ts +7 -7
- package/dist/types/onchain/accounts/intents/index.d.ts +6 -6
- package/dist/types/onchain/accounts/intents/leverage-band.d.ts +4 -5
- package/dist/types/onchain/accounts/intents/math.d.ts +8 -8
- package/dist/types/onchain/accounts/intents/maxBorrow.d.ts +3 -4
- package/dist/types/onchain/accounts/intents/maxWithdrawCollateral.d.ts +3 -4
- package/dist/types/onchain/accounts/intents/open-strategy.d.ts +4 -5
- package/dist/types/onchain/accounts/intents/operations.d.ts +34 -28
- package/dist/types/onchain/accounts/intents/plan.d.ts +35 -19
- package/dist/types/onchain/accounts/intents/realize.d.ts +4 -5
- package/dist/types/onchain/accounts/intents/resolveQuotaUpdate.d.ts +38 -0
- package/dist/types/onchain/accounts/intents/strategyLimits.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/tail.d.ts +4 -4
- package/dist/types/onchain/accounts/intents/testing/delayed.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/testing/expect.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/testing/market.d.ts +6 -6
- package/dist/types/onchain/accounts/intents/testing/sdk-mock.d.ts +3 -3
- package/dist/types/onchain/accounts/intents/tests/add-collateral.fixtures.d.ts +15 -16
- package/dist/types/onchain/accounts/intents/tests/adjust-leverage.fixtures.d.ts +22 -23
- package/dist/types/onchain/accounts/intents/tests/deposit.fixtures.d.ts +24 -25
- package/dist/types/onchain/accounts/intents/tests/finish-decrease-leverage.fixtures.d.ts +21 -21
- package/dist/types/onchain/accounts/intents/tests/finish-withdraw.fixtures.d.ts +30 -31
- package/dist/types/onchain/accounts/intents/tests/open-strategy.fixtures.d.ts +16 -17
- package/dist/types/onchain/accounts/intents/tests/update-quota.fixtures.d.ts +48 -0
- package/dist/types/onchain/accounts/intents/tests/withdraw-asset.fixtures.d.ts +16 -17
- package/dist/types/onchain/accounts/intents/tests/withdraw.fixtures.d.ts +26 -27
- package/dist/types/onchain/accounts/intents/types.d.ts +46 -30
- package/dist/types/onchain/accounts/intents/utils/adjust-state-to-snapshot.d.ts +2 -3
- package/dist/types/onchain/accounts/intents/utils/assemble-operation-calls.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/utils/borrowed-amount-plus-interest-and-fees.d.ts +2 -3
- package/dist/types/onchain/accounts/intents/utils/common.d.ts +5 -6
- package/dist/types/onchain/accounts/intents/utils/credit-account-slice.d.ts +4 -5
- package/dist/types/onchain/accounts/intents/utils/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/utils/ledger.d.ts +3 -4
- package/dist/types/onchain/accounts/intents/utils/pick-token.d.ts +6 -7
- package/dist/types/onchain/accounts/intents/utils/price-impact.d.ts +5 -6
- package/dist/types/onchain/accounts/intents/utils/quotas-for-update.d.ts +27 -9
- package/dist/types/onchain/accounts/intents/utils/router-path.d.ts +6 -7
- package/dist/types/onchain/accounts/intents/view.d.ts +2 -3
- package/dist/types/onchain/accounts/intents/withdraw-limits.d.ts +5 -6
- package/dist/types/onchain/accounts/liquidations/LiquidationsService.d.ts +50 -4
- package/dist/types/onchain/accounts/liquidations/MultichainLiquidationsService.d.ts +13 -4
- package/dist/types/onchain/accounts/liquidations/constants.d.ts +4 -5
- package/dist/types/onchain/accounts/liquidations/index.d.ts +3 -2
- package/dist/types/onchain/accounts/liquidations/partialLiquidation.d.ts +88 -0
- package/dist/types/onchain/accounts/liquidations/skipLiquidatableAccount.d.ts +2 -3
- package/dist/types/onchain/accounts/liquidations/types.d.ts +146 -21
- package/dist/types/onchain/accounts/multicall-utils.d.ts +4 -5
- package/dist/types/onchain/accounts/quota-utils.d.ts +11 -11
- package/dist/types/onchain/accounts/types.d.ts +18 -95
- package/dist/types/onchain/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +7 -7
- package/dist/types/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +2 -2
- package/dist/types/onchain/accounts/withdrawal-compressor/addresses.d.ts +4 -5
- package/dist/types/onchain/accounts/withdrawal-compressor/createRedemptionLogger.d.ts +2 -3
- package/dist/types/onchain/accounts/withdrawal-compressor/createWithdrawalCompressor.d.ts +2 -3
- package/dist/types/onchain/accounts/withdrawal-compressor/intent-codec.d.ts +5 -6
- package/dist/types/onchain/accounts/withdrawal-compressor/types.d.ts +16 -17
- package/dist/types/onchain/base/BaseContract.d.ts +5 -6
- package/dist/types/onchain/base/ChainContractsRegister.d.ts +3 -4
- package/dist/types/onchain/base/Construct.d.ts +3 -4
- package/dist/types/onchain/base/MultichainConstruct.d.ts +7 -8
- package/dist/types/onchain/base/SDKConstruct.d.ts +2 -3
- package/dist/types/onchain/base/TokensMeta.d.ts +13 -6
- package/dist/types/onchain/base/errors.d.ts +2 -3
- package/dist/types/onchain/base/token-types.d.ts +18 -18
- package/dist/types/onchain/base/types.d.ts +37 -38
- package/dist/types/onchain/chain/chains.d.ts +20 -21
- package/dist/types/onchain/chain/detectNetwork.d.ts +2 -3
- package/dist/types/onchain/constants/address-provider.d.ts +36 -37
- package/dist/types/onchain/constants/addresses.d.ts +5 -6
- package/dist/types/onchain/constants/bot-permissions.d.ts +3 -4
- package/dist/types/onchain/constants/index.d.ts +2 -2
- package/dist/types/onchain/constants/math.d.ts +25 -21
- package/dist/types/onchain/constants/networks.d.ts +3 -4
- package/dist/types/onchain/constants/periphery.d.ts +3 -4
- package/dist/types/onchain/constants/versions.d.ts +5 -6
- package/dist/types/onchain/core/AbstractAddressProviderContract.d.ts +2 -3
- package/dist/types/onchain/core/AddressProviderV310Contract.d.ts +2 -2
- package/dist/types/onchain/core/createAddressProvider.d.ts +3 -4
- package/dist/types/onchain/core/errors.d.ts +9 -10
- package/dist/types/onchain/core/types.d.ts +4 -5
- package/dist/types/onchain/index.d.ts +13 -7
- package/dist/types/onchain/market/MarketConfiguratorContract.d.ts +2 -2
- package/dist/types/onchain/market/MarketRegister.d.ts +4 -5
- package/dist/types/onchain/market/MarketSuite.d.ts +2 -3
- package/dist/types/onchain/market/ZapperRegister.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/actionAbi.d.ts +4 -5
- package/dist/types/onchain/market/adapters/abi/adapters/erc4626ReferralAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iBalancerV3RouterAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iBalancerV3WrapperAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iCamelotV3Adapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iConvexV1BaseRewardPoolAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iConvexV1BoosterAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iCurveV1StableNgAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iCurveV1_2AssetsAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iCurveV1_3AssetsAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iCurveV1_4AssetsAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iDaiUsdsAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iFluidDexAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iInfinifiGatewayAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iInfinifiUnwindingGateway.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iKelpLrtDepositPool.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iKelpLrtWithdrawalManager.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iLidoV1Adapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMellow4626VaultAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMellowClaimerAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMellowWrapperAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMidasGatewayAdapterV311.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMidasIssuanceVaultAdapterV310.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iMidasRedemptionVaultAdapterV310.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iPendleRouterAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iSecuritizeOnRampAdapterV310.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iStakingRewardsAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iTraderJoeRouterAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iUniswapV2Adapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iUniswapV3Adapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iUniswapV4Adapter.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iUpshiftVaultAdapter.d.ts +3 -4
- package/dist/types/onchain/market/adapters/abi/adapters/iVelodromeV2RouterAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/iwstEthv1Adapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/adapters/mellowDvvAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/conctructorAbi.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/conctructorAbiPatterns.d.ts +12 -13
- package/dist/types/onchain/market/adapters/abi/midas/iMidasGatewayV311.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/securitize/iBaseOnRamp.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/securitize/iSecuritizeOnRamp.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.d.ts +2 -3
- package/dist/types/onchain/market/adapters/abi/targetContractAbi.d.ts +29 -30
- package/dist/types/onchain/market/adapters/abi/utils.d.ts +7 -8
- package/dist/types/onchain/market/adapters/contracts/AbstractAdapter.d.ts +4 -5
- package/dist/types/onchain/market/adapters/contracts/AbstractCurveAdapter.d.ts +2 -3
- package/dist/types/onchain/market/adapters/contracts/AccountMigratorAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/BalancerV3RouterAdapterContract.d.ts +4 -4
- package/dist/types/onchain/market/adapters/contracts/BalancerV3WrapperAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/CamelotV3AdapterContract.d.ts +3 -3
- package/dist/types/onchain/market/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/ConvexV1BoosterAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/Curve2AssetsAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/Curve3AssetsAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/Curve4AssetsAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/CurveV1AdapterStETHContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/CurveV1StableNGAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/DaiUsdsAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/ERC4626AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/ERC4626ReferralAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/FluidDexAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/InfinifiGatewayAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/KelpLRTDepositPoolAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/KelpLRTWithdrawalManagerAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/LidoV1AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MellowClaimerAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MellowDVVAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MellowERC4626VaultAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MellowWrapperAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MidasGatewayAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/PendleRouterAdapterContract.d.ts +5 -5
- package/dist/types/onchain/market/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/StakingRewardsAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/TraderJoeRouterAdapterContract.d.ts +4 -4
- package/dist/types/onchain/market/adapters/contracts/UniswapV2AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/UniswapV3AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/UniswapV4AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/UpshiftVaultAdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/VelodromeV2AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/contracts/WstETHV1AdapterContract.d.ts +2 -2
- package/dist/types/onchain/market/adapters/createAdapter.d.ts +3 -4
- package/dist/types/onchain/market/adapters/legacyAdapterOperations.d.ts +27 -28
- package/dist/types/onchain/market/adapters/transferHelpers.d.ts +10 -11
- package/dist/types/onchain/market/adapters/transfers.d.ts +2 -3
- package/dist/types/onchain/market/adapters/types.d.ts +9 -10
- package/dist/types/onchain/market/credit/CreditConfiguratorV310Contract.d.ts +3 -3
- package/dist/types/onchain/market/credit/CreditFacadeV310BaseContract.d.ts +2 -2
- package/dist/types/onchain/market/credit/CreditFacadeV310Contract.d.ts +3 -3
- package/dist/types/onchain/market/credit/CreditManagerV310Contract.d.ts +3 -3
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +3 -14
- package/dist/types/onchain/market/credit/CreditSuiteStrategy.d.ts +2 -3
- package/dist/types/onchain/market/credit/collateralUtils.d.ts +6 -6
- package/dist/types/onchain/market/credit/createCreditConfigurator.d.ts +2 -3
- package/dist/types/onchain/market/credit/createCreditFacade.d.ts +2 -3
- package/dist/types/onchain/market/credit/createCreditManager.d.ts +2 -3
- package/dist/types/onchain/market/credit/expectedBalanceDeltas.d.ts +4 -5
- package/dist/types/onchain/market/credit/index.d.ts +2 -2
- package/dist/types/onchain/market/credit/types.d.ts +10 -46
- package/dist/types/onchain/market/index.d.ts +3 -3
- package/dist/types/onchain/market/loss-policy/AliasLossPolicyV310Contract.d.ts +3 -3
- package/dist/types/onchain/market/loss-policy/LossPolicyContract.d.ts +2 -2
- package/dist/types/onchain/market/loss-policy/constants.d.ts +5 -6
- package/dist/types/onchain/market/loss-policy/createLossPolicy.d.ts +2 -3
- package/dist/types/onchain/market/loss-policy/types.d.ts +2 -3
- package/dist/types/onchain/market/math.d.ts +48 -30
- package/dist/types/onchain/market/oracle/PriceFeedAnswerMap.d.ts +2 -3
- package/dist/types/onchain/market/oracle/PriceOracleBaseContract.d.ts +2 -3
- package/dist/types/onchain/market/oracle/PriceOracleV310Contract.d.ts +2 -2
- package/dist/types/onchain/market/oracle/collateralPriceInUnderlying.d.ts +2 -3
- package/dist/types/onchain/market/oracle/createPriceOracle.d.ts +2 -3
- package/dist/types/onchain/market/oracle/types.d.ts +5 -6
- package/dist/types/onchain/market/pool/GaugeContract.d.ts +3 -3
- package/dist/types/onchain/market/pool/LinearInterestRateModelContract.d.ts +2 -2
- package/dist/types/onchain/market/pool/PoolQuotaKeeperV310Contract.d.ts +2 -2
- package/dist/types/onchain/market/pool/PoolSuite.d.ts +2 -3
- package/dist/types/onchain/market/pool/PoolV310Contract.d.ts +3 -3
- package/dist/types/onchain/market/pool/TumblerContract.d.ts +2 -2
- package/dist/types/onchain/market/pool/createInterestRateModel.d.ts +2 -3
- package/dist/types/onchain/market/pool/createPool.d.ts +2 -3
- package/dist/types/onchain/market/pool/createPoolQuotaKeeper.d.ts +2 -3
- package/dist/types/onchain/market/pool/createRateKeeper.d.ts +2 -3
- package/dist/types/onchain/market/pool/math.d.ts +6 -7
- package/dist/types/onchain/market/pool/types.d.ts +7 -8
- package/dist/types/onchain/market/pricefeeds/AbstractLPPriceFeed.d.ts +3 -4
- package/dist/types/onchain/market/pricefeeds/AbstractPriceFeed.d.ts +5 -6
- package/dist/types/onchain/market/pricefeeds/PriceFeedRef.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/PriceFeedRegistry.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/feeds/BalancerStablePriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/BalancerWeightedPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/BoundedPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/CompositePriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/ConstantPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/CurveCryptoPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/CurveStablePriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/CurveUSDPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/Erc4626PriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/ExternalPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/MellowLRTPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/PendleTWAPPTPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/PythPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/RedstonePriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/WstETHPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/YearnPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/feeds/ZeroPriceFeed.d.ts +2 -2
- package/dist/types/onchain/market/pricefeeds/types.d.ts +5 -6
- package/dist/types/onchain/market/pricefeeds/updates/PriceUpdateTx.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/updates/PriceUpdatesCache.d.ts +3 -4
- package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/updates/getRawPriceUpdates.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.d.ts +2 -3
- package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +8 -9
- package/dist/types/onchain/market/pricefeeds/updates/updatableDependencies.d.ts +2 -3
- package/dist/types/onchain/market/rwa/RWARegistry.d.ts +3 -4
- package/dist/types/onchain/market/rwa/createDegenNFT.d.ts +2 -3
- package/dist/types/onchain/market/rwa/midas/MidasDegenNFT.d.ts +2 -2
- package/dist/types/onchain/market/rwa/midas/MidasLiquidatorContract.d.ts +2 -2
- package/dist/types/onchain/market/rwa/midas/constants.d.ts +4 -5
- package/dist/types/onchain/market/rwa/securitize/SecuritizeDegenNFT.d.ts +2 -2
- package/dist/types/onchain/market/rwa/securitize/SecuritizeLiquidatorContract.d.ts +2 -2
- package/dist/types/onchain/market/rwa/securitize/SecuritizeRWAFactory.d.ts +2 -2
- package/dist/types/onchain/market/rwa/securitize/constants.d.ts +4 -5
- package/dist/types/onchain/market/rwa/securitize/types.d.ts +5 -6
- package/dist/types/onchain/market/rwa/types.d.ts +16 -16
- package/dist/types/onchain/market/strategyName.d.ts +2 -3
- package/dist/types/onchain/market/types.d.ts +3 -4
- package/dist/types/onchain/market/zapper/IERC20ZapperContract.d.ts +2 -2
- package/dist/types/onchain/market/zapper/IETHZapperContract.d.ts +2 -2
- package/dist/types/onchain/market/zapper/ZapperContract.d.ts +2 -3
- package/dist/types/onchain/market/zapper/createZapper.d.ts +2 -3
- package/dist/types/onchain/market/zapper/types.d.ts +5 -6
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +2 -3
- package/dist/types/onchain/opportunities/OpportunitiesService.d.ts +2 -3
- package/dist/types/onchain/opportunities/types.d.ts +2 -3
- package/dist/types/onchain/options.d.ts +4 -5
- package/dist/types/onchain/plugins/BasePlugin.d.ts +2 -3
- package/dist/types/onchain/plugins/errors.d.ts +2 -3
- package/dist/types/onchain/plugins/types.d.ts +9 -10
- package/dist/types/onchain/pools/PoolService.d.ts +2 -3
- package/dist/types/onchain/pools/types.d.ts +12 -13
- package/dist/types/onchain/positions/MultichainPositionsService.d.ts +2 -3
- package/dist/types/onchain/positions/PositionsService.d.ts +3 -4
- package/dist/types/onchain/positions/calcBorrowRate.d.ts +3 -4
- package/dist/types/onchain/positions/calcHealthFactor.d.ts +3 -4
- package/dist/types/onchain/positions/calcLiquidationPrice.d.ts +3 -4
- package/dist/types/onchain/positions/calcLiquidationPriceForTarget.d.ts +4 -5
- package/dist/types/onchain/positions/calcTimeToLiquidationMs.d.ts +2 -3
- package/dist/types/onchain/positions/types.d.ts +9 -10
- package/dist/types/onchain/preview/parse/classifyInnerOperations.d.ts +3 -4
- package/dist/types/onchain/preview/parse/parseFacadeOperationCalldata.d.ts +2 -3
- package/dist/types/onchain/preview/parse/parseOperationCalldata.d.ts +2 -3
- package/dist/types/onchain/preview/parse/parsePoolOperationCalldata.d.ts +2 -3
- package/dist/types/onchain/preview/parse/parseRWAFactoryOperationCalldata.d.ts +2 -3
- package/dist/types/onchain/preview/parse/types-adapters.d.ts +4 -5
- package/dist/types/onchain/preview/parse/types-facades.d.ts +20 -21
- package/dist/types/onchain/preview/parse/types-pools.d.ts +6 -7
- package/dist/types/onchain/preview/parse/types-rwa.d.ts +5 -6
- package/dist/types/onchain/preview/parse/types.d.ts +4 -4
- package/dist/types/onchain/preview/preview/CreditAccountState.d.ts +5 -5
- package/dist/types/onchain/preview/preview/buildDelayedStrategyPositionOperationPreview.d.ts +2 -3
- package/dist/types/onchain/preview/preview/detectCloseOrRepay.d.ts +3 -4
- package/dist/types/onchain/preview/preview/detectDelayedClaim.d.ts +4 -5
- package/dist/types/onchain/preview/preview/detectDelayedOperation.d.ts +3 -4
- package/dist/types/onchain/preview/preview/estimateClaimableAt.d.ts +2 -3
- package/dist/types/onchain/preview/preview/midasGreenlistsAccount.d.ts +2 -3
- package/dist/types/onchain/preview/preview/previewAdjustStrategyPosition.d.ts +2 -3
- package/dist/types/onchain/preview/preview/previewExitOrRepayStrategyPosition.d.ts +3 -4
- package/dist/types/onchain/preview/preview/previewOpenStrategyPosition.d.ts +2 -2
- package/dist/types/onchain/preview/preview/previewOperation.d.ts +3 -4
- package/dist/types/onchain/preview/preview/previewPoolPositionOperation.d.ts +2 -3
- package/dist/types/onchain/preview/preview/replayInnerOperations.d.ts +4 -5
- package/dist/types/onchain/preview/preview/replayMulticall.d.ts +4 -5
- package/dist/types/onchain/preview/preview/unwrapNativeCollateral.d.ts +2 -3
- package/dist/types/onchain/router/AbstractRouterContract.d.ts +4 -5
- package/dist/types/onchain/router/RouterV310Contract.d.ts +2 -2
- package/dist/types/onchain/router/createRouter.d.ts +2 -3
- package/dist/types/onchain/router/helpers.d.ts +3 -4
- package/dist/types/onchain/router/types.d.ts +15 -16
- package/dist/types/onchain/types/logger.d.ts +3 -4
- package/dist/types/onchain/types/multichain.d.ts +6 -7
- package/dist/types/onchain/types/state-human.d.ts +36 -37
- package/dist/types/onchain/types/state.d.ts +3 -4
- package/dist/types/onchain/types/transactions.d.ts +5 -6
- package/dist/types/onchain/utils/AddressMap.d.ts +2 -3
- package/dist/types/onchain/utils/AddressSet.d.ts +2 -3
- package/dist/types/onchain/utils/AssetsMap.d.ts +2 -3
- package/dist/types/onchain/utils/abi-decode.d.ts +4 -5
- package/dist/types/onchain/utils/bigint-math.d.ts +2 -3
- package/dist/types/onchain/utils/bytes32ToString.d.ts +2 -3
- package/dist/types/onchain/utils/childLogger.d.ts +2 -3
- package/dist/types/onchain/utils/createRawTx.d.ts +2 -3
- package/dist/types/onchain/utils/etherscan.d.ts +4 -5
- package/dist/types/onchain/utils/filterDust.d.ts +4 -5
- package/dist/types/onchain/utils/formatter.d.ts +17 -17
- package/dist/types/onchain/utils/hex.d.ts +2 -3
- package/dist/types/onchain/utils/internal/Hooks.d.ts +3 -4
- package/dist/types/onchain/utils/isDust.d.ts +3 -4
- package/dist/types/onchain/utils/json.d.ts +3 -4
- package/dist/types/onchain/utils/mappers.d.ts +5 -6
- package/dist/types/onchain/utils/retry.d.ts +3 -4
- package/dist/types/onchain/utils/toAddress.d.ts +2 -3
- package/dist/types/onchain/utils/trace.d.ts +8 -9
- package/dist/types/onchain/utils/type-utils.d.ts +2 -3
- package/dist/types/onchain/utils/viem/cast.d.ts +3 -4
- package/dist/types/onchain/utils/viem/executeDelegatedMulticalls.d.ts +3 -4
- package/dist/types/onchain/utils/viem/executeMulticallBatches.d.ts +4 -5
- package/dist/types/onchain/utils/viem/sendRawTx.d.ts +5 -6
- package/dist/types/onchain/utils/viem/simulateCall.d.ts +7 -8
- package/dist/types/onchain/utils/viem/simulateMulticall.d.ts +4 -5
- package/dist/types/onchain/utils/viem/simulateWithPriceUpdates.d.ts +8 -9
- package/dist/types/onchain/utils/viem/watchBlocksAsync.d.ts +4 -4
- package/dist/types/onchain/utils/zod.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkAccountQuotas.d.ts +2 -3
- package/dist/types/onchain/validation/bundles/checkCollateralFunding.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkCreditOperation.d.ts +6 -7
- package/dist/types/onchain/validation/bundles/checkHealthFactors.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkIncreaseDebt.d.ts +2 -3
- package/dist/types/onchain/validation/bundles/checkIncreaseQuota.d.ts +2 -3
- package/dist/types/onchain/validation/bundles/checkLiquidationEligibility.d.ts +7 -7
- package/dist/types/onchain/validation/bundles/checkLiquidationFunding.d.ts +5 -5
- package/dist/types/onchain/validation/bundles/checkMarket.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/checkMidasAccountGreenlist.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/checkObtained.d.ts +2 -3
- package/dist/types/onchain/validation/bundles/checkPoolFunding.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/checkPoolOperation.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkQuotaUpdates.d.ts +15 -0
- package/dist/types/onchain/validation/bundles/checkRWAOpenRequirements.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/checkRWAOpening.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkWallet.d.ts +4 -5
- package/dist/types/onchain/validation/bundles/checkWalletAllowance.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/checkWalletBalance.d.ts +3 -4
- package/dist/types/onchain/validation/bundles/index.d.ts +2 -1
- package/dist/types/onchain/validation/checkLiquidation.d.ts +7 -7
- package/dist/types/onchain/validation/checkOperation.d.ts +5 -6
- package/dist/types/onchain/validation/checkSimulation.d.ts +5 -6
- package/dist/types/onchain/validation/checks/checkBorrowLimit.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkCollateralised.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkCreditAccountFrozen.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkCreditManagerPaused.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkDebtLimits.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkEmergencyLiquidator.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkForbiddenToken.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkLeverage.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkLiquidatorEligible.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkMarketExpired.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkMaxQuota.d.ts +15 -0
- package/dist/types/onchain/validation/checks/checkPartiallyLiquidatable.d.ts +16 -0
- package/dist/types/onchain/validation/checks/checkPoolLiquidity.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkPoolPaused.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkPoolSunset.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkQuotaActive.d.ts +12 -0
- package/dist/types/onchain/validation/checks/checkQuotaChange.d.ts +16 -0
- package/dist/types/onchain/validation/checks/checkQuotaCount.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkQuotaLimit.d.ts +3 -4
- package/dist/types/onchain/validation/checks/checkReservePriceLimited.d.ts +3 -4
- package/dist/types/onchain/validation/checks/index.d.ts +5 -1
- package/dist/types/onchain/validation/helpers/amount.d.ts +2 -3
- package/dist/types/onchain/validation/helpers/health-factor-limits.d.ts +5 -6
- package/dist/types/onchain/validation/helpers/token.d.ts +3 -4
- package/dist/types/onchain/validation/index.d.ts +6 -1
- package/dist/types/onchain/validation/raise.d.ts +5 -6
- package/dist/types/permissionless/api/GearboxPermissionless.d.ts +2 -3
- package/dist/types/permissionless/api/chains/ChainsNamespace.d.ts +2 -3
- package/dist/types/permissionless/api/chains/schemas.d.ts +5 -6
- package/dist/types/permissionless/api/chains/types.d.ts +6 -7
- package/dist/types/permissionless/api/deploy/PermissionlessDeploy.d.ts +4 -5
- package/dist/types/permissionless/api/deploy/effective-staleness.d.ts +2 -3
- package/dist/types/permissionless/api/deploy/types.d.ts +6 -7
- package/dist/types/permissionless/api/errors.d.ts +6 -7
- package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +4 -5
- package/dist/types/permissionless/api/oracles/schemas.d.ts +5 -6
- package/dist/types/permissionless/api/oracles/types.d.ts +5 -6
- package/dist/types/permissionless/api/schemas.d.ts +4 -5
- package/dist/types/permissionless/api/transactions/InstanceOwnerTransactions.d.ts +2 -3
- package/dist/types/permissionless/api/transactions/lp-price-feeds.d.ts +3 -4
- package/dist/types/permissionless/api/transactions/types.d.ts +7 -8
- package/dist/types/permissionless/api/types.d.ts +2 -3
- package/dist/types/permissionless/bindings/address-provider.d.ts +2 -3
- package/dist/types/permissionless/bindings/bytecode-repository.d.ts +2 -2
- package/dist/types/permissionless/bindings/compressors/token-compressor.d.ts +2 -2
- package/dist/types/permissionless/bindings/compressors/withdrawal-compressor.d.ts +2 -2
- package/dist/types/permissionless/bindings/cross-chain-multisig.d.ts +4 -4
- package/dist/types/permissionless/bindings/factory/abstract-factory.d.ts +2 -3
- package/dist/types/permissionless/bindings/factory/credit-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/factory/loss-policy-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/factory/pool-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/factory/price-oracle-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/factory/rate-keeper-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/governance/batches-chain.d.ts +2 -2
- package/dist/types/permissionless/bindings/governance/governor.d.ts +2 -2
- package/dist/types/permissionless/bindings/governance/timelock.d.ts +2 -3
- package/dist/types/permissionless/bindings/governance/types.d.ts +7 -8
- package/dist/types/permissionless/bindings/instance-manager.d.ts +2 -2
- package/dist/types/permissionless/bindings/market-configurator-factory.d.ts +2 -2
- package/dist/types/permissionless/bindings/market-configurator.d.ts +2 -2
- package/dist/types/permissionless/bindings/price-feed-store.d.ts +2 -2
- package/dist/types/permissionless/bindings/pricefeeds/balancer-stable.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/balancer-weighted.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/bounded.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/composite.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/constant.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/curve-crypto.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/curve-stable.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/curve-twap.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/curve-usd.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/erc4626.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/external.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/index.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/kodiak.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/mellow-lrt.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/pendle-pt-twap.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/pyth.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/redstone.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/wsteth.d.ts +2 -3
- package/dist/types/permissionless/bindings/pricefeeds/zero.d.ts +2 -3
- package/dist/types/permissionless/bindings/router/routing-manager.d.ts +2 -2
- package/dist/types/permissionless/bindings/treasury-splitter.d.ts +2 -2
- package/dist/types/permissionless/bindings/types.d.ts +17 -18
- package/dist/types/permissionless/chains/archive-transport.d.ts +3 -4
- package/dist/types/permissionless/chains/chunked-log-transport.d.ts +2 -2
- package/dist/types/permissionless/core/auditor.d.ts +2 -3
- package/dist/types/permissionless/core/bytecode.d.ts +5 -6
- package/dist/types/permissionless/core/pricefeed-builder.d.ts +6 -7
- package/dist/types/permissionless/core/pricefeed.d.ts +2 -3
- package/dist/types/permissionless/core/proposal.d.ts +5 -6
- package/dist/types/permissionless/core/raw-tx.d.ts +2 -3
- package/dist/types/permissionless/deployment/addresses.d.ts +2 -3
- package/dist/types/permissionless/deployment/mainnet.d.ts +6 -7
- package/dist/types/permissionless/plugins/irm/constructor-params-abi.d.ts +8 -8
- package/dist/types/permissionless/plugins/loss-policies/constructor-params-abi.d.ts +8 -8
- package/dist/types/permissionless/plugins/rate-keepers/constructor-params-abi.d.ts +9 -9
- package/dist/types/permissionless/utils/abi-encoder.d.ts +4 -5
- package/dist/types/permissionless/utils/block-utils.d.ts +2 -3
- package/dist/types/permissionless/utils/create2.d.ts +9 -10
- package/dist/types/permissionless/utils/format.d.ts +7 -8
- package/dist/types/permissionless/utils/governance/batch.d.ts +5 -6
- package/dist/types/permissionless/utils/governance/timelock-txs.d.ts +2 -3
- package/dist/types/permissionless/utils/governance/types.d.ts +3 -4
- package/dist/types/permissionless/utils/literals.d.ts +8 -9
- package/dist/types/permissionless/utils/price-update/get-price-update-tx.d.ts +2 -3
- package/dist/types/permissionless/utils/price-update/get-prices.d.ts +2 -3
- package/dist/types/permissionless/utils/price-update/get-updatable-feeds.d.ts +3 -4
- package/dist/types/permissionless/utils/signature.d.ts +2 -3
- package/dist/types/plugins/accounts/AccountsPlugin.d.ts +3 -4
- package/dist/types/plugins/accounts-counter/AccountsCounterPlugin.d.ts +3 -4
- package/dist/types/plugins/bots/BotsPlugin.d.ts +2 -3
- package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +3 -3
- package/dist/types/plugins/bots/abi/iPartialLiquidationBotV310.d.ts +2 -3
- package/dist/types/plugins/bots/config.d.ts +6 -7
- package/dist/types/plugins/bots/deserializePartialLiquidationBotParams.d.ts +2 -3
- package/dist/types/plugins/bots/types.d.ts +11 -12
- package/dist/types/sdk/AbstractNamespace.d.ts +3 -4
- package/dist/types/sdk/GearboxSDK.d.ts +3 -4
- package/dist/types/sdk/analytics/AnalyticsNamespace.d.ts +2 -3
- package/dist/types/sdk/analytics/types.d.ts +3 -4
- package/dist/types/sdk/errors/AllSourcesFailedError.d.ts +2 -3
- package/dist/types/sdk/errors/MissingSourceError.d.ts +2 -3
- package/dist/types/sdk/errors/NoSourceServedError.d.ts +2 -3
- package/dist/types/sdk/errors/SourceChainMismatchError.d.ts +3 -4
- package/dist/types/sdk/errors/SourceUnavailableError.d.ts +2 -3
- package/dist/types/sdk/errors/assertSameChains.d.ts +2 -3
- package/dist/types/sdk/errors/everyChainFailed.d.ts +2 -3
- package/dist/types/sdk/execute/ExecuteApi.d.ts +2 -3
- package/dist/types/sdk/execute/types.d.ts +9 -10
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/liquidations/LiquidationsNamespace.d.ts +11 -4
- package/dist/types/sdk/liquidations/types.d.ts +24 -9
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +2 -3
- package/dist/types/sdk/opportunities/types.d.ts +9 -10
- package/dist/types/sdk/positions/PositionsNamespace.d.ts +2 -3
- package/dist/types/sdk/positions/mergePositionList.d.ts +2 -3
- package/dist/types/sdk/positions/types.d.ts +9 -10
- package/dist/types/sdk/prepare/PrepareApi.d.ts +14 -7
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +72 -33
- package/dist/types/sdk/prepare/withdrawable-collaterals.d.ts +2 -3
- package/dist/types/sdk/preview/PreviewNamespace.d.ts +2 -3
- package/dist/types/sdk/preview/types.d.ts +4 -5
- package/dist/types/sdk/rewards/RewardsNamespace.d.ts +2 -3
- package/dist/types/sdk/rewards/errors.d.ts +3 -4
- package/dist/types/sdk/rewards/helpers.d.ts +7 -8
- package/dist/types/sdk/rewards/merkl-api.d.ts +6 -6
- package/dist/types/sdk/rewards/toMerklRewards.d.ts +2 -3
- package/dist/types/sdk/rewards/toTurtleRewards.d.ts +2 -3
- package/dist/types/sdk/rewards/turtle-api.d.ts +7 -8
- package/dist/types/sdk/rewards/types.d.ts +5 -6
- package/dist/types/sdk/types.d.ts +13 -14
- package/dist/types/sdk/utils/filterResponse.d.ts +2 -3
- package/dist/types/sdk/utils/mergeChains.d.ts +4 -5
- package/dist/types/sdk/utils/types.d.ts +5 -5
- package/package.json +15 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_model_errors_operation_errors = require("../../../model/errors/operation-errors.js");
|
|
3
|
+
require("../../../model/index.js");
|
|
4
|
+
const require_onchain_validation_helpers_amount = require("../helpers/amount.js");
|
|
5
|
+
require("../helpers/index.js");
|
|
6
|
+
//#region src/onchain/validation/checks/checkQuotaChange.ts
|
|
7
|
+
/** A quota update that rounds to nothing. */
|
|
8
|
+
function checkQuotaChange(args) {
|
|
9
|
+
const { token, current, requested, change, underlying } = args;
|
|
10
|
+
if (change !== 0n) return [];
|
|
11
|
+
return [require_model_errors_operation_errors.quotaUnchanged({
|
|
12
|
+
token,
|
|
13
|
+
current: require_onchain_validation_helpers_amount.amountOf(underlying, current),
|
|
14
|
+
requested: require_onchain_validation_helpers_amount.amountOf(underlying, requested)
|
|
15
|
+
})];
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.checkQuotaChange = checkQuotaChange;
|
|
@@ -9,9 +9,13 @@ const require_onchain_validation_checks_checkForbiddenToken = require("./checkFo
|
|
|
9
9
|
const require_onchain_validation_checks_checkLeverage = require("./checkLeverage.js");
|
|
10
10
|
const require_onchain_validation_checks_checkLiquidatorEligible = require("./checkLiquidatorEligible.js");
|
|
11
11
|
const require_onchain_validation_checks_checkMarketExpired = require("./checkMarketExpired.js");
|
|
12
|
+
const require_onchain_validation_checks_checkMaxQuota = require("./checkMaxQuota.js");
|
|
13
|
+
const require_onchain_validation_checks_checkPartiallyLiquidatable = require("./checkPartiallyLiquidatable.js");
|
|
12
14
|
const require_onchain_validation_checks_checkPoolLiquidity = require("./checkPoolLiquidity.js");
|
|
13
15
|
const require_onchain_validation_checks_checkPoolPaused = require("./checkPoolPaused.js");
|
|
14
16
|
const require_onchain_validation_checks_checkPoolSunset = require("./checkPoolSunset.js");
|
|
17
|
+
const require_onchain_validation_checks_checkQuotaActive = require("./checkQuotaActive.js");
|
|
18
|
+
const require_onchain_validation_checks_checkQuotaChange = require("./checkQuotaChange.js");
|
|
15
19
|
const require_onchain_validation_checks_checkQuotaCount = require("./checkQuotaCount.js");
|
|
16
20
|
const require_onchain_validation_checks_checkQuotaLimit = require("./checkQuotaLimit.js");
|
|
17
21
|
const require_onchain_validation_checks_checkReservePriceLimited = require("./checkReservePriceLimited.js");
|
|
@@ -25,9 +29,13 @@ exports.checkForbiddenToken = require_onchain_validation_checks_checkForbiddenTo
|
|
|
25
29
|
exports.checkLeverage = require_onchain_validation_checks_checkLeverage.checkLeverage;
|
|
26
30
|
exports.checkLiquidatorEligible = require_onchain_validation_checks_checkLiquidatorEligible.checkLiquidatorEligible;
|
|
27
31
|
exports.checkMarketExpired = require_onchain_validation_checks_checkMarketExpired.checkMarketExpired;
|
|
32
|
+
exports.checkMaxQuota = require_onchain_validation_checks_checkMaxQuota.checkMaxQuota;
|
|
33
|
+
exports.checkPartiallyLiquidatable = require_onchain_validation_checks_checkPartiallyLiquidatable.checkPartiallyLiquidatable;
|
|
28
34
|
exports.checkPoolLiquidity = require_onchain_validation_checks_checkPoolLiquidity.checkPoolLiquidity;
|
|
29
35
|
exports.checkPoolPaused = require_onchain_validation_checks_checkPoolPaused.checkPoolPaused;
|
|
30
36
|
exports.checkPoolSunset = require_onchain_validation_checks_checkPoolSunset.checkPoolSunset;
|
|
37
|
+
exports.checkQuotaActive = require_onchain_validation_checks_checkQuotaActive.checkQuotaActive;
|
|
38
|
+
exports.checkQuotaChange = require_onchain_validation_checks_checkQuotaChange.checkQuotaChange;
|
|
31
39
|
exports.checkQuotaCount = require_onchain_validation_checks_checkQuotaCount.checkQuotaCount;
|
|
32
40
|
exports.checkQuotaLimit = require_onchain_validation_checks_checkQuotaLimit.checkQuotaLimit;
|
|
33
41
|
exports.checkReservePriceLimited = require_onchain_validation_checks_checkReservePriceLimited.checkReservePriceLimited;
|
|
@@ -13,9 +13,13 @@ const require_onchain_validation_checks_checkForbiddenToken = require("./checks/
|
|
|
13
13
|
const require_onchain_validation_checks_checkLeverage = require("./checks/checkLeverage.js");
|
|
14
14
|
const require_onchain_validation_checks_checkLiquidatorEligible = require("./checks/checkLiquidatorEligible.js");
|
|
15
15
|
const require_onchain_validation_checks_checkMarketExpired = require("./checks/checkMarketExpired.js");
|
|
16
|
+
const require_onchain_validation_checks_checkMaxQuota = require("./checks/checkMaxQuota.js");
|
|
17
|
+
const require_onchain_validation_checks_checkPartiallyLiquidatable = require("./checks/checkPartiallyLiquidatable.js");
|
|
16
18
|
const require_onchain_validation_checks_checkPoolLiquidity = require("./checks/checkPoolLiquidity.js");
|
|
17
19
|
const require_onchain_validation_checks_checkPoolPaused = require("./checks/checkPoolPaused.js");
|
|
18
20
|
const require_onchain_validation_checks_checkPoolSunset = require("./checks/checkPoolSunset.js");
|
|
21
|
+
const require_onchain_validation_checks_checkQuotaActive = require("./checks/checkQuotaActive.js");
|
|
22
|
+
const require_onchain_validation_checks_checkQuotaChange = require("./checks/checkQuotaChange.js");
|
|
19
23
|
const require_onchain_validation_checks_checkQuotaCount = require("./checks/checkQuotaCount.js");
|
|
20
24
|
const require_onchain_validation_checks_checkQuotaLimit = require("./checks/checkQuotaLimit.js");
|
|
21
25
|
const require_onchain_validation_checks_checkReservePriceLimited = require("./checks/checkReservePriceLimited.js");
|
|
@@ -29,6 +33,7 @@ const require_onchain_validation_bundles_checkIncreaseDebt = require("./bundles/
|
|
|
29
33
|
const require_onchain_validation_bundles_checkIncreaseQuota = require("./bundles/checkIncreaseQuota.js");
|
|
30
34
|
const require_onchain_validation_bundles_checkMarket = require("./bundles/checkMarket.js");
|
|
31
35
|
const require_onchain_validation_bundles_checkObtained = require("./bundles/checkObtained.js");
|
|
36
|
+
const require_onchain_validation_bundles_checkQuotaUpdates = require("./bundles/checkQuotaUpdates.js");
|
|
32
37
|
const require_onchain_validation_bundles_checkMidasAccountGreenlist = require("./bundles/checkMidasAccountGreenlist.js");
|
|
33
38
|
const require_onchain_validation_bundles_checkRWAOpenRequirements = require("./bundles/checkRWAOpenRequirements.js");
|
|
34
39
|
const require_onchain_validation_bundles_checkRWAOpening = require("./bundles/checkRWAOpening.js");
|
|
@@ -68,16 +73,21 @@ exports.checkLiquidationFunding = require_onchain_validation_bundles_checkLiquid
|
|
|
68
73
|
exports.checkLiquidatorEligible = require_onchain_validation_checks_checkLiquidatorEligible.checkLiquidatorEligible;
|
|
69
74
|
exports.checkMarket = require_onchain_validation_bundles_checkMarket.checkMarket;
|
|
70
75
|
exports.checkMarketExpired = require_onchain_validation_checks_checkMarketExpired.checkMarketExpired;
|
|
76
|
+
exports.checkMaxQuota = require_onchain_validation_checks_checkMaxQuota.checkMaxQuota;
|
|
71
77
|
exports.checkMidasAccountGreenlist = require_onchain_validation_bundles_checkMidasAccountGreenlist.checkMidasAccountGreenlist;
|
|
72
78
|
exports.checkObtained = require_onchain_validation_bundles_checkObtained.checkObtained;
|
|
73
79
|
exports.checkOperation = require_onchain_validation_checkOperation.checkOperation;
|
|
80
|
+
exports.checkPartiallyLiquidatable = require_onchain_validation_checks_checkPartiallyLiquidatable.checkPartiallyLiquidatable;
|
|
74
81
|
exports.checkPoolFunding = require_onchain_validation_bundles_checkPoolFunding.checkPoolFunding;
|
|
75
82
|
exports.checkPoolLiquidity = require_onchain_validation_checks_checkPoolLiquidity.checkPoolLiquidity;
|
|
76
83
|
exports.checkPoolOperation = require_onchain_validation_bundles_checkPoolOperation.checkPoolOperation;
|
|
77
84
|
exports.checkPoolPaused = require_onchain_validation_checks_checkPoolPaused.checkPoolPaused;
|
|
78
85
|
exports.checkPoolSunset = require_onchain_validation_checks_checkPoolSunset.checkPoolSunset;
|
|
86
|
+
exports.checkQuotaActive = require_onchain_validation_checks_checkQuotaActive.checkQuotaActive;
|
|
87
|
+
exports.checkQuotaChange = require_onchain_validation_checks_checkQuotaChange.checkQuotaChange;
|
|
79
88
|
exports.checkQuotaCount = require_onchain_validation_checks_checkQuotaCount.checkQuotaCount;
|
|
80
89
|
exports.checkQuotaLimit = require_onchain_validation_checks_checkQuotaLimit.checkQuotaLimit;
|
|
90
|
+
exports.checkQuotaUpdates = require_onchain_validation_bundles_checkQuotaUpdates.checkQuotaUpdates;
|
|
81
91
|
exports.checkRWAOpenRequirements = require_onchain_validation_bundles_checkRWAOpenRequirements.checkRWAOpenRequirements;
|
|
82
92
|
exports.checkRWAOpening = require_onchain_validation_bundles_checkRWAOpening.checkRWAOpening;
|
|
83
93
|
exports.checkReservePriceLimited = require_onchain_validation_checks_checkReservePriceLimited.checkReservePriceLimited;
|
|
@@ -35,6 +35,20 @@ var LiquidationsNamespace = class {
|
|
|
35
35
|
return this.#onchain.liquidations.buildLiquidationTx(props);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
+
* {@inheritDoc ILiquidations.getPartialLiquidationDetails}
|
|
39
|
+
**/
|
|
40
|
+
async getPartialLiquidationDetails(props) {
|
|
41
|
+
await this.#ensureFresh?.(require_onchain_chain_chains.toChainIds([props.network]));
|
|
42
|
+
return this.#onchain.liquidations.getPartialLiquidationDetails(props);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* {@inheritDoc ILiquidations.buildPartialLiquidationTx}
|
|
46
|
+
**/
|
|
47
|
+
async buildPartialLiquidationTx(props) {
|
|
48
|
+
await this.#ensureFresh?.(require_onchain_chain_chains.toChainIds([props.network]));
|
|
49
|
+
return this.#onchain.liquidations.buildPartialLiquidationTx(props);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
38
52
|
* {@inheritDoc ILiquidations.getLiquidationPositions}
|
|
39
53
|
**/
|
|
40
54
|
async getLiquidationPositions(props) {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_onchain_constants_math = require("../../onchain/constants/math.js");
|
|
2
3
|
const require_onchain_utils_hex = require("../../onchain/utils/hex.js");
|
|
3
4
|
const require_onchain_base_MultichainConstruct = require("../../onchain/base/MultichainConstruct.js");
|
|
5
|
+
require("../../onchain/market/math.js");
|
|
4
6
|
const require_model_errors_prepare_errors = require("../../model/errors/prepare-errors.js");
|
|
5
7
|
const require_model_result = require("../../model/result.js");
|
|
6
8
|
require("../../model/index.js");
|
|
7
9
|
const require_onchain_validation_helpers_token = require("../../onchain/validation/helpers/token.js");
|
|
8
10
|
const require_onchain_validation_bundles_checkPoolOperation = require("../../onchain/validation/bundles/checkPoolOperation.js");
|
|
11
|
+
const require_onchain_validation_raise = require("../../onchain/validation/raise.js");
|
|
12
|
+
const require_onchain_accounts_intents_utils_pick_token = require("../../onchain/accounts/intents/utils/pick-token.js");
|
|
9
13
|
const require_onchain_accounts_intents_utils_credit_account_slice = require("../../onchain/accounts/intents/utils/credit-account-slice.js");
|
|
14
|
+
const require_onchain_accounts_intents_resolveQuotaUpdate = require("../../onchain/accounts/intents/resolveQuotaUpdate.js");
|
|
10
15
|
const require_onchain_accounts_intents_index = require("../../onchain/accounts/intents/index.js");
|
|
11
16
|
require("../../onchain/index.js");
|
|
12
17
|
const require_sdk_prepare_withdrawable_collaterals = require("./withdrawable-collaterals.js");
|
|
@@ -372,6 +377,16 @@ var PrepareApi = class extends require_onchain_base_MultichainConstruct.Multicha
|
|
|
372
377
|
});
|
|
373
378
|
}
|
|
374
379
|
/**
|
|
380
|
+
* {@inheritDoc IOpportunitiesPrepare.updateQuota}
|
|
381
|
+
**/
|
|
382
|
+
async updateQuota(position, params) {
|
|
383
|
+
return this.#startIntent(position, params, {
|
|
384
|
+
type: "UPDATE_QUOTA",
|
|
385
|
+
token: params.token,
|
|
386
|
+
quota: params.quota
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
375
390
|
* {@inheritDoc IOpportunitiesPrepare.leverageBand}
|
|
376
391
|
**/
|
|
377
392
|
leverageBand(strategy, collateral, targetHF, position) {
|
|
@@ -484,6 +499,58 @@ var PrepareApi = class extends require_onchain_base_MultichainConstruct.Multicha
|
|
|
484
499
|
return refused(require_model_errors_prepare_errors.unexpectedFailure(e), state);
|
|
485
500
|
}
|
|
486
501
|
}
|
|
502
|
+
/** {@inheritDoc IOpportunitiesPrepare.getQuotaBufferState} */
|
|
503
|
+
getQuotaBufferState(position, extraQuotas = []) {
|
|
504
|
+
const sdk = [...this.sdk.chains.values()].find((chain) => chain.chainId === position.chainId);
|
|
505
|
+
if (!sdk) return void 0;
|
|
506
|
+
if (position.kind !== "strategy" || position.chainId !== sdk.chainId || !position.targetCollateral || position.error || position.totalDebt.value <= 0n) return void 0;
|
|
507
|
+
const target = position.targetCollateral;
|
|
508
|
+
if (require_onchain_accounts_intents_utils_pick_token.isPhantomToken(sdk, target.address)) return void 0;
|
|
509
|
+
const suite = sdk.marketRegister.creditManagers.find((s) => s.creditManager.address.toLowerCase() === position.creditManager.toLowerCase());
|
|
510
|
+
if (!suite) return void 0;
|
|
511
|
+
const collateral = position.collaterals.find((c) => c.collateral.token.address.toLowerCase() === target.address.toLowerCase());
|
|
512
|
+
if (!collateral || collateral.collateral.value <= 0n || collateral.quota.value <= 0n) return void 0;
|
|
513
|
+
const lt = BigInt(suite.creditManager.liquidationThresholds.get(target.address) ?? 0);
|
|
514
|
+
if (lt <= 0n) return void 0;
|
|
515
|
+
const value = suite.market.priceOracle.safeConvert(target.address, suite.market.pool.underlying, collateral.collateral.value);
|
|
516
|
+
if (value.error) return void 0;
|
|
517
|
+
const tokens = position.collaterals.map((c) => ({
|
|
518
|
+
token: c.collateral.token.address,
|
|
519
|
+
balance: c.collateral.value,
|
|
520
|
+
quota: c.quota.value
|
|
521
|
+
}));
|
|
522
|
+
tokens.push(...extraQuotas.map(({ token, quota }) => ({
|
|
523
|
+
token,
|
|
524
|
+
quota,
|
|
525
|
+
balance: 0n
|
|
526
|
+
})));
|
|
527
|
+
try {
|
|
528
|
+
const { update } = require_onchain_accounts_intents_resolveQuotaUpdate.resolveQuotaUpdate({
|
|
529
|
+
sdk,
|
|
530
|
+
creditAccount: {
|
|
531
|
+
creditManager: position.creditManager,
|
|
532
|
+
tokens
|
|
533
|
+
},
|
|
534
|
+
token: target.address,
|
|
535
|
+
quota: void 0,
|
|
536
|
+
quotaReserve: 500
|
|
537
|
+
});
|
|
538
|
+
const quotaIncrease = update.quotaIncrease.find((q) => q.token.toLowerCase() === target.address.toLowerCase())?.balance ?? 0n;
|
|
539
|
+
if (quotaIncrease <= 0n) return void 0;
|
|
540
|
+
return {
|
|
541
|
+
position: {
|
|
542
|
+
...position,
|
|
543
|
+
targetCollateral: target
|
|
544
|
+
},
|
|
545
|
+
baseQuota: value.value * lt / require_onchain_constants_math.PERCENTAGE_FACTOR,
|
|
546
|
+
currentQuota: collateral.quota.value,
|
|
547
|
+
quotaIncrease
|
|
548
|
+
};
|
|
549
|
+
} catch (error) {
|
|
550
|
+
if (error instanceof require_onchain_validation_raise.IntentPreviewError) return void 0;
|
|
551
|
+
throw error;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
487
554
|
};
|
|
488
555
|
function service(sdk) {
|
|
489
556
|
return new require_onchain_accounts_intents_index.CreditAccountOperationsService(sdk);
|
|
@@ -7,7 +7,7 @@ const MERKL_API_KEY_HEADER = "X-API-Key";
|
|
|
7
7
|
* Merkl has no timeout of its own, and a hung connection would otherwise stall
|
|
8
8
|
* its leg of a fan-out for as long as the socket lives.
|
|
9
9
|
*/
|
|
10
|
-
const TIMEOUT =
|
|
10
|
+
const TIMEOUT = 3e4;
|
|
11
11
|
/**
|
|
12
12
|
* The wallet's raw Merkl rewards on one chain.
|
|
13
13
|
*
|
|
@@ -3,7 +3,7 @@ const require_sdk_rewards_errors = require("./errors.js");
|
|
|
3
3
|
//#region src/sdk/rewards/turtle-api.ts
|
|
4
4
|
const TURTLE_API_URL = "https://earn.turtle.xyz";
|
|
5
5
|
const GEARBOX_ORG_ID = "d171ba3d-ff89-4e6c-8f13-d94840b06edd";
|
|
6
|
-
const TIMEOUT =
|
|
6
|
+
const TIMEOUT = 3e4;
|
|
7
7
|
const turtleStreamAbi = [{
|
|
8
8
|
type: "function",
|
|
9
9
|
name: "getClaimedRewards",
|
package/dist/esm/dev/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens,
|
|
|
17
17
|
import { DEFAULT_MIDAS_ADMIN, getSecuritizeAdmin, greenlistMidasGateway, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor } from "./kycUtils.js";
|
|
18
18
|
import { isRangeError, logSplitterTransport } from "./logSplitterTransport.js";
|
|
19
19
|
import { setLTZero, setLTs } from "./ltUtils.js";
|
|
20
|
+
import { lowerHealthFactor } from "./lowerHealthFactor.js";
|
|
20
21
|
import { migrateFaucet } from "./migrateFaucet.js";
|
|
21
22
|
import { SUPPORTED_RPC_PROVIDERS, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getRpcProviderUrl, getThirdWebUrl, rpcProvidersSchema } from "./providers.js";
|
|
22
23
|
import { replaceStorage } from "./replaceStorage.js";
|
|
@@ -25,4 +26,4 @@ import { claimDSToken, claimDSTokens, enableDSTokenBackDating } from "./securiti
|
|
|
25
26
|
import "./types.js";
|
|
26
27
|
import { ONCHAIN_EXECUTION_ID_ADDRESS, verifyTestnet } from "./verifyTestnet.js";
|
|
27
28
|
import { makePendingWithdrawalsClaimable } from "./withdrawalUtils.js";
|
|
28
|
-
export { AccountOpener, Create2Deployer, DEFAULT_CREATE2_SALT, DEFAULT_MIDAS_ADMIN, EthCallSpy, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, RevolverTransport, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getSecuritizeAdmin, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iFaucetAbi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, makePendingWithdrawalsClaimable, migrateFaucet, providerConfigSchema, rateLimitOptionsSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, unpauseMidasIssuanceVault, verifyTestnet, writeContractSync };
|
|
29
|
+
export { AccountOpener, Create2Deployer, DEFAULT_CREATE2_SALT, DEFAULT_MIDAS_ADMIN, EthCallSpy, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, RevolverTransport, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getSecuritizeAdmin, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iFaucetAbi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, lowerHealthFactor, makePendingWithdrawalsClaimable, migrateFaucet, providerConfigSchema, rateLimitOptionsSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, unpauseMidasIssuanceVault, verifyTestnet, writeContractSync };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TypedObjectUtils } from "../onchain/utils/mappers.js";
|
|
2
|
+
import "../onchain/index.js";
|
|
3
|
+
import { calcLiquidatableLTs } from "./calcLiquidatableLTs.js";
|
|
4
|
+
import { setLTs } from "./ltUtils.js";
|
|
5
|
+
//#region src/dev/lowerHealthFactor.ts
|
|
6
|
+
/**
|
|
7
|
+
* Lowers liquidation thresholds of credit account's credit manager on anvil, so that account's health factor drops to `hf`.
|
|
8
|
+
* Does not update LTs held in sdk's cached credit manager state.
|
|
9
|
+
*/
|
|
10
|
+
async function lowerHealthFactor(anvil, sdk, ca, options = {}) {
|
|
11
|
+
const { hf, logger } = options;
|
|
12
|
+
if (ca.debt === 0n) throw new Error("warning: zero-debt account");
|
|
13
|
+
const cm = sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
14
|
+
const newLTs = await calcLiquidatableLTs(sdk, ca, hf, logger);
|
|
15
|
+
const oldLTs = {};
|
|
16
|
+
for (const t of TypedObjectUtils.keys(newLTs)) oldLTs[t] = cm.creditManager.liquidationThresholds.mustGet(t);
|
|
17
|
+
await setLTs(anvil, cm.state, newLTs, logger);
|
|
18
|
+
const account = await sdk.accounts.getCreditAccountData(ca.creditAccount);
|
|
19
|
+
if (!account) throw new Error(`cannot find credit account ${ca.creditAccount}`);
|
|
20
|
+
logger?.debug({
|
|
21
|
+
hfNew: account.healthFactor.toString(),
|
|
22
|
+
hfOld: ca.healthFactor.toString()
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
account,
|
|
26
|
+
oldLTs,
|
|
27
|
+
newLTs
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { lowerHealthFactor };
|
package/dist/esm/dev/ltUtils.js
CHANGED
|
@@ -14,13 +14,14 @@ import { erc20Abi, parseEther } from "viem";
|
|
|
14
14
|
*/
|
|
15
15
|
async function setLTs(anvil, cm, newLTs, logger) {
|
|
16
16
|
const configuratorAddr = await impresonateCCOwner(anvil, cm);
|
|
17
|
-
for (const [t, lt] of Object.entries(newLTs)) await anvil.
|
|
17
|
+
for (const [t, lt] of Object.entries(newLTs)) await anvil.writeContractSync({
|
|
18
18
|
chain: anvil.chain,
|
|
19
19
|
address: cm.creditConfigurator.baseParams.addr,
|
|
20
20
|
account: configuratorAddr,
|
|
21
21
|
abi: iCreditConfiguratorV310Abi,
|
|
22
22
|
functionName: "setLiquidationThreshold",
|
|
23
|
-
args: [t, lt]
|
|
23
|
+
args: [t, lt],
|
|
24
|
+
throwOnReceiptRevert: true
|
|
24
25
|
});
|
|
25
26
|
await anvil.stopImpersonatingAccount({ address: configuratorAddr });
|
|
26
27
|
await logLTs(anvil, cm, TypedObjectUtils.keys(newLTs), logger);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ZodAddress } from "../onchain/utils/zod.js";
|
|
2
|
-
import { assetTypeSchema, chainIdSchema } from "./primitives.schema.js";
|
|
2
|
+
import { assetTypeSchema, chainIdSchema, tokenSchema } from "./primitives.schema.js";
|
|
3
3
|
import { chartRangeSchema, protocolChartMetricSchema } from "./charts.schema.js";
|
|
4
|
+
import { curatorNameSchema } from "./curators.schema.js";
|
|
4
5
|
import { isFilterSet } from "./filters.js";
|
|
5
6
|
import { encodeFlag, filterable } from "./filters.schema.js";
|
|
6
7
|
import { liquidationPositionSchema } from "./liquidations.schema.js";
|
|
@@ -18,17 +19,39 @@ const analyticsPositionSortFieldSchema = z.enum([
|
|
|
18
19
|
"totalValueUsd",
|
|
19
20
|
"totalDebtUsd",
|
|
20
21
|
"pnlUsd",
|
|
21
|
-
"
|
|
22
|
-
"healthFactor",
|
|
23
|
-
"leverage",
|
|
24
|
-
"chainId",
|
|
25
|
-
"name",
|
|
26
|
-
"borrower"
|
|
22
|
+
"healthFactor"
|
|
27
23
|
]);
|
|
28
24
|
/** {@link AnalyticsSortDirection} */
|
|
29
25
|
const analyticsSortDirectionSchema = z.enum(["asc", "desc"]);
|
|
30
26
|
const analyticsOwnerShape = { borrower: ZodAddress() };
|
|
31
27
|
const addressSchema = z.custom((value) => typeof value === "string" && isAddress(value, { strict: false }));
|
|
28
|
+
const addressParamSchema = z.string().refine((value) => isAddress(value, { strict: false }), "invalid address");
|
|
29
|
+
/** {@link AnalyticsContractRef} */
|
|
30
|
+
const analyticsContractRefSchema = z.object({
|
|
31
|
+
chainId: chainIdSchema,
|
|
32
|
+
address: addressSchema
|
|
33
|
+
});
|
|
34
|
+
const contractFilterSchema = z.union([analyticsContractRefSchema, z.array(analyticsContractRefSchema).readonly()]);
|
|
35
|
+
const contractFilterParamSchema = z.string().regex(/^$|^\d+:\w+(,\d+:\w+)*$/);
|
|
36
|
+
/** Decode comma-separated choices, preserving scalar reads and empty lists. */
|
|
37
|
+
function decodeChoices(param, decode) {
|
|
38
|
+
const choices = param === "" ? [] : param.split(",").map(decode);
|
|
39
|
+
return choices.length === 1 ? choices[0] : choices;
|
|
40
|
+
}
|
|
41
|
+
function encodeChoices(choices, encode) {
|
|
42
|
+
if (choices === void 0) return;
|
|
43
|
+
return [].concat(choices).map(encode).join(",");
|
|
44
|
+
}
|
|
45
|
+
function decodeContractRef(param) {
|
|
46
|
+
const [chainId, address] = param.split(":");
|
|
47
|
+
return {
|
|
48
|
+
chainId: Number(chainId),
|
|
49
|
+
address
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function encodeContractRef(ref) {
|
|
53
|
+
return `${ref.chainId}:${ref.address}`;
|
|
54
|
+
}
|
|
32
55
|
/** {@link AnalyticsPosition} */
|
|
33
56
|
const analyticsPositionSchema = z.discriminatedUnion("kind", [
|
|
34
57
|
z.object({
|
|
@@ -47,6 +70,10 @@ const analyticsPositionSchema = z.discriminatedUnion("kind", [
|
|
|
47
70
|
/** {@link AnalyticsPositionListOptions} */
|
|
48
71
|
const analyticsPositionListOptionsSchema = z.object({
|
|
49
72
|
borrower: addressSchema.optional(),
|
|
73
|
+
pool: contractFilterSchema.optional(),
|
|
74
|
+
creditManager: contractFilterSchema.optional(),
|
|
75
|
+
asset: contractFilterSchema.optional(),
|
|
76
|
+
curator: filterable(z.union([curatorNameSchema, z.array(curatorNameSchema).readonly()])).optional(),
|
|
50
77
|
kind: filterable(positionKindSchema).optional(),
|
|
51
78
|
isZeroDebt: filterable(z.boolean()).optional(),
|
|
52
79
|
chainIds: z.array(chainIdSchema).optional(),
|
|
@@ -58,9 +85,16 @@ const analyticsPositionListOptionsSchema = z.object({
|
|
|
58
85
|
});
|
|
59
86
|
/**
|
|
60
87
|
* {@link AnalyticsPositionListOptions} as URL query parameters.
|
|
88
|
+
* Pool, credit manager and asset choices are comma-separated `chainId:address`
|
|
89
|
+
* references; curator choices are comma-separated names. An empty string
|
|
90
|
+
* carries an empty list rather than an unrestricted condition.
|
|
61
91
|
**/
|
|
62
92
|
const analyticsPositionListQueryParamsSchema = z.object({
|
|
63
|
-
borrower:
|
|
93
|
+
borrower: addressParamSchema.optional(),
|
|
94
|
+
pool: contractFilterParamSchema.optional(),
|
|
95
|
+
creditManager: contractFilterParamSchema.optional(),
|
|
96
|
+
asset: contractFilterParamSchema.optional(),
|
|
97
|
+
curator: z.string().optional(),
|
|
64
98
|
kind: positionKindSchema.optional(),
|
|
65
99
|
isZeroDebt: z.enum(["true", "false"]).optional(),
|
|
66
100
|
chainIds: z.string().regex(/^$|^\d+(,\d+)*$/).optional(),
|
|
@@ -77,6 +111,10 @@ const analyticsPositionListQueryParamsSchema = z.object({
|
|
|
77
111
|
const analyticsPositionListQuerySchema = z.codec(analyticsPositionListQueryParamsSchema, analyticsPositionListOptionsSchema, {
|
|
78
112
|
decode: (params) => ({
|
|
79
113
|
...params.borrower === void 0 ? {} : { borrower: params.borrower },
|
|
114
|
+
...params.pool === void 0 ? {} : { pool: decodeChoices(params.pool, decodeContractRef) },
|
|
115
|
+
...params.creditManager === void 0 ? {} : { creditManager: decodeChoices(params.creditManager, decodeContractRef) },
|
|
116
|
+
...params.asset === void 0 ? {} : { asset: decodeChoices(params.asset, decodeContractRef) },
|
|
117
|
+
...params.curator === void 0 ? {} : { curator: decodeChoices(params.curator, (name) => name) },
|
|
80
118
|
...params.kind === void 0 ? {} : { kind: params.kind },
|
|
81
119
|
...params.isZeroDebt === void 0 ? {} : { isZeroDebt: params.isZeroDebt === "true" },
|
|
82
120
|
...params.chainIds === void 0 ? {} : { chainIds: params.chainIds === "" ? [] : params.chainIds.split(",").map(Number) },
|
|
@@ -88,6 +126,10 @@ const analyticsPositionListQuerySchema = z.codec(analyticsPositionListQueryParam
|
|
|
88
126
|
}),
|
|
89
127
|
encode: (options) => ({
|
|
90
128
|
borrower: options.borrower,
|
|
129
|
+
pool: encodeChoices(options.pool, encodeContractRef),
|
|
130
|
+
creditManager: encodeChoices(options.creditManager, encodeContractRef),
|
|
131
|
+
asset: encodeChoices(options.asset, encodeContractRef),
|
|
132
|
+
curator: isFilterSet(options.curator) ? encodeChoices(options.curator, (name) => name) : void 0,
|
|
91
133
|
kind: isFilterSet(options.kind) ? options.kind : void 0,
|
|
92
134
|
isZeroDebt: encodeFlag(options.isZeroDebt),
|
|
93
135
|
chainIds: options.chainIds?.join(","),
|
|
@@ -105,6 +147,24 @@ const analyticsPositionPageSchema = z.object({
|
|
|
105
147
|
offset: z.number().int().nonnegative(),
|
|
106
148
|
limit: z.number().int().positive().max(100)
|
|
107
149
|
});
|
|
150
|
+
/** {@link AnalyticsContractOption} */
|
|
151
|
+
const analyticsContractOptionSchema = z.object({
|
|
152
|
+
chainId: chainIdSchema,
|
|
153
|
+
address: ZodAddress(),
|
|
154
|
+
name: z.string()
|
|
155
|
+
});
|
|
156
|
+
/** {@link AnalyticsPositionFilterOptions} */
|
|
157
|
+
const analyticsPositionFilterOptionsSchema = z.object({
|
|
158
|
+
pools: z.array(analyticsContractOptionSchema),
|
|
159
|
+
creditManagers: z.array(analyticsContractOptionSchema),
|
|
160
|
+
assets: z.array(tokenSchema),
|
|
161
|
+
curators: z.array(curatorNameSchema)
|
|
162
|
+
});
|
|
163
|
+
/** Chain scope of a filter-options read, shared by the client and backend. */
|
|
164
|
+
const analyticsPositionFilterOptionsQuerySchema = z.codec(analyticsPositionListQueryParamsSchema.pick({ chainIds: true }), analyticsPositionListOptionsSchema.pick({ chainIds: true }), {
|
|
165
|
+
decode: (params) => params.chainIds === void 0 ? {} : { chainIds: params.chainIds === "" ? [] : params.chainIds.split(",").map(Number) },
|
|
166
|
+
encode: (filter) => ({ chainIds: filter.chainIds?.join(",") })
|
|
167
|
+
});
|
|
108
168
|
/**
|
|
109
169
|
* {@link AnalyticsChartQuery}
|
|
110
170
|
*
|
|
@@ -145,4 +205,4 @@ const analyticsChartQuerySchema = z.codec(analyticsChartQueryParamsSchema, analy
|
|
|
145
205
|
})
|
|
146
206
|
});
|
|
147
207
|
//#endregion
|
|
148
|
-
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema };
|
|
208
|
+
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsContractOptionSchema, analyticsContractRefSchema, analyticsPositionFilterOptionsQuerySchema, analyticsPositionFilterOptionsSchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./base.js";
|
|
2
|
-
import { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator } from "./liquidation-errors.js";
|
|
3
|
-
import { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet } from "./operation-errors.js";
|
|
2
|
+
import { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator, partialLiquidationImpossible } from "./liquidation-errors.js";
|
|
3
|
+
import { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaAboveMax, quotaCountExceeded, quotaInactive, quotaLimitReached, quotaUnchanged, reservePriceLimited, rwaOpenRequirementsNotMet } from "./operation-errors.js";
|
|
4
4
|
import { unpriceableTokenError } from "./oracle-errors.js";
|
|
5
5
|
import { creditAccountNotEmpty, creditAccountNotFound, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, unexpectedFailure, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress } from "./prepare-errors.js";
|
|
6
6
|
import { malformedTransaction } from "./preview-errors.js";
|
|
7
|
-
export { accountNotMidasGreenlisted, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, liquidatorNotEligible, malformedTransaction, marketExpired, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress };
|
|
7
|
+
export { accountNotMidasGreenlisted, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, liquidatorNotEligible, malformedTransaction, marketExpired, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, partialLiquidationImpossible, poolPaused, poolSunset, quotaAboveMax, quotaCountExceeded, quotaInactive, quotaLimitReached, quotaUnchanged, reservePriceLimited, rwaOpenRequirementsNotMet, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress };
|
|
@@ -7,6 +7,14 @@ function creditAccountFrozen(creditAccount) {
|
|
|
7
7
|
creditAccount
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
+
/** {@inheritDoc PartialLiquidationImpossibleError} */
|
|
11
|
+
function partialLiquidationImpossible(creditAccount) {
|
|
12
|
+
return {
|
|
13
|
+
code: "partialLiquidationImpossible",
|
|
14
|
+
message: `Credit account ${creditAccount} cannot be partially liquidated.`,
|
|
15
|
+
creditAccount
|
|
16
|
+
};
|
|
17
|
+
}
|
|
10
18
|
/** {@inheritDoc NotEmergencyLiquidatorError} */
|
|
11
19
|
function notEmergencyLiquidator(creditManager, liquidator) {
|
|
12
20
|
return {
|
|
@@ -26,4 +34,4 @@ function liquidatorNotEligible(kycProtocol, kycToken) {
|
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
//#endregion
|
|
29
|
-
export { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator };
|
|
37
|
+
export { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator, partialLiquidationImpossible };
|
|
@@ -100,6 +100,30 @@ function quotaCountExceeded(count, max) {
|
|
|
100
100
|
max
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
+
/** {@inheritDoc QuotaInactiveError} */
|
|
104
|
+
function quotaInactive(token) {
|
|
105
|
+
return {
|
|
106
|
+
code: "quotaInactive",
|
|
107
|
+
message: `${token.symbol} has no active quota in this market.`,
|
|
108
|
+
token
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** {@inheritDoc QuotaUnchangedError} */
|
|
112
|
+
function quotaUnchanged(args) {
|
|
113
|
+
return {
|
|
114
|
+
code: "quotaUnchanged",
|
|
115
|
+
message: `${args.token.symbol} quota of ${args.requested.value} rounds to the current ${args.current.value}.`,
|
|
116
|
+
...args
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** {@inheritDoc QuotaAboveMaxError} */
|
|
120
|
+
function quotaAboveMax(args) {
|
|
121
|
+
return {
|
|
122
|
+
code: "quotaAboveMax",
|
|
123
|
+
message: `${args.token.symbol} quota of ${args.requested.value} exceeds maxQuota ${args.maxQuota.value}.`,
|
|
124
|
+
...args
|
|
125
|
+
};
|
|
126
|
+
}
|
|
103
127
|
/** {@inheritDoc InsufficientBalanceError} */
|
|
104
128
|
function insufficientBalance(args = {}) {
|
|
105
129
|
const { required, held } = args;
|
|
@@ -134,4 +158,4 @@ function accountNotMidasGreenlisted(args) {
|
|
|
134
158
|
};
|
|
135
159
|
}
|
|
136
160
|
//#endregion
|
|
137
|
-
export { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet };
|
|
161
|
+
export { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaAboveMax, quotaCountExceeded, quotaInactive, quotaLimitReached, quotaUnchanged, reservePriceLimited, rwaOpenRequirementsNotMet };
|
package/dist/esm/model/index.js
CHANGED
|
@@ -3,19 +3,19 @@ import { CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, POOL_OPPORTU
|
|
|
3
3
|
import { backendPreferred, compareTagOf, offchainOnly, onchainOnly, tolerance } from "./compare.schema.js";
|
|
4
4
|
import { amountSchema, assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema, timestampSchema, tokenAmountSchema, tokenSchema, txCallSchema, underlyingTokenSchema } from "./primitives.schema.js";
|
|
5
5
|
import { chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, poolOpportunityChartMetricSchema, poolPositionChartMetricSchema, protocolChartMetricSchema, strategyOpportunityChartMetricSchema, strategyPositionChartMetricSchema } from "./charts.schema.js";
|
|
6
|
+
import { curatorNameSchema, curatorSchema } from "./curators.schema.js";
|
|
6
7
|
import { FILTER_ALL, isFilterSet } from "./filters.js";
|
|
7
8
|
import { booleanParamSchema, encodeFlag, filterAllSchema, filterable } from "./filters.schema.js";
|
|
8
|
-
import { curatorNameSchema, curatorSchema } from "./curators.schema.js";
|
|
9
9
|
import { delayedReceivedAssetSchema, instantReceivedAssetSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionSchema, receivedAssetSchema } from "./liquidations.schema.js";
|
|
10
10
|
import { KYC_REGISTRATION_LINKS, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES } from "./rwa.js";
|
|
11
11
|
import { kycRequirementSchema, rwaProtocolSchema } from "./rwa.schema.js";
|
|
12
12
|
import { apyBreakdownSchema, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, pointRewardsSchema, pointsProgramSchema, poolOpportunityDetailSchema, poolOpportunityKeySchema, poolOpportunitySchema, priceFeedDataSchema, priceFeedSummarySchema, quotaAssetSchema, rateCurvePointSchema, rateCurveSchema, rewardsSchema, strategyOpportunityDetailSchema, strategyOpportunityKeySchema, strategyOpportunitySchema, tokenRewardsSchema } from "./opportunities.schema.js";
|
|
13
13
|
import { borrowRateBreakdownSchema, pnlBreakdownSchema, pointsProgramPnLSchema, pointsRewardsPnLSchema, poolPositionKeySchema, poolPositionSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionKeySchema, positionKindSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionsTotalsSchema, rewardsPnLSchema, strategyPositionKeySchema, strategyPositionSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema } from "./positions.schema.js";
|
|
14
|
-
import { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema } from "./analytics.schema.js";
|
|
14
|
+
import { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsContractOptionSchema, analyticsContractRefSchema, analyticsPositionFilterOptionsQuerySchema, analyticsPositionFilterOptionsSchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema } from "./analytics.schema.js";
|
|
15
15
|
import "./curators.js";
|
|
16
16
|
import "./delayed-intents.js";
|
|
17
|
-
import { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator } from "./errors/liquidation-errors.js";
|
|
18
|
-
import { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
17
|
+
import { creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator, partialLiquidationImpossible } from "./errors/liquidation-errors.js";
|
|
18
|
+
import { accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaAboveMax, quotaCountExceeded, quotaInactive, quotaLimitReached, quotaUnchanged, reservePriceLimited, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
19
19
|
import { unpriceableTokenError } from "./errors/oracle-errors.js";
|
|
20
20
|
import { creditAccountNotEmpty, creditAccountNotFound, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, unexpectedFailure, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress } from "./errors/prepare-errors.js";
|
|
21
21
|
import { malformedTransaction } from "./errors/preview-errors.js";
|
|
@@ -33,4 +33,4 @@ import { safeValue, sdkErr, sdkOk } from "./result.js";
|
|
|
33
33
|
import "./rewards.js";
|
|
34
34
|
import "./withdrawals.js";
|
|
35
35
|
import { positionClaimableWithdrawalSchema, positionPendingWithdrawalSchema, positionWithdrawalsSchema, withdrawalOutputAmountSchema } from "./withdrawals.schema.js";
|
|
36
|
-
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, FILTER_ALL, KYC_REGISTRATION_LINKS, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, accountNotMidasGreenlisted, amountSchema, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema, apyBreakdownSchema, asEstimated, assetTypeSchema, backendPreferred, booleanParamSchema, borrowRateBreakdownSchema, bpsSchema, chainFailedSchema, chainIdSchema, chainMetadataSchema, chainSucceededSchema, chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, compareTagOf, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, curatorNameSchema, curatorSchema, dataSourceSchema, debtOutOfRange, delayedReceivedAssetSchema, encodeFlag, filterAllSchema, filterable, forbiddenToken, instantReceivedAssetSchema, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, isFilterSet, kycRequirementSchema, leverageOutOfRange, leverageSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionId, liquidationPositionSchema, liquidatorNotEligible, malformedTransaction, marketExpired, matchesLiquidatableAccountFilter, matchesOpportunityFilter, matchesPositionFilter, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, noticeKindSchema, noticeSchema, offchainOnly, onchainOnly, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityId, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, pnlBreakdownSchema, pointRewardsSchema, pointsProgramPnLSchema, pointsProgramSchema, pointsRewardsPnLSchema, poolOpportunityChartMetricSchema, poolOpportunityDetailSchema, poolOpportunityId, poolOpportunityKeySchema, poolOpportunitySchema, poolPaused, poolPositionChartMetricSchema, poolPositionId, poolPositionKeySchema, poolPositionSchema, poolSunset, positionClaimableWithdrawalSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionId, positionKeySchema, positionKindSchema, positionPendingWithdrawalSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionWithdrawalsSchema, positionsTotalsSchema, priceFeedDataSchema, priceFeedSummarySchema, protocolChartMetricSchema, quotaAssetSchema, quotaCountExceeded, quotaLimitReached, rateCurvePointSchema, rateCurveSchema, receivedAssetSchema, reservePriceLimited, responseMetadataSchema, responseSchema, rewardsPnLSchema, rewardsSchema, rwaOpenRequirementsNotMet, rwaProtocolSchema, safeValue, sdkErr, sdkOk, strategyOpportunityChartMetricSchema, strategyOpportunityDetailSchema, strategyOpportunityId, strategyOpportunityKeySchema, strategyOpportunitySchema, strategyPositionChartMetricSchema, strategyPositionId, strategyPositionKeySchema, strategyPositionSchema, timestampSchema, tokenAmountSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema, tokenRewardsSchema, tokenSchema, tolerance, txCallSchema, underlyingTokenSchema, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress, withdrawalOutputAmountSchema };
|
|
36
|
+
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, FILTER_ALL, KYC_REGISTRATION_LINKS, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, accountNotMidasGreenlisted, amountSchema, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsContractOptionSchema, analyticsContractRefSchema, analyticsPositionFilterOptionsQuerySchema, analyticsPositionFilterOptionsSchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema, apyBreakdownSchema, asEstimated, assetTypeSchema, backendPreferred, booleanParamSchema, borrowRateBreakdownSchema, bpsSchema, chainFailedSchema, chainIdSchema, chainMetadataSchema, chainSucceededSchema, chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, compareTagOf, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, curatorNameSchema, curatorSchema, dataSourceSchema, debtOutOfRange, delayedReceivedAssetSchema, encodeFlag, filterAllSchema, filterable, forbiddenToken, instantReceivedAssetSchema, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, isFilterSet, kycRequirementSchema, leverageOutOfRange, leverageSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionId, liquidationPositionSchema, liquidatorNotEligible, malformedTransaction, marketExpired, matchesLiquidatableAccountFilter, matchesOpportunityFilter, matchesPositionFilter, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, noticeKindSchema, noticeSchema, offchainOnly, onchainOnly, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityId, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, partialLiquidationImpossible, pnlBreakdownSchema, pointRewardsSchema, pointsProgramPnLSchema, pointsProgramSchema, pointsRewardsPnLSchema, poolOpportunityChartMetricSchema, poolOpportunityDetailSchema, poolOpportunityId, poolOpportunityKeySchema, poolOpportunitySchema, poolPaused, poolPositionChartMetricSchema, poolPositionId, poolPositionKeySchema, poolPositionSchema, poolSunset, positionClaimableWithdrawalSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionId, positionKeySchema, positionKindSchema, positionPendingWithdrawalSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionWithdrawalsSchema, positionsTotalsSchema, priceFeedDataSchema, priceFeedSummarySchema, protocolChartMetricSchema, quotaAboveMax, quotaAssetSchema, quotaCountExceeded, quotaInactive, quotaLimitReached, quotaUnchanged, rateCurvePointSchema, rateCurveSchema, receivedAssetSchema, reservePriceLimited, responseMetadataSchema, responseSchema, rewardsPnLSchema, rewardsSchema, rwaOpenRequirementsNotMet, rwaProtocolSchema, safeValue, sdkErr, sdkOk, strategyOpportunityChartMetricSchema, strategyOpportunityDetailSchema, strategyOpportunityId, strategyOpportunityKeySchema, strategyOpportunitySchema, strategyPositionChartMetricSchema, strategyPositionId, strategyPositionKeySchema, strategyPositionSchema, timestampSchema, tokenAmountSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema, tokenRewardsSchema, tokenSchema, tolerance, txCallSchema, underlyingTokenSchema, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress, withdrawalOutputAmountSchema };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ZodAddress } from "../onchain/utils/zod.js";
|
|
2
2
|
import { assetTypeSchema, bpsSchema, chainIdSchema, timestampSchema, tokenAmountSchema, tokenSchema, txCallSchema, underlyingTokenSchema } from "./primitives.schema.js";
|
|
3
|
-
import { filterable } from "./filters.schema.js";
|
|
4
3
|
import { curatorSchema } from "./curators.schema.js";
|
|
4
|
+
import { filterable } from "./filters.schema.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
//#region src/model/liquidations.schema.ts
|
|
7
7
|
/**
|
|
@@ -35,7 +35,8 @@ const liquidatableAccountSchema = z.object({
|
|
|
35
35
|
estimatedProfit: tokenAmountSchema,
|
|
36
36
|
isDelayed: z.boolean(),
|
|
37
37
|
paused: z.boolean(),
|
|
38
|
-
rwa: z.boolean()
|
|
38
|
+
rwa: z.boolean(),
|
|
39
|
+
isPartiallyLiquidatable: z.boolean()
|
|
39
40
|
});
|
|
40
41
|
/**
|
|
41
42
|
* {@link InstantReceivedAsset}
|
|
@@ -85,7 +86,8 @@ const liquidationDetailsSchema = z.object({
|
|
|
85
86
|
isCreditAccountFrozen: z.boolean(),
|
|
86
87
|
kycProtocol: z.string().optional(),
|
|
87
88
|
kycToken: tokenSchema.optional(),
|
|
88
|
-
approve: liquidationApprovalSchema.optional()
|
|
89
|
+
approve: liquidationApprovalSchema.optional(),
|
|
90
|
+
isPartial: z.boolean()
|
|
89
91
|
});
|
|
90
92
|
//#endregion
|
|
91
93
|
export { delayedReceivedAssetSchema, instantReceivedAssetSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionSchema, receivedAssetSchema };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ZodAddress } from "../onchain/utils/zod.js";
|
|
2
2
|
import { offchainOnly, onchainOnly, tolerance } from "./compare.schema.js";
|
|
3
3
|
import { amountSchema, assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema, timestampSchema, tokenSchema, underlyingTokenSchema } from "./primitives.schema.js";
|
|
4
|
+
import { curatorSchema } from "./curators.schema.js";
|
|
4
5
|
import { isFilterSet } from "./filters.js";
|
|
5
6
|
import { booleanParamSchema, encodeFlag, filterable } from "./filters.schema.js";
|
|
6
|
-
import { curatorSchema } from "./curators.schema.js";
|
|
7
7
|
import { kycRequirementSchema } from "./rwa.schema.js";
|
|
8
8
|
import { z } from "zod/v4";
|
|
9
9
|
//#region src/model/opportunities.schema.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ZodAddress, ZodBigInt, ZodHex } from "../onchain/utils/zod.js";
|
|
2
2
|
import { backendPreferred, offchainOnly, onchainOnly, tolerance } from "./compare.schema.js";
|
|
3
3
|
import { assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema, timestampSchema, tokenAmountSchema, tokenSchema, underlyingTokenSchema } from "./primitives.schema.js";
|
|
4
|
+
import { curatorSchema } from "./curators.schema.js";
|
|
4
5
|
import { isFilterSet } from "./filters.js";
|
|
5
6
|
import { booleanParamSchema, encodeFlag, filterable } from "./filters.schema.js";
|
|
6
7
|
import { delayedReceivedAssetSchema, liquidationPositionSchema } from "./liquidations.schema.js";
|
|
@@ -66,6 +67,7 @@ const positionCollateralSchema = z.object({
|
|
|
66
67
|
const poolPositionSchema = z.object({
|
|
67
68
|
kind: z.literal("pool"),
|
|
68
69
|
name: z.string(),
|
|
70
|
+
curator: curatorSchema,
|
|
69
71
|
chainId: chainIdSchema,
|
|
70
72
|
pool: ZodAddress(),
|
|
71
73
|
underlyingToken: underlyingTokenSchema,
|
|
@@ -96,6 +98,7 @@ const borrowRateBreakdownSchema = z.object({
|
|
|
96
98
|
const strategyPositionSchema = z.object({
|
|
97
99
|
kind: z.literal("strategy"),
|
|
98
100
|
name: backendPreferred(z.string()),
|
|
101
|
+
curator: curatorSchema,
|
|
99
102
|
chainId: chainIdSchema,
|
|
100
103
|
creditManager: ZodAddress(),
|
|
101
104
|
creditAccount: ZodAddress(),
|