@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 20
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npm test
|
|
20
|
+
|
|
21
|
+
publish-npm:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: actions/setup-node@v4
|
|
27
|
+
with:
|
|
28
|
+
node-version: 20
|
|
29
|
+
registry-url: https://registry.npmjs.org/
|
|
30
|
+
- run: npm ci
|
|
31
|
+
- run: npm publish
|
|
32
|
+
env:
|
|
33
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/dist/index.d.mts
CHANGED
|
@@ -4847,6 +4847,11 @@ declare const borrowV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAccou
|
|
|
4847
4847
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
4848
4848
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
4849
4849
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
4850
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
4851
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
4852
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
4853
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
4854
|
+
* @param optionalRPCResults - Optional RPC results to use for the transaction (speeds up the transaction building)
|
|
4850
4855
|
*
|
|
4851
4856
|
* @returns A versioned transaction ready to be signed and sent
|
|
4852
4857
|
*
|
|
@@ -4911,6 +4916,11 @@ declare const openTradeV1: (lavarageProgram: Program<Lavarage$1>, offer: Program
|
|
|
4911
4916
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
4912
4917
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
4913
4918
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
4919
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
4920
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
4921
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
4922
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
4923
|
+
* @param optionalRPCResults - Optional RPC results to use for the transaction (speeds up the transaction building)
|
|
4914
4924
|
*
|
|
4915
4925
|
* @returns A versioned transaction ready to be signed and sent
|
|
4916
4926
|
*
|
|
@@ -5148,6 +5158,10 @@ declare const partialRepayV2: (lavarageProgram: Program<Lavarage>, position: Pro
|
|
|
5148
5158
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
5149
5159
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
5150
5160
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
5161
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
5162
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
5163
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
5164
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
5151
5165
|
*
|
|
5152
5166
|
* @returns Transaction to close the position
|
|
5153
5167
|
*
|
|
@@ -5202,6 +5216,10 @@ declare const closeTradeV1: (lavarageProgram: Program<Lavarage$1>, position: Pro
|
|
|
5202
5216
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
5203
5217
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
5204
5218
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
5219
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
5220
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
5221
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
5222
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
5205
5223
|
*
|
|
5206
5224
|
* @returns Transaction to close the position
|
|
5207
5225
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4847,6 +4847,11 @@ declare const borrowV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAccou
|
|
|
4847
4847
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
4848
4848
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
4849
4849
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
4850
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
4851
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
4852
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
4853
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
4854
|
+
* @param optionalRPCResults - Optional RPC results to use for the transaction (speeds up the transaction building)
|
|
4850
4855
|
*
|
|
4851
4856
|
* @returns A versioned transaction ready to be signed and sent
|
|
4852
4857
|
*
|
|
@@ -4911,6 +4916,11 @@ declare const openTradeV1: (lavarageProgram: Program<Lavarage$1>, offer: Program
|
|
|
4911
4916
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
4912
4917
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
4913
4918
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
4919
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
4920
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
4921
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
4922
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
4923
|
+
* @param optionalRPCResults - Optional RPC results to use for the transaction (speeds up the transaction building)
|
|
4914
4924
|
*
|
|
4915
4925
|
* @returns A versioned transaction ready to be signed and sent
|
|
4916
4926
|
*
|
|
@@ -5148,6 +5158,10 @@ declare const partialRepayV2: (lavarageProgram: Program<Lavarage>, position: Pro
|
|
|
5148
5158
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
5149
5159
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
5150
5160
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
5161
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
5162
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
5163
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
5164
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
5151
5165
|
*
|
|
5152
5166
|
* @returns Transaction to close the position
|
|
5153
5167
|
*
|
|
@@ -5202,6 +5216,10 @@ declare const closeTradeV1: (lavarageProgram: Program<Lavarage$1>, position: Pro
|
|
|
5202
5216
|
* @param partnerFeeRecipient - Optional wallet to receive partner fees
|
|
5203
5217
|
* @param partnerFeeMarkup - Optional partner fee amount in basis points
|
|
5204
5218
|
* @param computeBudgetMicroLamports - Optional compute budget for priority fees
|
|
5219
|
+
* @param platformFeeRecipient - Optional wallet to receive platform fees (jup, okx)
|
|
5220
|
+
* @param splitTransactions - Optional boolean to split the transaction into multiple transactions (jito bundle)
|
|
5221
|
+
* @param discountBps - Optional discount basis points for the referral program
|
|
5222
|
+
* @param referralBps - Optional referral basis points for the referral program
|
|
5205
5223
|
*
|
|
5206
5224
|
* @returns Transaction to close the position
|
|
5207
5225
|
*
|
package/dist/index.js
CHANGED
|
@@ -1330,7 +1330,7 @@ function createNodeWallet(lavarageProgram, params) {
|
|
|
1330
1330
|
new import_web3.PublicKey(params.mint),
|
|
1331
1331
|
lavarageProgram.programId
|
|
1332
1332
|
);
|
|
1333
|
-
instructions.push(yield lavarageProgram.methods.lpOperatorCreateNodeWallet(
|
|
1333
|
+
instructions.push(yield lavarageProgram.methods.lpOperatorCreateNodeWallet(params.liquidationLtv).accounts({
|
|
1334
1334
|
nodeWallet,
|
|
1335
1335
|
operator: new import_web3.PublicKey(params.operator),
|
|
1336
1336
|
systemProgram: import_web3.SystemProgram.programId,
|
|
@@ -1549,7 +1549,7 @@ function createOffer(lavarageProgram, params) {
|
|
|
1549
1549
|
nodeWalletPubKey = nodeWalletAccount.publicKey;
|
|
1550
1550
|
}
|
|
1551
1551
|
const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
1552
|
-
const instruction = yield lavarageProgram.methods.lpOperatorCreateTradingPool(
|
|
1552
|
+
const instruction = yield lavarageProgram.methods.lpOperatorCreateTradingPool(params.interestRate).accounts({
|
|
1553
1553
|
tradingPool: params.tradingPool,
|
|
1554
1554
|
operator: params.poolOwner,
|
|
1555
1555
|
nodeWallet: nodeWalletPubKey,
|
|
@@ -1616,7 +1616,7 @@ function updateInterestRate(lavarageProgram, params) {
|
|
|
1616
1616
|
return __async(this, null, function* () {
|
|
1617
1617
|
var _a;
|
|
1618
1618
|
const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
1619
|
-
const instruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(
|
|
1619
|
+
const instruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(params.interestRate).accounts({
|
|
1620
1620
|
tradingPool: params.tradingPool,
|
|
1621
1621
|
nodeWallet: new import_web3.PublicKey(params.nodeWallet),
|
|
1622
1622
|
operator: params.poolOwner,
|
|
@@ -1644,7 +1644,7 @@ function updateOffer(lavarageProgram, params) {
|
|
|
1644
1644
|
operator: params.poolOwner,
|
|
1645
1645
|
systemProgram: import_web3.SystemProgram.programId
|
|
1646
1646
|
}).instruction();
|
|
1647
|
-
const updateInterestRateInstruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(
|
|
1647
|
+
const updateInterestRateInstruction = yield lavarageProgram.methods.lpOperatorUpdateInterestRate(params.interestRate).accounts({
|
|
1648
1648
|
tradingPool: params.tradingPool,
|
|
1649
1649
|
nodeWallet: new import_web3.PublicKey(params.nodeWallet),
|
|
1650
1650
|
operator: params.poolOwner,
|
|
@@ -5962,6 +5962,12 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
5962
5962
|
);
|
|
5963
5963
|
}
|
|
5964
5964
|
}
|
|
5965
|
+
const partnerDirectAta = partnerFeeRecipient ? (0, import_spl_token2.getAssociatedTokenAddressSync)(
|
|
5966
|
+
quoteToken,
|
|
5967
|
+
partnerFeeRecipient,
|
|
5968
|
+
true,
|
|
5969
|
+
quoteTokenProgram
|
|
5970
|
+
) : void 0;
|
|
5965
5971
|
const tradingOpenBorrowInstruction = useReferral ? yield lavarageProgram.methods.tradingOpenBorrowWithReferral(
|
|
5966
5972
|
new import_anchor2.BN((marginSOL.toNumber() * leverage).toFixed(0)),
|
|
5967
5973
|
marginSOL,
|
|
@@ -6041,15 +6047,9 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
6041
6047
|
quoteTokenProgram
|
|
6042
6048
|
)
|
|
6043
6049
|
}).remainingAccounts(
|
|
6044
|
-
partnerFeeRecipient && partnerFeeMarkupAsPkey &&
|
|
6050
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey && partnerDirectAta ? [
|
|
6045
6051
|
{
|
|
6046
|
-
pubkey:
|
|
6047
|
-
quoteToken,
|
|
6048
|
-
userVaultPda,
|
|
6049
|
-
true,
|
|
6050
|
-
// allowOwnerOffCurve for PDA
|
|
6051
|
-
quoteTokenProgram
|
|
6052
|
-
),
|
|
6052
|
+
pubkey: partnerDirectAta,
|
|
6053
6053
|
isSigner: false,
|
|
6054
6054
|
isWritable: true
|
|
6055
6055
|
},
|