@lavarage/sdk 7.5.9 → 7.5.11
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/.github/workflows/npm-publish.yml +33 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/docs/functions/borrowV1.html +1 -1
- package/docs/functions/borrowV2.html +1 -1
- package/docs/functions/closePositionEvm.html +2 -2
- package/docs/functions/closeTradeV1.html +7 -3
- package/docs/functions/closeTradeV2.html +7 -3
- package/docs/functions/createTpDelegate.html +2 -2
- package/docs/functions/getActiveLoanCountEvm.html +2 -2
- package/docs/functions/getActiveLoansBatchEvm.html +2 -2
- package/docs/functions/getAllPositions.html +2 -2
- package/docs/functions/getAvailableExposureEvm.html +2 -2
- package/docs/functions/getClosedPositions.html +2 -2
- package/docs/functions/getClosedPositionsEvm.html +2 -2
- package/docs/functions/getCollateralExposureEvm.html +2 -2
- package/docs/functions/getCollateralInfoEvm.html +2 -2
- package/docs/functions/getDelegateAccounts.html +2 -2
- package/docs/functions/getLiquidatedPositions.html +2 -2
- package/docs/functions/getLiquidatedPositionsEvm.html +2 -2
- package/docs/functions/getLoanEvm.html +2 -2
- package/docs/functions/getLoansByBorrowerEvm.html +2 -2
- package/docs/functions/getOffers.html +2 -2
- package/docs/functions/getOffersEvm.html +2 -2
- package/docs/functions/getOpenPositions.html +2 -2
- package/docs/functions/getOpeningFeeEvm.html +2 -2
- package/docs/functions/getPda.html +2 -2
- package/docs/functions/getPositionAccountPDA.html +2 -2
- package/docs/functions/getPositionsEvm.html +2 -2
- package/docs/functions/getProfitFeeEvm.html +2 -2
- package/docs/functions/getTokenBalanceEvm.html +2 -2
- package/docs/functions/getUserLoansEvm.html +2 -2
- package/docs/functions/lending.addToWithdrawalAccessList.html +1 -1
- package/docs/functions/lending.createOffer.html +2 -2
- package/docs/functions/lending.depositFunds.html +2 -2
- package/docs/functions/lending.getNodeWalletPDA.html +2 -2
- package/docs/functions/lending.getTradingPoolPDA.html +2 -2
- package/docs/functions/lending.getWithdrawalAccessList.html +1 -1
- package/docs/functions/lending.getWithdrawalAccessListPDA.html +1 -1
- package/docs/functions/lending.removeFromWithdrawalAccessList.html +1 -1
- package/docs/functions/lending.updateInterestRate.html +2 -2
- package/docs/functions/lending.updateMaxBorrow.html +2 -2
- package/docs/functions/lending.updateMaxExposure.html +2 -2
- package/docs/functions/lending.updateOffer.html +2 -2
- package/docs/functions/lending.withdrawFunds.html +2 -2
- package/docs/functions/lending.withdrawFundsV1.html +2 -2
- package/docs/functions/lending.withdrawFundsV2.html +2 -2
- package/docs/functions/liquidatePositionEvm.html +2 -2
- package/docs/functions/mergePositionV2.html +2 -2
- package/docs/functions/modifyTpDelegate.html +2 -2
- package/docs/functions/openPositionEvm.html +2 -2
- package/docs/functions/openTradeV1.html +8 -3
- package/docs/functions/openTradeV2.html +8 -3
- package/docs/functions/partialRepayV1.html +2 -2
- package/docs/functions/partialRepayV2.html +2 -2
- package/docs/functions/removeTpDelegate.html +2 -2
- package/docs/functions/splitPositionV2.html +2 -2
- package/docs/functions/updateMaxLendPerTokenBatchEvm.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/modules/IDLV2.html +2 -2
- package/docs/modules/lending.html +1 -1
- package/docs/modules.html +2 -2
- package/docs/types/IDLV2.Lavarage.html +2 -2
- package/docs/types/Lavarage.html +2 -2
- package/docs/variables/IDL.html +1 -1
- package/docs/variables/IDLV2.IDL.html +1 -1
- package/index.ts +27 -7
- package/lending.ts +4 -4
- package/package.json +1 -1
- package/.DS_Store +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1296,7 +1296,7 @@ function createNodeWallet(lavarageProgram, params) {
|
|
|
1296
1296
|
new PublicKey(params.mint),
|
|
1297
1297
|
lavarageProgram.programId
|
|
1298
1298
|
);
|
|
1299
|
-
instructions.push(yield lavarageProgram.methods.lpOperatorCreateNodeWallet(
|
|
1299
|
+
instructions.push(yield lavarageProgram.methods.lpOperatorCreateNodeWallet(params.liquidationLtv).accounts({
|
|
1300
1300
|
nodeWallet,
|
|
1301
1301
|
operator: new PublicKey(params.operator),
|
|
1302
1302
|
systemProgram: SystemProgram.programId,
|
|
@@ -1515,7 +1515,7 @@ function createOffer(lavarageProgram, params) {
|
|
|
1515
1515
|
nodeWalletPubKey = nodeWalletAccount.publicKey;
|
|
1516
1516
|
}
|
|
1517
1517
|
const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
1518
|
-
const instruction = yield lavarageProgram.methods.lpOperatorCreateTradingPool(
|
|
1518
|
+
const instruction = yield lavarageProgram.methods.lpOperatorCreateTradingPool(params.interestRate).accounts({
|
|
1519
1519
|
tradingPool: params.tradingPool,
|
|
1520
1520
|
operator: params.poolOwner,
|
|
1521
1521
|
nodeWallet: nodeWalletPubKey,
|
|
@@ -1582,7 +1582,7 @@ function updateInterestRate(lavarageProgram, params) {
|
|
|
1582
1582
|
return __async(this, null, function* () {
|
|
1583
1583
|
var _a;
|
|
1584
1584
|
const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
1585
|
-
const instruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(
|
|
1585
|
+
const instruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(params.interestRate).accounts({
|
|
1586
1586
|
tradingPool: params.tradingPool,
|
|
1587
1587
|
nodeWallet: new PublicKey(params.nodeWallet),
|
|
1588
1588
|
operator: params.poolOwner,
|
|
@@ -1610,7 +1610,7 @@ function updateOffer(lavarageProgram, params) {
|
|
|
1610
1610
|
operator: params.poolOwner,
|
|
1611
1611
|
systemProgram: SystemProgram.programId
|
|
1612
1612
|
}).instruction();
|
|
1613
|
-
const updateInterestRateInstruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(
|
|
1613
|
+
const updateInterestRateInstruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(params.interestRate).accounts({
|
|
1614
1614
|
tradingPool: params.tradingPool,
|
|
1615
1615
|
nodeWallet: new PublicKey(params.nodeWallet),
|
|
1616
1616
|
operator: params.poolOwner,
|
|
@@ -5928,6 +5928,12 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
5928
5928
|
);
|
|
5929
5929
|
}
|
|
5930
5930
|
}
|
|
5931
|
+
const partnerDirectAta = partnerFeeRecipient ? getAssociatedTokenAddressSync2(
|
|
5932
|
+
quoteToken,
|
|
5933
|
+
partnerFeeRecipient,
|
|
5934
|
+
true,
|
|
5935
|
+
quoteTokenProgram
|
|
5936
|
+
) : void 0;
|
|
5931
5937
|
const tradingOpenBorrowInstruction = useReferral ? yield lavarageProgram.methods.tradingOpenBorrowWithReferral(
|
|
5932
5938
|
new BN2((marginSOL.toNumber() * leverage).toFixed(0)),
|
|
5933
5939
|
marginSOL,
|
|
@@ -6007,15 +6013,9 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
6007
6013
|
quoteTokenProgram
|
|
6008
6014
|
)
|
|
6009
6015
|
}).remainingAccounts(
|
|
6010
|
-
partnerFeeRecipient && partnerFeeMarkupAsPkey &&
|
|
6016
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey && partnerDirectAta ? [
|
|
6011
6017
|
{
|
|
6012
|
-
pubkey:
|
|
6013
|
-
quoteToken,
|
|
6014
|
-
userVaultPda,
|
|
6015
|
-
true,
|
|
6016
|
-
// allowOwnerOffCurve for PDA
|
|
6017
|
-
quoteTokenProgram
|
|
6018
|
-
),
|
|
6018
|
+
pubkey: partnerDirectAta,
|
|
6019
6019
|
isSigner: false,
|
|
6020
6020
|
isWritable: true
|
|
6021
6021
|
},
|