@gearbox-protocol/sdk 16.3.0-next.4 → 17.0.0-next.1
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/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 +2 -3
- package/dist/cjs/onchain/validation/bundles/checkDraw.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/checkSimulation.js +4 -11
- package/dist/cjs/onchain/validation/checks/checkDebtLimits.js +2 -3
- 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/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 +2 -3
- package/dist/esm/onchain/validation/bundles/checkDraw.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/checkSimulation.js +4 -11
- package/dist/esm/onchain/validation/checks/checkDebtLimits.js +2 -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 +4 -10
- package/dist/types/model/index.d.ts +3 -3
- package/dist/types/model/opportunities.d.ts +5 -4
- 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 +2 -2
- 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/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/checkRWAOpenRequirements.d.ts +2 -2
- package/dist/types/onchain/validation/bundles/checkRWAOpening.d.ts +3 -3
- package/dist/types/onchain/validation/checkSimulation.d.ts +3 -6
- package/dist/types/onchain/validation/checks/checkDebtLimits.d.ts +0 -4
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { iRWACompressorAbi } from "../../../abi/rwa/iRWACompressor.js";
|
|
2
|
-
import { RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs,
|
|
2
|
+
import { KycProtocol, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWA_FACTORY_SECURITIZE } from "../../../model/rwa.js";
|
|
3
3
|
import "../../../model/index.js";
|
|
4
4
|
import { IBaseContract, Unarray } from "../../base/types.js";
|
|
5
5
|
import { SecuritizeInvestorData, SecuritizeRWAFactoryStateHuman } from "./securitize/types.js";
|
|
@@ -19,15 +19,10 @@ import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
|
19
19
|
**/
|
|
20
20
|
interface RWAFactoryTypeMap {
|
|
21
21
|
[RWA_FACTORY_SECURITIZE]: {
|
|
22
|
-
protocol: "securitize";
|
|
23
22
|
investorData: SecuritizeInvestorData;
|
|
24
23
|
stateHuman: SecuritizeRWAFactoryStateHuman;
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* {@link RWAProtocol} of the factory type `T`.
|
|
29
|
-
**/
|
|
30
|
-
type RWAFactoryProtocol<T extends RWAFactoryType> = RWAFactoryTypeMap[T]["protocol"];
|
|
31
26
|
/**
|
|
32
27
|
* Investor data decoded from the RWA compressor, defaults to union of all factory types
|
|
33
28
|
* Can be discriminated by type
|
|
@@ -156,7 +151,26 @@ interface IRWAFactory<T extends RWAFactoryType = RWAFactoryType> extends IBaseCo
|
|
|
156
151
|
* @param args - factory-specific args (e.g. tokens to register, signatures to cache).
|
|
157
152
|
* Undefined value means that no RWA actions are required
|
|
158
153
|
**/
|
|
159
|
-
multicall(creditAccount: Address, calls: MultiCall[], args?: RWAOperationArgs<
|
|
154
|
+
multicall(creditAccount: Address, calls: MultiCall[], args?: RWAOperationArgs<T>): RawTx;
|
|
155
|
+
/**
|
|
156
|
+
* Checks if the user can open a credit account with this factory.
|
|
157
|
+
* @param investor - investor address
|
|
158
|
+
* @param props - {@link GetOpenAccountRequirementsProps}
|
|
159
|
+
* @returns open account requirements for the investor, or `undefined` if the
|
|
160
|
+
* user can open a credit account without any further actions
|
|
161
|
+
**/
|
|
162
|
+
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<RWAOpenAccountRequirements<T> | undefined>;
|
|
163
|
+
/**
|
|
164
|
+
* Computes the subset of `requirements` still unfulfilled, given the
|
|
165
|
+
* factory-specific params already carried by the transaction calldata.
|
|
166
|
+
*
|
|
167
|
+
* @param requirements - requirements fetched via {@link getOpenAccountRequirements}
|
|
168
|
+
* @param providedArgs - params decoded from the transaction calldata, if
|
|
169
|
+
* any; e.g. signatures already included there need not be signed again
|
|
170
|
+
* @returns the missing requirements, or `undefined` when everything is
|
|
171
|
+
* satisfied
|
|
172
|
+
**/
|
|
173
|
+
getMissingRequirements(requirements: RWAOpenAccountRequirements<T>, providedArgs?: RWAOperationArgs<T>): RWAMissingOpenAccountRequirements<T> | undefined;
|
|
160
174
|
/**
|
|
161
175
|
* Creates a raw transaction to open a credit account.
|
|
162
176
|
* Similar to {@link CreditFacadeV310Contract.openCreditAccount}.
|
|
@@ -166,41 +180,25 @@ interface IRWAFactory<T extends RWAFactoryType = RWAFactoryType> extends IBaseCo
|
|
|
166
180
|
* @param args - factory-specific args (e.g. tokens to register, signatures to cache).
|
|
167
181
|
* Undefined value means that no RWA actions are required (e.g. when we open second credit account)
|
|
168
182
|
**/
|
|
169
|
-
openCreditAccount(creditManager: Address, calls: MultiCall[], args?: RWAOperationArgs<
|
|
170
|
-
/**
|
|
171
|
-
* Degen NFT this factory deploys as the KYC gate. Midas has no factory;
|
|
172
|
-
* its NFT is loaded separately via {@link createDegenNFT}.
|
|
173
|
-
**/
|
|
174
|
-
readonly degenNFT: IDegenNFT<RWAFactoryProtocol<T>>;
|
|
183
|
+
openCreditAccount(creditManager: Address, calls: MultiCall[], args?: RWAOperationArgs<T>): RawTx;
|
|
175
184
|
}
|
|
176
185
|
/**
|
|
177
|
-
*
|
|
178
|
-
|
|
179
|
-
interface
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*/
|
|
190
|
-
getOpenAccountRequirements(wallet: Address, props: GetOpenAccountRequirementsProps): Promise<RWAOpenAccountRequirements<P>>;
|
|
191
|
-
/**
|
|
192
|
-
* Protocol-side KYC is done: registered at Securitize for every requested
|
|
193
|
-
* DS token, or greenlisted by Midas.
|
|
194
|
-
*
|
|
195
|
-
* User might still be required to do additional actions on Gearbox side,
|
|
196
|
-
* e.g. sign EIP-712 messages for Securitize
|
|
197
|
-
*/
|
|
198
|
-
isRegistered(requirements: RWAOpenAccountRequirements<P>): boolean;
|
|
186
|
+
* Result of {@link IDegenNFT.checkKyc}.
|
|
187
|
+
*/
|
|
188
|
+
interface KycCheckResult {
|
|
189
|
+
eligible: boolean;
|
|
190
|
+
/** Token the wallet must be registered for. */
|
|
191
|
+
token: Address;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Degen NFT that gates credit-account opening behind a KYC provider.
|
|
195
|
+
*/
|
|
196
|
+
interface IDegenNFT extends IBaseContract {
|
|
197
|
+
readonly protocol: KycProtocol;
|
|
199
198
|
/**
|
|
200
|
-
*
|
|
201
|
-
* Always `undefined` for Midas (no tx args).
|
|
199
|
+
* Same predicate the NFT's `burn` reverts on.
|
|
202
200
|
*/
|
|
203
|
-
|
|
201
|
+
checkKyc(wallet: Address, targetCollateral: Address): Promise<KycCheckResult>;
|
|
204
202
|
}
|
|
205
203
|
/**
|
|
206
204
|
* Narrows any contract to an {@link IRWAFactory}.
|
|
@@ -213,4 +211,4 @@ interface IDegenNFT<P extends RWAProtocol = RWAProtocol> extends IBaseContract {
|
|
|
213
211
|
**/
|
|
214
212
|
declare function isRWAFactory<T extends RWAFactoryType = RWAFactoryType>(contract: IBaseContract, type?: T): contract is IRWAFactory<T>;
|
|
215
213
|
//#endregion
|
|
216
|
-
export { GetInvestorOptions, GetOpenAccountRequirementsProps, IDegenNFT, IRWAFactory, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData,
|
|
214
|
+
export { GetInvestorOptions, GetOpenAccountRequirementsProps, IDegenNFT, IRWAFactory, KycCheckResult, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryStateHuman, RWAInvestorData, RWAState, RWAStateHuman, RWAUnderlyingData, isRWAFactory };
|
|
@@ -33,11 +33,7 @@ declare class MultichainOpportunitiesService<const Plugins extends PluginsMap =
|
|
|
33
33
|
*
|
|
34
34
|
* See {@link MultichainOpportunitiesService.getPool}.
|
|
35
35
|
**/
|
|
36
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
37
|
-
/**
|
|
38
|
-
* {@inheritDoc OpportunitiesService.isEligibleForStrategy}
|
|
39
|
-
**/
|
|
40
|
-
isEligibleForStrategy(key: StrategyOpportunityKey, wallet: Address): Promise<boolean>;
|
|
36
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
41
37
|
}
|
|
42
38
|
//#endregion
|
|
43
39
|
export { MultichainOpportunitiesService };
|
|
@@ -34,20 +34,13 @@ declare class OpportunitiesService extends SDKConstruct {
|
|
|
34
34
|
* A single strategy opportunity plus the rate curve of the pool it borrows
|
|
35
35
|
* from and the price feeds its liquidation price depends on.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* @param wallet - When given, `kyc` says whether this wallet must register
|
|
38
|
+
* with the strategy's KYC provider first; `null` otherwise.
|
|
38
39
|
*
|
|
39
40
|
* @throws If the credit manager is unknown, or does not currently offer a
|
|
40
41
|
* strategy.
|
|
41
42
|
**/
|
|
42
|
-
getStrategy(key: StrategyOpportunityKey): Promise<StrategyOpportunityDetail>;
|
|
43
|
-
/**
|
|
44
|
-
* Whether `wallet` may open this strategy today: `true` when it is not
|
|
45
|
-
* KYC-gated or the wallet already passed the gate.
|
|
46
|
-
*
|
|
47
|
-
* @throws If the credit manager is unknown, or does not currently offer a
|
|
48
|
-
* strategy.
|
|
49
|
-
**/
|
|
50
|
-
isEligibleForStrategy(key: StrategyOpportunityKey, wallet: Address): Promise<boolean>;
|
|
43
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<StrategyOpportunityDetail>;
|
|
51
44
|
}
|
|
52
45
|
//#endregion
|
|
53
46
|
export { OpportunitiesService };
|
|
@@ -22,12 +22,7 @@ interface IMultichainOpportunitiesService {
|
|
|
22
22
|
/**
|
|
23
23
|
* Detailed view of one strategy opportunity.
|
|
24
24
|
**/
|
|
25
|
-
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
26
|
-
/**
|
|
27
|
-
* Whether `wallet` may open this strategy today. Throws when that chain
|
|
28
|
-
* cannot answer.
|
|
29
|
-
**/
|
|
30
|
-
isEligibleForStrategy(key: StrategyOpportunityKey, wallet: Address): Promise<boolean>;
|
|
25
|
+
getStrategy(key: StrategyOpportunityKey, wallet?: Address): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
31
26
|
}
|
|
32
27
|
//#endregion
|
|
33
28
|
export { IMultichainOpportunitiesService };
|
|
@@ -10,10 +10,10 @@ interface CheckRWAOpenRequirementsInput {
|
|
|
10
10
|
wallet: Address;
|
|
11
11
|
creditManager: Address;
|
|
12
12
|
token: Address;
|
|
13
|
-
providedArgs
|
|
13
|
+
providedArgs: RWAOperationArgs;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The
|
|
16
|
+
* The RWA factory is satisfied that `wallet` may open on `token` with the
|
|
17
17
|
* registration args already on the transaction.
|
|
18
18
|
*/
|
|
19
19
|
declare function checkRWAOpenRequirements(input: CheckRWAOpenRequirementsInput): Promise<(RWAOpenRequirementsError | UnexpectedFailureError)[]>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { RWAOpenRequirementsError } from "../../../model/errors/operation-errors.js";
|
|
2
2
|
import { UnexpectedFailureError } from "../../../model/errors/prepare-errors.js";
|
|
3
|
-
import {
|
|
3
|
+
import { OpenRWAStrategyPositionPreview } from "../../../model/previews.js";
|
|
4
4
|
import "../../../model/index.js";
|
|
5
5
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
6
6
|
import { Address } from "viem";
|
|
7
7
|
//#region src/onchain/validation/bundles/checkRWAOpening.d.ts
|
|
8
8
|
interface CheckRWAOpeningInput {
|
|
9
9
|
sdk: OnchainSDK;
|
|
10
|
-
preview:
|
|
10
|
+
preview: OpenRWAStrategyPositionPreview;
|
|
11
11
|
sender: Address;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Per
|
|
14
|
+
* Per factory-gated token among `collateralAdded ∪ quotas`, whether the
|
|
15
15
|
* borrower still has to register or sign before this opening can land.
|
|
16
16
|
*/
|
|
17
17
|
declare function checkRWAOpening(input: CheckRWAOpeningInput): Promise<(RWAOpenRequirementsError | UnexpectedFailureError)[]>;
|
|
@@ -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
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Token } from "../../../model/primitives.js";
|
|
2
2
|
import { DebtOutOfRangeError } from "../../../model/errors/operation-errors.js";
|
|
3
3
|
import "../../../model/index.js";
|
|
4
|
-
import { MaxBorrowAmount } from "../../market/credit/types.js";
|
|
5
|
-
import "../../market/index.js";
|
|
6
4
|
//#region src/onchain/validation/checks/checkDebtLimits.d.ts
|
|
7
5
|
interface DebtLimitsArgs {
|
|
8
6
|
debt: bigint;
|
|
@@ -16,8 +14,6 @@ interface DebtLimitsArgs {
|
|
|
16
14
|
* rather than assumed.
|
|
17
15
|
*/
|
|
18
16
|
allowZero: boolean;
|
|
19
|
-
/** From the caller's suite; a caller that raises to throw advises nobody. */
|
|
20
|
-
maxBorrowAmount?: MaxBorrowAmount;
|
|
21
17
|
}
|
|
22
18
|
/** A debt the facade would revert on. */
|
|
23
19
|
declare function checkDebtLimits(args: DebtLimitsArgs): DebtOutOfRangeError[];
|
|
@@ -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.
|