@meteora-ag/dlmm 1.5.0-rc.1 → 1.5.0-rc.2

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
@@ -12,7 +12,7 @@ import {
12
12
  } from "@solana/spl-token";
13
13
  import {
14
14
  ComputeBudgetProgram as ComputeBudgetProgram3,
15
- Keypair,
15
+ Keypair as Keypair2,
16
16
  LAMPORTS_PER_SOL as LAMPORTS_PER_SOL2,
17
17
  PublicKey as PublicKey9,
18
18
  SYSVAR_CLOCK_PUBKEY,
@@ -14417,7 +14417,9 @@ var DLMM = class {
14417
14417
  tokenBadgeX,
14418
14418
  tokenBadgeY
14419
14419
  ]);
14420
- const presetParameterState = await program.account.presetParameter2.fetch(presetParameter);
14420
+ const presetParameterState = await program.account.presetParameter2.fetch(
14421
+ presetParameter
14422
+ );
14421
14423
  const existsPool = await this.getPairPubkeyIfExists(
14422
14424
  connection,
14423
14425
  tokenX,
@@ -15170,7 +15172,7 @@ var DLMM = class {
15170
15172
  const initBinArrayIxs = [];
15171
15173
  const binArrayIndexSet = /* @__PURE__ */ new Set();
15172
15174
  for (let i = 0; i < positionCount; i++) {
15173
- const positionKeypair = Keypair.generate();
15175
+ const positionKeypair = Keypair2.generate();
15174
15176
  positionKeypairs.push(positionKeypair);
15175
15177
  const { lowerBinId, upperBinId } = chunkedBinRange[i];
15176
15178
  let width = upperBinId - lowerBinId + 1;
@@ -15446,7 +15448,8 @@ var DLMM = class {
15446
15448
  totalYAmount,
15447
15449
  strategy,
15448
15450
  user,
15449
- slippage
15451
+ slippage,
15452
+ customKeyPairGenerator
15450
15453
  }) {
15451
15454
  const { maxBinId, minBinId } = strategy;
15452
15455
  const activeBin = await this.getActiveBin();
@@ -15473,7 +15476,7 @@ var DLMM = class {
15473
15476
  const initPositionIxs = [];
15474
15477
  const addLiquidityIxs = [];
15475
15478
  for (let i = 0; i < chunkedPositionBinRange.length; i++) {
15476
- const positionKeypair = Keypair.generate();
15479
+ const positionKeypair = await customKeyPairGenerator?.() ?? Keypair2.generate();
15477
15480
  positionKeypairs.push(positionKeypair);
15478
15481
  const { lowerBinId, upperBinId } = chunkedPositionBinRange[i];
15479
15482
  let width = upperBinId - lowerBinId + 1;
@@ -16103,7 +16106,9 @@ var DLMM = class {
16103
16106
  slippage
16104
16107
  }) {
16105
16108
  const maxActiveBinSlippage = slippage ? Math.ceil(slippage / (this.lbPair.binStep / 100)) : MAX_ACTIVE_BIN_SLIPPAGE;
16106
- const positionAccount = await this.program.account.positionV2.fetch(positionPubKey);
16109
+ const positionAccount = await this.program.account.positionV2.fetch(
16110
+ positionPubKey
16111
+ );
16107
16112
  const { lowerBinId, upperBinId, binIds } = this.processXYAmountDistribution(xYAmountDistribution);
16108
16113
  if (lowerBinId < positionAccount.lowerBinId)
16109
16114
  throw new Error(