@gearbox-protocol/sdk 17.0.0-next.4 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dev/abi.js +14 -15
- package/dist/cjs/dev/claimFromFaucet.js +4 -8
- package/dist/cjs/dev/createAnvilClient.js +35 -17
- package/dist/cjs/dev/index.js +7 -2
- package/dist/cjs/dev/kycUtils.js +66 -58
- package/dist/cjs/dev/midasUtils.js +113 -16
- package/dist/cjs/dev/securitizeUtils.js +82 -42
- package/dist/cjs/dev/withdrawalUtils.js +3 -6
- package/dist/cjs/model/errors/index.js +2 -0
- package/dist/cjs/model/errors/operation-errors.js +19 -1
- package/dist/cjs/model/index.js +4 -2
- package/dist/cjs/model/rwa.js +4 -4
- package/dist/cjs/model/rwa.schema.js +4 -4
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/cjs/onchain/OnchainSDK.js +3 -3
- package/dist/cjs/onchain/accounts/CreditAccountsServiceV310.js +2 -17
- package/dist/cjs/onchain/accounts/intents/borrow.js +140 -0
- package/dist/cjs/onchain/accounts/intents/collateral-valuation.js +41 -0
- package/dist/cjs/onchain/accounts/intents/guards.js +15 -3
- package/dist/cjs/onchain/accounts/intents/index.js +107 -20
- package/dist/cjs/onchain/accounts/intents/leverage-band.js +2 -12
- package/dist/cjs/onchain/accounts/intents/maxBorrow.js +89 -0
- package/dist/cjs/onchain/accounts/intents/maxWithdrawCollateral.js +15 -41
- package/dist/cjs/onchain/accounts/intents/open-strategy.js +8 -46
- package/dist/cjs/onchain/accounts/intents/operations.js +0 -1
- package/dist/cjs/onchain/accounts/intents/realize.js +61 -4
- package/dist/cjs/onchain/accounts/intents/tail.js +1 -1
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +1 -0
- package/dist/cjs/onchain/accounts/intents/utils/common.js +19 -0
- package/dist/cjs/onchain/accounts/intents/utils/credit-account-slice.js +21 -0
- package/dist/cjs/onchain/accounts/intents/utils/index.js +2 -0
- package/dist/cjs/onchain/accounts/intents/utils/price-impact.js +12 -9
- package/dist/cjs/onchain/accounts/intents/utils/router-path.js +4 -5
- package/dist/cjs/onchain/accounts/intents/withdraw-limits.js +97 -0
- package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/cjs/onchain/constants/address-provider.js +0 -2
- package/dist/cjs/onchain/constants/index.js +0 -1
- package/dist/cjs/onchain/core/createAddressProvider.js +2 -5
- package/dist/cjs/onchain/index.js +60 -43
- package/dist/cjs/onchain/market/adapters/abi/conctructorAbi.js +2 -2
- package/dist/cjs/onchain/market/adapters/contracts/AbstractAdapter.js +6 -0
- package/dist/cjs/onchain/market/adapters/contracts/MidasGatewayAdapterContract.js +49 -5
- package/dist/cjs/onchain/market/credit/CreditSuite.js +26 -9
- package/dist/cjs/onchain/market/index.js +50 -38
- package/dist/cjs/onchain/market/oracle/PriceOracleBaseContract.js +3 -3
- package/dist/cjs/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedRegistry.js +127 -0
- package/dist/cjs/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/cjs/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/feeds/index.js +35 -0
- package/dist/cjs/onchain/market/pricefeeds/index.js +51 -39
- package/dist/cjs/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +189 -0
- package/dist/cjs/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/cjs/onchain/market/pricefeeds/updates/index.js +8 -0
- package/dist/cjs/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/cjs/onchain/market/pricefeeds/updates/updatableDependencies.js +14 -0
- package/dist/cjs/onchain/market/rwa/RWARegistry.js +4 -7
- package/dist/cjs/onchain/market/rwa/index.js +1 -0
- package/dist/cjs/onchain/market/rwa/midas/MidasDegenNFT.js +45 -5
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +56 -12
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +0 -37
- package/dist/cjs/onchain/opportunities/MultichainOpportunitiesService.js +8 -2
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +16 -4
- package/dist/cjs/onchain/positions/calcHealthFactor.js +3 -3
- package/dist/cjs/onchain/preview/index.js +2 -0
- package/dist/cjs/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/cjs/onchain/preview/preview/index.js +2 -0
- package/dist/cjs/onchain/preview/preview/midasGreenlistsAccount.js +17 -0
- package/dist/cjs/onchain/preview/preview/previewOpenStrategyPosition.js +13 -16
- package/dist/cjs/onchain/preview/preview/previewOperation.js +19 -11
- package/dist/cjs/onchain/preview/preview/replayMulticall.js +4 -3
- package/dist/cjs/onchain/validation/bundles/checkCollateralFunding.js +3 -3
- package/dist/cjs/onchain/validation/bundles/checkCreditOperation.js +11 -9
- package/dist/cjs/onchain/validation/bundles/{checkDraw.js → checkIncreaseDebt.js} +10 -10
- package/dist/cjs/onchain/validation/bundles/{checkQuotasAsked.js → checkIncreaseQuota.js} +3 -3
- package/dist/cjs/onchain/validation/bundles/checkMidasAccountGreenlist.js +44 -0
- package/dist/cjs/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/cjs/onchain/validation/bundles/checkRWAOpening.js +18 -8
- package/dist/cjs/onchain/validation/bundles/index.js +6 -4
- package/dist/cjs/onchain/validation/checkOperation.js +0 -1
- package/dist/cjs/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/cjs/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/cjs/onchain/validation/checks/checkReservePriceLimited.js +30 -0
- package/dist/cjs/onchain/validation/checks/index.js +2 -0
- package/dist/cjs/onchain/validation/index.js +8 -4
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +2 -2
- package/dist/cjs/permissionless/utils/price-update/get-updatable-feeds.js +2 -2
- package/dist/cjs/sdk/execute/ExecuteApi.js +67 -7
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +9 -3
- package/dist/cjs/sdk/prepare/PrepareApi.js +89 -14
- package/dist/esm/dev/abi.js +14 -15
- package/dist/esm/dev/claimFromFaucet.js +4 -8
- package/dist/esm/dev/createAnvilClient.js +36 -19
- package/dist/esm/dev/index.js +4 -4
- package/dist/esm/dev/kycUtils.js +66 -59
- package/dist/esm/dev/midasUtils.js +112 -18
- package/dist/esm/dev/securitizeUtils.js +84 -44
- package/dist/esm/dev/withdrawalUtils.js +3 -6
- package/dist/esm/model/errors/index.js +2 -2
- package/dist/esm/model/errors/operation-errors.js +18 -2
- package/dist/esm/model/index.js +4 -4
- package/dist/esm/model/rwa.js +4 -4
- package/dist/esm/model/rwa.schema.js +5 -5
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/esm/onchain/OnchainSDK.js +3 -3
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -17
- package/dist/esm/onchain/accounts/intents/borrow.js +138 -0
- package/dist/esm/onchain/accounts/intents/collateral-valuation.js +40 -0
- package/dist/esm/onchain/accounts/intents/guards.js +15 -3
- package/dist/esm/onchain/accounts/intents/index.js +107 -20
- package/dist/esm/onchain/accounts/intents/leverage-band.js +2 -12
- package/dist/esm/onchain/accounts/intents/maxBorrow.js +87 -0
- package/dist/esm/onchain/accounts/intents/maxWithdrawCollateral.js +15 -41
- package/dist/esm/onchain/accounts/intents/open-strategy.js +8 -46
- package/dist/esm/onchain/accounts/intents/operations.js +0 -1
- package/dist/esm/onchain/accounts/intents/realize.js +61 -4
- package/dist/esm/onchain/accounts/intents/tail.js +1 -1
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +1 -0
- package/dist/esm/onchain/accounts/intents/utils/common.js +19 -1
- package/dist/esm/onchain/accounts/intents/utils/credit-account-slice.js +21 -1
- package/dist/esm/onchain/accounts/intents/utils/index.js +3 -3
- package/dist/esm/onchain/accounts/intents/utils/price-impact.js +12 -9
- package/dist/esm/onchain/accounts/intents/utils/router-path.js +4 -5
- package/dist/esm/onchain/accounts/intents/withdraw-limits.js +95 -0
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/constants/address-provider.js +1 -2
- package/dist/esm/onchain/constants/index.js +2 -2
- package/dist/esm/onchain/core/createAddressProvider.js +2 -5
- package/dist/esm/onchain/index.js +32 -24
- package/dist/esm/onchain/market/adapters/abi/conctructorAbi.js +2 -2
- package/dist/esm/onchain/market/adapters/contracts/AbstractAdapter.js +6 -0
- package/dist/esm/onchain/market/adapters/contracts/MidasGatewayAdapterContract.js +50 -6
- package/dist/esm/onchain/market/credit/CreditSuite.js +26 -9
- package/dist/esm/onchain/market/index.js +26 -21
- package/dist/esm/onchain/market/oracle/PriceOracleBaseContract.js +1 -1
- package/dist/esm/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/esm/onchain/market/pricefeeds/PriceFeedRegistry.js +126 -0
- package/dist/esm/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/esm/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/feeds/index.js +18 -0
- package/dist/esm/onchain/market/pricefeeds/index.js +27 -21
- package/dist/esm/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +188 -0
- package/dist/esm/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/esm/onchain/market/pricefeeds/updates/index.js +5 -1
- package/dist/esm/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/esm/onchain/market/pricefeeds/updates/updatableDependencies.js +13 -0
- package/dist/esm/onchain/market/rwa/RWARegistry.js +4 -8
- package/dist/esm/onchain/market/rwa/index.js +2 -2
- package/dist/esm/onchain/market/rwa/midas/MidasDegenNFT.js +45 -5
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +55 -10
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +0 -37
- package/dist/esm/onchain/opportunities/MultichainOpportunitiesService.js +8 -2
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +16 -4
- package/dist/esm/onchain/positions/calcHealthFactor.js +3 -3
- package/dist/esm/onchain/preview/index.js +2 -1
- package/dist/esm/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/esm/onchain/preview/preview/index.js +2 -1
- package/dist/esm/onchain/preview/preview/midasGreenlistsAccount.js +16 -0
- package/dist/esm/onchain/preview/preview/previewOpenStrategyPosition.js +14 -17
- package/dist/esm/onchain/preview/preview/previewOperation.js +19 -11
- package/dist/esm/onchain/preview/preview/replayMulticall.js +4 -3
- package/dist/esm/onchain/validation/bundles/checkCollateralFunding.js +3 -3
- package/dist/esm/onchain/validation/bundles/checkCreditOperation.js +11 -9
- package/dist/esm/onchain/validation/bundles/checkIncreaseDebt.js +27 -0
- package/dist/esm/onchain/validation/bundles/{checkQuotasAsked.js → checkIncreaseQuota.js} +3 -3
- package/dist/esm/onchain/validation/bundles/checkMidasAccountGreenlist.js +43 -0
- package/dist/esm/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/esm/onchain/validation/bundles/checkRWAOpening.js +18 -8
- package/dist/esm/onchain/validation/bundles/index.js +4 -3
- package/dist/esm/onchain/validation/checkOperation.js +0 -1
- package/dist/esm/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/esm/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/esm/onchain/validation/checks/checkReservePriceLimited.js +29 -0
- package/dist/esm/onchain/validation/checks/index.js +2 -1
- package/dist/esm/onchain/validation/index.js +5 -3
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +1 -1
- package/dist/esm/permissionless/utils/price-update/get-updatable-feeds.js +1 -1
- package/dist/esm/sdk/execute/ExecuteApi.js +67 -7
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +9 -3
- package/dist/esm/sdk/prepare/PrepareApi.js +94 -19
- package/dist/types/dev/abi.d.ts +13 -15
- package/dist/types/dev/claimFromFaucet.d.ts +0 -1
- package/dist/types/dev/createAnvilClient.d.ts +10 -3
- package/dist/types/dev/index.d.ts +4 -4
- package/dist/types/dev/kycUtils.d.ts +15 -24
- package/dist/types/dev/midasUtils.d.ts +35 -4
- package/dist/types/dev/securitizeUtils.d.ts +3 -9
- package/dist/types/model/errors/index.d.ts +2 -2
- package/dist/types/model/errors/operation-errors.d.ts +62 -7
- package/dist/types/model/index.d.ts +5 -5
- package/dist/types/model/opportunities.d.ts +6 -7
- package/dist/types/model/previews.d.ts +25 -19
- package/dist/types/model/rwa.d.ts +47 -27
- package/dist/types/model/rwa.schema.d.ts +3 -3
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +1 -2
- package/dist/types/offchain/opportunities/types.d.ts +1 -4
- package/dist/types/onchain/OnchainSDK.d.ts +2 -2
- package/dist/types/onchain/accounts/index.d.ts +5 -4
- package/dist/types/onchain/accounts/intents/borrow.d.ts +141 -0
- package/dist/types/onchain/accounts/intents/collateral-valuation.d.ts +42 -0
- package/dist/types/onchain/accounts/intents/guards.d.ts +18 -2
- package/dist/types/onchain/accounts/intents/index.d.ts +103 -15
- package/dist/types/onchain/accounts/intents/maxBorrow.d.ts +54 -0
- package/dist/types/onchain/accounts/intents/maxWithdrawCollateral.d.ts +3 -8
- package/dist/types/onchain/accounts/intents/open-strategy.d.ts +3 -17
- package/dist/types/onchain/accounts/intents/testing/sdk-mock.d.ts +2 -0
- package/dist/types/onchain/accounts/intents/tests/open-strategy.fixtures.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/types.d.ts +51 -6
- package/dist/types/onchain/accounts/intents/utils/common.d.ts +15 -1
- package/dist/types/onchain/accounts/intents/utils/credit-account-slice.d.ts +14 -1
- package/dist/types/onchain/accounts/intents/utils/index.d.ts +3 -3
- package/dist/types/onchain/accounts/intents/utils/price-impact.d.ts +4 -1
- package/dist/types/onchain/accounts/intents/utils/router-path.d.ts +2 -5
- package/dist/types/onchain/accounts/intents/withdraw-limits.d.ts +80 -0
- package/dist/types/onchain/accounts/types.d.ts +4 -2
- package/dist/types/onchain/constants/address-provider.d.ts +1 -2
- package/dist/types/onchain/constants/index.d.ts +2 -2
- package/dist/types/onchain/index.d.ts +40 -31
- package/dist/types/onchain/market/adapters/contracts/AbstractAdapter.d.ts +6 -0
- package/dist/types/onchain/market/adapters/contracts/MidasGatewayAdapterContract.d.ts +20 -4
- package/dist/types/onchain/market/adapters/types.d.ts +8 -0
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +13 -3
- package/dist/types/onchain/market/index.d.ts +29 -24
- package/dist/types/onchain/market/oracle/PriceOracleBaseContract.d.ts +2 -1
- package/dist/types/onchain/market/oracle/types.d.ts +2 -1
- package/dist/types/onchain/market/pool/types.d.ts +1 -1
- package/dist/types/onchain/market/pricefeeds/AbstractPriceFeed.d.ts +1 -2
- package/dist/types/onchain/market/pricefeeds/PriceFeedRegistry.d.ts +60 -0
- package/dist/types/onchain/market/pricefeeds/feeds/BalancerStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.d.ts → feeds/BalancerWeightedPriceFeed.d.ts} +7 -7
- package/dist/types/onchain/market/pricefeeds/feeds/BoundedPriceFeed.d.ts +15 -0
- package/dist/types/onchain/market/pricefeeds/{CompositePriceFeed.d.ts → feeds/CompositePriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/{ConstantPriceFeed.d.ts → feeds/ConstantPriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/feeds/CurveCryptoPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveUSDPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/Erc4626PriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ExternalPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/MellowLRTPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.d.ts → feeds/PendleTWAPPTPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{PythPriceFeed.d.ts → feeds/PythPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{RedstonePriceFeed.d.ts → feeds/RedstonePriceFeed.d.ts} +9 -9
- package/dist/types/onchain/market/pricefeeds/feeds/WstETHPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/YearnPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ZeroPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/index.d.ts +18 -0
- package/dist/types/onchain/market/pricefeeds/index.d.ts +28 -22
- package/dist/types/onchain/market/pricefeeds/types.d.ts +1 -31
- package/dist/types/onchain/market/pricefeeds/updates/RedstoneUpdater.d.ts +1 -1
- package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +106 -0
- package/dist/types/onchain/market/pricefeeds/updates/getRawPriceUpdates.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/index.d.ts +7 -3
- package/dist/types/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +56 -2
- package/dist/types/onchain/market/pricefeeds/updates/updatableDependencies.d.ts +10 -0
- package/dist/types/onchain/market/rwa/RWARegistry.d.ts +2 -1
- package/dist/types/onchain/market/rwa/index.d.ts +3 -3
- package/dist/types/onchain/market/rwa/midas/MidasDegenNFT.d.ts +19 -4
- package/dist/types/onchain/market/rwa/securitize/SecuritizeDegenNFT.d.ts +24 -4
- package/dist/types/onchain/market/rwa/securitize/SecuritizeRWAFactory.d.ts +2 -14
- package/dist/types/onchain/market/rwa/types.d.ts +39 -37
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +5 -1
- package/dist/types/onchain/opportunities/OpportunitiesService.d.ts +10 -3
- package/dist/types/onchain/opportunities/types.d.ts +6 -1
- package/dist/types/onchain/preview/index.d.ts +2 -1
- package/dist/types/onchain/preview/preview/index.d.ts +2 -1
- package/dist/types/onchain/preview/preview/midasGreenlistsAccount.d.ts +13 -0
- package/dist/types/onchain/preview/preview/previewOpenStrategyPosition.d.ts +5 -3
- package/dist/types/onchain/preview/preview/replayMulticall.d.ts +8 -7
- package/dist/types/onchain/validation/bundles/checkCreditOperation.d.ts +5 -4
- package/dist/types/onchain/validation/bundles/{checkDraw.d.ts → checkIncreaseDebt.d.ts} +7 -7
- package/dist/types/onchain/validation/bundles/{checkQuotasAsked.d.ts → checkIncreaseQuota.d.ts} +3 -3
- package/dist/types/onchain/validation/bundles/checkMidasAccountGreenlist.d.ts +22 -0
- package/dist/types/onchain/validation/bundles/checkRWAOpenRequirements.d.ts +2 -2
- package/dist/types/onchain/validation/bundles/checkRWAOpening.d.ts +9 -7
- package/dist/types/onchain/validation/bundles/index.d.ts +5 -4
- package/dist/types/onchain/validation/checks/checkBorrowLimit.d.ts +1 -1
- package/dist/types/onchain/validation/checks/checkDebtLimits.d.ts +2 -2
- package/dist/types/onchain/validation/checks/checkPoolLiquidity.d.ts +1 -1
- package/dist/types/onchain/validation/checks/checkReservePriceLimited.d.ts +31 -0
- package/dist/types/onchain/validation/checks/index.d.ts +2 -1
- package/dist/types/onchain/validation/index.d.ts +6 -4
- package/dist/types/onchain/validation/raise.d.ts +2 -2
- package/dist/types/sdk/execute/index.d.ts +2 -2
- package/dist/types/sdk/execute/types.d.ts +48 -6
- package/dist/types/sdk/index.d.ts +5 -4
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +5 -1
- package/dist/types/sdk/opportunities/types.d.ts +9 -3
- package/dist/types/sdk/prepare/PrepareApi.d.ts +16 -4
- package/dist/types/sdk/prepare/index.d.ts +4 -3
- package/dist/types/sdk/prepare/types.d.ts +200 -66
- package/package.json +1 -1
- package/dist/cjs/onchain/accounts/utils/midasUtils.js +0 -70
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -301
- package/dist/cjs/plugins/degen-distributors/DegenDistributorsPlugin.js +0 -61
- package/dist/cjs/plugins/degen-distributors/index.js +0 -4
- package/dist/cjs/plugins/degen-distributors/package.json +0 -1
- package/dist/cjs/plugins/degen-distributors/types.js +0 -1
- package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +0 -114
- package/dist/cjs/plugins/delayed-withdrawal/index.js +0 -4
- package/dist/cjs/plugins/delayed-withdrawal/package.json +0 -1
- package/dist/cjs/plugins/delayed-withdrawal/types.js +0 -1
- package/dist/esm/onchain/accounts/utils/midasUtils.js +0 -69
- package/dist/esm/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -300
- package/dist/esm/onchain/validation/bundles/checkDraw.js +0 -27
- package/dist/esm/plugins/degen-distributors/DegenDistributorsPlugin.js +0 -60
- package/dist/esm/plugins/degen-distributors/index.js +0 -3
- package/dist/esm/plugins/degen-distributors/package.json +0 -1
- package/dist/esm/plugins/degen-distributors/types.js +0 -1
- package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +0 -113
- package/dist/esm/plugins/delayed-withdrawal/index.js +0 -3
- package/dist/esm/plugins/delayed-withdrawal/package.json +0 -1
- package/dist/esm/plugins/delayed-withdrawal/types.js +0 -1
- package/dist/types/onchain/accounts/utils/midasUtils.d.ts +0 -38
- package/dist/types/onchain/market/pricefeeds/BalancerStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/BoundedPriceFeed.d.ts +0 -15
- package/dist/types/onchain/market/pricefeeds/CurveCryptoPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveUSDPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/Erc4626PriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ExternalPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/MellowLRTPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/PriceFeedsRegister.d.ts +0 -180
- package/dist/types/onchain/market/pricefeeds/WstETHPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/YearnPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ZeroPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/getRawPriceUpdates.d.ts +0 -5
- package/dist/types/onchain/market/pricefeeds/isUpdatablePriceFeed.d.ts +0 -5
- package/dist/types/plugins/degen-distributors/DegenDistributorsPlugin.d.ts +0 -25
- package/dist/types/plugins/degen-distributors/index.d.ts +0 -3
- package/dist/types/plugins/degen-distributors/types.d.ts +0 -8
- package/dist/types/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.d.ts +0 -25
- package/dist/types/plugins/delayed-withdrawal/index.d.ts +0 -3
- package/dist/types/plugins/delayed-withdrawal/types.d.ts +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Bps, Token, TokenAmount } from "../primitives.js";
|
|
2
2
|
import { IGearboxError } from "./base.js";
|
|
3
|
-
import { RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements } from "../rwa.js";
|
|
3
|
+
import { RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAProtocol } from "../rwa.js";
|
|
4
4
|
import { MaxBorrowAmount } from "../../onchain/market/credit/types.js";
|
|
5
5
|
import "../../onchain/index.js";
|
|
6
6
|
import { Address } from "viem";
|
|
@@ -55,7 +55,7 @@ interface PoolSunsetError extends IGearboxError {
|
|
|
55
55
|
/** {@inheritDoc PoolSunsetError} */
|
|
56
56
|
declare function poolSunset(pool: Address): PoolSunsetError;
|
|
57
57
|
/**
|
|
58
|
-
* The pool cannot lend what the operation
|
|
58
|
+
* The pool cannot lend what the operation wants to borrow.
|
|
59
59
|
**/
|
|
60
60
|
interface InsufficientPoolLiquidityError extends IGearboxError {
|
|
61
61
|
code: "insufficientPoolLiquidity";
|
|
@@ -126,6 +126,46 @@ interface InsufficientCollateralError extends IGearboxError {
|
|
|
126
126
|
}
|
|
127
127
|
/** {@inheritDoc InsufficientCollateralError} */
|
|
128
128
|
declare function insufficientCollateral(args: Omit<InsufficientCollateralError, "code" | "message">): InsufficientCollateralError;
|
|
129
|
+
/**
|
|
130
|
+
* The same failure as {@link InsufficientCollateralError}, traced to the
|
|
131
|
+
* reserve price feed rather than to the size of the position.
|
|
132
|
+
*
|
|
133
|
+
* A call that hands funds over is weighed at safe prices — `min` of a token's
|
|
134
|
+
* two feeds, and nothing at all for collateral governance registered no
|
|
135
|
+
* reserve feed for — so an account that covers its debt at the main feed can
|
|
136
|
+
* still be refused. Worth its own code because the two call for opposite
|
|
137
|
+
* words: an under-collateralised position is fixed by adding collateral or
|
|
138
|
+
* requesting less, while this is a valuation the account does not control, and
|
|
139
|
+
* requesting less only helps as far as {@link withdrawable} says it does.
|
|
140
|
+
**/
|
|
141
|
+
interface ReservePriceLimitedError extends IGearboxError {
|
|
142
|
+
code: "reservePriceLimited";
|
|
143
|
+
/** The safe-price factor the operation would have ended at. */
|
|
144
|
+
healthFactor: Bps;
|
|
145
|
+
/**
|
|
146
|
+
* The same account at the main feed. Above {@link healthFactorThreshold} by
|
|
147
|
+
* definition — that is what makes the reserve feed the thing in the way, and
|
|
148
|
+
* the gap between the two is how far it marks the collateral down.
|
|
149
|
+
**/
|
|
150
|
+
atMainPrices: Bps;
|
|
151
|
+
/** The threshold both were weighed against, the facade's own `1.0`. */
|
|
152
|
+
healthFactorThreshold: Bps;
|
|
153
|
+
/**
|
|
154
|
+
* What the account can still take out under the same check, in the market's
|
|
155
|
+
* underlying — the request to offer instead of the refused one. It is the
|
|
156
|
+
* `safePartial` of `WithdrawCeilings`, from the same code that answers
|
|
157
|
+
* `maxWithdraw`, so the two never disagree.
|
|
158
|
+
*
|
|
159
|
+
* `0n` says no partial withdrawal clears the threshold at all, and a smaller
|
|
160
|
+
* request will not help: holding leverage flat scales collateral and debt
|
|
161
|
+
* together, which leaves the safe-price factor exactly where it found it.
|
|
162
|
+
* Such a position can still leave entirely — an exit settles the debt rather
|
|
163
|
+
* than shrinking it, and a check with no debt to divide by refuses nothing.
|
|
164
|
+
**/
|
|
165
|
+
withdrawable: TokenAmount;
|
|
166
|
+
}
|
|
167
|
+
/** {@inheritDoc ReservePriceLimitedError} */
|
|
168
|
+
declare function reservePriceLimited(args: Omit<ReservePriceLimitedError, "code" | "message">): ReservePriceLimitedError;
|
|
129
169
|
/**
|
|
130
170
|
* The operation would increase the balance of a token the market forbids.
|
|
131
171
|
**/
|
|
@@ -140,7 +180,7 @@ declare function forbiddenToken(token: Token): ForbiddenTokenError;
|
|
|
140
180
|
**/
|
|
141
181
|
interface QuotaLimitReachedError extends IGearboxError {
|
|
142
182
|
code: "quotaLimitReached";
|
|
143
|
-
/** The token whose quota is
|
|
183
|
+
/** The token whose quota is increased. */
|
|
144
184
|
token: Token;
|
|
145
185
|
/**
|
|
146
186
|
* In the **underlying**, which is what a quota is measured in. Absent for a
|
|
@@ -201,20 +241,35 @@ interface InsufficientAllowanceError extends IGearboxError {
|
|
|
201
241
|
/** {@inheritDoc InsufficientAllowanceError} */
|
|
202
242
|
declare function insufficientAllowance(args: Omit<InsufficientAllowanceError, "code" | "message">): InsufficientAllowanceError;
|
|
203
243
|
/**
|
|
204
|
-
* The RWA
|
|
244
|
+
* The RWA protocol still wants something from the borrower before this token
|
|
205
245
|
* can be opened on.
|
|
206
246
|
**/
|
|
207
247
|
interface RWAOpenRequirementsError extends IGearboxError {
|
|
208
248
|
code: "rwaOpenRequirementsNotMet";
|
|
209
249
|
token: Token;
|
|
210
250
|
creditManager: Address;
|
|
211
|
-
|
|
251
|
+
protocol: RWAProtocol;
|
|
252
|
+
/** Where the wallet completes registration with {@link protocol}. */
|
|
253
|
+
registrationLink: string;
|
|
212
254
|
/** Always present on the error. */
|
|
213
255
|
requirements: RWAOpenAccountRequirements;
|
|
214
|
-
/** Absent when only issuer-side registration is pending. */
|
|
256
|
+
/** Absent when only issuer-side registration is pending (or Midas greenlist). */
|
|
215
257
|
missing?: RWAMissingOpenAccountRequirements;
|
|
216
258
|
}
|
|
217
259
|
/** {@inheritDoc RWAOpenRequirementsError} */
|
|
218
260
|
declare function rwaOpenRequirementsNotMet(args: Omit<RWAOpenRequirementsError, "code" | "message">): RWAOpenRequirementsError;
|
|
261
|
+
/**
|
|
262
|
+
* The credit account does not hold the Midas greenlisted role this
|
|
263
|
+
* permissioned mToken requires of its holder.
|
|
264
|
+
**/
|
|
265
|
+
interface AccountNotMidasGreenlistedError extends IGearboxError {
|
|
266
|
+
code: "accountNotMidasGreenlisted";
|
|
267
|
+
token: Token;
|
|
268
|
+
creditManager: Address;
|
|
269
|
+
/** Absent when the opening creates the account. */
|
|
270
|
+
creditAccount?: Address;
|
|
271
|
+
}
|
|
272
|
+
/** {@inheritDoc AccountNotMidasGreenlistedError} */
|
|
273
|
+
declare function accountNotMidasGreenlisted(args: Omit<AccountNotMidasGreenlistedError, "code" | "message">): AccountNotMidasGreenlistedError;
|
|
219
274
|
//#endregion
|
|
220
|
-
export { BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, rwaOpenRequirementsNotMet };
|
|
275
|
+
export { AccountNotMidasGreenlistedError, BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, ReservePriceLimitedError, accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet };
|
|
@@ -5,15 +5,15 @@ import { Curator, CuratorName } from "./curators.js";
|
|
|
5
5
|
import { DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedWithdrawCollateralIntent } from "./delayed-intents.js";
|
|
6
6
|
import { IGearboxError } from "./errors/base.js";
|
|
7
7
|
import { CreditAccountFrozenError, LiquidatorNotEligibleError, NotEmergencyLiquidatorError, creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator } from "./errors/liquidation-errors.js";
|
|
8
|
-
import {
|
|
9
|
-
import { BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
8
|
+
import { KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, MidasOpenAccountRequirements, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWAProtocol, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature } from "./rwa.js";
|
|
9
|
+
import { AccountNotMidasGreenlistedError, BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, ReservePriceLimitedError, accountNotMidasGreenlisted, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, reservePriceLimited, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
10
10
|
import { UnpriceableTokenError, unpriceableTokenError } from "./errors/oracle-errors.js";
|
|
11
11
|
import { CreditAccountNotEmptyError, CreditAccountNotFoundError, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, UnexpectedFailureError, UnsupportedCollateralTokenError, UnsupportedTokenPairError, WithdrawalInProgressError, creditAccountNotEmpty, creditAccountNotFound, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, unexpectedFailure, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress } from "./errors/prepare-errors.js";
|
|
12
12
|
import { InvalidDelayedIntentError, MalformedTransactionError, PoolOperationPreviewError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedZapperFunctionError, malformedTransaction } from "./errors/preview-errors.js";
|
|
13
13
|
import "./errors/index.js";
|
|
14
14
|
import { ApyBreakdown, Opportunity, OpportunityBase, OpportunityDetail, OpportunityFilter, OpportunityId, OpportunityKey, OpportunityKind, OpportunityTotals, PointRewards, PointsProgram, PoolOpportunity, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, PriceFeedData, PriceFeedSummary, QuotaAsset, RateCurve, RateCurvePoint, Rewards, StrategyOpportunity, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef, TokenRewards, matchesOpportunityFilter, opportunityId, poolOpportunityId, strategyOpportunityId } from "./opportunities.js";
|
|
15
15
|
import { BorrowRateBreakdown, PnlBreakdown, PointsProgramPnL, PointsRewardsPnL, PoolPosition, PoolPositionKey, PoolPositionRef, Position, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionTransaction, PositionTransactionKind, PositionsTotals, RewardsPnL, STRATEGY_POSITION_COLLATERAL_ERROR, StrategyPosition, StrategyPositionKey, StrategyPositionRef, TokenQuotaRate, TokenRewardsPnL, liquidationPositionId, matchesPositionFilter, poolPositionId, positionId, strategyPositionId } from "./positions.js";
|
|
16
|
-
import { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, CreditOperationMarket, DelayedStrategyPositionOperationPreview, Estimated, EstimatedProjection, ExitStrategyPositionPreview, InstantStrategyPositionOperationPreview,
|
|
16
|
+
import { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, CreditOperationMarket, DelayedStrategyPositionOperationPreview, Estimated, EstimatedProjection, ExitStrategyPositionPreview, InstantStrategyPositionOperationPreview, OpenStrategyPositionPreview, OperationPreview, PoolOperationType, PoolPositionOperationPreview, PreviewOperationInput, PreviewOperationOptions, RepayStrategyPositionPreview, RoutedField, asEstimated } from "./previews.js";
|
|
17
17
|
import { DelayedReceivedAsset, InstantReceivedAsset, LiquidatableAccount, LiquidatableAccountFilter, LiquidationApproval, LiquidationDetails, LiquidationPosition, ReceivedAsset, matchesLiquidatableAccountFilter } from "./liquidations.js";
|
|
18
18
|
import { AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition } from "./analytics.js";
|
|
19
19
|
import { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema } from "./analytics.schema.js";
|
|
@@ -30,7 +30,7 @@ import { amountSchema, assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema
|
|
|
30
30
|
import { ChainFailed, ChainMetadata, ChainScoped, ChainSucceeded, DataResponse, DataSource, ResponseMetadata } from "./response.js";
|
|
31
31
|
import { chainFailedSchema, chainMetadataSchema, chainSucceededSchema, dataSourceSchema, responseMetadataSchema, responseSchema } from "./response.schema.js";
|
|
32
32
|
import { SDKError, SDKResult, SDKReturn, SafeValue, safeValue, sdkErr, sdkOk } from "./result.js";
|
|
33
|
-
import {
|
|
33
|
+
import { kycRequirementSchema, rwaProtocolSchema } from "./rwa.schema.js";
|
|
34
34
|
import { PositionClaimableWithdrawal, PositionPendingWithdrawal, PositionWithdrawals, WithdrawalOutputAmount } from "./withdrawals.js";
|
|
35
35
|
import { positionClaimableWithdrawalSchema, positionPendingWithdrawalSchema, positionWithdrawalsSchema, withdrawalOutputAmountSchema } from "./withdrawals.schema.js";
|
|
36
|
-
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError,
|
|
36
|
+
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountNotMidasGreenlistedError, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError, KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, Leverage, LeverageOutOfRangeError, LiquidatableAccount, LiquidatableAccountFilter, LiquidationApproval, LiquidationDetails, LiquidationPosition, LiquidatorNotEligibleError, MalformedTransactionError, MarketExpiredError, MidasOpenAccountRequirements, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, NotEmergencyLiquidatorError, Notice, NoticeKind, NoticeSubject, OpenStrategyPositionPreview, OperationPreview, Opportunity, OpportunityBase, OpportunityChartMetric, OpportunityDetail, OpportunityFilter, OpportunityId, OpportunityKey, OpportunityKind, OpportunityTotals, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, PnlBreakdown, PointRewards, PointsProgram, PointsProgramPnL, PointsRewardsPnL, PoolOperationPreviewError, PoolOperationType, PoolOpportunity, PoolOpportunityChartMetric, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, PoolPausedError, PoolPosition, PoolPositionChartMetric, PoolPositionKey, PoolPositionOperationPreview, PoolPositionRef, PoolSunsetError, Position, PositionChartMetric, PositionClaimableWithdrawal, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionPendingWithdrawal, PositionTransaction, PositionTransactionKind, PositionWithdrawals, PositionsTotals, PreviewOperationInput, PreviewOperationOptions, PriceFeedData, PriceFeedSummary, ProtocolChartMetric, QuotaAsset, QuotaCountExceededError, QuotaLimitReachedError, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOpenRequirementsError, RWAOperationArgs, RWAProtocol, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, RateCurve, RateCurvePoint, ReceivedAsset, RepayStrategyPositionPreview, ReservePriceLimitedError, ResponseMetadata, Rewards, RewardsPnL, RoutedField, SDKError, SDKResult, SDKReturn, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, SafeValue, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyOpportunity, StrategyOpportunityChartMetric, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef, StrategyPosition, StrategyPositionChartMetric, StrategyPositionKey, StrategyPositionRef, Timestamp, Token, TokenAmount, TokenQuotaRate, TokenRewards, TokenRewardsPnL, ToleranceCompareTag, TxCall, UnderlyingToken, UnexpectedFailureError, UnpriceableTokenError, UnsupportedCollateralTokenError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedTokenPairError, UnsupportedZapperFunctionError, WithdrawalInProgressError, WithdrawalOutputAmount, 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 };
|
|
@@ -221,7 +221,7 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
221
221
|
**/
|
|
222
222
|
targetCollateral: Token;
|
|
223
223
|
/**
|
|
224
|
-
* Debt principal this credit manager has
|
|
224
|
+
* Debt principal this credit manager has borrowed from the pool
|
|
225
225
|
* (`pool.creditManagerBorrowed(creditManager)`). Denominated in the
|
|
226
226
|
* underlying.
|
|
227
227
|
**/
|
|
@@ -331,7 +331,7 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
331
331
|
**/
|
|
332
332
|
minDebt: Amount;
|
|
333
333
|
/**
|
|
334
|
-
* Cap on the total debt this credit manager may
|
|
334
|
+
* Cap on the total debt this credit manager may borrow from the pool, shared
|
|
335
335
|
* by all of its accounts and denominated in the underlying
|
|
336
336
|
* (`creditManagerDebtParams.limit`).
|
|
337
337
|
**/
|
|
@@ -591,11 +591,10 @@ interface StrategyOpportunityDetail extends StrategyOpportunity {
|
|
|
591
591
|
**/
|
|
592
592
|
priceFeeds: PriceFeedSummary;
|
|
593
593
|
/**
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
* `both` mode `kyc` is taken from the chain whenever that leg succeeded.
|
|
594
|
+
* KYC gate of this strategy, independent of any wallet. `null` when the
|
|
595
|
+
* strategy is not KYC-gated. `undefined` only in `offchain` mode, until the
|
|
596
|
+
* backend serves it. In `both` mode `kyc` is taken from the chain whenever
|
|
597
|
+
* that leg succeeded.
|
|
599
598
|
**/
|
|
600
599
|
kyc?: KycRequirement | null;
|
|
601
600
|
}
|
|
@@ -369,37 +369,43 @@ interface OpenStrategyPositionProjection extends EstimatedProjection {
|
|
|
369
369
|
* accordingly (omitted entirely when it reaches zero).
|
|
370
370
|
*/
|
|
371
371
|
collateralAdded: TokenAmount[];
|
|
372
|
+
/**
|
|
373
|
+
* Tokens the same transaction hands back to the wallet
|
|
374
|
+
* (`withdrawCollateral` calls, with the MAX_UINT256 sentinel resolved
|
|
375
|
+
* against replayed balances).
|
|
376
|
+
*
|
|
377
|
+
* Empty for an opening that keeps everything it bought; a borrow pays its
|
|
378
|
+
* loan out here, and the values above are what is left once it has.
|
|
379
|
+
*/
|
|
380
|
+
collateralWithdrawn: TokenAmount[];
|
|
372
381
|
/**
|
|
373
382
|
* The oracle could not price a token; it contributes nothing to the values.
|
|
374
383
|
*/
|
|
375
384
|
warning?: UnpriceableTokenError;
|
|
376
385
|
}
|
|
377
386
|
/**
|
|
378
|
-
* What
|
|
379
|
-
*
|
|
387
|
+
* What an account-opening transaction that already exists would do — the
|
|
388
|
+
* counterpart of `prepare.openNewStrategy` and `prepare.borrow`, read off
|
|
380
389
|
* calldata rather than planned into it.
|
|
381
390
|
**/
|
|
382
|
-
interface
|
|
391
|
+
interface OpenStrategyPositionPreview extends OpenStrategyPositionProjection {
|
|
383
392
|
operation: "OpenCreditAccount";
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
**/
|
|
389
|
-
interface OpenRWAStrategyPositionPreview extends OpenStrategyPositionProjection {
|
|
390
|
-
operation: "RWAOpenCreditAccount";
|
|
393
|
+
/**
|
|
394
|
+
* Existing zero-debt, zero-quota account this operation reopens.
|
|
395
|
+
*/
|
|
396
|
+
creditAccount?: Address;
|
|
391
397
|
/**
|
|
392
398
|
* Registration args the factory received (Securitize: `tokensToRegister`,
|
|
393
|
-
* `signaturesToCache`).
|
|
399
|
+
* `signaturesToCache`). Present on RWA-factory accounts only.
|
|
400
|
+
*/
|
|
401
|
+
rwaArgs?: RWAOperationArgs;
|
|
402
|
+
/**
|
|
403
|
+
* Whether the multicall grants the Midas greenlisted role to the credit
|
|
404
|
+
* account via `receiveGreenlist()`. Needed for the Midas empty-account
|
|
405
|
+
* flow.
|
|
394
406
|
*/
|
|
395
|
-
|
|
407
|
+
midasGreenlistsAccount?: boolean;
|
|
396
408
|
}
|
|
397
|
-
/**
|
|
398
|
-
* What an account-opening transaction that already exists would do — the
|
|
399
|
-
* counterpart of `prepare.openNewStrategy`, read off calldata rather than
|
|
400
|
-
* planned into it.
|
|
401
|
-
**/
|
|
402
|
-
type OpenStrategyPositionPreview = OpenNonRWAStrategyPositionPreview | OpenRWAStrategyPositionPreview;
|
|
403
409
|
/**
|
|
404
410
|
* What a transaction on an existing account would do — the counterpart of the
|
|
405
411
|
* `prepare` flows that adjust one (`depositStrategy`, `withdrawStrategy`,
|
|
@@ -585,4 +591,4 @@ interface DelayedStrategyPositionOperationPreview extends CreditOperationMarket
|
|
|
585
591
|
*/
|
|
586
592
|
type OperationPreview = PoolPositionOperationPreview | OpenStrategyPositionPreview | AdjustStrategyPositionPreview | ExitStrategyPositionPreview | RepayStrategyPositionPreview | DelayedStrategyPositionOperationPreview;
|
|
587
593
|
//#endregion
|
|
588
|
-
export { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, CreditOperationMarket, DelayedStrategyPositionOperationPreview, Estimated, EstimatedProjection, ExitStrategyPositionPreview, InstantStrategyPositionOperationPreview,
|
|
594
|
+
export { AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, CreditOperationMarket, DelayedStrategyPositionOperationPreview, Estimated, EstimatedProjection, ExitStrategyPositionPreview, InstantStrategyPositionOperationPreview, OpenStrategyPositionPreview, OperationPreview, PoolOperationType, PoolPositionOperationPreview, PreviewOperationInput, PreviewOperationOptions, RepayStrategyPositionPreview, RoutedField, asEstimated };
|
|
@@ -72,12 +72,22 @@ declare const SECURITIZE_REGISTER_VAULT_TYPES: {
|
|
|
72
72
|
* @see VaultRegistrar in https://github.com/Gearbox-protocol/periphery-v3
|
|
73
73
|
**/
|
|
74
74
|
type SecuritizeRegisterVaultMessage = TypedDataDefinition<typeof SECURITIZE_REGISTER_VAULT_TYPES, "RegisterVault">;
|
|
75
|
+
/**
|
|
76
|
+
* RWA protocols that require dedicated flows
|
|
77
|
+
**/
|
|
78
|
+
declare const RWA_PROTOCOLS: readonly ["securitize", "midas"];
|
|
79
|
+
/** String literal union of {@link RWA_PROTOCOLS}. */
|
|
80
|
+
type RWAProtocol = (typeof RWA_PROTOCOLS)[number];
|
|
81
|
+
/**
|
|
82
|
+
* KYC is only ever an RWA concern today, so the two names coincide.
|
|
83
|
+
**/
|
|
84
|
+
type KycProtocol = RWAProtocol;
|
|
75
85
|
/**
|
|
76
86
|
* Factory-specific args for a Securitize RWA factory `multicall` /
|
|
77
87
|
* `openCreditAccount`.
|
|
78
88
|
**/
|
|
79
89
|
interface SecuritizeOperationArgs {
|
|
80
|
-
|
|
90
|
+
protocol: "securitize";
|
|
81
91
|
/** DSToken addresses to register for this operation. */
|
|
82
92
|
tokensToRegister: Address[];
|
|
83
93
|
/** Cached EIP-712 registration signatures to store on-chain. */
|
|
@@ -85,12 +95,11 @@ interface SecuritizeOperationArgs {
|
|
|
85
95
|
}
|
|
86
96
|
/**
|
|
87
97
|
* Subset of {@link SecuritizeOpenAccountRequirements} still unfulfilled given
|
|
88
|
-
* the params already carried by the transaction calldata.
|
|
89
|
-
* `SecuritizeRWAFactory.getMissingRequirements`; `undefined` there means the
|
|
98
|
+
* the params already carried by the transaction calldata. `undefined` there means the
|
|
90
99
|
* requirements are satisfied.
|
|
91
100
|
**/
|
|
92
101
|
interface SecuritizeMissingOpenAccountRequirements {
|
|
93
|
-
|
|
102
|
+
protocol: "securitize";
|
|
94
103
|
/**
|
|
95
104
|
* EIP-712 messages the investor still has to sign (not covered by
|
|
96
105
|
* calldata-provided signatures). Once signed, they become the
|
|
@@ -100,7 +109,12 @@ interface SecuritizeMissingOpenAccountRequirements {
|
|
|
100
109
|
requiredSignatures: SecuritizeRegisterVaultMessage[];
|
|
101
110
|
}
|
|
102
111
|
interface SecuritizeOpenAccountRequirements {
|
|
103
|
-
|
|
112
|
+
protocol: "securitize";
|
|
113
|
+
/**
|
|
114
|
+
* RWA Factory contract address whose `openCreditAccount`/`multicall`
|
|
115
|
+
* consume `tokensToRegister` and the signatures.
|
|
116
|
+
*/
|
|
117
|
+
factory: Address;
|
|
104
118
|
/**
|
|
105
119
|
* User must visit securitize website to register these tokens
|
|
106
120
|
* May be empty if user already registered all required tokens
|
|
@@ -119,35 +133,41 @@ interface SecuritizeOpenAccountRequirements {
|
|
|
119
133
|
requiredSignatures: SecuritizeRegisterVaultMessage[];
|
|
120
134
|
}
|
|
121
135
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
136
|
+
* What a wallet still has to do before a Permissioned Midas market lets it
|
|
137
|
+
* open. There are no tx args: Midas grants a role off-chain.
|
|
124
138
|
**/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
interface MidasOpenAccountRequirements {
|
|
140
|
+
protocol: "midas";
|
|
141
|
+
/** mToken the gateway greenlists wallets for. */
|
|
142
|
+
token: Address;
|
|
143
|
+
/** `false` until Midas grants the greenlisted role; there is nothing else to do and no tx args. */
|
|
144
|
+
greenlisted: boolean;
|
|
145
|
+
}
|
|
128
146
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* Can be discriminated by type.
|
|
147
|
+
* Open-account requirements for an RWA protocol, defaults to the union of all
|
|
148
|
+
* protocols. Discriminated by {@link RWAProtocol}.
|
|
132
149
|
**/
|
|
133
|
-
type
|
|
134
|
-
|
|
150
|
+
type RWAOpenAccountRequirements<P extends RWAProtocol = RWAProtocol> = Extract<SecuritizeOpenAccountRequirements | MidasOpenAccountRequirements, {
|
|
151
|
+
protocol: P;
|
|
135
152
|
}>;
|
|
136
153
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
154
|
+
* Subset of {@link RWAOpenAccountRequirements} that is still unfulfilled given
|
|
155
|
+
* the params already on the transaction. Midas has none (`never`).
|
|
139
156
|
**/
|
|
140
|
-
type
|
|
141
|
-
|
|
157
|
+
type RWAMissingOpenAccountRequirements<P extends RWAProtocol = RWAProtocol> = Extract<SecuritizeMissingOpenAccountRequirements, {
|
|
158
|
+
protocol: P;
|
|
142
159
|
}>;
|
|
143
160
|
/**
|
|
144
|
-
*
|
|
161
|
+
* Open credit account/Multicall extra params for an RWA protocol. Midas has
|
|
162
|
+
* none (`never`): accounts open through the plain facade.
|
|
145
163
|
**/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
type RWAOperationArgs<P extends RWAProtocol = RWAProtocol> = Extract<SecuritizeOperationArgs, {
|
|
165
|
+
protocol: P;
|
|
166
|
+
}>;
|
|
149
167
|
/**
|
|
150
|
-
* What a wallet still has to do before it may open a KYC-gated strategy
|
|
168
|
+
* What a wallet still has to do before it may open a KYC-gated strategy —
|
|
169
|
+
* the gate itself, independent of any particular wallet. `null` on a
|
|
170
|
+
* strategy that is not gated.
|
|
151
171
|
**/
|
|
152
172
|
interface KycRequirement {
|
|
153
173
|
protocol: KycProtocol;
|
|
@@ -160,8 +180,8 @@ interface KycRequirement {
|
|
|
160
180
|
registrationLink: string;
|
|
161
181
|
}
|
|
162
182
|
/**
|
|
163
|
-
* Hardcoded registration URLs for each {@link
|
|
183
|
+
* Hardcoded registration URLs for each {@link RWAProtocol}.
|
|
164
184
|
**/
|
|
165
|
-
declare const KYC_REGISTRATION_LINKS: Record<
|
|
185
|
+
declare const KYC_REGISTRATION_LINKS: Record<RWAProtocol, string>;
|
|
166
186
|
//#endregion
|
|
167
|
-
export {
|
|
187
|
+
export { KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, MidasOpenAccountRequirements, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWAProtocol, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
//#region src/model/rwa.schema.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* {@link ./rwa.js#
|
|
4
|
+
* {@link ./rwa.js#RWAProtocol}
|
|
5
5
|
**/
|
|
6
|
-
declare const
|
|
6
|
+
declare const rwaProtocolSchema: z.ZodEnum<{
|
|
7
7
|
midas: "midas";
|
|
8
8
|
securitize: "securitize";
|
|
9
9
|
}>;
|
|
@@ -26,4 +26,4 @@ declare const kycRequirementSchema: z.ZodObject<{
|
|
|
26
26
|
registrationLink: z.ZodString;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export { kycRequirementSchema, rwaProtocolSchema };
|
|
@@ -4,7 +4,6 @@ import { DataResponse } from "../../model/response.js";
|
|
|
4
4
|
import { GearboxAPIOptions } from "../types.js";
|
|
5
5
|
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
6
6
|
import { IOffchainOpportunities, OpportunityChartMetricFor } from "./types.js";
|
|
7
|
-
import { Address } from "viem";
|
|
8
7
|
//#region src/offchain/opportunities/OffchainOpportunities.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Backend counterpart of the `opportunities` namespace.
|
|
@@ -23,7 +22,7 @@ declare class OffchainOpportunities extends AbstractOffchainNamespace implements
|
|
|
23
22
|
/**
|
|
24
23
|
* {@inheritDoc IOffchainOpportunities.getStrategy}
|
|
25
24
|
**/
|
|
26
|
-
getStrategy(key: StrategyOpportunityKey
|
|
25
|
+
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
27
26
|
/**
|
|
28
27
|
* {@inheritDoc IOffchainOpportunities.getTotals}
|
|
29
28
|
**/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChartBundle, ChartRange, PoolOpportunityChartMetric, StrategyOpportunityChartMetric } from "../../model/charts.js";
|
|
2
2
|
import { Opportunity, OpportunityFilter, OpportunityKey, OpportunityTotals, PoolOpportunityDetail, PoolOpportunityKey, StrategyOpportunityDetail, StrategyOpportunityKey } from "../../model/opportunities.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
|
-
import { Address } from "viem";
|
|
5
4
|
//#region src/offchain/opportunities/types.d.ts
|
|
6
5
|
type OpportunityChartMetricFor<K extends OpportunityKey> = {
|
|
7
6
|
pool: PoolOpportunityChartMetric;
|
|
@@ -22,10 +21,8 @@ interface IOffchainOpportunities {
|
|
|
22
21
|
getPool(key: PoolOpportunityKey): Promise<DataResponse<PoolOpportunityDetail>>;
|
|
23
22
|
/**
|
|
24
23
|
* Detailed view of one strategy opportunity.
|
|
25
|
-
*
|
|
26
|
-
* @param wallet - Optional wallet address to check KYC status for.
|
|
27
24
|
**/
|
|
28
|
-
getStrategy(key: StrategyOpportunityKey
|
|
25
|
+
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
29
26
|
/**
|
|
30
27
|
* Protocol-wide totals across every opportunity the backend serves.
|
|
31
28
|
**/
|
|
@@ -7,8 +7,8 @@ import "./constants/index.js";
|
|
|
7
7
|
import { RWARegistry } from "./market/rwa/RWARegistry.js";
|
|
8
8
|
import { GearboxStateHuman } from "./types/state-human.js";
|
|
9
9
|
import { RedstoneOptions } from "./market/pricefeeds/updates/RedstoneUpdater.js";
|
|
10
|
+
import { UpdatablePriceFeedRegistry } from "./market/pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
10
11
|
import "./market/pricefeeds/updates/index.js";
|
|
11
|
-
import { PriceFeedRegister } from "./market/pricefeeds/PriceFeedsRegister.js";
|
|
12
12
|
import "./market/pricefeeds/index.js";
|
|
13
13
|
import { IRouterContract } from "./router/types.js";
|
|
14
14
|
import "./router/index.js";
|
|
@@ -270,7 +270,7 @@ declare class OnchainSDK<const Plugins extends PluginsMap = {}> extends ChainCon
|
|
|
270
270
|
* Global registry of all price feeds known to the SDK.
|
|
271
271
|
* @throws {@link SdkNotAttachedError} if not attached.
|
|
272
272
|
*/
|
|
273
|
-
get priceFeeds():
|
|
273
|
+
get priceFeeds(): UpdatablePriceFeedRegistry;
|
|
274
274
|
/** GEAR governance token address, or `undefined` if not listed. */
|
|
275
275
|
get gear(): Address | undefined;
|
|
276
276
|
/**
|
|
@@ -19,17 +19,18 @@ import { AccountBotsService } from "./bots/AccountBotsService.js";
|
|
|
19
19
|
import { PeripheryCompressorV310Contract } from "./bots/PeripheryCompressorV310Contract.js";
|
|
20
20
|
import "./bots/index.js";
|
|
21
21
|
import { CreditAccountsServiceV310 } from "./CreditAccountsServiceV310.js";
|
|
22
|
-
import { LeverageBand } from "./intents/leverage-band.js";
|
|
23
22
|
import { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./quota-utils.js";
|
|
24
23
|
import { AccountCalculatorOperation } from "./intents/operations.js";
|
|
25
|
-
import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./intents/types.js";
|
|
24
|
+
import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./intents/types.js";
|
|
25
|
+
import { BorrowProps, BorrowState } from "./intents/borrow.js";
|
|
26
|
+
import { LeverageBand } from "./intents/leverage-band.js";
|
|
26
27
|
import { OpenStrategyProps, OpenStrategyState } from "./intents/open-strategy.js";
|
|
27
28
|
import { fetchCreditAccountSlice, toCreditAccountSlice } from "./intents/utils/credit-account-slice.js";
|
|
28
29
|
import { isPhantomToken } from "./intents/utils/pick-token.js";
|
|
29
|
-
import { CreditAccountOperationsService, OpenStrategyPreviewResult } from "./intents/index.js";
|
|
30
|
+
import { BorrowPreviewResult, CreditAccountOperationsService, EmptyAccountPreviewResult, OpenStrategyPreviewResult } from "./intents/index.js";
|
|
30
31
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./liquidations/constants.js";
|
|
31
32
|
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LoadRWALiquidatorsProps, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo } from "./liquidations/types.js";
|
|
32
33
|
import { LiquidationsService } from "./liquidations/LiquidationsService.js";
|
|
33
34
|
import { MultichainLiquidationsService } from "./liquidations/MultichainLiquidationsService.js";
|
|
34
35
|
import "./liquidations/index.js";
|
|
35
|
-
export { AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountToCheck, type AddCollateralIntent, type AdjustLeverageIntent, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EncodableCreditAccountOperation, type FinishIntentProps, type FinishIntentResult, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetWithdrawalRequestResultProps, ICreditAccountsService, IRedemptionLoggerContract, IWithdrawalCompressorContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, type LeverageBand, LiquidationsService, LoadRWALiquidatorsProps, MulticallWithFailure, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PeripheryCompressorV310Contract, PreviewDelayedWithdrawalProps, RWALiquidatorInfo, RedemptionLog, RedemptionLoggerV310Contract, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, Rewards, type RouteErrors, SetBotProps, SetBotResult, type StartIntent, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, createRedemptionLogger, createWithdrawalCompressor, decodeDelayedIntent, encodeDelayedIntent, fetchCreditAccountSlice, getWithdrawalCompressorAddress, iCreditAccountAbi, isPhantomToken, roundUpQuota, toClaimableWithdrawal, toCreditAccountSlice, toPendingWithdrawal, toRequestableWithdrawal, toWithdrawalStatus };
|
|
36
|
+
export { AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountToCheck, type AddCollateralIntent, type AdjustLeverageIntent, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BorrowPreviewResult, type BorrowProps, type BorrowState, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EmptyAccountPreviewResult, EncodableCreditAccountOperation, type ExecutionCost, type FinishIntentProps, type FinishIntentResult, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetWithdrawalRequestResultProps, ICreditAccountsService, IRedemptionLoggerContract, IWithdrawalCompressorContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, type LeverageBand, LiquidationsService, LoadRWALiquidatorsProps, MulticallWithFailure, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PeripheryCompressorV310Contract, PreviewDelayedWithdrawalProps, RWALiquidatorInfo, RedemptionLog, RedemptionLoggerV310Contract, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, Rewards, type RouteErrors, SetBotProps, SetBotResult, type StartIntent, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, createRedemptionLogger, createWithdrawalCompressor, decodeDelayedIntent, encodeDelayedIntent, fetchCreditAccountSlice, getWithdrawalCompressorAddress, iCreditAccountAbi, isPhantomToken, roundUpQuota, toClaimableWithdrawal, toCreditAccountSlice, toPendingWithdrawal, toRequestableWithdrawal, toWithdrawalStatus };
|