@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.
Files changed (75) hide show
  1. package/.github/workflows/npm-publish.yml +33 -0
  2. package/dist/index.d.mts +18 -0
  3. package/dist/index.d.ts +18 -0
  4. package/dist/index.js +12 -12
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +12 -12
  7. package/dist/index.mjs.map +1 -1
  8. package/docs/functions/borrowV1.html +1 -1
  9. package/docs/functions/borrowV2.html +1 -1
  10. package/docs/functions/closePositionEvm.html +2 -2
  11. package/docs/functions/closeTradeV1.html +7 -3
  12. package/docs/functions/closeTradeV2.html +7 -3
  13. package/docs/functions/createTpDelegate.html +2 -2
  14. package/docs/functions/getActiveLoanCountEvm.html +2 -2
  15. package/docs/functions/getActiveLoansBatchEvm.html +2 -2
  16. package/docs/functions/getAllPositions.html +2 -2
  17. package/docs/functions/getAvailableExposureEvm.html +2 -2
  18. package/docs/functions/getClosedPositions.html +2 -2
  19. package/docs/functions/getClosedPositionsEvm.html +2 -2
  20. package/docs/functions/getCollateralExposureEvm.html +2 -2
  21. package/docs/functions/getCollateralInfoEvm.html +2 -2
  22. package/docs/functions/getDelegateAccounts.html +2 -2
  23. package/docs/functions/getLiquidatedPositions.html +2 -2
  24. package/docs/functions/getLiquidatedPositionsEvm.html +2 -2
  25. package/docs/functions/getLoanEvm.html +2 -2
  26. package/docs/functions/getLoansByBorrowerEvm.html +2 -2
  27. package/docs/functions/getOffers.html +2 -2
  28. package/docs/functions/getOffersEvm.html +2 -2
  29. package/docs/functions/getOpenPositions.html +2 -2
  30. package/docs/functions/getOpeningFeeEvm.html +2 -2
  31. package/docs/functions/getPda.html +2 -2
  32. package/docs/functions/getPositionAccountPDA.html +2 -2
  33. package/docs/functions/getPositionsEvm.html +2 -2
  34. package/docs/functions/getProfitFeeEvm.html +2 -2
  35. package/docs/functions/getTokenBalanceEvm.html +2 -2
  36. package/docs/functions/getUserLoansEvm.html +2 -2
  37. package/docs/functions/lending.addToWithdrawalAccessList.html +1 -1
  38. package/docs/functions/lending.createOffer.html +2 -2
  39. package/docs/functions/lending.depositFunds.html +2 -2
  40. package/docs/functions/lending.getNodeWalletPDA.html +2 -2
  41. package/docs/functions/lending.getTradingPoolPDA.html +2 -2
  42. package/docs/functions/lending.getWithdrawalAccessList.html +1 -1
  43. package/docs/functions/lending.getWithdrawalAccessListPDA.html +1 -1
  44. package/docs/functions/lending.removeFromWithdrawalAccessList.html +1 -1
  45. package/docs/functions/lending.updateInterestRate.html +2 -2
  46. package/docs/functions/lending.updateMaxBorrow.html +2 -2
  47. package/docs/functions/lending.updateMaxExposure.html +2 -2
  48. package/docs/functions/lending.updateOffer.html +2 -2
  49. package/docs/functions/lending.withdrawFunds.html +2 -2
  50. package/docs/functions/lending.withdrawFundsV1.html +2 -2
  51. package/docs/functions/lending.withdrawFundsV2.html +2 -2
  52. package/docs/functions/liquidatePositionEvm.html +2 -2
  53. package/docs/functions/mergePositionV2.html +2 -2
  54. package/docs/functions/modifyTpDelegate.html +2 -2
  55. package/docs/functions/openPositionEvm.html +2 -2
  56. package/docs/functions/openTradeV1.html +8 -3
  57. package/docs/functions/openTradeV2.html +8 -3
  58. package/docs/functions/partialRepayV1.html +2 -2
  59. package/docs/functions/partialRepayV2.html +2 -2
  60. package/docs/functions/removeTpDelegate.html +2 -2
  61. package/docs/functions/splitPositionV2.html +2 -2
  62. package/docs/functions/updateMaxLendPerTokenBatchEvm.html +2 -2
  63. package/docs/hierarchy.html +1 -1
  64. package/docs/index.html +2 -2
  65. package/docs/modules/IDLV2.html +2 -2
  66. package/docs/modules/lending.html +1 -1
  67. package/docs/modules.html +2 -2
  68. package/docs/types/IDLV2.Lavarage.html +2 -2
  69. package/docs/types/Lavarage.html +2 -2
  70. package/docs/variables/IDL.html +1 -1
  71. package/docs/variables/IDLV2.IDL.html +1 -1
  72. package/index.ts +27 -7
  73. package/lending.ts +4 -4
  74. package/package.json +1 -1
  75. 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(new BN(params.liquidationLtv)).accounts({
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(new BN(params.interestRate)).accounts({
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(new BN(params.interestRate)).accounts({
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(new BN(params.interestRate)).accounts({
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 && userVaultPda ? [
6016
+ partnerFeeRecipient && partnerFeeMarkupAsPkey && partnerDirectAta ? [
6011
6017
  {
6012
- pubkey: getAssociatedTokenAddressSync2(
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
  },