@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/abi/borrowerOperations.ts +1 -248
- package/dist/index.d.mts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +26 -251
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -250
- package/dist/index.mjs.map +1 -1
- package/evm.ts +43 -0
- package/lending.ts +2 -2
- package/package.json +1 -1
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
|
|
72
|
-
if (params.
|
|
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),
|