@lavarage/sdk 6.2.0 → 6.3.0

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/index.js CHANGED
@@ -2608,7 +2608,7 @@ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
2608
2608
  }, new Array());
2609
2609
  });
2610
2610
  const addressLookupTableAccounts = [];
2611
- addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(addressLookupTableAddresses));
2611
+ addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(["5LEAB3owNUSKvECm7vkr58tDtQpzbngQ2NYpc7qmRFdi", ...addressLookupTableAddresses]));
2612
2612
  const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
2613
2613
  const tradingOpenBorrowInstruction = yield lavarageProgram.methods.tradingOpenBorrow(new import_anchor.BN((marginSOL.toNumber() * leverage).toFixed(0)), marginSOL).accountsStrict({
2614
2614
  nodeWallet: offer.account.nodeWallet,
@@ -2708,7 +2708,7 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
2708
2708
  }, new Array());
2709
2709
  });
2710
2710
  const addressLookupTableAccounts = [];
2711
- addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(addressLookupTableAddresses));
2711
+ addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts([...addressLookupTableAddresses, getQuoteCurrencySpecificAddressLookupTable(quoteToken.toBase58()), "5LEAB3owNUSKvECm7vkr58tDtQpzbngQ2NYpc7qmRFdi"]));
2712
2712
  const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
2713
2713
  const tradingOpenBorrowInstruction = yield lavarageProgram.methods.tradingOpenBorrow(new import_anchor.BN((marginSOL.toNumber() * leverage).toFixed(0)), marginSOL).accountsStrict({
2714
2714
  nodeWallet: offer.account.nodeWallet,
@@ -2991,7 +2991,7 @@ var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFee
2991
2991
  deserializeInstruction(swapInstructionPayload),
2992
2992
  deserializeInstruction(cleanupInstruction)
2993
2993
  ];
2994
- addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(addressLookupTableAddresses));
2994
+ addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(["5LEAB3owNUSKvECm7vkr58tDtQpzbngQ2NYpc7qmRFdi", ...addressLookupTableAddresses]));
2995
2995
  }
2996
2996
  const profit = new import_anchor.BN(jupInstruction.quoteResponse.outAmount).sub(position.account.amount).sub(position.account.userPaid);
2997
2997
  const allInstructions = [
@@ -3123,7 +3123,7 @@ var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken
3123
3123
  swapInstructionPayload ? deserializeInstruction(swapInstructionPayload) : null,
3124
3124
  cleanupInstruction ? deserializeInstruction(cleanupInstruction) : null
3125
3125
  ].filter((i) => !!i);
3126
- addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(addressLookupTableAddresses));
3126
+ addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts([...addressLookupTableAddresses, getQuoteCurrencySpecificAddressLookupTable(quoteToken.toBase58()), "5LEAB3owNUSKvECm7vkr58tDtQpzbngQ2NYpc7qmRFdi"]));
3127
3127
  }
3128
3128
  const profit = new import_anchor.BN(jupInstruction.quoteResponse.outAmount).sub(position.account.amount).sub(position.account.userPaid);
3129
3129
  const allInstructions = [
@@ -3154,6 +3154,16 @@ var getDelegateAccounts = (lavarageProgram, userPubKey) => __async(void 0, null,
3154
3154
  }
3155
3155
  }));
3156
3156
  });
3157
+ var getQuoteCurrencySpecificAddressLookupTable = (quoteCurrency) => {
3158
+ switch (quoteCurrency) {
3159
+ case "J9BcrQfX4p9D1bvLzRNCbMDv8f44a9LFdeqNE4Yk2WMD":
3160
+ return "2EdNtwVhyjkEgkKDC7GShfSSczZYMKLuJraeoJzG4E4R";
3161
+ case "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":
3162
+ return "CxLE1LRaZg2eYygzFfVRhgmSACsvqzyhySDrMHq3QSab";
3163
+ default:
3164
+ return "2EdNtwVhyjkEgkKDC7GShfSSczZYMKLuJraeoJzG4E4R";
3165
+ }
3166
+ };
3157
3167
  // Annotate the CommonJS export names for ESM import in node:
3158
3168
  0 && (module.exports = {
3159
3169
  IDL,