@lavarage/sdk 7.1.1 → 7.1.2

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.d.mts CHANGED
@@ -3348,6 +3348,7 @@ declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
3348
3348
  interestRate: number;
3349
3349
  maxExposure: number;
3350
3350
  computeBudgetMicroLamports?: number;
3351
+ maxBorrow?: number;
3351
3352
  }): Promise<VersionedTransaction>;
3352
3353
  declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
3353
3354
  tradingPool: PublicKey;
package/dist/index.d.ts CHANGED
@@ -3348,6 +3348,7 @@ declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
3348
3348
  interestRate: number;
3349
3349
  maxExposure: number;
3350
3350
  computeBudgetMicroLamports?: number;
3351
+ maxBorrow?: number;
3351
3352
  }): Promise<VersionedTransaction>;
3352
3353
  declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
3353
3354
  tradingPool: PublicKey;
package/dist/index.js CHANGED
@@ -1338,7 +1338,7 @@ function withdrawFunds(lavarageProgram, params) {
1338
1338
  }
1339
1339
  function createOffer(lavarageProgram, params) {
1340
1340
  return __async(this, null, function* () {
1341
- var _a;
1341
+ var _a, _b;
1342
1342
  let nodeWalletAccount, nodeWalletSigner, createNodeWalletInstruction = [], nodeWalletPubKey;
1343
1343
  if (params.quoteMint === "So11111111111111111111111111111111111111112") {
1344
1344
  const nodeWallets = yield lavarageProgram.account.nodeWallet.all();
@@ -1400,6 +1400,12 @@ function createOffer(lavarageProgram, params) {
1400
1400
  toPubkey: new import_web3.PublicKey("BMME51pfWdBfakTEMuQbNP4NG3wCY4Fo47dKatThhXGQ"),
1401
1401
  lamports: 0.3 * import_web3.LAMPORTS_PER_SOL
1402
1402
  });
1403
+ const updateMaxBorrowInstruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new import_anchor.BN((_b = params.maxBorrow) != null ? _b : 0)).accountsStrict({
1404
+ tradingPool: params.tradingPool,
1405
+ nodeWallet: nodeWalletPubKey,
1406
+ operator: params.poolOwner,
1407
+ systemProgram: import_web3.SystemProgram.programId
1408
+ }).instruction();
1403
1409
  const messageV0 = new import_web3.TransactionMessage({
1404
1410
  payerKey: lavarageProgram.provider.publicKey,
1405
1411
  recentBlockhash: blockhash,
@@ -1408,6 +1414,7 @@ function createOffer(lavarageProgram, params) {
1408
1414
  instruction,
1409
1415
  updateMaxExposureInstruction,
1410
1416
  transferInstruction,
1417
+ params.maxBorrow ? updateMaxBorrowInstruction : void 0,
1411
1418
  computeFeeIx
1412
1419
  ].filter(Boolean)
1413
1420
  }).compileToV0Message();