@jup-ag/lend 0.0.102 → 0.0.104

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.
@@ -1392,11 +1392,21 @@ async function getExchangePrices({
1392
1392
  transaction.recentBlockhash = latestBlockHash.blockhash;
1393
1393
  transaction.feePayer = signer;
1394
1394
  const raw = await connection.simulateTransaction(transaction);
1395
+ if (raw.value.err && raw.value.err === "InvalidAccountForFee" && signer.toBase58() !== "HEyJLdMfZhhQ7FHCtjD5DWDFNFQhaeAVAsHeWqoY6dSD") {
1396
+ return await getExchangePrices({
1397
+ vaultId,
1398
+ vaultConfig,
1399
+ connection,
1400
+ signer: new PublicKey("HEyJLdMfZhhQ7FHCtjD5DWDFNFQhaeAVAsHeWqoY6dSD")
1401
+ });
1402
+ }
1395
1403
  const returnLog = raw.value.logs?.find(
1396
1404
  (log) => log.startsWith("Program return:")
1397
1405
  );
1398
1406
  if (!returnLog) {
1399
- throw new Error("No return data found in logs");
1407
+ let error = new Error("No return data found in logs");
1408
+ error.simulation = raw.value;
1409
+ throw error;
1400
1410
  }
1401
1411
  const base64Data = returnLog.split(" ")[3];
1402
1412
  const buffer = Buffer.from(base64Data, "base64");
@@ -2166,8 +2176,8 @@ async function getRemainingAccountsLiquidate(vaultId, vaultState, vaultConfig, o
2166
2176
  const remainingAccounts = [];
2167
2177
  const { oraclePriceLiquidate, oracleSources } = await readOraclePrice({
2168
2178
  oracle: vaultConfig.oracle,
2169
- connection,
2170
- signer
2179
+ connection
2180
+ // signer,
2171
2181
  });
2172
2182
  const liquidationRatio = new BN(oraclePriceLiquidate).mul(new BN(281474976710656)).div(new BN(10).pow(new BN(15)));
2173
2183
  const liquidationThresholdRatio = liquidationRatio.mul(new BN(vaultConfig.liquidationThreshold)).div(new BN(10).pow(new BN(3)));
package/dist/index.mjs CHANGED
@@ -8,6 +8,6 @@ import './shared/lend.CioR9-te.mjs';
8
8
  import '@solana/spl-token';
9
9
  import 'bn.js';
10
10
 
11
- const version = "0.0.102";
11
+ const version = "0.0.104";
12
12
 
13
13
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",