@meteora-ag/dlmm 1.9.8 → 1.9.10

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.d.ts CHANGED
@@ -14332,7 +14332,8 @@ declare class DLMM {
14332
14332
  * - `limitOrderPubkey`: The public key of the limit-order account to cancel.
14333
14333
  * - `owner`: The owner of the limit-order account and transaction fee payer.
14334
14334
  * - `binIds`: Bin IDs to cancel from the limit order.
14335
- * @returns {Promise<Transaction>} A transaction that cancels the limit order and handles SOL unwrap when needed.
14335
+ * @returns {Promise<Transaction>} A transaction that cancels the limit order, ensures owner ATAs for both pool
14336
+ * mints (including idempotent creates for non-SOL legs), and unwraps SOL when applicable.
14336
14337
  */
14337
14338
  cancelLimitOrder({ limitOrderPubkey, owner, rentReceiver, binIds, }: {
14338
14339
  limitOrderPubkey: PublicKey;
package/dist/index.js CHANGED
@@ -10266,6 +10266,7 @@ var DlmmSdkError = class extends Error {
10266
10266
 
10267
10267
 
10268
10268
 
10269
+
10269
10270
  // src/dlmm/types/index.ts
10270
10271
 
10271
10272
 
@@ -15354,7 +15355,8 @@ async function chunkDepositWithRebalanceEndpoint(dlmm, strategy, slippagePercent
15354
15355
  const initBitmapIx = await dlmm.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
15355
15356
  binArrayBitmapExtension: bitmapPubkey,
15356
15357
  lbPair: dlmm.pubkey,
15357
- funder: payer
15358
+ funder: payer,
15359
+ rent: _web3js.SYSVAR_RENT_PUBKEY
15358
15360
  }).instruction();
15359
15361
  initBitmapIxs.push(initBitmapIx);
15360
15362
  binArrayOrBitmapInitTracking.add(bitmapPubkey.toBase58());
@@ -20731,7 +20733,8 @@ var DLMM = class {
20731
20733
  await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
20732
20734
  binArrayBitmapExtension,
20733
20735
  funder: payer,
20734
- lbPair: this.pubkey
20736
+ lbPair: this.pubkey,
20737
+ rent: _web3js.SYSVAR_RENT_PUBKEY
20735
20738
  }).instruction()
20736
20739
  );
20737
20740
  appendedInitBinArrayBitmap = true;
@@ -20930,7 +20933,8 @@ var DLMM = class {
20930
20933
  await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
20931
20934
  binArrayBitmapExtension,
20932
20935
  funder: payer,
20933
- lbPair: this.pubkey
20936
+ lbPair: this.pubkey,
20937
+ rent: _web3js.SYSVAR_RENT_PUBKEY
20934
20938
  }).instruction()
20935
20939
  );
20936
20940
  binArrayBitmapLamports = binArrayBitmapLamports.add(
@@ -21346,7 +21350,8 @@ var DLMM = class {
21346
21350
  const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
21347
21351
  binArrayBitmapExtension: binArrayBitMapExtensionPubkey,
21348
21352
  funder: owner,
21349
- lbPair: this.pubkey
21353
+ lbPair: this.pubkey,
21354
+ rent: _web3js.SYSVAR_RENT_PUBKEY
21350
21355
  }).instruction();
21351
21356
  preInstructions.push(initializeBitmapExtensionIx);
21352
21357
  }
