@gearbox-protocol/sdk 15.1.0-next.12 → 15.1.0-next.13
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/new-sdk/index.js +3 -3
- package/dist/cjs/new-sdk/opportunities/OpportunitiesNamespace.js +8 -8
- package/dist/cjs/new-sdk/{simulate/SimulateApi.js → prepare/PrepareApi.js} +21 -49
- package/dist/cjs/new-sdk/prepare/index.js +4 -0
- package/dist/esm/common-utils/index.js +3 -3
- package/dist/esm/common-utils/utils/index.js +1 -1
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/new-sdk/index.js +3 -3
- package/dist/esm/new-sdk/opportunities/OpportunitiesNamespace.js +8 -8
- package/dist/esm/new-sdk/{simulate/SimulateApi.js → prepare/PrepareApi.js} +21 -49
- package/dist/esm/new-sdk/prepare/index.js +3 -0
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/plugins/apy/ApyPlugin.js +2 -2
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +3 -3
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/new-sdk/execute/ExecuteApi.d.ts +9 -9
- package/dist/types/new-sdk/index.d.ts +4 -4
- package/dist/types/new-sdk/opportunities/OpportunitiesNamespace.d.ts +4 -4
- package/dist/types/new-sdk/opportunities/types.d.ts +5 -5
- package/dist/types/new-sdk/{simulate/SimulateApi.d.ts → prepare/PrepareApi.d.ts} +19 -19
- package/dist/types/new-sdk/prepare/index.d.ts +3 -0
- package/dist/types/new-sdk/{simulate → prepare}/types.d.ts +35 -61
- package/dist/types/sdk/accounts/intents/testing/sdk-mock.d.ts +1 -1
- package/dist/types/sdk/accounts/intents/types.d.ts +12 -12
- package/package.json +1 -1
- package/dist/cjs/new-sdk/simulate/index.js +0 -4
- package/dist/esm/new-sdk/simulate/index.js +0 -3
- package/dist/types/new-sdk/simulate/index.d.ts +0 -3
- /package/dist/cjs/new-sdk/{simulate → prepare}/types.js +0 -0
- /package/dist/esm/new-sdk/{simulate → prepare}/types.js +0 -0
|
@@ -10,8 +10,8 @@ require("./errors/index.js");
|
|
|
10
10
|
const require_new_sdk_AbstractNamespace = require("./AbstractNamespace.js");
|
|
11
11
|
const require_new_sdk_execute_ExecuteApi = require("./execute/ExecuteApi.js");
|
|
12
12
|
require("./execute/index.js");
|
|
13
|
-
const
|
|
14
|
-
require("./
|
|
13
|
+
const require_new_sdk_prepare_PrepareApi = require("./prepare/PrepareApi.js");
|
|
14
|
+
require("./prepare/index.js");
|
|
15
15
|
const require_new_sdk_utils_filterResponse = require("./utils/filterResponse.js");
|
|
16
16
|
const require_new_sdk_utils_mergeChains = require("./utils/mergeChains.js");
|
|
17
17
|
require("./utils/index.js");
|
|
@@ -31,7 +31,7 @@ exports.MissingSourceError = require_new_sdk_errors_MissingSourceError.MissingSo
|
|
|
31
31
|
exports.NoSourceServedError = require_new_sdk_errors_NoSourceServedError.NoSourceServedError;
|
|
32
32
|
exports.OpportunitiesNamespace = require_new_sdk_opportunities_OpportunitiesNamespace.OpportunitiesNamespace;
|
|
33
33
|
exports.PositionsNamespace = require_new_sdk_positions_PositionsNamespace.PositionsNamespace;
|
|
34
|
-
exports.
|
|
34
|
+
exports.PrepareApi = require_new_sdk_prepare_PrepareApi.PrepareApi;
|
|
35
35
|
exports.SourceChainMismatchError = require_new_sdk_errors_SourceChainMismatchError.SourceChainMismatchError;
|
|
36
36
|
exports.SourceUnavailableError = require_new_sdk_errors_SourceUnavailableError.SourceUnavailableError;
|
|
37
37
|
exports.assertSameChains = require_new_sdk_errors_assertSameChains.assertSameChains;
|
|
@@ -6,8 +6,8 @@ require("../errors/index.js");
|
|
|
6
6
|
const require_new_sdk_AbstractNamespace = require("../AbstractNamespace.js");
|
|
7
7
|
const require_new_sdk_execute_ExecuteApi = require("../execute/ExecuteApi.js");
|
|
8
8
|
require("../execute/index.js");
|
|
9
|
-
const
|
|
10
|
-
require("../
|
|
9
|
+
const require_new_sdk_prepare_PrepareApi = require("../prepare/PrepareApi.js");
|
|
10
|
+
require("../prepare/index.js");
|
|
11
11
|
const require_new_sdk_utils_filterResponse = require("../utils/filterResponse.js");
|
|
12
12
|
const require_new_sdk_utils_mergeChains = require("../utils/mergeChains.js");
|
|
13
13
|
require("../utils/index.js");
|
|
@@ -25,19 +25,19 @@ var OpportunitiesNamespace = class extends require_new_sdk_AbstractNamespace.Abs
|
|
|
25
25
|
pool: (onchain, offchain) => require_new_sdk_utils_mergeChains.mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds),
|
|
26
26
|
strategy: (onchain, offchain) => require_new_sdk_utils_mergeChains.mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds)
|
|
27
27
|
};
|
|
28
|
-
#
|
|
28
|
+
#prepare;
|
|
29
29
|
#execute;
|
|
30
30
|
constructor(onchain, offchain, options) {
|
|
31
31
|
super("Opportunities", onchain?.opportunities, offchain?.opportunities, options);
|
|
32
|
-
this.#
|
|
32
|
+
this.#prepare = onchain && new require_new_sdk_prepare_PrepareApi.PrepareApi(onchain, options.ensureFresh);
|
|
33
33
|
this.#execute = onchain && new require_new_sdk_execute_ExecuteApi.ExecuteApi((chainId) => onchain.chain(chainId));
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* {@inheritDoc OpportunitiesOnchainOnly.
|
|
36
|
+
* {@inheritDoc OpportunitiesOnchainOnly.prepare}
|
|
37
37
|
**/
|
|
38
|
-
get
|
|
39
|
-
if (!this.#
|
|
40
|
-
return this.#
|
|
38
|
+
get prepare() {
|
|
39
|
+
if (!this.#prepare) throw new require_new_sdk_errors_SourceUnavailableError.SourceUnavailableError("Opportunities", "onchain");
|
|
40
|
+
return this.#prepare;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* {@inheritDoc OpportunitiesOnchainOnly.execute}
|
|
@@ -4,9 +4,9 @@ const require_sdk_base_MultichainConstruct = require("../../sdk/base/MultichainC
|
|
|
4
4
|
const require_sdk_accounts_intents_utils_credit_account_slice = require("../../sdk/accounts/intents/utils/credit-account-slice.js");
|
|
5
5
|
const require_sdk_accounts_intents_index = require("../../sdk/accounts/intents/index.js");
|
|
6
6
|
require("../../sdk/index.js");
|
|
7
|
-
//#region src/new-sdk/
|
|
7
|
+
//#region src/new-sdk/prepare/PrepareApi.ts
|
|
8
8
|
/**
|
|
9
|
-
* {@inheritDoc
|
|
9
|
+
* {@inheritDoc OpportunitiesPrepare}
|
|
10
10
|
*
|
|
11
11
|
* Holds no state of its own: it owns the mapping from the public,
|
|
12
12
|
* read-model-shaped request to the engine's intent, and nothing else. All
|
|
@@ -18,7 +18,7 @@ require("../../sdk/index.js");
|
|
|
18
18
|
* to, hence a chain the SDK does not cover, or one that fails the read, throws
|
|
19
19
|
* rather than answering with empty metadata.
|
|
20
20
|
**/
|
|
21
|
-
var
|
|
21
|
+
var PrepareApi = class extends require_sdk_base_MultichainConstruct.MultichainConstruct {
|
|
22
22
|
#ensureFresh;
|
|
23
23
|
constructor(sdk, ensureFresh) {
|
|
24
24
|
super(sdk);
|
|
@@ -29,22 +29,10 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
29
29
|
return super.queryChain(props);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* {@inheritDoc
|
|
32
|
+
* {@inheritDoc OpportunitiesPrepare.finalize}
|
|
33
33
|
**/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type: "WITHDRAW",
|
|
37
|
-
amount: params.amount,
|
|
38
|
-
to: params.to,
|
|
39
|
-
tokenOut: params.tokenOut,
|
|
40
|
-
sourceToken: params.sourceToken
|
|
41
|
-
}),
|
|
42
|
-
adjustLeverage: (position, params) => this.#startDelayedIntent(position, params, {
|
|
43
|
-
type: "ADJUST_LEVERAGE",
|
|
44
|
-
targetLeverage: params.targetLeverage,
|
|
45
|
-
token: params.token
|
|
46
|
-
}),
|
|
47
|
-
finish: (position, params) => this.queryChain({
|
|
34
|
+
async finalize(position, params) {
|
|
35
|
+
return this.queryChain({
|
|
48
36
|
network: position.chainId,
|
|
49
37
|
run: async (sdk) => {
|
|
50
38
|
const intent = resumable(params.intent ?? params.claimable.intent);
|
|
@@ -61,10 +49,10 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
61
49
|
quotaReserve: params.quotaReserve
|
|
62
50
|
});
|
|
63
51
|
}
|
|
64
|
-
})
|
|
65
|
-
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
66
54
|
/**
|
|
67
|
-
* {@inheritDoc
|
|
55
|
+
* {@inheritDoc OpportunitiesPrepare.deposit}
|
|
68
56
|
**/
|
|
69
57
|
deposit(pool, params) {
|
|
70
58
|
const { marketRegister, pools } = this.sdk.chain(pool.chainId);
|
|
@@ -98,7 +86,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
98
86
|
};
|
|
99
87
|
}
|
|
100
88
|
/**
|
|
101
|
-
* {@inheritDoc
|
|
89
|
+
* {@inheritDoc OpportunitiesPrepare.withdraw}
|
|
102
90
|
**/
|
|
103
91
|
withdraw(pool, params) {
|
|
104
92
|
const { pools } = this.sdk.chain(pool.chainId);
|
|
@@ -130,7 +118,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
130
118
|
};
|
|
131
119
|
}
|
|
132
120
|
/**
|
|
133
|
-
* {@inheritDoc
|
|
121
|
+
* {@inheritDoc OpportunitiesPrepare.redeem}
|
|
134
122
|
**/
|
|
135
123
|
redeem(pool, params) {
|
|
136
124
|
const { pools } = this.sdk.chain(pool.chainId);
|
|
@@ -162,7 +150,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
162
150
|
};
|
|
163
151
|
}
|
|
164
152
|
/**
|
|
165
|
-
* {@inheritDoc
|
|
153
|
+
* {@inheritDoc OpportunitiesPrepare.openNewStrategy}
|
|
166
154
|
**/
|
|
167
155
|
async openNewStrategy(strategy, params) {
|
|
168
156
|
return this.queryChain({
|
|
@@ -180,7 +168,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
180
168
|
});
|
|
181
169
|
}
|
|
182
170
|
/**
|
|
183
|
-
* {@inheritDoc
|
|
171
|
+
* {@inheritDoc OpportunitiesPrepare.depositStrategy}
|
|
184
172
|
**/
|
|
185
173
|
async depositStrategy(position, params) {
|
|
186
174
|
return this.#startIntent(position, params, {
|
|
@@ -193,7 +181,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
193
181
|
});
|
|
194
182
|
}
|
|
195
183
|
/**
|
|
196
|
-
* {@inheritDoc
|
|
184
|
+
* {@inheritDoc OpportunitiesPrepare.withdrawStrategy}
|
|
197
185
|
**/
|
|
198
186
|
async withdrawStrategy(position, params) {
|
|
199
187
|
return this.#startRoutes(position, params, {
|
|
@@ -205,7 +193,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
205
193
|
});
|
|
206
194
|
}
|
|
207
195
|
/**
|
|
208
|
-
* {@inheritDoc
|
|
196
|
+
* {@inheritDoc OpportunitiesPrepare.maxWithdraw}
|
|
209
197
|
**/
|
|
210
198
|
async maxWithdraw(position) {
|
|
211
199
|
return this.queryChain({
|
|
@@ -217,7 +205,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
217
205
|
});
|
|
218
206
|
}
|
|
219
207
|
/**
|
|
220
|
-
* {@inheritDoc
|
|
208
|
+
* {@inheritDoc OpportunitiesPrepare.repayStrategy}
|
|
221
209
|
**/
|
|
222
210
|
async repayStrategy(position, params) {
|
|
223
211
|
return this.#startIntent(position, params, {
|
|
@@ -228,7 +216,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
228
216
|
});
|
|
229
217
|
}
|
|
230
218
|
/**
|
|
231
|
-
* {@inheritDoc
|
|
219
|
+
* {@inheritDoc OpportunitiesPrepare.maxRepay}
|
|
232
220
|
**/
|
|
233
221
|
async maxRepay(position) {
|
|
234
222
|
return this.queryChain({
|
|
@@ -240,7 +228,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
240
228
|
});
|
|
241
229
|
}
|
|
242
230
|
/**
|
|
243
|
-
* {@inheritDoc
|
|
231
|
+
* {@inheritDoc OpportunitiesPrepare.adjustLeverage}
|
|
244
232
|
**/
|
|
245
233
|
async adjustLeverage(position, params) {
|
|
246
234
|
return this.#startRoutes(position, params, {
|
|
@@ -250,7 +238,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
250
238
|
});
|
|
251
239
|
}
|
|
252
240
|
/**
|
|
253
|
-
* {@inheritDoc
|
|
241
|
+
* {@inheritDoc OpportunitiesPrepare.addCollateral}
|
|
254
242
|
**/
|
|
255
243
|
async addCollateral(position, params) {
|
|
256
244
|
return this.#startIntent(position, params, {
|
|
@@ -261,7 +249,7 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
261
249
|
});
|
|
262
250
|
}
|
|
263
251
|
/**
|
|
264
|
-
* {@inheritDoc
|
|
252
|
+
* {@inheritDoc OpportunitiesPrepare.withdrawCollateral}
|
|
265
253
|
**/
|
|
266
254
|
async withdrawCollateral(position, params) {
|
|
267
255
|
return this.#startIntent(position, params, {
|
|
@@ -288,22 +276,6 @@ var SimulateApi = class extends require_sdk_base_MultichainConstruct.MultichainC
|
|
|
288
276
|
});
|
|
289
277
|
}
|
|
290
278
|
/**
|
|
291
|
-
* Shared path of the same two flows when only the delayed route is asked for:
|
|
292
|
-
* a planner that requests a redemption instead of swapping.
|
|
293
|
-
**/
|
|
294
|
-
async #startDelayedIntent(position, options, intent) {
|
|
295
|
-
return this.queryChain({
|
|
296
|
-
network: position.chainId,
|
|
297
|
-
run: async (sdk) => service(sdk).startDelayedIntent({
|
|
298
|
-
intent,
|
|
299
|
-
creditAccount: await slice(sdk, position.creditAccount),
|
|
300
|
-
sdk,
|
|
301
|
-
slippage: options.slippage,
|
|
302
|
-
quotaReserve: options.quotaReserve
|
|
303
|
-
})
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
279
|
* Shared path of the five flows that act on an existing account: read the
|
|
308
280
|
* account, then run the intent through the engine.
|
|
309
281
|
**/
|
|
@@ -358,4 +330,4 @@ function lpRoute(requested, routes) {
|
|
|
358
330
|
return options.length === 1 ? options[0] : void 0;
|
|
359
331
|
}
|
|
360
332
|
//#endregion
|
|
361
|
-
exports.
|
|
333
|
+
exports.PrepareApi = PrepareApi;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BigIntMath } from "../sdk/utils/bigint-math.js";
|
|
2
|
-
import { calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./utils/creditAccount/quota-utils.js";
|
|
3
|
-
import { EXECUTE_BYTES_SELECTOR, collectTraces, findCallTo, findCallWithInput, findExecuteBytes, resolveProtocolCall } from "./utils/trace.js";
|
|
4
1
|
import { AxiosCache } from "./axios-cache/AxiosCache.js";
|
|
5
2
|
import "./axios-cache/index.js";
|
|
3
|
+
import { BigIntMath } from "../sdk/utils/bigint-math.js";
|
|
4
|
+
import { calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./utils/creditAccount/quota-utils.js";
|
|
6
5
|
import { ChartsCreditManagerData } from "./charts/credit-manager.js";
|
|
7
6
|
import { CREDIT_SESSION_ID_BY_STATUS, CREDIT_SESSION_STATUS_BY_ID, CreditSession, CreditSessionFiltered, UserCreditSessionsBuilder } from "./charts/credit-session.js";
|
|
8
7
|
import { ChartsPoolData, UserPoolData } from "./charts/pool.js";
|
|
@@ -92,5 +91,6 @@ import { getCMYouCanEarn } from "./utils/strategies/strategy-info/get-cm-you-can
|
|
|
92
91
|
import { getStrategyInfoCore } from "./utils/strategies/strategy-info/get-strategy-info-core.js";
|
|
93
92
|
import { getStrategyInfo } from "./utils/strategies/strategy-info/get-strategy-info.js";
|
|
94
93
|
import { getStrategyYouCanEarn } from "./utils/strategies/strategy-info/get-strategy-you-can-earn.js";
|
|
94
|
+
import { EXECUTE_BYTES_SELECTOR, collectTraces, findCallTo, findCallWithInput, findExecuteBytes, resolveProtocolCall } from "./utils/trace.js";
|
|
95
95
|
import "./utils/index.js";
|
|
96
96
|
export { AssetUtils, AxiosCache, BONUS_APY_FROM_POINTS, BigIntMath, CREDIT_SESSION_ID_BY_STATUS, CREDIT_SESSION_STATUS_BY_ID, ChartsCreditManagerData, ChartsPoolData, CreditSession, CreditSessionFiltered, EMPTY_ADDRESS, EMPTY_ARRAY, EMPTY_OBJECT, EXECUTE_BYTES_SELECTOR, MIN_HF_LIMITED, PriceUtils, RST_ETH_ADDRESS, TokenData, UserCreditSessionsBuilder, UserPoolData, addAmountInTarget, amountAbcComparator, assetComparator, calcDefaultQuota, calcHealthFactor, calcMaxDebtIncrease, calcMaxLendingDebt, calcOverallAPY, calcQuotaBorrowRate, calcQuotaUpdate, calcRecommendedQuota, calcRelativeBaseBorrowRate, calculateBorrowRateFromUtilization, calculateEarnings, calculateEffectiveBorrowRate, calculateLossCoefficient, calculateMaxLeverageFactor, calculateMaxStrategyDebt, calculateSafeBorrowRate, calculateTotalAPY, calculateTotalPoints, checkBoolean, checkDegenNFT, cmAvailabilityCondition, collectTraces, createLegacyStrategyDataSource, findCallTo, findCallWithInput, findExecuteBytes, getAvailableAndDisabledStrategies, getCMAllowedCollaterals, getCMYouCanEarn, getChainPhantomTokens, getCollateralByDebt, getComplexAPYList, getComplexPointsList, getDefaultAsset, getFactorFromLeverage, getLeverageFromFactor, getListWithAmountInTarget, getNativeTokenAddress, getPointsInfo, getPointsRates, getRateWithFee, getRecommendedDebt, getRecommendedLeverageFactor, getReleasedStrategiesList, getReleasedStrategiesListCore, getSafeBaseBorrowRate, getSingleQuotaBorrowRate, getStrategyCreditManagers, getStrategyCreditManagersList, getStrategyCreditManagersListCore, getStrategyInfo, getStrategyInfoCore, getStrategyMaxAPY, getStrategyPoints, getStrategyYouCanEarn, getTimeToLiquidation, getWalletBalancesAllowedOnCM, isActivatedToken, isApyWithPointsException, isCollateralToken, isCreditManagerUsable, isForbiddenToken, isObtainableToken, isStrategyCMDisabled, isStrategyDisabled, isStrategyEligible, isStrategyReleased, isUsableToken, isValidExtraCollateralToken, isZeroBalance, liquidationPrice, maxAPYFormula, maxLeverage, maxLeverageThreshold, resolveProtocolCall, roundUpQuota, sortAssets, sortBalances, sortStrategyCMsByAvailability, tokensAbcComparator, validateBalance, validateBalances, validateCreditManager, validateHF, validateOpenAccount, validateOpenAccountPoolQuotaStatus, validateOpenAccountPoolStatus, validateQuota, validateTokenToObtain, wrapTokenAddress };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BigIntMath } from "../../sdk/utils/bigint-math.js";
|
|
2
2
|
import { calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./creditAccount/quota-utils.js";
|
|
3
|
-
import { EXECUTE_BYTES_SELECTOR, collectTraces, findCallTo, findCallWithInput, findExecuteBytes, resolveProtocolCall } from "./trace.js";
|
|
4
3
|
import { BONUS_APY_FROM_POINTS } from "./apy/bonus-apy-from-points.js";
|
|
5
4
|
import { calculateBorrowRateFromUtilization } from "./apy/calculate-borrow-rate-from-utilization.js";
|
|
6
5
|
import { PriceUtils } from "./price-math.js";
|
|
@@ -87,5 +86,6 @@ import { getStrategyInfoCore } from "./strategies/strategy-info/get-strategy-inf
|
|
|
87
86
|
import { getStrategyInfo } from "./strategies/strategy-info/get-strategy-info.js";
|
|
88
87
|
import { getStrategyYouCanEarn } from "./strategies/strategy-info/get-strategy-you-can-earn.js";
|
|
89
88
|
import "./strategies/index.js";
|
|
89
|
+
import { EXECUTE_BYTES_SELECTOR, collectTraces, findCallTo, findCallWithInput, findExecuteBytes, resolveProtocolCall } from "./trace.js";
|
|
90
90
|
import "./validation/index.js";
|
|
91
91
|
export { AssetUtils, BONUS_APY_FROM_POINTS, BigIntMath, EMPTY_ADDRESS, EMPTY_ARRAY, EMPTY_OBJECT, EXECUTE_BYTES_SELECTOR, MIN_HF_LIMITED, PriceUtils, RST_ETH_ADDRESS, addAmountInTarget, amountAbcComparator, assetComparator, calcDefaultQuota, calcHealthFactor, calcMaxDebtIncrease, calcMaxLendingDebt, calcOverallAPY, calcQuotaBorrowRate, calcQuotaUpdate, calcRecommendedQuota, calcRelativeBaseBorrowRate, calculateBorrowRateFromUtilization, calculateEarnings, calculateEffectiveBorrowRate, calculateLossCoefficient, calculateMaxLeverageFactor, calculateMaxStrategyDebt, calculateSafeBorrowRate, calculateTotalAPY, calculateTotalPoints, checkBoolean, checkDegenNFT, cmAvailabilityCondition, collectTraces, createLegacyStrategyDataSource, findCallTo, findCallWithInput, findExecuteBytes, getAvailableAndDisabledStrategies, getCMAllowedCollaterals, getCMYouCanEarn, getChainPhantomTokens, getCollateralByDebt, getComplexAPYList, getComplexPointsList, getDefaultAsset, getFactorFromLeverage, getLeverageFromFactor, getListWithAmountInTarget, getNativeTokenAddress, getPointsInfo, getPointsRates, getRateWithFee, getRecommendedDebt, getRecommendedLeverageFactor, getReleasedStrategiesList, getReleasedStrategiesListCore, getSafeBaseBorrowRate, getSingleQuotaBorrowRate, getStrategyCreditManagers, getStrategyCreditManagersList, getStrategyCreditManagersListCore, getStrategyInfo, getStrategyInfoCore, getStrategyMaxAPY, getStrategyPoints, getStrategyYouCanEarn, getTimeToLiquidation, getWalletBalancesAllowedOnCM, isActivatedToken, isApyWithPointsException, isCollateralToken, isCreditManagerUsable, isForbiddenToken, isObtainableToken, isStrategyCMDisabled, isStrategyDisabled, isStrategyEligible, isStrategyReleased, isUsableToken, isValidExtraCollateralToken, isZeroBalance, liquidationPrice, maxAPYFormula, maxLeverage, maxLeverageThreshold, resolveProtocolCall, roundUpQuota, sortAssets, sortBalances, sortStrategyCMsByAvailability, tokensAbcComparator, validateBalance, validateBalances, validateCreditManager, validateHF, validateOpenAccount, validateOpenAccountPoolQuotaStatus, validateOpenAccountPoolStatus, validateQuota, validateTokenToObtain, wrapTokenAddress };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ierc20Abi } from "../abi/iERC20.js";
|
|
2
1
|
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
3
2
|
import { AddressMap } from "../sdk/utils/AddressMap.js";
|
|
4
3
|
import { AddressSet } from "../sdk/utils/AddressSet.js";
|
|
5
4
|
import { AssetsMap } from "../sdk/utils/AssetsMap.js";
|
|
6
5
|
import { childLogger } from "../sdk/utils/childLogger.js";
|
|
6
|
+
import { ierc20Abi } from "../abi/iERC20.js";
|
|
7
7
|
import "../sdk/constants/addresses.js";
|
|
8
8
|
import { MAX_UINT256, PERCENTAGE_FACTOR } from "../sdk/constants/math.js";
|
|
9
9
|
import { SDKConstruct } from "../sdk/base/SDKConstruct.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
2
1
|
import { getNetworkType } from "../sdk/chain/chains.js";
|
|
3
2
|
import { getWithdrawalCompressorAddress } from "../sdk/accounts/withdrawal-compressor/addresses.js";
|
|
3
|
+
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import "../sdk/index.js";
|
|
5
5
|
import { iMidasDataFeedAbi, iMidasRedemptionVaultAbi, midasGatewayAbi, midasRedeemerAbi, midasRedemptionVaultPhantomTokenAbi, securitizeRedeemerAbi, securitizeRedemptionGatewayAbi, securitizeRedemptionPhantomTokenAbi } from "./withdrawalAbi.js";
|
|
6
6
|
import { erc20Abi, hexToString, parseAbi, parseEther } from "viem";
|
|
@@ -9,8 +9,8 @@ import "./errors/index.js";
|
|
|
9
9
|
import { AbstractNamespace } from "./AbstractNamespace.js";
|
|
10
10
|
import { ExecuteApi } from "./execute/ExecuteApi.js";
|
|
11
11
|
import "./execute/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import "./
|
|
12
|
+
import { PrepareApi } from "./prepare/PrepareApi.js";
|
|
13
|
+
import "./prepare/index.js";
|
|
14
14
|
import { filterResponse } from "./utils/filterResponse.js";
|
|
15
15
|
import { DEFAULT_MAX_OFFCHAIN_LAG, mergeChainList, mergeChainOne } from "./utils/mergeChains.js";
|
|
16
16
|
import "./utils/index.js";
|
|
@@ -20,4 +20,4 @@ import { PositionsNamespace } from "./positions/PositionsNamespace.js";
|
|
|
20
20
|
import "./positions/index.js";
|
|
21
21
|
import { DEFAULT_MAX_STATE_AGE, GearboxSDK } from "./GearboxSDK.js";
|
|
22
22
|
import "./types.js";
|
|
23
|
-
export { AbstractNamespace, AllSourcesFailedError, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE, ExecuteApi, GearboxSDK, MissingSourceError, NoSourceServedError, OpportunitiesNamespace, PositionsNamespace,
|
|
23
|
+
export { AbstractNamespace, AllSourcesFailedError, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE, ExecuteApi, GearboxSDK, MissingSourceError, NoSourceServedError, OpportunitiesNamespace, PositionsNamespace, PrepareApi, SourceChainMismatchError, SourceUnavailableError, assertSameChains, everyChainFailed, filterResponse, mergeChainList, mergeChainOne };
|
|
@@ -5,8 +5,8 @@ import "../errors/index.js";
|
|
|
5
5
|
import { AbstractNamespace } from "../AbstractNamespace.js";
|
|
6
6
|
import { ExecuteApi } from "../execute/ExecuteApi.js";
|
|
7
7
|
import "../execute/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
8
|
+
import { PrepareApi } from "../prepare/PrepareApi.js";
|
|
9
|
+
import "../prepare/index.js";
|
|
10
10
|
import { filterResponse } from "../utils/filterResponse.js";
|
|
11
11
|
import { mergeChainList, mergeChainOne } from "../utils/mergeChains.js";
|
|
12
12
|
import "../utils/index.js";
|
|
@@ -24,19 +24,19 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
|
|
|
24
24
|
pool: (onchain, offchain) => mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds),
|
|
25
25
|
strategy: (onchain, offchain) => mergeChainOne(onchain, offchain, this.maxOffchainLagSeconds)
|
|
26
26
|
};
|
|
27
|
-
#
|
|
27
|
+
#prepare;
|
|
28
28
|
#execute;
|
|
29
29
|
constructor(onchain, offchain, options) {
|
|
30
30
|
super("Opportunities", onchain?.opportunities, offchain?.opportunities, options);
|
|
31
|
-
this.#
|
|
31
|
+
this.#prepare = onchain && new PrepareApi(onchain, options.ensureFresh);
|
|
32
32
|
this.#execute = onchain && new ExecuteApi((chainId) => onchain.chain(chainId));
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* {@inheritDoc OpportunitiesOnchainOnly.
|
|
35
|
+
* {@inheritDoc OpportunitiesOnchainOnly.prepare}
|
|
36
36
|
**/
|
|
37
|
-
get
|
|
38
|
-
if (!this.#
|
|
39
|
-
return this.#
|
|
37
|
+
get prepare() {
|
|
38
|
+
if (!this.#prepare) throw new SourceUnavailableError("Opportunities", "onchain");
|
|
39
|
+
return this.#prepare;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* {@inheritDoc OpportunitiesOnchainOnly.execute}
|
|
@@ -3,9 +3,9 @@ import { MultichainConstruct } from "../../sdk/base/MultichainConstruct.js";
|
|
|
3
3
|
import { fetchCreditAccountSlice } from "../../sdk/accounts/intents/utils/credit-account-slice.js";
|
|
4
4
|
import { CreditAccountOperationsService } from "../../sdk/accounts/intents/index.js";
|
|
5
5
|
import "../../sdk/index.js";
|
|
6
|
-
//#region src/new-sdk/
|
|
6
|
+
//#region src/new-sdk/prepare/PrepareApi.ts
|
|
7
7
|
/**
|
|
8
|
-
* {@inheritDoc
|
|
8
|
+
* {@inheritDoc OpportunitiesPrepare}
|
|
9
9
|
*
|
|
10
10
|
* Holds no state of its own: it owns the mapping from the public,
|
|
11
11
|
* read-model-shaped request to the engine's intent, and nothing else. All
|
|
@@ -17,7 +17,7 @@ import "../../sdk/index.js";
|
|
|
17
17
|
* to, hence a chain the SDK does not cover, or one that fails the read, throws
|
|
18
18
|
* rather than answering with empty metadata.
|
|
19
19
|
**/
|
|
20
|
-
var
|
|
20
|
+
var PrepareApi = class extends MultichainConstruct {
|
|
21
21
|
#ensureFresh;
|
|
22
22
|
constructor(sdk, ensureFresh) {
|
|
23
23
|
super(sdk);
|
|
@@ -28,22 +28,10 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
28
28
|
return super.queryChain(props);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* {@inheritDoc
|
|
31
|
+
* {@inheritDoc OpportunitiesPrepare.finalize}
|
|
32
32
|
**/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type: "WITHDRAW",
|
|
36
|
-
amount: params.amount,
|
|
37
|
-
to: params.to,
|
|
38
|
-
tokenOut: params.tokenOut,
|
|
39
|
-
sourceToken: params.sourceToken
|
|
40
|
-
}),
|
|
41
|
-
adjustLeverage: (position, params) => this.#startDelayedIntent(position, params, {
|
|
42
|
-
type: "ADJUST_LEVERAGE",
|
|
43
|
-
targetLeverage: params.targetLeverage,
|
|
44
|
-
token: params.token
|
|
45
|
-
}),
|
|
46
|
-
finish: (position, params) => this.queryChain({
|
|
33
|
+
async finalize(position, params) {
|
|
34
|
+
return this.queryChain({
|
|
47
35
|
network: position.chainId,
|
|
48
36
|
run: async (sdk) => {
|
|
49
37
|
const intent = resumable(params.intent ?? params.claimable.intent);
|
|
@@ -60,10 +48,10 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
60
48
|
quotaReserve: params.quotaReserve
|
|
61
49
|
});
|
|
62
50
|
}
|
|
63
|
-
})
|
|
64
|
-
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
65
53
|
/**
|
|
66
|
-
* {@inheritDoc
|
|
54
|
+
* {@inheritDoc OpportunitiesPrepare.deposit}
|
|
67
55
|
**/
|
|
68
56
|
deposit(pool, params) {
|
|
69
57
|
const { marketRegister, pools } = this.sdk.chain(pool.chainId);
|
|
@@ -97,7 +85,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
97
85
|
};
|
|
98
86
|
}
|
|
99
87
|
/**
|
|
100
|
-
* {@inheritDoc
|
|
88
|
+
* {@inheritDoc OpportunitiesPrepare.withdraw}
|
|
101
89
|
**/
|
|
102
90
|
withdraw(pool, params) {
|
|
103
91
|
const { pools } = this.sdk.chain(pool.chainId);
|
|
@@ -129,7 +117,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
129
117
|
};
|
|
130
118
|
}
|
|
131
119
|
/**
|
|
132
|
-
* {@inheritDoc
|
|
120
|
+
* {@inheritDoc OpportunitiesPrepare.redeem}
|
|
133
121
|
**/
|
|
134
122
|
redeem(pool, params) {
|
|
135
123
|
const { pools } = this.sdk.chain(pool.chainId);
|
|
@@ -161,7 +149,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
161
149
|
};
|
|
162
150
|
}
|
|
163
151
|
/**
|
|
164
|
-
* {@inheritDoc
|
|
152
|
+
* {@inheritDoc OpportunitiesPrepare.openNewStrategy}
|
|
165
153
|
**/
|
|
166
154
|
async openNewStrategy(strategy, params) {
|
|
167
155
|
return this.queryChain({
|
|
@@ -179,7 +167,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
179
167
|
});
|
|
180
168
|
}
|
|
181
169
|
/**
|
|
182
|
-
* {@inheritDoc
|
|
170
|
+
* {@inheritDoc OpportunitiesPrepare.depositStrategy}
|
|
183
171
|
**/
|
|
184
172
|
async depositStrategy(position, params) {
|
|
185
173
|
return this.#startIntent(position, params, {
|
|
@@ -192,7 +180,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
192
180
|
});
|
|
193
181
|
}
|
|
194
182
|
/**
|
|
195
|
-
* {@inheritDoc
|
|
183
|
+
* {@inheritDoc OpportunitiesPrepare.withdrawStrategy}
|
|
196
184
|
**/
|
|
197
185
|
async withdrawStrategy(position, params) {
|
|
198
186
|
return this.#startRoutes(position, params, {
|
|
@@ -204,7 +192,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
204
192
|
});
|
|
205
193
|
}
|
|
206
194
|
/**
|
|
207
|
-
* {@inheritDoc
|
|
195
|
+
* {@inheritDoc OpportunitiesPrepare.maxWithdraw}
|
|
208
196
|
**/
|
|
209
197
|
async maxWithdraw(position) {
|
|
210
198
|
return this.queryChain({
|
|
@@ -216,7 +204,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
216
204
|
});
|
|
217
205
|
}
|
|
218
206
|
/**
|
|
219
|
-
* {@inheritDoc
|
|
207
|
+
* {@inheritDoc OpportunitiesPrepare.repayStrategy}
|
|
220
208
|
**/
|
|
221
209
|
async repayStrategy(position, params) {
|
|
222
210
|
return this.#startIntent(position, params, {
|
|
@@ -227,7 +215,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
227
215
|
});
|
|
228
216
|
}
|
|
229
217
|
/**
|
|
230
|
-
* {@inheritDoc
|
|
218
|
+
* {@inheritDoc OpportunitiesPrepare.maxRepay}
|
|
231
219
|
**/
|
|
232
220
|
async maxRepay(position) {
|
|
233
221
|
return this.queryChain({
|
|
@@ -239,7 +227,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
239
227
|
});
|
|
240
228
|
}
|
|
241
229
|
/**
|
|
242
|
-
* {@inheritDoc
|
|
230
|
+
* {@inheritDoc OpportunitiesPrepare.adjustLeverage}
|
|
243
231
|
**/
|
|
244
232
|
async adjustLeverage(position, params) {
|
|
245
233
|
return this.#startRoutes(position, params, {
|
|
@@ -249,7 +237,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
249
237
|
});
|
|
250
238
|
}
|
|
251
239
|
/**
|
|
252
|
-
* {@inheritDoc
|
|
240
|
+
* {@inheritDoc OpportunitiesPrepare.addCollateral}
|
|
253
241
|
**/
|
|
254
242
|
async addCollateral(position, params) {
|
|
255
243
|
return this.#startIntent(position, params, {
|
|
@@ -260,7 +248,7 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
260
248
|
});
|
|
261
249
|
}
|
|
262
250
|
/**
|
|
263
|
-
* {@inheritDoc
|
|
251
|
+
* {@inheritDoc OpportunitiesPrepare.withdrawCollateral}
|
|
264
252
|
**/
|
|
265
253
|
async withdrawCollateral(position, params) {
|
|
266
254
|
return this.#startIntent(position, params, {
|
|
@@ -287,22 +275,6 @@ var SimulateApi = class extends MultichainConstruct {
|
|
|
287
275
|
});
|
|
288
276
|
}
|
|
289
277
|
/**
|
|
290
|
-
* Shared path of the same two flows when only the delayed route is asked for:
|
|
291
|
-
* a planner that requests a redemption instead of swapping.
|
|
292
|
-
**/
|
|
293
|
-
async #startDelayedIntent(position, options, intent) {
|
|
294
|
-
return this.queryChain({
|
|
295
|
-
network: position.chainId,
|
|
296
|
-
run: async (sdk) => service(sdk).startDelayedIntent({
|
|
297
|
-
intent,
|
|
298
|
-
creditAccount: await slice(sdk, position.creditAccount),
|
|
299
|
-
sdk,
|
|
300
|
-
slippage: options.slippage,
|
|
301
|
-
quotaReserve: options.quotaReserve
|
|
302
|
-
})
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
278
|
* Shared path of the five flows that act on an existing account: read the
|
|
307
279
|
* account, then run the intent through the engine.
|
|
308
280
|
**/
|
|
@@ -357,4 +329,4 @@ function lpRoute(requested, routes) {
|
|
|
357
329
|
return options.length === 1 ? options[0] : void 0;
|
|
358
330
|
}
|
|
359
331
|
//#endregion
|
|
360
|
-
export {
|
|
332
|
+
export { PrepareApi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ierc4626AdapterAbi } from "../../../abi/ierc4626Adapter.js";
|
|
2
1
|
import { MissingSerializedParamsError } from "../../../sdk/base/errors.js";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../../abi/ierc4626Adapter.js";
|
|
3
3
|
import "../../../sdk/index.js";
|
|
4
4
|
import { fnSigToName, swapFromTransfers } from "../transferHelpers.js";
|
|
5
5
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AxiosCache } from "../../common-utils/axios-cache/AxiosCache.js";
|
|
2
|
+
import "../../common-utils/axios-cache/index.js";
|
|
1
3
|
import { AddressMap } from "../../sdk/utils/AddressMap.js";
|
|
2
4
|
import { AP_MARKET_COMPRESSOR } from "../../sdk/constants/address-provider.js";
|
|
3
5
|
import { PERCENTAGE_DECIMALS } from "../../sdk/constants/math.js";
|
|
@@ -8,8 +10,6 @@ import { hexEq } from "../../sdk/utils/hex.js";
|
|
|
8
10
|
import { marketCompressorAbi } from "../../abi/compressors/marketCompressor.js";
|
|
9
11
|
import { BasePlugin } from "../../sdk/plugins/BasePlugin.js";
|
|
10
12
|
import "../../sdk/index.js";
|
|
11
|
-
import { AxiosCache } from "../../common-utils/axios-cache/AxiosCache.js";
|
|
12
|
-
import "../../common-utils/axios-cache/index.js";
|
|
13
13
|
import { getStrategyCreditManagersListCore } from "../../common-utils/utils/strategies/credit-managers/get-strategy-credit-managers-list-core.js";
|
|
14
14
|
import { getAvailableAndDisabledStrategies } from "../../common-utils/utils/strategies/lists/get-available-and-disabled-strategies.js";
|
|
15
15
|
import { getReleasedStrategiesListCore } from "../../common-utils/utils/strategies/lists/get-released-strategies-list-core.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
2
1
|
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
2
|
+
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
3
3
|
import { asPreviewSimulationError } from "./errors.js";
|
|
4
4
|
//#region src/preview/simulate/simulatePoolOperation.ts
|
|
5
5
|
function previewRead(operation) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
1
|
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
3
2
|
import { AddressMap } from "../../sdk/utils/AddressMap.js";
|
|
3
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
4
4
|
import "../../sdk/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|
|
6
6
|
import { getAddress, isAddressEqual, parseEventLogs } from "viem";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
2
|
-
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
3
1
|
import { AP_REWARDS_COMPRESSOR } from "../constants/address-provider.js";
|
|
4
2
|
import { ADDRESS_0X0 } from "../constants/addresses.js";
|
|
5
3
|
import { MAX_UINT256 } from "../constants/math.js";
|
|
@@ -10,6 +8,8 @@ import "../base/index.js";
|
|
|
10
8
|
import { AccountBotsService } from "./bots/AccountBotsService.js";
|
|
11
9
|
import "./bots/index.js";
|
|
12
10
|
import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
|
|
11
|
+
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
12
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
13
13
|
import { expectedBalanceDeltas } from "../market/credit/expectedBalanceDeltas.js";
|
|
14
14
|
import "../market/index.js";
|
|
15
15
|
import { CreditAccountCompressor } from "./credit-account-compressor/CreditAccountCompressor.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
2
1
|
import { AddressSet } from "../../utils/AddressSet.js";
|
|
3
2
|
import { bytes32ToString } from "../../utils/bytes32ToString.js";
|
|
4
3
|
import { ADDRESS_0X0 } from "../../constants/addresses.js";
|
|
@@ -20,6 +19,7 @@ import { SecuritizeLiquidatorContract } from "../../market/rwa/securitize/Securi
|
|
|
20
19
|
import "../../market/rwa/securitize/index.js";
|
|
21
20
|
import "../../market/index.js";
|
|
22
21
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
22
|
+
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
23
23
|
//#region src/sdk/accounts/liquidations/LiquidationsService.ts
|
|
24
24
|
/**
|
|
25
25
|
* Service for discovering liquidatable credit accounts and previewing manual
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
2
1
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
3
2
|
import "../../base/index.js";
|
|
4
3
|
import { decodeDelayedIntent } from "./intent-codec.js";
|
|
4
|
+
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
5
5
|
import { InvalidDelayedIntentError } from "./errors.js";
|
|
6
6
|
//#region src/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.ts
|
|
7
7
|
const abi = iRedemptionLoggerV310Abi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iWithdrawalCompressorV310Abi } from "../../../abi/IWithdrawalCompressorV310.js";
|
|
2
1
|
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
|
+
import { iWithdrawalCompressorV310Abi } from "../../../abi/IWithdrawalCompressorV310.js";
|
|
3
3
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV310Abi;
|
|
5
5
|
/**
|