@lavarage/sdk 6.6.0 → 6.7.0

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/dist/index.mjs CHANGED
@@ -3480,7 +3480,8 @@ function getPositionsEvm(provider, borrowerOpsContractAddress, fromBlock = 42960
3480
3480
  loanId,
3481
3481
  openingPositionSize,
3482
3482
  collateralAmount,
3483
- initialMargin
3483
+ initialMargin,
3484
+ transactionHash: event.transactionHash
3484
3485
  };
3485
3486
  });
3486
3487
  });
@@ -3495,19 +3496,14 @@ function getClosedPositionsEvm(provider, borrowerOpsContractAddress, fromBlock =
3495
3496
  const filter = contract.filters.Sell();
3496
3497
  const events = yield contract.queryFilter(filter, fromBlock);
3497
3498
  return events.map((event) => {
3498
- const {
3499
- buyer,
3500
- tokenCollateral,
3501
- loanId,
3502
- closingPositionSize,
3503
- profit
3504
- } = event.args;
3499
+ const { buyer, tokenCollateral, loanId, closingPositionSize, profit } = event.args;
3505
3500
  return {
3506
3501
  trader: buyer,
3507
3502
  tokenCollateral,
3508
3503
  loanId,
3509
3504
  closingPositionSize,
3510
- profit
3505
+ profit,
3506
+ transactionHash: event.transactionHash
3511
3507
  };
3512
3508
  });
3513
3509
  });
@@ -3534,7 +3530,8 @@ function getLiquidatedPositionsEvm(provider, borrowerOpsContractAddress, fromBlo
3534
3530
  tokenCollateral,
3535
3531
  loanId,
3536
3532
  closingPositionSize,
3537
- liquidatorRepaidAmount
3533
+ liquidatorRepaidAmount,
3534
+ transactionHash: event.transactionHash
3538
3535
  };
3539
3536
  });
3540
3537
  });
@@ -3710,7 +3707,7 @@ var getLiquidatedPositions = (lavarageProgram) => {
3710
3707
  var getAllPositions = (lavarageProgram) => {
3711
3708
  return lavarageProgram.account.position.all([{ dataSize: 178 }]);
3712
3709
  };
3713
- var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
3710
+ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, tokenProgram, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
3714
3711
  let partnerFeeMarkupAsPkey;
3715
3712
  if (partnerFeeMarkup) {
3716
3713
  const feeBuffer = Buffer.alloc(8);
@@ -3724,10 +3721,6 @@ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
3724
3721
  offer,
3725
3722
  randomSeed.publicKey
3726
3723
  );
3727
- const mintAccount = yield lavarageProgram.provider.connection.getAccountInfo(
3728
- offer.account.collateralType
3729
- );
3730
- const tokenProgram = mintAccount == null ? void 0 : mintAccount.owner;
3731
3724
  const fromTokenAccount = yield getTokenAccountOrCreateIfNotExists(
3732
3725
  lavarageProgram,
3733
3726
  lavarageProgram.provider.publicKey,
@@ -3845,7 +3838,7 @@ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
3845
3838
  const tx = new VersionedTransaction(messageV0);
3846
3839
  return tx;
3847
3840
  });
3848
- var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, quoteToken, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
3841
+ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, quoteToken, tokenProgram, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
3849
3842
  let partnerFeeMarkupAsPkey;
3850
3843
  if (partnerFeeMarkup) {
3851
3844
  const feeBuffer = Buffer.alloc(8);
@@ -3859,10 +3852,6 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
3859
3852
  offer,
3860
3853
  randomSeed.publicKey
3861
3854
  );
3862
- const mintAccount = yield lavarageProgram.provider.connection.getAccountInfo(
3863
- offer.account.collateralType
3864
- );
3865
- const tokenProgram = mintAccount == null ? void 0 : mintAccount.owner;
3866
3855
  const quoteMintAccount = yield lavarageProgram.provider.connection.getAccountInfo(quoteToken);
3867
3856
  const quoteTokenProgram = quoteMintAccount == null ? void 0 : quoteMintAccount.owner;
3868
3857
  const fromTokenAccount = yield getTokenAccountOrCreateIfNotExists(