@gearbox-protocol/sdk 16.3.0-next.5 → 17.0.0-next.2
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/model/errors/operation-errors.js +1 -1
- package/dist/cjs/model/index.js +2 -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/accounts/CreditAccountsServiceV310.js +3 -1
- package/dist/cjs/onchain/accounts/intents/guards.js +4 -4
- package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/cjs/onchain/index.js +4 -4
- package/dist/cjs/onchain/market/credit/CreditSuite.js +12 -26
- package/dist/cjs/onchain/market/rwa/midas/MidasDegenNFT.js +5 -45
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +12 -56
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +37 -0
- package/dist/cjs/onchain/opportunities/MultichainOpportunitiesService.js +2 -8
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +4 -16
- package/dist/cjs/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/cjs/onchain/validation/bundles/checkCreditOperation.js +8 -9
- package/dist/cjs/onchain/validation/bundles/checkDraw.js +28 -0
- package/dist/cjs/onchain/validation/bundles/{checkIncreaseQuota.js → checkQuotasAsked.js} +3 -3
- package/dist/cjs/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/cjs/onchain/validation/bundles/checkRWAOpening.js +5 -6
- package/dist/cjs/onchain/validation/bundles/index.js +4 -4
- package/dist/cjs/onchain/validation/checkSimulation.js +4 -10
- package/dist/cjs/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/cjs/onchain/validation/checks/checkDebtLimits.js +5 -2
- package/dist/cjs/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/cjs/onchain/validation/index.js +4 -4
- package/dist/cjs/sdk/execute/ExecuteApi.js +2 -2
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +3 -9
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/history/trace/extractTransfers.js +1 -1
- package/dist/esm/model/errors/operation-errors.js +1 -1
- package/dist/esm/model/index.js +3 -3
- 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/accounts/CreditAccountsServiceV310.js +5 -3
- package/dist/esm/onchain/accounts/intents/guards.js +4 -4
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +2 -2
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/index.js +3 -3
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditSuite.js +12 -26
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/rwa/createDegenNFT.js +1 -1
- package/dist/esm/onchain/market/rwa/midas/MidasDegenNFT.js +5 -45
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +10 -55
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +37 -0
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/opportunities/MultichainOpportunitiesService.js +2 -8
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +4 -16
- package/dist/esm/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/esm/onchain/preview/preview/previewPoolPositionOperation.js +2 -2
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/onchain/validation/bundles/checkCreditOperation.js +8 -9
- package/dist/esm/onchain/validation/bundles/checkDraw.js +27 -0
- package/dist/esm/onchain/validation/bundles/{checkIncreaseQuota.js → checkQuotasAsked.js} +3 -3
- package/dist/esm/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/esm/onchain/validation/bundles/checkRWAOpening.js +5 -6
- package/dist/esm/onchain/validation/bundles/index.js +3 -3
- package/dist/esm/onchain/validation/checkSimulation.js +4 -10
- package/dist/esm/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/esm/onchain/validation/checks/checkDebtLimits.js +5 -2
- package/dist/esm/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/esm/onchain/validation/index.js +3 -3
- package/dist/esm/sdk/execute/ExecuteApi.js +2 -2
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +3 -9
- package/dist/types/model/errors/operation-errors.d.ts +10 -11
- package/dist/types/model/index.d.ts +3 -3
- package/dist/types/model/opportunities.d.ts +7 -6
- package/dist/types/model/rwa.d.ts +27 -47
- package/dist/types/model/rwa.schema.d.ts +3 -3
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +2 -1
- package/dist/types/offchain/opportunities/types.d.ts +4 -1
- package/dist/types/onchain/accounts/types.d.ts +2 -4
- package/dist/types/onchain/index.d.ts +4 -4
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +3 -8
- package/dist/types/onchain/market/credit/types.d.ts +2 -2
- package/dist/types/onchain/market/index.d.ts +2 -2
- package/dist/types/onchain/market/pool/types.d.ts +1 -1
- package/dist/types/onchain/market/rwa/index.d.ts +2 -2
- package/dist/types/onchain/market/rwa/midas/MidasDegenNFT.d.ts +4 -19
- package/dist/types/onchain/market/rwa/securitize/SecuritizeDegenNFT.d.ts +4 -24
- package/dist/types/onchain/market/rwa/securitize/SecuritizeRWAFactory.d.ts +14 -2
- package/dist/types/onchain/market/rwa/types.d.ts +37 -39
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +1 -5
- package/dist/types/onchain/opportunities/OpportunitiesService.d.ts +3 -10
- package/dist/types/onchain/opportunities/types.d.ts +1 -6
- package/dist/types/onchain/validation/bundles/checkCreditOperation.d.ts +2 -3
- package/dist/types/onchain/validation/bundles/{checkIncreaseDebt.d.ts → checkDraw.d.ts} +7 -7
- package/dist/types/onchain/validation/bundles/{checkIncreaseQuota.d.ts → checkQuotasAsked.d.ts} +3 -3
- package/dist/types/onchain/validation/bundles/checkRWAOpenRequirements.d.ts +2 -2
- package/dist/types/onchain/validation/bundles/checkRWAOpening.d.ts +3 -3
- package/dist/types/onchain/validation/bundles/index.d.ts +3 -3
- package/dist/types/onchain/validation/checkSimulation.d.ts +3 -6
- package/dist/types/onchain/validation/checks/checkBorrowLimit.d.ts +1 -1
- package/dist/types/onchain/validation/checks/checkDebtLimits.d.ts +1 -1
- package/dist/types/onchain/validation/checks/checkPoolLiquidity.d.ts +1 -1
- package/dist/types/onchain/validation/index.d.ts +3 -3
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +1 -5
- package/dist/types/sdk/opportunities/types.d.ts +3 -9
- package/package.json +1 -1
- package/dist/cjs/onchain/validation/bundles/checkIncreaseDebt.js +0 -28
- package/dist/esm/onchain/validation/bundles/checkIncreaseDebt.js +0 -27
|
@@ -4,15 +4,15 @@ import { CheckCollateralFundingInput, CollateralFundingPreview, checkCollateralF
|
|
|
4
4
|
import { HealthFactorThresholds, WeighedFactors, checkHealthFactors } from "./checkHealthFactors.js";
|
|
5
5
|
import { MarketStateError, checkMarket } from "./checkMarket.js";
|
|
6
6
|
import { CreditOperationArgs, CreditOperationError, CreditOperationPreview, checkCreditOperation } from "./checkCreditOperation.js";
|
|
7
|
-
import {
|
|
8
|
-
import { checkIncreaseQuota } from "./checkIncreaseQuota.js";
|
|
7
|
+
import { checkDraw } from "./checkDraw.js";
|
|
9
8
|
import { CheckLiquidationEligibilityInput, LiquidationEligibilityError, checkLiquidationEligibility } from "./checkLiquidationEligibility.js";
|
|
10
9
|
import { CheckLiquidationFundingInput, checkLiquidationFunding } from "./checkLiquidationFunding.js";
|
|
11
10
|
import { checkObtained } from "./checkObtained.js";
|
|
12
11
|
import { CheckPoolFundingInput, checkPoolFunding } from "./checkPoolFunding.js";
|
|
13
12
|
import { PoolOperationArgs, PoolOperationError, checkPoolOperation } from "./checkPoolOperation.js";
|
|
13
|
+
import { checkQuotasAsked } from "./checkQuotasAsked.js";
|
|
14
14
|
import { CheckRWAOpeningInput, checkRWAOpening } from "./checkRWAOpening.js";
|
|
15
15
|
import { CheckRWAOpenRequirementsInput, checkRWAOpenRequirements } from "./checkRWAOpenRequirements.js";
|
|
16
16
|
import { CheckWalletAllowanceInput, checkWalletAllowance } from "./checkWalletAllowance.js";
|
|
17
17
|
import { CheckWalletBalanceInput, checkWalletBalance } from "./checkWalletBalance.js";
|
|
18
|
-
export { CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CreditOperationArgs, CreditOperationError, CreditOperationPreview, HealthFactorThresholds, LiquidationEligibilityError, MarketStateError, PoolOperationArgs, PoolOperationError, WalletFundingError, WeighedFactors, checkAccountQuotas, checkCollateralFunding, checkCreditOperation,
|
|
18
|
+
export { CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CreditOperationArgs, CreditOperationError, CreditOperationPreview, HealthFactorThresholds, LiquidationEligibilityError, MarketStateError, PoolOperationArgs, PoolOperationError, WalletFundingError, WeighedFactors, checkAccountQuotas, checkCollateralFunding, checkCreditOperation, checkDraw, checkHealthFactors, checkLiquidationEligibility, checkLiquidationFunding, checkMarket, checkObtained, checkPoolFunding, checkPoolOperation, checkQuotasAsked, checkRWAOpenRequirements, checkRWAOpening, checkWallet, checkWalletAllowance, checkWalletBalance };
|
|
@@ -3,14 +3,13 @@ import { DebtOutOfRangeError, InsufficientCollateralError, QuotaCountExceededErr
|
|
|
3
3
|
import "../../model/index.js";
|
|
4
4
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
5
5
|
import { OperationState } from "../accounts/intents/types.js";
|
|
6
|
-
import { OpenStrategyState } from "../accounts/intents/open-strategy.js";
|
|
7
6
|
import { HealthFactorThresholds } from "./bundles/checkHealthFactors.js";
|
|
8
7
|
import { MarketStateError } from "./bundles/checkMarket.js";
|
|
9
8
|
//#region src/onchain/validation/checkSimulation.d.ts
|
|
10
9
|
/** A simulated credit operation, as the intents engine reports one. */
|
|
11
10
|
interface CreditSimulationInput {
|
|
12
11
|
chainId: ChainId;
|
|
13
|
-
state: OperationState
|
|
12
|
+
state: OperationState;
|
|
14
13
|
}
|
|
15
14
|
type CheckSimulationInput = CreditSimulationInput;
|
|
16
15
|
/** {@inheritDoc checkSimulation} */
|
|
@@ -35,10 +34,8 @@ type SimulationValidationError = MarketStateError | DebtOutOfRangeError | QuotaC
|
|
|
35
34
|
* touched. The engine performed all three during the walk, so a simulation that
|
|
36
35
|
* came back `ok` has already passed them.
|
|
37
36
|
*
|
|
38
|
-
* A credit account only
|
|
39
|
-
*
|
|
40
|
-
* before it answers. An opening names its quotas `averageQuota` — the branch
|
|
41
|
-
* the planner already weighed it as.
|
|
37
|
+
* A credit account only: a pool operation has no account to weigh, and the
|
|
38
|
+
* three things its own state decides are read by `prepare` before it answers.
|
|
42
39
|
*/
|
|
43
40
|
declare function checkSimulation(sdk: OnchainSDK, input: CheckSimulationInput, options?: HealthFactorThresholds): SimulationValidationError[];
|
|
44
41
|
//#endregion
|
|
@@ -10,7 +10,7 @@ interface BorrowLimitArgs {
|
|
|
10
10
|
maxBorrowAmount?: bigint;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* What the pool will hand over, against
|
|
13
|
+
* What the pool will hand over, against what is asked for.
|
|
14
14
|
*
|
|
15
15
|
* `available` and `limit` are the caller's reading of which limit is in the
|
|
16
16
|
* way; this check only compares. `maxBorrowAmount` is the largest debt still
|
|
@@ -17,7 +17,7 @@ interface DebtLimitsArgs {
|
|
|
17
17
|
*/
|
|
18
18
|
allowZero: boolean;
|
|
19
19
|
/** From the caller's suite; a caller that raises to throw advises nobody. */
|
|
20
|
-
|
|
20
|
+
ceiling?: MaxBorrowAmount;
|
|
21
21
|
}
|
|
22
22
|
/** A debt the facade would revert on. */
|
|
23
23
|
declare function checkDebtLimits(args: DebtLimitsArgs): DebtOutOfRangeError[];
|
|
@@ -11,7 +11,7 @@ interface PoolLiquidityArgs {
|
|
|
11
11
|
* What the pool holds, against what is being taken out of it.
|
|
12
12
|
*
|
|
13
13
|
* The operator is not `checkBorrowLimit`'s: a pool holding exactly the amount
|
|
14
|
-
*
|
|
14
|
+
* asked for still cannot serve it, so equality is already a refusal. That is
|
|
15
15
|
* the rule the legacy withdrawal validator enforced and it is preserved to the
|
|
16
16
|
* unit.
|
|
17
17
|
*/
|
|
@@ -5,13 +5,13 @@ import { CheckCollateralFundingInput, CollateralFundingPreview, checkCollateralF
|
|
|
5
5
|
import { HealthFactorThresholds, WeighedFactors, checkHealthFactors } from "./bundles/checkHealthFactors.js";
|
|
6
6
|
import { MarketStateError, checkMarket } from "./bundles/checkMarket.js";
|
|
7
7
|
import { CreditOperationArgs, CreditOperationError, CreditOperationPreview, checkCreditOperation } from "./bundles/checkCreditOperation.js";
|
|
8
|
-
import {
|
|
9
|
-
import { checkIncreaseQuota } from "./bundles/checkIncreaseQuota.js";
|
|
8
|
+
import { checkDraw } from "./bundles/checkDraw.js";
|
|
10
9
|
import { CheckLiquidationEligibilityInput, LiquidationEligibilityError, checkLiquidationEligibility } from "./bundles/checkLiquidationEligibility.js";
|
|
11
10
|
import { CheckLiquidationFundingInput, checkLiquidationFunding } from "./bundles/checkLiquidationFunding.js";
|
|
12
11
|
import { checkObtained } from "./bundles/checkObtained.js";
|
|
13
12
|
import { CheckPoolFundingInput, checkPoolFunding } from "./bundles/checkPoolFunding.js";
|
|
14
13
|
import { PoolOperationArgs, PoolOperationError, checkPoolOperation } from "./bundles/checkPoolOperation.js";
|
|
14
|
+
import { checkQuotasAsked } from "./bundles/checkQuotasAsked.js";
|
|
15
15
|
import { CheckRWAOpeningInput, checkRWAOpening } from "./bundles/checkRWAOpening.js";
|
|
16
16
|
import { CheckRWAOpenRequirementsInput, checkRWAOpenRequirements } from "./bundles/checkRWAOpenRequirements.js";
|
|
17
17
|
import { CheckWalletAllowanceInput, checkWalletAllowance } from "./bundles/checkWalletAllowance.js";
|
|
@@ -40,4 +40,4 @@ import { amountOf } from "./helpers/amount.js";
|
|
|
40
40
|
import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM } from "./helpers/health-factor-limits.js";
|
|
41
41
|
import { toToken, toTokenAmount } from "./helpers/token.js";
|
|
42
42
|
import "./helpers/index.js";
|
|
43
|
-
export { BorrowLimitArgs, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CollateralisedArgs, CreditAccountFrozenArgs, CreditManagerPausedArgs, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, DebtLimitsArgs, EmergencyLiquidatorArgs, ForbiddenTokenArgs, HealthFactorThresholds, type IntentValidationError, LeverageArgs, LiquidationEligibilityError, LiquidationValidationError, LiquidatorEligibleArgs, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, MarketExpiredArgs, MarketStateError, OperationValidationError, PoolLiquidityArgs, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolSunsetArgs, QuotaCountArgs, QuotaLimitArgs, SimulationValidationError, WalletFundingError, WeighedFactors, amountOf, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors,
|
|
43
|
+
export { BorrowLimitArgs, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CollateralisedArgs, CreditAccountFrozenArgs, CreditManagerPausedArgs, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, DebtLimitsArgs, EmergencyLiquidatorArgs, ForbiddenTokenArgs, HealthFactorThresholds, type IntentValidationError, LeverageArgs, LiquidationEligibilityError, LiquidationValidationError, LiquidatorEligibleArgs, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, MarketExpiredArgs, MarketStateError, OperationValidationError, PoolLiquidityArgs, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolSunsetArgs, QuotaCountArgs, QuotaLimitArgs, SimulationValidationError, WalletFundingError, WeighedFactors, amountOf, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkDraw, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkQuotasAsked, checkRWAOpenRequirements, checkRWAOpening, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, raise, toToken, toTokenAmount };
|
|
@@ -47,11 +47,7 @@ declare class OpportunitiesNamespace extends AbstractNamespace<MultichainSDK["op
|
|
|
47
47
|
/**
|
|
48
48
|
* {@inheritDoc IOpportunitiesBase.getStrategy}
|
|
49
49
|
**/
|
|
50
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
51
|
-
/**
|
|
52
|
-
* {@inheritDoc IOpportunitiesOnchainOnly.isEligibleForStrategy}
|
|
53
|
-
**/
|
|
54
|
-
isEligibleForStrategy(key: StrategyOpportunityKey, wallet: Address): Promise<boolean>;
|
|
50
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
55
51
|
/**
|
|
56
52
|
* {@inheritDoc IOpportunitiesBase.filter}
|
|
57
53
|
**/
|
|
@@ -30,11 +30,10 @@ interface IOpportunitiesBase {
|
|
|
30
30
|
**/
|
|
31
31
|
getPool(key: PoolOpportunityKey): Promise<DataResponse<PoolOpportunityDetail>>;
|
|
32
32
|
/**
|
|
33
|
-
* Detailed view of one strategy opportunity. `kyc`
|
|
34
|
-
*
|
|
35
|
-
* for a wallet verdict.
|
|
33
|
+
* Detailed view of one strategy opportunity. With `wallet`, `kyc` tells whether
|
|
34
|
+
* that wallet must register with the strategy's KYC provider before opening.
|
|
36
35
|
**/
|
|
37
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
36
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
38
37
|
/**
|
|
39
38
|
* Narrows an already-read list, rows and metadata alike. `undefined` passes
|
|
40
39
|
* through, so a read still in flight stays that way, and a list already read
|
|
@@ -89,11 +88,6 @@ interface IOpportunitiesOnchainOnly {
|
|
|
89
88
|
* same reason as {@link prepare}: it encodes against live chain state.
|
|
90
89
|
**/
|
|
91
90
|
readonly execute: IOpportunitiesExecute;
|
|
92
|
-
/**
|
|
93
|
-
* Whether `wallet` may open this strategy today: `true` when it is not
|
|
94
|
-
* KYC-gated or the wallet already passed the gate. Chain-only.
|
|
95
|
-
**/
|
|
96
|
-
isEligibleForStrategy(key: StrategyOpportunityKey, wallet: Address): Promise<boolean>;
|
|
97
91
|
}
|
|
98
92
|
/**
|
|
99
93
|
* The chain on its own, for a consumer that shows each source as it arrives.
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_onchain_validation_checks_checkBorrowLimit = require("../checks/checkBorrowLimit.js");
|
|
3
|
-
require("../checks/index.js");
|
|
4
|
-
//#region src/onchain/validation/bundles/checkIncreaseDebt.ts
|
|
5
|
-
/**
|
|
6
|
-
* What the transaction borrows, against what the market can lend right now.
|
|
7
|
-
*
|
|
8
|
-
* Only a debt increase is weighed: repaying, or leaving the debt alone, can
|
|
9
|
-
* never exceed the borrow limit. Opening borrows the whole debt; adjusting
|
|
10
|
-
* borrows `totalDebtChange`.
|
|
11
|
-
*
|
|
12
|
-
* The engine holds every simulation to this already (`assertCanBorrow`), so
|
|
13
|
-
* this is here for the transactions it never saw — a pasted calldata reaches
|
|
14
|
-
* the confirm screen with nothing else standing between it and a revert.
|
|
15
|
-
*/
|
|
16
|
-
function checkIncreaseDebt(suite, preview, underlying) {
|
|
17
|
-
const debtIncrease = preview.operation === "AdjustCreditAccount" ? preview.totalDebtChange.value : preview.totalDebt.value;
|
|
18
|
-
if (debtIncrease <= 0n) return [];
|
|
19
|
-
const maxBorrowAmount = suite.maxBorrowAmount();
|
|
20
|
-
return require_onchain_validation_checks_checkBorrowLimit.checkBorrowLimit({
|
|
21
|
-
requested: debtIncrease,
|
|
22
|
-
available: maxBorrowAmount.amount.value,
|
|
23
|
-
limit: maxBorrowAmount.limit,
|
|
24
|
-
underlying
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.checkIncreaseDebt = checkIncreaseDebt;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { checkBorrowLimit } from "../checks/checkBorrowLimit.js";
|
|
2
|
-
import "../checks/index.js";
|
|
3
|
-
//#region src/onchain/validation/bundles/checkIncreaseDebt.ts
|
|
4
|
-
/**
|
|
5
|
-
* What the transaction borrows, against what the market can lend right now.
|
|
6
|
-
*
|
|
7
|
-
* Only a debt increase is weighed: repaying, or leaving the debt alone, can
|
|
8
|
-
* never exceed the borrow limit. Opening borrows the whole debt; adjusting
|
|
9
|
-
* borrows `totalDebtChange`.
|
|
10
|
-
*
|
|
11
|
-
* The engine holds every simulation to this already (`assertCanBorrow`), so
|
|
12
|
-
* this is here for the transactions it never saw — a pasted calldata reaches
|
|
13
|
-
* the confirm screen with nothing else standing between it and a revert.
|
|
14
|
-
*/
|
|
15
|
-
function checkIncreaseDebt(suite, preview, underlying) {
|
|
16
|
-
const debtIncrease = preview.operation === "AdjustCreditAccount" ? preview.totalDebtChange.value : preview.totalDebt.value;
|
|
17
|
-
if (debtIncrease <= 0n) return [];
|
|
18
|
-
const maxBorrowAmount = suite.maxBorrowAmount();
|
|
19
|
-
return checkBorrowLimit({
|
|
20
|
-
requested: debtIncrease,
|
|
21
|
-
available: maxBorrowAmount.amount.value,
|
|
22
|
-
limit: maxBorrowAmount.limit,
|
|
23
|
-
underlying
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { checkIncreaseDebt };
|