@kamino-finance/klend-sdk 5.13.0 → 5.13.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/classes/action.d.ts +74 -49
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +167 -115
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/fraction.d.ts +2 -0
- package/dist/classes/fraction.d.ts.map +1 -1
- package/dist/classes/fraction.js +6 -0
- package/dist/classes/fraction.js.map +1 -1
- package/dist/classes/index.d.ts +3 -2
- package/dist/classes/index.d.ts.map +1 -1
- package/dist/classes/index.js +3 -2
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/manager.d.ts +7 -7
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +46 -46
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +1 -6
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/obligationOrder.d.ts +1 -1
- package/dist/classes/obligationOrder.d.ts.map +1 -1
- package/dist/classes/reserve.d.ts +2 -2
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +71 -74
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/shared.d.ts +13 -0
- package/dist/classes/shared.d.ts.map +1 -1
- package/dist/classes/utils.d.ts +1 -9
- package/dist/classes/utils.d.ts.map +1 -1
- package/dist/classes/utils.js +4 -51
- package/dist/classes/utils.js.map +1 -1
- package/dist/classes/vault.d.ts +5 -3
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +53 -41
- package/dist/classes/vault.js.map +1 -1
- package/dist/classes/{types.d.ts → vault_types.d.ts} +2 -15
- package/dist/classes/vault_types.d.ts.map +1 -0
- package/dist/classes/{types.js → vault_types.js} +1 -1
- package/dist/classes/vault_types.js.map +1 -0
- package/dist/client_kamino_manager.d.ts.map +1 -1
- package/dist/client_kamino_manager.js +25 -26
- package/dist/client_kamino_manager.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +8 -8
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.d.ts +6 -6
- package/dist/lending_operations/swap_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.js +63 -65
- package/dist/lending_operations/swap_collateral_operations.js.map +1 -1
- package/dist/leverage/calcs.d.ts +0 -1
- package/dist/leverage/calcs.d.ts.map +1 -1
- package/dist/leverage/calcs.js +5 -8
- package/dist/leverage/calcs.js.map +1 -1
- package/dist/leverage/operations.d.ts +5 -5
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js +80 -87
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +1 -1
- package/dist/leverage/types.d.ts.map +1 -1
- package/dist/leverage/utils.d.ts +2 -2
- package/dist/leverage/utils.d.ts.map +1 -1
- package/dist/leverage/utils.js +5 -5
- package/dist/leverage/utils.js.map +1 -1
- package/dist/referrals/instructions.d.ts +3 -3
- package/dist/referrals/instructions.d.ts.map +1 -1
- package/dist/referrals/instructions.js +10 -10
- package/dist/referrals/instructions.js.map +1 -1
- package/dist/referrals/operations.js +6 -6
- package/dist/referrals/operations.js.map +1 -1
- package/dist/utils/ata.d.ts +3 -3
- package/dist/utils/ata.d.ts.map +1 -1
- package/dist/utils/ata.js +22 -22
- package/dist/utils/ata.js.map +1 -1
- package/dist/utils/instruction.d.ts +2 -2
- package/dist/utils/instruction.d.ts.map +1 -1
- package/dist/utils/instruction.js +12 -12
- package/dist/utils/instruction.js.map +1 -1
- package/dist/utils/lookupTable.js +6 -6
- package/dist/utils/lookupTable.js.map +1 -1
- package/dist/utils/userMetadata.d.ts +1 -1
- package/dist/utils/userMetadata.d.ts.map +1 -1
- package/dist/utils/userMetadata.js +3 -3
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/action.ts +198 -150
- package/src/classes/fraction.ts +7 -0
- package/src/classes/index.ts +5 -2
- package/src/classes/manager.ts +54 -51
- package/src/classes/obligation.ts +2 -7
- package/src/classes/obligationOrder.ts +1 -1
- package/src/classes/reserve.ts +128 -137
- package/src/classes/shared.ts +15 -0
- package/src/classes/utils.ts +3 -52
- package/src/classes/vault.ts +56 -42
- package/src/classes/{types.ts → vault_types.ts} +1 -16
- package/src/client.ts +16 -16
- package/src/client_kamino_manager.ts +25 -25
- package/src/lending_operations/repay_with_collateral_operations.ts +13 -15
- package/src/lending_operations/swap_collateral_operations.ts +87 -89
- package/src/leverage/calcs.ts +2 -6
- package/src/leverage/operations.ts +91 -97
- package/src/leverage/types.ts +1 -1
- package/src/leverage/utils.ts +5 -5
- package/src/referrals/instructions.ts +6 -6
- package/src/referrals/operations.ts +9 -9
- package/src/utils/ata.ts +18 -18
- package/src/utils/instruction.ts +10 -10
- package/src/utils/lookupTable.ts +6 -6
- package/src/utils/userMetadata.ts +1 -1
- package/dist/classes/types.d.ts.map +0 -1
- package/dist/classes/types.js.map +0 -1
- package/dist/classes/types_utils.d.ts +0 -14
- package/dist/classes/types_utils.d.ts.map +0 -1
- package/dist/classes/types_utils.js +0 -50
- package/dist/classes/types_utils.js.map +0 -1
- package/src/classes/types_utils.ts +0 -49
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getScopeRefreshIx = void 0;
|
|
7
7
|
exports.getDepositWithLeverageSwapInputs = getDepositWithLeverageSwapInputs;
|
|
8
|
-
exports.
|
|
8
|
+
exports.getDepositWithLeverageIxs = getDepositWithLeverageIxs;
|
|
9
9
|
exports.getWithdrawWithLeverageSwapInputs = getWithdrawWithLeverageSwapInputs;
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
10
|
+
exports.getWithdrawWithLeverageIxs = getWithdrawWithLeverageIxs;
|
|
11
|
+
exports.buildWithdrawWithLeverageIxs = buildWithdrawWithLeverageIxs;
|
|
12
12
|
exports.getAdjustLeverageSwapInputs = getAdjustLeverageSwapInputs;
|
|
13
|
-
exports.
|
|
13
|
+
exports.getAdjustLeverageIxs = getAdjustLeverageIxs;
|
|
14
14
|
const web3_js_1 = require("@solana/web3.js");
|
|
15
15
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
16
16
|
const classes_1 = require("../classes");
|
|
@@ -31,7 +31,7 @@ async function getDepositWithLeverageSwapInputs({ owner, kaminoMarket, debtToken
|
|
|
31
31
|
const collIsKtoken = await isKtoken(collTokenMint);
|
|
32
32
|
const strategy = collIsKtoken ? (await kamino.getStrategyByKTokenMint(collTokenMint)) : undefined;
|
|
33
33
|
const calcs = await getDepositWithLeverageCalcs(depositAmount, selectedTokenIsCollToken, collIsKtoken, depositTokenIsSol, priceDebtToColl, targetLeverage, slippagePct, flashLoanFee, kamino, strategy, debtTokenMint, priceAinB, debtReserve);
|
|
34
|
-
console.log('Ops Calcs', (0,
|
|
34
|
+
console.log('Ops Calcs', (0, classes_1.toJson)(calcs));
|
|
35
35
|
let obligationType;
|
|
36
36
|
if (obligationTypeTagOverride === utils_1.ObligationTypeTag.Multiply) {
|
|
37
37
|
// multiply
|
|
@@ -45,7 +45,7 @@ async function getDepositWithLeverageSwapInputs({ owner, kaminoMarket, debtToken
|
|
|
45
45
|
throw Error('Obligation type tag not supported for leverage, please use 1 - multiply or 3 - leverage');
|
|
46
46
|
}
|
|
47
47
|
// Build the repay & withdraw collateral tx to get the number of accounts
|
|
48
|
-
const klendIxs = await
|
|
48
|
+
const klendIxs = await buildDepositWithLeverageIxs(kaminoMarket, debtReserve, collReserve, owner, obligation ? obligation : obligationType, referrer, currentSlot, depositTokenIsSol, scopeRefreshConfig, calcs, budgetAndPriorityFeeIxs, {
|
|
49
49
|
preActionIxs: [],
|
|
50
50
|
swapIxs: [],
|
|
51
51
|
lookupTables: [],
|
|
@@ -124,7 +124,7 @@ async function getDepositWithLeverageCalcs(depositAmount, selectedTokenIsCollTok
|
|
|
124
124
|
}
|
|
125
125
|
return calcs;
|
|
126
126
|
}
|
|
127
|
-
async function
|
|
127
|
+
async function getDepositWithLeverageIxs({ owner, kaminoMarket, debtTokenMint, collTokenMint, depositAmount, priceDebtToColl, slippagePct, obligation, referrer, currentSlot, targetLeverage, selectedTokenMint, kamino, obligationTypeTagOverride, scopeRefreshConfig, budgetAndPriorityFeeIxs, quoteBufferBps, priceAinB, isKtoken, quoter, swapper, elevationGroupOverride, useV2Ixs, }) {
|
|
128
128
|
const { swapInputs, initialInputs } = await getDepositWithLeverageSwapInputs({
|
|
129
129
|
owner,
|
|
130
130
|
kaminoMarket,
|
|
@@ -172,7 +172,7 @@ async function getDepositWithLeverageIxns({ owner, kaminoMarket, debtTokenMint,
|
|
|
172
172
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
173
173
|
const solTokenReserve = kaminoMarket.getReserveByMint(spl_token_1.NATIVE_MINT);
|
|
174
174
|
const depositTokenIsSol = !solTokenReserve ? false : selectedTokenMint.equals(solTokenReserve.getLiquidityMint());
|
|
175
|
-
const ixs = await
|
|
175
|
+
const ixs = await buildDepositWithLeverageIxs(kaminoMarket, debtReserve, collReserve, owner, initialInputs.obligation, referrer, currentSlot, depositTokenIsSol, scopeRefreshConfig, initialInputs.calcs, budgetAndPriorityFeeIxs, {
|
|
176
176
|
preActionIxs: [],
|
|
177
177
|
swapIxs: swapIxs,
|
|
178
178
|
lookupTables: lookupTables,
|
|
@@ -185,13 +185,13 @@ async function getDepositWithLeverageIxns({ owner, kaminoMarket, debtTokenMint,
|
|
|
185
185
|
initialInputs,
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
189
|
-
const
|
|
188
|
+
async function buildDepositWithLeverageIxs(market, debtReserve, collReserve, owner, obligation, referrer, currentSlot, depositTokenIsSol, scopeRefreshConfig, calcs, budgetAndPriorityFeeIxs, swapQuoteIxs, strategy, collIsKtoken, useV2Ixs, elevationGroupOverride) {
|
|
189
|
+
const budgetIxs = budgetAndPriorityFeeIxs || (0, utils_1.getComputeBudgetAndPriorityFeeIxs)(3000000);
|
|
190
190
|
const collTokenMint = collReserve.getLiquidityMint();
|
|
191
191
|
const debtTokenMint = debtReserve.getLiquidityMint();
|
|
192
192
|
const collTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(collTokenMint, owner, false, collReserve.getLiquidityTokenProgram());
|
|
193
193
|
const debtTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(debtTokenMint, owner, false, debtReserve.getLiquidityTokenProgram());
|
|
194
|
-
// 1. Create atas & budget
|
|
194
|
+
// 1. Create atas & budget ixs
|
|
195
195
|
let mintsToCreateAtas;
|
|
196
196
|
if (collIsKtoken) {
|
|
197
197
|
const secondTokenAta = strategy.strategy.tokenAMint.equals(debtTokenMint)
|
|
@@ -239,16 +239,16 @@ async function buildDepositWithLeverageIxns(market, debtReserve, collReserve, ow
|
|
|
239
239
|
},
|
|
240
240
|
];
|
|
241
241
|
}
|
|
242
|
-
const
|
|
243
|
-
const
|
|
242
|
+
const atasAndCreateIxs = (0, utils_1.createAtasIdempotent)(owner, mintsToCreateAtas);
|
|
243
|
+
const fillWsolAtaIxs = [];
|
|
244
244
|
if (depositTokenIsSol) {
|
|
245
|
-
|
|
245
|
+
fillWsolAtaIxs.push(...(0, utils_1.getTransferWsolIxs)(owner, (0, spl_token_1.getAssociatedTokenAddressSync)(spl_token_1.NATIVE_MINT, owner), (0, classes_2.numberToLamportsDecimal)(calcs.initDepositInSol, utils_1.SOL_DECIMALS).ceil()));
|
|
246
246
|
}
|
|
247
247
|
const scopeRefreshIxn = await (0, exports.getScopeRefreshIx)(market, collReserve, debtReserve, obligation, scopeRefreshConfig);
|
|
248
248
|
// 2. Flash borrow & repay the collateral amount needed for given leverage
|
|
249
249
|
// if user deposits coll, then we borrow the diff, else we borrow the entire amount
|
|
250
250
|
const { flashBorrowIxn, flashRepayIxn } = (0, instructions_1.getFlashLoanInstructions)({
|
|
251
|
-
borrowIxnIndex:
|
|
251
|
+
borrowIxnIndex: budgetIxs.length + atasAndCreateIxs.length + fillWsolAtaIxs.length + (scopeRefreshIxn.length > 0 ? 1 : 0),
|
|
252
252
|
walletPublicKey: owner,
|
|
253
253
|
lendingMarketAuthority: market.getLendingMarketAuthority(),
|
|
254
254
|
lendingMarketAddress: market.getAddress(),
|
|
@@ -266,12 +266,11 @@ async function buildDepositWithLeverageIxns(market, debtReserve, collReserve, ow
|
|
|
266
266
|
.toString(), collTokenMint, (0, classes_2.numberToLamportsDecimal)(!collIsKtoken ? calcs.debtTokenToBorrow : calcs.debtTokenToBorrow, debtReserve.stats.decimals)
|
|
267
267
|
.ceil()
|
|
268
268
|
.toString(), debtTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, elevationGroupOverride === 0 ? false : true, // emode
|
|
269
|
-
|
|
270
|
-
false, // to be checked and created in a setup tx in the UI
|
|
269
|
+
{ skipInitialization: true, skipLutCreation: true }, // to be checked and created in a setup tx in the UI
|
|
271
270
|
referrer, currentSlot);
|
|
272
271
|
// 4. Swap
|
|
273
272
|
const { swapIxs } = swapQuoteIxs;
|
|
274
|
-
const swapInstructions = (0, utils_1.
|
|
273
|
+
const swapInstructions = (0, utils_1.removeBudgetAndAtaIxs)(swapIxs, []);
|
|
275
274
|
const flashBorrowReserve = !collIsKtoken ? collReserve : debtReserve;
|
|
276
275
|
const flashLoanInfo = {
|
|
277
276
|
flashBorrowReserve: flashBorrowReserve.address,
|
|
@@ -282,9 +281,9 @@ async function buildDepositWithLeverageIxns(market, debtReserve, collReserve, ow
|
|
|
282
281
|
flashLoanInfo,
|
|
283
282
|
instructions: [
|
|
284
283
|
...scopeRefreshIxn,
|
|
285
|
-
...
|
|
286
|
-
...
|
|
287
|
-
...
|
|
284
|
+
...budgetIxs,
|
|
285
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
286
|
+
...fillWsolAtaIxs,
|
|
288
287
|
...[flashBorrowIxn],
|
|
289
288
|
...classes_1.KaminoAction.actionToIxs(kaminoDepositAndBorrowAction),
|
|
290
289
|
...swapInstructions,
|
|
@@ -297,9 +296,9 @@ async function buildDepositWithLeverageIxns(market, debtReserve, collReserve, ow
|
|
|
297
296
|
flashLoanInfo,
|
|
298
297
|
instructions: [
|
|
299
298
|
...scopeRefreshIxn,
|
|
300
|
-
...
|
|
301
|
-
...
|
|
302
|
-
...
|
|
299
|
+
...budgetIxs,
|
|
300
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
301
|
+
...fillWsolAtaIxs,
|
|
303
302
|
...[flashBorrowIxn],
|
|
304
303
|
...swapInstructions,
|
|
305
304
|
...kaminoDepositAndBorrowAction.setupIxs,
|
|
@@ -320,7 +319,7 @@ async function getWithdrawWithLeverageSwapInputs({ owner, kaminoMarket, debtToke
|
|
|
320
319
|
const solTokenReserve = kaminoMarket.getReserveByMint(spl_token_1.NATIVE_MINT);
|
|
321
320
|
const depositTokenIsSol = !solTokenReserve ? false : selectedTokenMint.equals(solTokenReserve.getLiquidityMint());
|
|
322
321
|
const calcs = (0, calcs_1.withdrawLeverageCalcs)(kaminoMarket, collReserve, debtReserve, priceCollToDebt, withdrawAmount, deposited, borrowed, currentSlot, isClosingPosition, selectedTokenIsCollToken, selectedTokenMint, obligation, flashLoanFee, slippagePct);
|
|
323
|
-
const klendIxs = await
|
|
322
|
+
const klendIxs = await buildWithdrawWithLeverageIxs(kaminoMarket, debtReserve, collReserve, owner, obligation, referrer, currentSlot, isClosingPosition, depositTokenIsSol, scopeRefreshConfig, calcs, budgetAndPriorityFeeIxs, {
|
|
324
323
|
preActionIxs: [],
|
|
325
324
|
swapIxs: [],
|
|
326
325
|
lookupTables: [],
|
|
@@ -356,7 +355,7 @@ async function getWithdrawWithLeverageSwapInputs({ owner, kaminoMarket, debtToke
|
|
|
356
355
|
},
|
|
357
356
|
};
|
|
358
357
|
}
|
|
359
|
-
async function
|
|
358
|
+
async function getWithdrawWithLeverageIxs({ owner, kaminoMarket, debtTokenMint, collTokenMint, obligation, deposited, borrowed, referrer, currentSlot, withdrawAmount, priceCollToDebt, slippagePct, isClosingPosition, selectedTokenMint, budgetAndPriorityFeeIxs, kamino, scopeRefreshConfig, quoteBufferBps, isKtoken, quoter, swapper, useV2Ixs, }) {
|
|
360
359
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
361
360
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
362
361
|
const solTokenReserve = kaminoMarket.getReserveByMint(spl_token_1.NATIVE_MINT);
|
|
@@ -404,12 +403,12 @@ async function getWithdrawWithLeverageIxns({ owner, kaminoMarket, debtTokenMint,
|
|
|
404
403
|
console.log('Strategy lookup table not found');
|
|
405
404
|
}
|
|
406
405
|
}
|
|
407
|
-
const ixs = await
|
|
406
|
+
const ixs = await buildWithdrawWithLeverageIxs(kaminoMarket, debtReserve, collReserve, owner, obligation, referrer, currentSlot, isClosingPosition, depositTokenIsSol, scopeRefreshConfig, initialInputs.calcs, budgetAndPriorityFeeIxs, {
|
|
408
407
|
preActionIxs: [],
|
|
409
408
|
swapIxs,
|
|
410
409
|
lookupTables,
|
|
411
410
|
}, initialInputs.strategy, initialInputs.collIsKtoken, useV2Ixs);
|
|
412
|
-
// Send
|
|
411
|
+
// Send ixs and lookup tables
|
|
413
412
|
return {
|
|
414
413
|
ixs: ixs.instructions,
|
|
415
414
|
flashLoanInfo: ixs.flashLoanInfo,
|
|
@@ -418,7 +417,7 @@ async function getWithdrawWithLeverageIxns({ owner, kaminoMarket, debtTokenMint,
|
|
|
418
417
|
initialInputs: initialInputs,
|
|
419
418
|
};
|
|
420
419
|
}
|
|
421
|
-
async function
|
|
420
|
+
async function buildWithdrawWithLeverageIxs(market, debtReserve, collReserve, owner, obligation, referrer, currentSlot, isClosingPosition, depositTokenIsSol, scopeRefreshConfig, calcs, budgetAndPriorityFeeIxs, swapQuoteIxs, strategy, collIsKtoken, useV2Ixs) {
|
|
422
421
|
const collTokenMint = collReserve.getLiquidityMint();
|
|
423
422
|
const debtTokenMint = debtReserve.getLiquidityMint();
|
|
424
423
|
const debtTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(debtTokenMint, owner, false, debtReserve.getLiquidityTokenProgram());
|
|
@@ -470,27 +469,27 @@ async function buildWithdrawWithLeverageIxns(market, debtReserve, collReserve, o
|
|
|
470
469
|
},
|
|
471
470
|
];
|
|
472
471
|
}
|
|
473
|
-
const
|
|
474
|
-
const
|
|
472
|
+
const atasAndCreateIxs = (0, utils_1.createAtasIdempotent)(owner, mintsToCreateAtas);
|
|
473
|
+
const closeWsolAtaIxs = [];
|
|
475
474
|
if (depositTokenIsSol || debtTokenMint.equals(spl_token_1.NATIVE_MINT)) {
|
|
476
475
|
const wsolAta = (0, utils_1.getAssociatedTokenAddress)(spl_token_1.NATIVE_MINT, owner, false);
|
|
477
|
-
|
|
476
|
+
closeWsolAtaIxs.push((0, spl_token_1.createCloseAccountInstruction)(wsolAta, owner, owner, [], spl_token_1.TOKEN_PROGRAM_ID));
|
|
478
477
|
}
|
|
479
|
-
const
|
|
478
|
+
const budgetIxs = budgetAndPriorityFeeIxs || (0, utils_1.getComputeBudgetAndPriorityFeeIxs)(3000000);
|
|
480
479
|
// TODO: Mihai/Marius check if we can improve this logic and not convert any SOL
|
|
481
480
|
// This is here so that we have enough wsol to repay in case the kAB swapped to sol after estimates is not enough
|
|
482
|
-
const
|
|
481
|
+
const fillWsolAtaIxs = [];
|
|
483
482
|
if (debtTokenMint.equals(spl_token_1.NATIVE_MINT)) {
|
|
484
483
|
const halfSolBalance = (await market.getConnection().getBalance(owner)) / web3_js_1.LAMPORTS_PER_SOL / 2;
|
|
485
484
|
const balanceToWrap = halfSolBalance < 0.1 ? halfSolBalance : 0.1;
|
|
486
|
-
|
|
485
|
+
fillWsolAtaIxs.push(...(0, utils_1.getTransferWsolIxs)(owner, (0, spl_token_1.getAssociatedTokenAddressSync)(spl_token_1.NATIVE_MINT, owner), (0, classes_2.numberToLamportsDecimal)(balanceToWrap, utils_1.SOL_DECIMALS).ceil()));
|
|
487
486
|
}
|
|
488
487
|
const scopeRefreshIxn = await (0, exports.getScopeRefreshIx)(market, collReserve, debtReserve, obligation, scopeRefreshConfig);
|
|
489
|
-
// 2. Prepare the flash borrow and flash repay amounts and
|
|
488
|
+
// 2. Prepare the flash borrow and flash repay amounts and ixs
|
|
490
489
|
// We borrow exactly how much we need to repay
|
|
491
490
|
// and repay that + flash amount fee
|
|
492
491
|
const { flashBorrowIxn, flashRepayIxn } = (0, instructions_1.getFlashLoanInstructions)({
|
|
493
|
-
borrowIxnIndex:
|
|
492
|
+
borrowIxnIndex: budgetIxs.length + atasAndCreateIxs.length + fillWsolAtaIxs.length + (scopeRefreshIxn.length > 0 ? 1 : 0),
|
|
494
493
|
walletPublicKey: owner,
|
|
495
494
|
lendingMarketAuthority: market.getLendingMarketAuthority(),
|
|
496
495
|
lendingMarketAddress: market.getAddress(),
|
|
@@ -505,10 +504,9 @@ async function buildWithdrawWithLeverageIxns(market, debtReserve, collReserve, o
|
|
|
505
504
|
// 3. Repay borrowed tokens and Withdraw tokens from reserve that will be swapped to repay flash loan
|
|
506
505
|
const repayAndWithdrawAction = await classes_1.KaminoAction.buildRepayAndWithdrawTxns(market, isClosingPosition ? utils_1.U64_MAX : (0, classes_2.numberToLamportsDecimal)(calcs.repayAmount, debtReserve.stats.decimals).floor().toString(), debtTokenMint, isClosingPosition
|
|
507
506
|
? utils_1.U64_MAX
|
|
508
|
-
: (0, classes_2.numberToLamportsDecimal)(calcs.depositTokenWithdrawAmount, collReserve.stats.decimals).ceil().toString(), collTokenMint, owner, currentSlot, obligation, useV2Ixs, undefined, 0, false, false, // to be checked and created in a setup tx in the UI (won't be the case for withdraw anyway as this would be created in deposit)
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const swapInstructions = (0, utils_1.removeBudgetAndAtaIxns)(swapQuoteIxs.swapIxs, []);
|
|
507
|
+
: (0, classes_2.numberToLamportsDecimal)(calcs.depositTokenWithdrawAmount, collReserve.stats.decimals).ceil().toString(), collTokenMint, owner, currentSlot, obligation, useV2Ixs, undefined, 0, false, false, { skipInitialization: true, skipLutCreation: true }, // to be checked and created in a setup tx in the UI (won't be the case for withdraw anyway as this would be created in deposit)
|
|
508
|
+
referrer);
|
|
509
|
+
const swapInstructions = (0, utils_1.removeBudgetAndAtaIxs)(swapQuoteIxs.swapIxs, []);
|
|
512
510
|
return {
|
|
513
511
|
flashLoanInfo: {
|
|
514
512
|
flashLoanFee: debtReserve.getFlashLoanFee(),
|
|
@@ -516,14 +514,14 @@ async function buildWithdrawWithLeverageIxns(market, debtReserve, collReserve, o
|
|
|
516
514
|
},
|
|
517
515
|
instructions: [
|
|
518
516
|
...scopeRefreshIxn,
|
|
519
|
-
...
|
|
520
|
-
...
|
|
521
|
-
...
|
|
517
|
+
...budgetIxs,
|
|
518
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
519
|
+
...fillWsolAtaIxs,
|
|
522
520
|
...[flashBorrowIxn],
|
|
523
521
|
...classes_1.KaminoAction.actionToIxs(repayAndWithdrawAction),
|
|
524
522
|
...swapInstructions,
|
|
525
523
|
...[flashRepayIxn],
|
|
526
|
-
...
|
|
524
|
+
...closeWsolAtaIxs,
|
|
527
525
|
],
|
|
528
526
|
};
|
|
529
527
|
}
|
|
@@ -558,7 +556,7 @@ async function getAdjustLeverageSwapInputs({ owner, kaminoMarket, debtTokenMint,
|
|
|
558
556
|
if (isDeposit) {
|
|
559
557
|
const calcs = await (0, calcs_1.adjustDepositLeverageCalcs)(kaminoMarket, owner, debtReserve, adjustDepositPosition, adjustBorrowPosition, priceDebtToColl, flashLoanFee, slippagePct, collIsKtoken);
|
|
560
558
|
// Build the repay & withdraw collateral tx to get the number of accounts
|
|
561
|
-
const klendIxs = await
|
|
559
|
+
const klendIxs = await buildIncreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, calcs, strategy, scopeRefreshConfig, collIsKtoken, {
|
|
562
560
|
preActionIxs: [],
|
|
563
561
|
swapIxs: [],
|
|
564
562
|
lookupTables: [],
|
|
@@ -608,7 +606,7 @@ async function getAdjustLeverageSwapInputs({ owner, kaminoMarket, debtTokenMint,
|
|
|
608
606
|
}
|
|
609
607
|
else {
|
|
610
608
|
const calcs = (0, calcs_1.adjustWithdrawLeverageCalcs)(adjustDepositPosition, adjustBorrowPosition, flashLoanFee, slippagePct);
|
|
611
|
-
const klendIxs = await
|
|
609
|
+
const klendIxs = await buildDecreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, calcs, strategy, scopeRefreshConfig, collIsKtoken, {
|
|
612
610
|
preActionIxs: [],
|
|
613
611
|
swapIxs: [],
|
|
614
612
|
lookupTables: [],
|
|
@@ -653,7 +651,7 @@ async function getAdjustLeverageSwapInputs({ owner, kaminoMarket, debtTokenMint,
|
|
|
653
651
|
};
|
|
654
652
|
}
|
|
655
653
|
}
|
|
656
|
-
async function
|
|
654
|
+
async function getAdjustLeverageIxs({ owner, kaminoMarket, debtTokenMint, collTokenMint, obligation, depositedLamports, borrowedLamports, referrer, currentSlot, targetLeverage, priceCollToDebt, priceDebtToColl, slippagePct, budgetAndPriorityFeeIxs, kamino, scopeRefreshConfig, quoteBufferBps, priceAinB, isKtoken, quoter, swapper, useV2Ixs, }) {
|
|
657
655
|
const { swapInputs, initialInputs } = await getAdjustLeverageSwapInputs({
|
|
658
656
|
owner,
|
|
659
657
|
kaminoMarket,
|
|
@@ -690,7 +688,7 @@ async function getAdjustLeverageIxns({ owner, kaminoMarket, debtTokenMint, collT
|
|
|
690
688
|
depositSwapper = swapper;
|
|
691
689
|
}
|
|
692
690
|
const { swapIxs, lookupTables } = await depositSwapper(swapInputs, initialInputs.klendAccounts, initialInputs.swapQuote);
|
|
693
|
-
const ixs = await
|
|
691
|
+
const ixs = await buildIncreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, initialInputs.calcs, initialInputs.strategy, scopeRefreshConfig, initialInputs.collIsKtoken, {
|
|
694
692
|
preActionIxs: [],
|
|
695
693
|
swapIxs,
|
|
696
694
|
lookupTables,
|
|
@@ -715,9 +713,9 @@ async function getAdjustLeverageIxns({ owner, kaminoMarket, debtTokenMint, collT
|
|
|
715
713
|
else {
|
|
716
714
|
withdrawSwapper = swapper;
|
|
717
715
|
}
|
|
718
|
-
// 5. Get swap
|
|
716
|
+
// 5. Get swap ixs
|
|
719
717
|
const { swapIxs, lookupTables } = await withdrawSwapper(swapInputs, initialInputs.klendAccounts, initialInputs.swapQuote);
|
|
720
|
-
const ixs = await
|
|
718
|
+
const ixs = await buildDecreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, initialInputs.calcs, initialInputs.strategy, scopeRefreshConfig, initialInputs.collIsKtoken, {
|
|
721
719
|
preActionIxs: [],
|
|
722
720
|
swapIxs,
|
|
723
721
|
lookupTables,
|
|
@@ -734,13 +732,13 @@ async function getAdjustLeverageIxns({ owner, kaminoMarket, debtTokenMint, collT
|
|
|
734
732
|
/**
|
|
735
733
|
* Deposit and borrow tokens if leverage increased
|
|
736
734
|
*/
|
|
737
|
-
async function
|
|
735
|
+
async function buildIncreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, calcs, strategy, scopeRefreshConfig, collIsKtoken, swapQuoteIxs, budgetAndPriorityFeeIxs, useV2Ixs) {
|
|
738
736
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
739
737
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
740
738
|
const debtTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(debtTokenMint, owner, false, debtReserve.getLiquidityTokenProgram());
|
|
741
739
|
const collTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(collTokenMint, owner, false, collReserve.getLiquidityTokenProgram());
|
|
742
740
|
// 1. Create atas & budget txns
|
|
743
|
-
const
|
|
741
|
+
const budgetIxs = budgetAndPriorityFeeIxs || (0, utils_1.getComputeBudgetAndPriorityFeeIxs)(3000000);
|
|
744
742
|
let mintsToCreateAtas;
|
|
745
743
|
if (collIsKtoken) {
|
|
746
744
|
const secondTokenAta = strategy.strategy.tokenAMint.equals(debtTokenMint)
|
|
@@ -788,11 +786,11 @@ async function buildIncreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
788
786
|
},
|
|
789
787
|
];
|
|
790
788
|
}
|
|
791
|
-
const
|
|
789
|
+
const atasAndCreateIxs = (0, utils_1.createAtasIdempotent)(owner, mintsToCreateAtas);
|
|
792
790
|
const scopeRefreshIxn = await (0, exports.getScopeRefreshIx)(kaminoMarket, collReserve, debtReserve, obligation, scopeRefreshConfig);
|
|
793
791
|
// 2. Create borrow flash loan instruction
|
|
794
792
|
const { flashBorrowIxn, flashRepayIxn } = (0, instructions_1.getFlashLoanInstructions)({
|
|
795
|
-
borrowIxnIndex:
|
|
793
|
+
borrowIxnIndex: budgetIxs.length + atasAndCreateIxs.length + (scopeRefreshIxn.length > 0 ? 1 : 0), // TODO: how about user metadata ixs
|
|
796
794
|
walletPublicKey: owner,
|
|
797
795
|
lendingMarketAuthority: kaminoMarket.getLendingMarketAuthority(),
|
|
798
796
|
lendingMarketAddress: kaminoMarket.getAddress(),
|
|
@@ -804,19 +802,16 @@ async function buildIncreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
804
802
|
referrerTokenState: kaminoMarket.programId,
|
|
805
803
|
programId: kaminoMarket.programId,
|
|
806
804
|
});
|
|
807
|
-
const depositAction = await classes_1.KaminoAction.buildDepositTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.adjustDepositPosition, collReserve.stats.decimals).floor().toString(), collTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false,
|
|
808
|
-
false, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
809
|
-
referrer, currentSlot);
|
|
805
|
+
const depositAction = await classes_1.KaminoAction.buildDepositTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.adjustDepositPosition, collReserve.stats.decimals).floor().toString(), collTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false, { skipInitialization: true, skipLutCreation: true }, referrer, currentSlot);
|
|
810
806
|
// 4. Borrow tokens in borrow token reserve that will be swapped to repay flash loan
|
|
811
|
-
const borrowAction = await classes_1.KaminoAction.buildBorrowTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.borrowAmount, debtReserve.stats.decimals).ceil().toString(), debtTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false,
|
|
812
|
-
false, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
807
|
+
const borrowAction = await classes_1.KaminoAction.buildBorrowTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.borrowAmount, debtReserve.stats.decimals).ceil().toString(), debtTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false, { skipInitialization: true, skipLutCreation: true }, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
813
808
|
referrer, currentSlot);
|
|
814
|
-
const swapInstructions = (0, utils_1.
|
|
809
|
+
const swapInstructions = (0, utils_1.removeBudgetAndAtaIxs)(swapQuoteIxs.swapIxs, []);
|
|
815
810
|
const ixs = !collIsKtoken
|
|
816
811
|
? [
|
|
817
812
|
...scopeRefreshIxn,
|
|
818
|
-
...
|
|
819
|
-
...
|
|
813
|
+
...budgetIxs,
|
|
814
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
820
815
|
...[flashBorrowIxn],
|
|
821
816
|
...classes_1.KaminoAction.actionToIxs(depositAction),
|
|
822
817
|
...classes_1.KaminoAction.actionToIxs(borrowAction),
|
|
@@ -825,8 +820,8 @@ async function buildIncreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
825
820
|
]
|
|
826
821
|
: [
|
|
827
822
|
...scopeRefreshIxn,
|
|
828
|
-
...
|
|
829
|
-
...
|
|
823
|
+
...budgetIxs,
|
|
824
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
830
825
|
...[flashBorrowIxn],
|
|
831
826
|
...swapInstructions,
|
|
832
827
|
...classes_1.KaminoAction.actionToIxs(depositAction),
|
|
@@ -846,12 +841,12 @@ async function buildIncreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
846
841
|
/**
|
|
847
842
|
* Withdraw and repay tokens if leverage decreased
|
|
848
843
|
*/
|
|
849
|
-
async function
|
|
844
|
+
async function buildDecreaseLeverageIxs(owner, kaminoMarket, collTokenMint, debtTokenMint, obligation, referrer, currentSlot, calcs, strategy, scopeRefreshConfig, collIsKtoken, swapQuoteIxs, budgetAndPriorityFeeIxs, useV2Ixs) {
|
|
850
845
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
851
846
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
852
847
|
const debtTokenAta = (0, spl_token_1.getAssociatedTokenAddressSync)(debtTokenMint, owner, false, debtReserve.getLiquidityTokenProgram());
|
|
853
848
|
// 1. Create atas & budget txns
|
|
854
|
-
const
|
|
849
|
+
const budgetIxs = budgetAndPriorityFeeIxs || (0, utils_1.getComputeBudgetAndPriorityFeeIxs)(3000000);
|
|
855
850
|
let mintsToCreateAtas;
|
|
856
851
|
if (collIsKtoken) {
|
|
857
852
|
const secondTokenAta = strategy.strategy.tokenAMint.equals(debtTokenMint)
|
|
@@ -899,22 +894,22 @@ async function buildDecreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
899
894
|
},
|
|
900
895
|
];
|
|
901
896
|
}
|
|
902
|
-
const
|
|
897
|
+
const atasAndCreateIxs = (0, utils_1.createAtasIdempotent)(owner, mintsToCreateAtas);
|
|
903
898
|
// TODO: Mihai/Marius check if we can improve this logic and not convert any SOL
|
|
904
899
|
// This is here so that we have enough wsol to repay in case the kAB swapped to sol after estimates is not enough
|
|
905
|
-
const
|
|
906
|
-
const
|
|
900
|
+
const closeWsolAtaIxs = [];
|
|
901
|
+
const fillWsolAtaIxs = [];
|
|
907
902
|
if (debtTokenMint.equals(spl_token_1.NATIVE_MINT)) {
|
|
908
903
|
const wsolAta = (0, utils_1.getAssociatedTokenAddress)(spl_token_1.NATIVE_MINT, owner, false);
|
|
909
|
-
|
|
904
|
+
closeWsolAtaIxs.push((0, spl_token_1.createCloseAccountInstruction)(wsolAta, owner, owner, [], spl_token_1.TOKEN_PROGRAM_ID));
|
|
910
905
|
const halfSolBalance = (await kaminoMarket.getConnection().getBalance(owner)) / web3_js_1.LAMPORTS_PER_SOL / 2;
|
|
911
906
|
const balanceToWrap = halfSolBalance < 0.1 ? halfSolBalance : 0.1;
|
|
912
|
-
|
|
907
|
+
fillWsolAtaIxs.push(...(0, utils_1.getTransferWsolIxs)(owner, wsolAta, (0, classes_2.numberToLamportsDecimal)(balanceToWrap, debtReserve.stats.decimals).ceil()));
|
|
913
908
|
}
|
|
914
909
|
const scopeRefreshIxn = await (0, exports.getScopeRefreshIx)(kaminoMarket, collReserve, debtReserve, obligation, scopeRefreshConfig);
|
|
915
910
|
// 3. Flash borrow & repay amount to repay (debt)
|
|
916
911
|
const { flashBorrowIxn, flashRepayIxn } = (0, instructions_1.getFlashLoanInstructions)({
|
|
917
|
-
borrowIxnIndex:
|
|
912
|
+
borrowIxnIndex: budgetIxs.length + atasAndCreateIxs.length + fillWsolAtaIxs.length + (scopeRefreshIxn.length > 0 ? 1 : 0),
|
|
918
913
|
walletPublicKey: owner,
|
|
919
914
|
lendingMarketAuthority: kaminoMarket.getLendingMarketAuthority(),
|
|
920
915
|
lendingMarketAddress: kaminoMarket.getAddress(),
|
|
@@ -927,32 +922,30 @@ async function buildDecreaseLeverageIxns(owner, kaminoMarket, collTokenMint, deb
|
|
|
927
922
|
programId: kaminoMarket.programId,
|
|
928
923
|
});
|
|
929
924
|
// 4. Actually do the repay of the flash borrowed amounts
|
|
930
|
-
const repayAction = await classes_1.KaminoAction.buildRepayTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(decimal_js_1.default.abs(calcs.adjustBorrowPosition), debtReserve.stats.decimals).floor().toString(), debtTokenMint, owner, obligation, useV2Ixs, undefined, currentSlot, undefined, 0, false, false,
|
|
931
|
-
false, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
925
|
+
const repayAction = await classes_1.KaminoAction.buildRepayTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(decimal_js_1.default.abs(calcs.adjustBorrowPosition), debtReserve.stats.decimals).floor().toString(), debtTokenMint, owner, obligation, useV2Ixs, undefined, currentSlot, undefined, 0, false, false, { skipInitialization: true, skipLutCreation: true }, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
932
926
|
referrer);
|
|
933
927
|
// 6. Withdraw collateral (a little bit more to be able to pay for the slippage on swap)
|
|
934
|
-
const withdrawAction = await classes_1.KaminoAction.buildWithdrawTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.withdrawAmountWithSlippageAndFlashLoanFee, collReserve.stats.decimals).ceil().toString(), collTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false,
|
|
935
|
-
false, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
928
|
+
const withdrawAction = await classes_1.KaminoAction.buildWithdrawTxns(kaminoMarket, (0, classes_2.numberToLamportsDecimal)(calcs.withdrawAmountWithSlippageAndFlashLoanFee, collReserve.stats.decimals).ceil().toString(), collTokenMint, owner, obligation, useV2Ixs, undefined, 0, false, false, { skipInitialization: true, skipLutCreation: true }, // to be checked and create in a setup tx in the UI (won't be the case for adjust anyway as this would be created in deposit)
|
|
936
929
|
referrer, currentSlot);
|
|
937
|
-
const swapInstructions = (0, utils_1.
|
|
938
|
-
const
|
|
930
|
+
const swapInstructions = (0, utils_1.removeBudgetAndAtaIxs)(swapQuoteIxs.swapIxs, []);
|
|
931
|
+
const ixs = [
|
|
939
932
|
...scopeRefreshIxn,
|
|
940
|
-
...
|
|
941
|
-
...
|
|
942
|
-
...
|
|
933
|
+
...budgetIxs,
|
|
934
|
+
...atasAndCreateIxs.map((x) => x.createAtaIx),
|
|
935
|
+
...fillWsolAtaIxs,
|
|
943
936
|
...[flashBorrowIxn],
|
|
944
937
|
...classes_1.KaminoAction.actionToIxs(repayAction),
|
|
945
938
|
...classes_1.KaminoAction.actionToIxs(withdrawAction),
|
|
946
939
|
...swapInstructions,
|
|
947
940
|
...[flashRepayIxn],
|
|
948
|
-
...
|
|
941
|
+
...closeWsolAtaIxs,
|
|
949
942
|
];
|
|
950
943
|
const res = {
|
|
951
944
|
flashLoanInfo: {
|
|
952
945
|
flashBorrowReserve: debtReserve.address,
|
|
953
946
|
flashLoanFee: debtReserve.getFlashLoanFee(),
|
|
954
947
|
},
|
|
955
|
-
instructions:
|
|
948
|
+
instructions: ixs,
|
|
956
949
|
};
|
|
957
950
|
return res;
|
|
958
951
|
}
|
|
@@ -966,13 +959,13 @@ const getScopeRefreshIx = async (market, collReserve, debtReserve, obligation, s
|
|
|
966
959
|
]).toArray()
|
|
967
960
|
: new utils_1.PublicKeySet([collReserve.address, debtReserve.address]).toArray();
|
|
968
961
|
const tokenIds = (0, classes_1.getTokenIdsForScopeRefresh)(market, allReserves);
|
|
969
|
-
const
|
|
962
|
+
const scopeRefreshIxs = [];
|
|
970
963
|
if (tokenIds.length > 0 && scopeRefreshConfig) {
|
|
971
|
-
|
|
964
|
+
scopeRefreshIxs.push(await scopeRefreshConfig.scope.refreshPriceListIx({
|
|
972
965
|
feed: scopeRefreshConfig.scopeFeed,
|
|
973
966
|
}, tokenIds));
|
|
974
967
|
}
|
|
975
|
-
return
|
|
968
|
+
return scopeRefreshIxs;
|
|
976
969
|
};
|
|
977
970
|
exports.getScopeRefreshIx = getScopeRefreshIx;
|
|
978
971
|
//# sourceMappingURL=operations.js.map
|