@crypticdot/defituna-client 2.0.15 → 2.0.17

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.js CHANGED
@@ -7251,9 +7251,9 @@ function getLiquidityIncreaseQuote(args) {
7251
7251
  throw new Error("sqrtPrice must be less than upperSqrtPrice if collateral B is computed.");
7252
7252
  }
7253
7253
  }
7254
- const protocolFeeA = calculateProtocolFee(collateralA, borrowA, protocolFeeRate, protocolFeeRateOnCollateral);
7254
+ const protocolFeeA = calculateProtocolFee(collateralA, borrowA, protocolFeeRateOnCollateral, protocolFeeRate);
7255
7255
  const providedA = collateralA + borrowA - protocolFeeA;
7256
- const protocolFeeB = calculateProtocolFee(collateralB, borrowB, protocolFeeRate, protocolFeeRateOnCollateral);
7256
+ const protocolFeeB = calculateProtocolFee(collateralB, borrowB, protocolFeeRateOnCollateral, protocolFeeRate);
7257
7257
  const providedB = collateralB + borrowB - protocolFeeB;
7258
7258
  let swapInput = 0n;
7259
7259
  let swapOutput = 0n;
@@ -8737,22 +8737,22 @@ var import_memo8 = require("@solana-program/memo");
8737
8737
  var import_token_202214 = require("@solana-program/token-2022");
8738
8738
  async function liquidatePositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
8739
8739
  const instructions = [];
8740
- const createLiquidatorAtaAInstructions = await getCreateAtaInstructions(
8740
+ const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
8741
8741
  void 0,
8742
8742
  authority,
8743
8743
  mintA.address,
8744
- authority.address,
8744
+ tunaConfig.data.feeRecipient,
8745
8745
  mintA.programAddress
8746
8746
  );
8747
- instructions.push(...createLiquidatorAtaAInstructions.init);
8748
- const createLiquidatorAtaBInstructions = await getCreateAtaInstructions(
8747
+ instructions.push(...createFeeRecipientAtaAInstructions.init);
8748
+ const createFeeRecipientAtaBInstructions = await getCreateAtaInstructions(
8749
8749
  void 0,
8750
8750
  authority,
8751
8751
  mintB.address,
8752
- authority.address,
8752
+ tunaConfig.data.feeRecipient,
8753
8753
  mintB.programAddress
8754
8754
  );
8755
- instructions.push(...createLiquidatorAtaBInstructions.init);
8755
+ instructions.push(...createFeeRecipientAtaBInstructions.init);
8756
8756
  const ix = await liquidatePositionOrcaInstruction(
8757
8757
  authority,
8758
8758
  tunaPosition,
@@ -8765,8 +8765,8 @@ async function liquidatePositionOrcaInstructions(authority, tunaPosition, tunaCo
8765
8765
  withdrawPercent
8766
8766
  );
8767
8767
  instructions.push(ix);
8768
- instructions.push(...createLiquidatorAtaAInstructions.cleanup);
8769
- instructions.push(...createLiquidatorAtaBInstructions.cleanup);
8768
+ instructions.push(...createFeeRecipientAtaAInstructions.cleanup);
8769
+ instructions.push(...createFeeRecipientAtaBInstructions.cleanup);
8770
8770
  return instructions;
8771
8771
  }
8772
8772
  async function liquidatePositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
@@ -8878,22 +8878,22 @@ var import_memo9 = require("@solana-program/memo");
8878
8878
  var import_token_202215 = require("@solana-program/token-2022");
8879
8879
  async function liquidatePositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
8880
8880
  const instructions = [];
8881
- const createLiquidatorAtaAInstructions = await getCreateAtaInstructions(
8881
+ const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
8882
8882
  void 0,
8883
8883
  authority,
8884
8884
  mintA.address,
8885
- authority.address,
8885
+ tunaConfig.data.feeRecipient,
8886
8886
  mintA.programAddress
8887
8887
  );
8888
- instructions.push(...createLiquidatorAtaAInstructions.init);
8889
- const createLiquidatorAtaBInstructions = await getCreateAtaInstructions(
8888
+ instructions.push(...createFeeRecipientAtaAInstructions.init);
8889
+ const createFeeRecipientAtaBInstructions = await getCreateAtaInstructions(
8890
8890
  void 0,
8891
8891
  authority,
8892
8892
  mintB.address,
8893
- authority.address,
8893
+ tunaConfig.data.feeRecipient,
8894
8894
  mintB.programAddress
8895
8895
  );
8896
- instructions.push(...createLiquidatorAtaBInstructions.init);
8896
+ instructions.push(...createFeeRecipientAtaBInstructions.init);
8897
8897
  const ix = await liquidatePositionFusionInstruction(
8898
8898
  authority,
8899
8899
  tunaPosition,
@@ -8906,8 +8906,8 @@ async function liquidatePositionFusionInstructions(authority, tunaPosition, tuna
8906
8906
  withdrawPercent
8907
8907
  );
8908
8908
  instructions.push(ix);
8909
- instructions.push(...createLiquidatorAtaAInstructions.cleanup);
8910
- instructions.push(...createLiquidatorAtaBInstructions.cleanup);
8909
+ instructions.push(...createFeeRecipientAtaAInstructions.cleanup);
8910
+ instructions.push(...createFeeRecipientAtaBInstructions.cleanup);
8911
8911
  return instructions;
8912
8912
  }
8913
8913
  async function liquidatePositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, withdrawPercent) {
package/dist/index.mjs CHANGED
@@ -7353,9 +7353,9 @@ function getLiquidityIncreaseQuote(args) {
7353
7353
  throw new Error("sqrtPrice must be less than upperSqrtPrice if collateral B is computed.");
7354
7354
  }
7355
7355
  }
7356
- const protocolFeeA = calculateProtocolFee(collateralA, borrowA, protocolFeeRate, protocolFeeRateOnCollateral);
7356
+ const protocolFeeA = calculateProtocolFee(collateralA, borrowA, protocolFeeRateOnCollateral, protocolFeeRate);
7357
7357
  const providedA = collateralA + borrowA - protocolFeeA;
7358
- const protocolFeeB = calculateProtocolFee(collateralB, borrowB, protocolFeeRate, protocolFeeRateOnCollateral);
7358
+ const protocolFeeB = calculateProtocolFee(collateralB, borrowB, protocolFeeRateOnCollateral, protocolFeeRate);
7359
7359
  const providedB = collateralB + borrowB - protocolFeeB;
7360
7360
  let swapInput = 0n;
7361
7361
  let swapOutput = 0n;
@@ -8920,22 +8920,22 @@ import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS8 } from "@solana-program/m
8920
8920
  import { findAssociatedTokenPda as findAssociatedTokenPda14, TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS11 } from "@solana-program/token-2022";
