@jup-ag/lend 0.0.83 → 0.0.85
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/borrow/index.d.mts +1 -1
- package/dist/borrow/index.d.ts +1 -1
- package/dist/borrow/index.mjs +15 -25
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/borrow/index.d.mts
CHANGED
|
@@ -4120,7 +4120,7 @@ declare const getLiquidations: (params: Omit<LiquidateParams, "debtAmount">) =>
|
|
|
4120
4120
|
}[]>;
|
|
4121
4121
|
declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" | "vaultId">) => Promise<{
|
|
4122
4122
|
vaultId: number;
|
|
4123
|
-
liquidations:
|
|
4123
|
+
liquidations: number[] | {
|
|
4124
4124
|
amtOut: string;
|
|
4125
4125
|
amtIn: string;
|
|
4126
4126
|
topTick: string;
|
package/dist/borrow/index.d.ts
CHANGED
|
@@ -4120,7 +4120,7 @@ declare const getLiquidations: (params: Omit<LiquidateParams, "debtAmount">) =>
|
|
|
4120
4120
|
}[]>;
|
|
4121
4121
|
declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" | "vaultId">) => Promise<{
|
|
4122
4122
|
vaultId: number;
|
|
4123
|
-
liquidations:
|
|
4123
|
+
liquidations: number[] | {
|
|
4124
4124
|
amtOut: string;
|
|
4125
4125
|
amtIn: string;
|
|
4126
4126
|
topTick: string;
|
package/dist/borrow/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PublicKey,
|
|
1
|
+
import { PublicKey, Transaction, SystemProgram, SYSVAR_RENT_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, TransactionMessage, ComputeBudgetProgram, VersionedTransaction } from '@solana/web3.js';
|
|
2
2
|
import BN from 'bn.js';
|
|
3
|
-
import { Program } from '@coral-xyz/anchor';
|
|
3
|
+
import { Program, AnchorProvider } from '@coral-xyz/anchor';
|
|
4
4
|
import { l as liquidity } from '../shared/lend.CioR9-te.mjs';
|
|
5
5
|
import { getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
6
6
|
import { g as getTickHasDebt, v as vaults, a as getPosition, c as getTick, d as getTickIdLiquidation, e as getVaultConfig, f as getBranch, h as getVaultState, i as getVaultMetadata, j as getLiquidity, k as getRateModel, l as getUserBorrowPosition, m as getUserSupplyPosition, n as getLiquidityReserve, o as getPositionTokenAccount, p as getPositionMetadata, q as getPositionMint, r as getVaultAdmin, s as getClaimAccount } from '../shared/lend.qfqiaCtm.mjs';
|
|
@@ -1285,27 +1285,18 @@ async function readOraclePrice({
|
|
|
1285
1285
|
signer,
|
|
1286
1286
|
oracle: oracle$1
|
|
1287
1287
|
}) {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
connection,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
tx.feePayer = signer;
|
|
1301
|
-
const res = await connection.simulateTransaction(tx);
|
|
1302
|
-
if (res.value.err) {
|
|
1303
|
-
throw new Error(`Simulation failed: ${res.value.err}`);
|
|
1304
|
-
}
|
|
1305
|
-
return res.value;
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1288
|
+
const program = new Program(
|
|
1289
|
+
oracle,
|
|
1290
|
+
new AnchorProvider(connection, {
|
|
1291
|
+
signTransaction() {
|
|
1292
|
+
throw new Error("Not implemented");
|
|
1293
|
+
},
|
|
1294
|
+
signAllTransactions() {
|
|
1295
|
+
throw new Error("Not implemented");
|
|
1296
|
+
},
|
|
1297
|
+
publicKey: signer ?? new PublicKey("JupRhwjrF5fAcs6dFhLH59r3TJFvbcyLP2NRM8UGH9H")
|
|
1298
|
+
})
|
|
1299
|
+
);
|
|
1309
1300
|
const oracleData = await program.account.oracle.fetch(oracle$1);
|
|
1310
1301
|
let remainingAccounts = [];
|
|
1311
1302
|
for (const source of oracleData.sources) {
|
|
@@ -1454,7 +1445,6 @@ async function getRemainingAccountsOperate(vaultId, vaultState, vaultConfig, fin
|
|
|
1454
1445
|
});
|
|
1455
1446
|
const branchLength = branches.length;
|
|
1456
1447
|
for (const branch of branches) {
|
|
1457
|
-
if (!branch) continue;
|
|
1458
1448
|
remainingAccounts.push({
|
|
1459
1449
|
pubkey: getBranch(vaultId, branch),
|
|
1460
1450
|
isWritable: true,
|
|
@@ -2098,7 +2088,7 @@ const getAllLiquidations = async (params) => {
|
|
|
2098
2088
|
Array.from({ length: totalVaults - 1 }, async (_, i) => ({
|
|
2099
2089
|
vaultId: i + 1,
|
|
2100
2090
|
liquidations: await getLiquidations({ ...params, vaultId: i + 1 }).catch(
|
|
2101
|
-
() => []
|
|
2091
|
+
() => [1]
|
|
2102
2092
|
)
|
|
2103
2093
|
}))
|
|
2104
2094
|
);
|
package/dist/index.mjs
CHANGED