@kamino-finance/klend-sdk 7.0.6 → 7.0.8
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 +1 -1
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +15 -15
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/manager.d.ts +8 -0
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +10 -0
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/obligation.js +7 -6
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/vault.d.ts +8 -0
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +90 -1
- package/dist/classes/vault.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 +36 -32
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.js +6 -6
- package/dist/lending_operations/swap_collateral_operations.js.map +1 -1
- package/dist/leverage/operations.d.ts +4 -3
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js +175 -149
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +1 -0
- package/dist/leverage/types.d.ts.map +1 -1
- package/dist/manager/client_kamino_manager.js +15 -2
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/action.ts +15 -15
- package/src/classes/manager.ts +24 -1
- package/src/classes/obligation.ts +9 -9
- package/src/classes/vault.ts +100 -1
- package/src/lending_operations/repay_with_collateral_operations.ts +78 -74
- package/src/lending_operations/swap_collateral_operations.ts +15 -13
- package/src/leverage/operations.ts +350 -318
- package/src/leverage/types.ts +1 -0
- package/src/manager/client_kamino_manager.ts +19 -2
package/src/leverage/types.ts
CHANGED
|
@@ -189,6 +189,7 @@ export interface AdjustLeverageSwapInputsProps<QuoteResponse> extends BaseLevera
|
|
|
189
189
|
priceCollToDebt: Decimal;
|
|
190
190
|
priceDebtToColl: Decimal;
|
|
191
191
|
priceAinB: PriceAinBProvider;
|
|
192
|
+
withdrawSlotOffset?: number;
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
export interface AdjustLeverageProps<QuoteResponse> extends AdjustLeverageSwapInputsProps<QuoteResponse> {
|
|
@@ -1355,6 +1355,23 @@ async function main() {
|
|
|
1355
1355
|
console.log('farmAPY', farmAPY);
|
|
1356
1356
|
});
|
|
1357
1357
|
|
|
1358
|
+
commands
|
|
1359
|
+
.command('get-vault-all-mints')
|
|
1360
|
+
.option(`--staging`, 'If true, will use the staging programs')
|
|
1361
|
+
.option(`--vault <string>`, 'Vault address')
|
|
1362
|
+
.action(async ({ staging, vault }) => {
|
|
1363
|
+
const env = await initEnv(staging);
|
|
1364
|
+
const slotDuration = await getMedianSlotDurationInMsFromLastEpochs();
|
|
1365
|
+
|
|
1366
|
+
const kaminoManager = new KaminoManager(env.c.rpc, slotDuration, env.klendProgramId, env.kvaultProgramId);
|
|
1367
|
+
|
|
1368
|
+
const vaultAddress = address(vault);
|
|
1369
|
+
const kaminoVault = new KaminoVault(vaultAddress, undefined, env.kvaultProgramId);
|
|
1370
|
+
|
|
1371
|
+
const allVaultsTokenMints = await kaminoManager.getAllVaultsTokenMintsIncludingRewards([kaminoVault]);
|
|
1372
|
+
console.log('allVaultsTokenMints', allVaultsTokenMints);
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1358
1375
|
commands
|
|
1359
1376
|
.command('get-vault-allocation-distribution')
|
|
1360
1377
|
.requiredOption('--vault <string>', 'Vault address')
|
|
@@ -1726,8 +1743,8 @@ async function main() {
|
|
|
1726
1743
|
const ixs = kaminoManager.updateLendingMarketIxs(signer, marketWithAddress, newLendingMarket);
|
|
1727
1744
|
|
|
1728
1745
|
// executing 6 ixs in a txn to make sure they fit
|
|
1729
|
-
for (let
|
|
1730
|
-
const ixsToExecute = ixs.slice(
|
|
1746
|
+
for (let ixIndex = 0; ixIndex < ixs.length; ixIndex += 6) {
|
|
1747
|
+
const ixsToExecute = ixs.slice(ixIndex, ixIndex + 6);
|
|
1731
1748
|
await processTx(
|
|
1732
1749
|
env.c,
|
|
1733
1750
|
signer,
|