@meteora-ag/dlmm 1.9.1-rc.0 → 1.9.1-rc.1

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
@@ -17032,6 +17032,16 @@ var DLMM = class {
17032
17032
  tokenYAccount.owner
17033
17033
  );
17034
17034
  createUserTokenYIx && preInstructions.push(createUserTokenYIx);
17035
+ const postInstructions = [];
17036
+ if (tokenY.equals(NATIVE_MINT2) && !opt?.skipSolWrappingOperation) {
17037
+ const wrapAmount = BigInt(1e6);
17038
+ const wrapSOLIx = wrapSOLInstruction(creatorKey, userTokenY, wrapAmount);
17039
+ preInstructions.push(...wrapSOLIx);
17040
+ const unwrapSOLIx = await unwrapSOLInstruction(creatorKey);
17041
+ if (unwrapSOLIx) {
17042
+ postInstructions.push(unwrapSOLIx);
17043
+ }
17044
+ }
17035
17045
  return program.methods.initializeCustomizablePermissionlessLbPair2(ixData).accountsPartial({
17036
17046
  tokenBadgeX: tokenBadgeXAccount ? tokenBadgeX : program.programId,
17037
17047
  tokenBadgeY: tokenBadgeYAccount ? tokenBadgeY : program.programId,
@@ -17048,7 +17058,7 @@ var DLMM = class {
17048
17058
  funder: creatorKey,
17049
17059
  tokenProgramX: tokenXAccount.owner,
17050
17060
  tokenProgramY: tokenYAccount.owner
17051
- }).preInstructions(preInstructions).transaction();
17061
+ }).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
17052
17062
  }
17053
17063
  /**
17054
17064
  * Create a new customizable permissionless pair. Support only token program.
@@ -17072,13 +17082,7 @@ var DLMM = class {
17072
17082
  tokenY,
17073
17083
  program.programId
17074
17084
  );
17075
- const [
17076
- tokenXAccount,
17077
- tokenYAccount
17078
- ] = await connection.getMultipleAccountsInfo([
17079
- tokenX,
17080
- tokenY
17081
- ]);
17085
+ const [tokenXAccount, tokenYAccount] = await connection.getMultipleAccountsInfo([tokenX, tokenY]);
17082
17086
  const [reserveX] = deriveReserve(tokenX, lbPair, program.programId);
17083
17087
  const [reserveY] = deriveReserve(tokenY, lbPair, program.programId);
17084
17088
  const [oracle] = deriveOracle(lbPair, program.programId);
@@ -17120,6 +17124,16 @@ var DLMM = class {
17120
17124
  tokenYAccount.owner
17121
17125
  );
17122
17126
  createUserTokenYIx && preInstructions.push(createUserTokenYIx);
17127
+ const postInstructions = [];
17128
+ if (tokenY.equals(NATIVE_MINT2) && !opt?.skipSolWrappingOperation) {
17129
+ const wrapAmount = BigInt(1e6);
17130
+ const wrapSOLIx = wrapSOLInstruction(creatorKey, userTokenY, wrapAmount);
17131
+ preInstructions.push(...wrapSOLIx);
17132
+ const unwrapSOLIx = await unwrapSOLInstruction(creatorKey);
17133
+ if (unwrapSOLIx) {
17134
+ postInstructions.push(unwrapSOLIx);
17135
+ }
17136
+ }
17123
17137
  return program.methods.initializeCustomizablePermissionlessLbPair(ixData).accountsPartial({
17124
17138
  lbPair,
17125
17139
  reserveX,
@@ -17132,7 +17146,7 @@ var DLMM = class {
17132
17146
  userTokenX,
17133
17147
  userTokenY,
17134
17148
  funder: creatorKey
17135
- }).preInstructions(preInstructions).transaction();
17149
+ }).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
17136
17150
  }
17137
17151
  /**
17138
17152
  * Create a new liquidity pair. Support only token program.