@lavarage/sdk 6.8.0 → 6.8.3

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/evm.ts CHANGED
@@ -528,3 +528,46 @@ export async function getAvailableExposureEvm(
528
528
  );
529
529
  return contract.getAvailableExposure(collateralAddress);
530
530
  }
531
+
532
+ /**
533
+ * Update max lend per token for multiple collaterals in batch
534
+ * @param provider - Ethers provider
535
+ * @param tokenHolderContractAddress - Address of the TokenHolder contract
536
+ * @param collateralAddresses - Array of collateral token addresses
537
+ * @param newMaxLendPerTokens - Array of new max lend per token values
538
+ * @param gasLimit - Optional gas limit
539
+ * @param gasPrice - Optional gas price
540
+ * @returns Unsigned transaction object
541
+ */
542
+ export const updateMaxLendPerTokenBatchEvm = async (
543
+ provider: Provider,
544
+ tokenHolderContractAddress: string,
545
+ {
546
+ collateralAddresses,
547
+ newMaxLendPerTokens,
548
+ gasLimit,
549
+ gasPrice,
550
+ }: {
551
+ collateralAddresses: string[];
552
+ newMaxLendPerTokens: BigNumberish[];
553
+ gasLimit?: string | number;
554
+ gasPrice?: string | number;
555
+ }
556
+ ): Promise<ContractTransaction> => {
557
+ const contract = new Contract(
558
+ tokenHolderContractAddress,
559
+ tokenHolderAbi,
560
+ provider
561
+ );
562
+
563
+ const txOptions: { gasLimit?: BigNumberish; gasPrice?: BigNumberish } = {};
564
+
565
+ if (gasLimit) txOptions.gasLimit = gasLimit;
566
+ if (gasPrice) txOptions.gasPrice = gasPrice;
567
+
568
+ return contract.updateMaxLendPerTokenBulk.populateTransaction(
569
+ collateralAddresses,
570
+ newMaxLendPerTokens,
571
+ Object.keys(txOptions).length > 0 ? txOptions : {}
572
+ );
573
+ };
package/lending.ts CHANGED
@@ -68,8 +68,8 @@ async function createNodeWallet(
68
68
 
69
69
  let instruction, nodeWallet;
70
70
 
71
- // Check if this is V2 program (has liquidationLtv parameter)
72
- if (params.liquidationLtv !== undefined && params.mint !== undefined) {
71
+ // Check if this is V2 program (has mint parameter)
72
+ if (params.mint !== undefined) {
73
73
  nodeWallet = getNodeWalletPDA(
74
74
  new PublicKey(params.operator),
75
75
  new PublicKey(params.mint),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lavarage/sdk",
3
- "version": "6.8.0",
3
+ "version": "6.8.3",
4
4
  "description": "Lavarage SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",