@@ -21754,7 +21759,8 @@ var DLMM = class {
21754
21759
  const initBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
21755
21760
  binArrayBitmapExtension: binArrayBitmap,
21756
21761
  funder: owner,
21757
- lbPair: this.pubkey
21762
+ lbPair: this.pubkey,
21763
+ rent: _web3js.SYSVAR_RENT_PUBKEY
21758
21764
  }).preInstructions([
21759
21765
  _web3js.ComputeBudgetProgram.setComputeUnitLimit({
21760
21766
  units: DEFAULT_INIT_BIN_ARRAY_CU
@@ -21970,7 +21976,8 @@ var DLMM = class {
21970
21976
  const initializeBitmapExtensionIx = await this.program.methods.initializeBinArrayBitmapExtension().accountsPartial({
21971
21977
  binArrayBitmapExtension,
21972
21978
  funder: owner,
21973
- lbPair: this.pubkey
21979
+ lbPair: this.pubkey,
21980
+ rent: _web3js.SYSVAR_RENT_PUBKEY
21974
21981
  }).instruction();
21975
21982
  preInstructions.push(initializeBitmapExtensionIx);
21976
21983
  }
@@ -22062,7 +22069,8 @@ var DLMM = class {
22062
22069
  * - `limitOrderPubkey`: The public key of the limit-order account to cancel.
22063
22070
  * - `owner`: The owner of the limit-order account and transaction fee payer.
22064
22071
  * - `binIds`: Bin IDs to cancel from the limit order.
22065
- * @returns {Promise<Transaction>} A transaction that cancels the limit order and handles SOL unwrap when needed.
22072
+ * @returns {Promise<Transaction>} A transaction that cancels the limit order, ensures owner ATAs for both pool
22073
+ * mints (including idempotent creates for non-SOL legs), and unwraps SOL when applicable.
22066
22074
  */
22067
22075
  async cancelLimitOrder({
22068
22076
  limitOrderPubkey,
@@ -22090,7 +22098,20 @@ var DLMM = class {
22090
22098
  true,
22091
22099
  this.tokenY.owner
22092
22100
  );
22093
- if (this.tokenX.mint.address.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _177 => _177.opt, 'optionalAccess', _178 => _178.skipSolWrappingOperation])) {
22101
+ if (this.tokenX.mint.address.equals(_spltoken.NATIVE_MINT)) {
22102
+ if (!_optionalChain([this, 'access', _177 => _177.opt, 'optionalAccess', _178 => _178.skipSolWrappingOperation])) {
22103
+ preInstructions.push(
22104
+ _spltoken.createAssociatedTokenAccountIdempotentInstruction.call(void 0,
22105
+ owner,
22106
+ userTokenX,
22107
+ owner,
22108
+ this.tokenX.mint.address,
22109
+ this.tokenX.owner
22110
+ )
22111
+ );
22112
+ postInstructions.push(unwrapSOLInstruction(owner));
22113
+ }
22114
+ } else {
22094
22115
  preInstructions.push(
22095
22116
  _spltoken.createAssociatedTokenAccountIdempotentInstruction.call(void 0,
22096
22117
  owner,
@@ -22100,9 +22121,21 @@ var DLMM = class {
22100
22121
  this.tokenX.owner
22101
22122
  )
22102
22123
  );
22103
- postInstructions.push(unwrapSOLInstruction(owner));
22104
22124
  }
22105
- if (this.tokenY.mint.address.equals(_spltoken.NATIVE_MINT) && !_optionalChain([this, 'access', _179 => _179.opt, 'optionalAccess', _180 => _180.skipSolWrappingOperation])) {
22125
+ if (this.tokenY.mint.address.equals(_spltoken.NATIVE_MINT)) {
22126
+ if (!_optionalChain([this, 'access', _179 => _179.opt, 'optionalAccess', _180 => _180.skipSolWrappingOperation])) {
22127
+ preInstructions.push(
22128
+ _spltoken.createAssociatedTokenAccountIdempotentInstruction.call(void 0,
22129
+ owner,
22130
+ userTokenY,
22131
+ owner,
22132
+ this.tokenY.mint.address,
22133
+ this.tokenY.owner
22134
+ )
22135
+ );
22136
+ postInstructions.push(unwrapSOLInstruction(owner));
22137
+ }
22138
+ } else {
22106
22139
  preInstructions.push(
22107
22140
  _spltoken.createAssociatedTokenAccountIdempotentInstruction.call(void 0,
22108
22141
  owner,
@@ -22112,7 +22145,6 @@ var DLMM = class {
22112
22145
  this.tokenY.owner
22113
22146
  )
22114
22147
  );
22115
- postInstructions.push(unwrapSOLInstruction(owner));
22116
22148
  }
22117
22149
  const closeLimitOrderIx = await this.program.methods.closeLimitOrderIfEmpty().accountsPartial({
22118
22150
  limitOrder: limitOrderPubkey,