@jup-ag/lend 0.0.21 → 0.0.22

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.
@@ -1127,7 +1127,7 @@ async function getOtherInstructionsOperate(vaultId, vaultState, currentPosition,
1127
1127
  finalTickIdDataPda
1128
1128
  };
1129
1129
  }
1130
- async function getRemainingAccountsOperate(vaultId, positionId, vaultState, vaultConfig, hasDebt, program) {
1130
+ async function getRemainingAccountsOperate(vaultId, vaultState, vaultConfig, program) {
1131
1131
  const remainingAccounts = [];
1132
1132
  const oracleProgram = new Program(oracle, program.provider);
1133
1133
  const oracleData = await oracleProgram.account.oracle.fetch(
@@ -1150,18 +1150,19 @@ async function getRemainingAccountsOperate(vaultId, positionId, vaultState, vaul
1150
1150
  isSigner: false
1151
1151
  });
1152
1152
  }
1153
- let remainingAccountsIndices = [2, 0, 0];
1154
- if (positionId !== 0 || hasDebt) {
1155
- const tickHasDebt = await loadRelevantTicksHasDebtArrays(vaultId, program);
1156
- let tickHasDebtLength = tickHasDebt.length;
1157
- for (const tickHasDebtArray of tickHasDebt)
1158
- remainingAccounts.push({
1159
- pubkey: getTickHasDebt(vaultId, tickHasDebtArray.index),
1160
- isWritable: true,
1161
- isSigner: false
1162
- });
1163
- remainingAccountsIndices = [sourceLength, branchLength, tickHasDebtLength];
1164
- }
1153
+ const tickHasDebt = await loadRelevantTicksHasDebtArrays(vaultId, program);
1154
+ let tickHasDebtLength = tickHasDebt.length;
1155
+ for (const tickHasDebtArray of tickHasDebt)
1156
+ remainingAccounts.push({
1157
+ pubkey: getTickHasDebt(vaultId, tickHasDebtArray.index),
1158
+ isWritable: true,
1159
+ isSigner: false
1160
+ });
1161
+ const remainingAccountsIndices = [
1162
+ sourceLength,
1163
+ branchLength,
1164
+ tickHasDebtLength
1165
+ ];
1165
1166
  return {
1166
1167
  remainingAccounts,
1167
1168
  remainingAccountsIndices
@@ -1239,13 +1240,10 @@ async function getOperateContext({
1239
1240
  program,
1240
1241
  signer
1241
1242
  );
1242
- const hasDebt = !newDebt.eq(new BN(0));
1243
1243
  const { remainingAccounts, remainingAccountsIndices } = await getRemainingAccountsOperate(
1244
1244
  vaultId,
1245
- positionId,
1246
1245
  vaultState,
1247
1246
  vaultConfig,
1248
- hasDebt,
1249
1247
  program
1250
1248
  );
1251
1249
  const accounts = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",