@meteora-ag/dlmm 1.0.3 → 1.0.5

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
@@ -2086,6 +2086,27 @@ var IDL = {
2086
2086
  "type": "u64"
2087
2087
  }
2088
2088
  ]
2089
+ },
2090
+ {
2091
+ "name": "setActivationSlot",
2092
+ "accounts": [
2093
+ {
2094
+ "name": "lbPair",
2095
+ "isMut": true,
2096
+ "isSigner": false
2097
+ },
2098
+ {
2099
+ "name": "admin",
2100
+ "isMut": true,
2101
+ "isSigner": true
2102
+ }
2103
+ ],
2104
+ "args": [
2105
+ {
2106
+ "name": "activationSlot",
2107
+ "type": "u64"
2108
+ }
2109
+ ]
2089
2110
  }
2090
2111
  ],
2091
2112
  "accounts": [
@@ -2246,7 +2267,7 @@ var IDL = {
2246
2267
  {
2247
2268
  "name": "status",
2248
2269
  "docs": [
2249
- "Status of the pair"
2270
+ "Status of the pair. Check PairStatus enum."
2250
2271
  ],
2251
2272
  "type": "u8"
2252
2273
  },
@@ -2362,6 +2383,13 @@ var IDL = {
2362
2383
  ],
2363
2384
  "type": "publicKey"
2364
2385
  },
2386
+ {
2387
+ "name": "activationSlot",
2388
+ "docs": [
2389
+ "Slot to enable the pair. Only available for permission pair."
2390
+ ],
2391
+ "type": "u64"
2392
+ },
2365
2393
  {
2366
2394
  "name": "reserved",
2367
2395
  "docs": [
@@ -2370,7 +2398,7 @@ var IDL = {
2370
2398
  "type": {
2371
2399
  "array": [
2372
2400
  "u8",
2373
- 88
2401
+ 80
2374
2402
  ]
2375
2403
  }
2376
2404
  }
@@ -7427,7 +7455,7 @@ var DLMM = class {
7427
7455
  pubkey
7428
7456
  };
7429
7457
  });
7430
- return await this.program.methods.swap(inAmount, minOutAmount).accounts({
7458
+ const swapTx = await this.program.methods.swap(inAmount, minOutAmount).accounts({
7431
7459
  lbPair,
7432
7460
  reserveX,
7433
7461
  reserveY,
@@ -7444,6 +7472,12 @@ var DLMM = class {
7444
7472
  oracle,
7445
7473
  hostFeeIn: null
7446
7474
  }).remainingAccounts(binArrays).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
7475
+ const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
7476
+ return new Transaction({
7477
+ blockhash,
7478
+ lastValidBlockHeight,
7479
+ feePayer: user
7480
+ }).add(swapTx);
7447
7481
  }
7448
7482
  /**
7449
7483
  * The claimLMReward function is used to claim rewards for a specific position owned by a specific owner.
@@ -8160,6 +8194,37 @@ var DLMM = class {
8160
8194
 
8161
8195
  // src/dlmm/error.ts
8162
8196
  import { AnchorError } from "@coral-xyz/anchor";
8197
+ var DLMMError = class extends Error {
8198
+ errorCode;
8199
+ errorName;
8200
+ errorMessage;
8201
+ constructor(error) {
8202
+ let _errorCode = 0;
8203
+ let _errorName = "Something went wrong";
8204
+ let _errorMessage = "Something went wrong";
8205
+ if (error instanceof Error) {
8206
+ const anchorError = AnchorError.parse(
8207
+ JSON.parse(JSON.stringify(error)).logs
8208
+ );
8209
+ if (anchorError?.program.toBase58() === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
8210
+ _errorCode = anchorError.error.errorCode.number;
8211
+ _errorName = anchorError.error.errorCode.code;
8212
+ _errorMessage = anchorError.error.errorMessage;
8213
+ }
8214
+ } else {
8215
+ const idlError = IDL.errors.find((err) => err.code === error);
8216
+ if (idlError) {
8217
+ _errorCode = idlError.code;
8218
+ _errorName = idlError.name;
8219
+ _errorMessage = idlError.msg;
8220
+ }
8221
+ }
8222
+ super(_errorMessage);
8223
+ this.errorCode = _errorCode;
8224
+ this.errorName = _errorName;
8225
+ this.errorMessage = _errorMessage;
8226
+ }
8227
+ };
8163
8228
 
8164
8229
  // src/index.ts
8165
8230
  var src_default = DLMM;
@@ -8168,6 +8233,7 @@ export {
8168
8233
  BASIS_POINT_MAX,
8169
8234
  BIN_ARRAY_BITMAP_SIZE,
8170
8235
  BitmapType,
8236
+ DLMMError,
8171
8237
  EXTENSION_BINARRAY_BITMAP_SIZE,
8172
8238
  FEE_PRECISION,
8173
8239
  LBCLMM_PROGRAM_IDS,