8921
8921
  async function liquidatePositionOrcaInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
8922
8922
  const instructions = [];
8923
- const createLiquidatorAtaAInstructions = await getCreateAtaInstructions(
8923
+ const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
8924
8924
  void 0,
8925
8925
  authority,
8926
8926
  mintA.address,
8927
- authority.address,
8927
+ tunaConfig.data.feeRecipient,
8928
8928
  mintA.programAddress
8929
8929
  );
8930
- instructions.push(...createLiquidatorAtaAInstructions.init);
8931
- const createLiquidatorAtaBInstructions = await getCreateAtaInstructions(
8930
+ instructions.push(...createFeeRecipientAtaAInstructions.init);
8931
+ const createFeeRecipientAtaBInstructions = await getCreateAtaInstructions(
8932
8932
  void 0,
8933
8933
  authority,
8934
8934
  mintB.address,
8935
- authority.address,
8935
+ tunaConfig.data.feeRecipient,
8936
8936
  mintB.programAddress
8937
8937
  );
8938
- instructions.push(...createLiquidatorAtaBInstructions.init);
8938
+ instructions.push(...createFeeRecipientAtaBInstructions.init);
8939
8939
  const ix = await liquidatePositionOrcaInstruction(
8940
8940
  authority,
8941
8941
  tunaPosition,
@@ -8948,8 +8948,8 @@ async function liquidatePositionOrcaInstructions(authority, tunaPosition, tunaCo
8948
8948
  withdrawPercent
8949
8949
  );
8950
8950
  instructions.push(ix);
8951
- instructions.push(...createLiquidatorAtaAInstructions.cleanup);
8952
- instructions.push(...createLiquidatorAtaBInstructions.cleanup);
8951
+ instructions.push(...createFeeRecipientAtaAInstructions.cleanup);
8952
+ instructions.push(...createFeeRecipientAtaBInstructions.cleanup);
8953
8953
  return instructions;
8954
8954
  }
8955
8955
  async function liquidatePositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
@@ -9061,22 +9061,22 @@ import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS9 } from "@solana-program/m
9061
9061
  import { findAssociatedTokenPda as findAssociatedTokenPda15, TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS12 } from "@solana-program/token-2022";
9062
9062
  async function liquidatePositionFusionInstructions(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, withdrawPercent) {
9063
9063
  const instructions = [];
9064
- const createLiquidatorAtaAInstructions = await getCreateAtaInstructions(
9064
+ const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
9065
9065
  void 0,
9066
9066
  authority,
9067
9067
  mintA.address,
9068
- authority.address,
9068
+ tunaConfig.data.feeRecipient,
9069
9069
  mintA.programAddress
9070
9070
  );
9071
- instructions.push(...createLiquidatorAtaAInstructions.init);
9072
- const createLiquidatorAtaBInstructions = await getCreateAtaInstructions(
9071
+ instructions.push(...createFeeRecipientAtaAInstructions.init);
9072
+ const createFeeRecipientAtaBInstructions = await getCreateAtaInstructions(
9073
9073
  void 0,
9074
9074
  authority,
9075
9075
  mintB.address,
9076
- authority.address,
9076
+ tunaConfig.data.feeRecipient,
9077
9077
  mintB.programAddress
9078
9078
  );
9079
- instructions.push(...createLiquidatorAtaBInstructions.init);
9079
+ instructions.push(...createFeeRecipientAtaBInstructions.init);
9080
9080
  const ix = await liquidatePositionFusionInstruction(
9081
9081
  authority,
9082
9082
  tunaPosition,
@@ -9089,8 +9089,8 @@ async function liquidatePositionFusionInstructions(authority, tunaPosition, tuna
9089
9089
  withdrawPercent
9090
9090
  );
9091
9091
  instructions.push(ix);
9092
- instructions.push(...createLiquidatorAtaAInstructions.cleanup);
9093
- instructions.push(...createLiquidatorAtaBInstructions.cleanup);
9092
+ instructions.push(...createFeeRecipientAtaAInstructions.cleanup);
9093
+ instructions.push(...createFeeRecipientAtaBInstructions.cleanup);
9094
9094
  return instructions;
9095
9095
  }
9096
9096
  async function liquidatePositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, withdrawPercent) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crypticdot/defituna-client",
3
3
  "description": "Typescript client to interact with DefiTuna's on-chain program.",
4
- "version": "2.0.15",
4
+ "version": "2.0.17",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "main": "./dist/index.js",