@meteora-ag/dlmm 1.0.2 → 1.0.4

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
@@ -2082,6 +2082,27 @@ type LbClmm = {
2082
2082
  "type": "u64";
2083
2083
  }
2084
2084
  ];
2085
+ },
2086
+ {
2087
+ "name": "setActivationSlot";
2088
+ "accounts": [
2089
+ {
2090
+ "name": "lbPair";
2091
+ "isMut": true;
2092
+ "isSigner": false;
2093
+ },
2094
+ {
2095
+ "name": "admin";
2096
+ "isMut": true;
2097
+ "isSigner": true;
2098
+ }
2099
+ ];
2100
+ "args": [
2101
+ {
2102
+ "name": "activationSlot";
2103
+ "type": "u64";
2104
+ }
2105
+ ];
2085
2106
  }
2086
2107
  ];
2087
2108
  "accounts": [
@@ -2242,7 +2263,7 @@ type LbClmm = {
2242
2263
  {
2243
2264
  "name": "status";
2244
2265
  "docs": [
2245
- "Status of the pair"
2266
+ "Status of the pair. Check PairStatus enum."
2246
2267
  ];
2247
2268
  "type": "u8";
2248
2269
  },
@@ -2358,6 +2379,13 @@ type LbClmm = {
2358
2379
  ];
2359
2380
  "type": "publicKey";
2360
2381
  },
2382
+ {
2383
+ "name": "activationSlot";
2384
+ "docs": [
2385
+ "Slot to enable the pair. Only available for permission pair."
2386
+ ];
2387
+ "type": "u64";
2388
+ },
2361
2389
  {
2362
2390
  "name": "reserved";
2363
2391
  "docs": [
@@ -2366,7 +2394,7 @@ type LbClmm = {
2366
2394
  "type": {
2367
2395
  "array": [
2368
2396
  "u8",
2369
- 88
2397
+ 80
2370
2398
  ];
2371
2399
  };
2372
2400
  }
@@ -4390,6 +4418,7 @@ type LbClmm = {
4390
4418
  }
4391
4419
  ];
4392
4420
  };
4421
+ declare const IDL: LbClmm;
4393
4422
 
4394
4423
  interface BinAndAmount {
4395
4424
  binId: number;
@@ -5081,6 +5110,7 @@ declare function chunkedFetchMultiplePoolAccount(program: ClmmProgram, pks: Publ
5081
5110
  lastUpdatedAt: BN;
5082
5111
  whitelistedWallet: PublicKey[];
5083
5112
  baseKey: PublicKey;
5113
+ activationSlot: BN;
5084
5114
  reserved: number[];
5085
5115
  }[]>;
5086
5116
  declare function chunkedFetchMultipleBinArrayBitmapExtensionAccount(program: ClmmProgram, pks: PublicKey[], chunkSize?: number): Promise<{
@@ -5098,6 +5128,14 @@ declare const unwrapSOLInstruction: (owner: PublicKey) => Promise<TransactionIns
5098
5128
  declare function chunkedGetMultipleAccountInfos(connection: Connection, pks: PublicKey[], chunkSize?: number): Promise<_solana_web3_js.AccountInfo<Buffer>[]>;
5099
5129
  declare const computeBudgetIx: () => TransactionInstruction;
5100
5130
 
5131
+ type Codes = (typeof IDL.errors)[number]["code"];
5132
+ declare class DLMMError extends Error {
5133
+ errorCode: number;
5134
+ errorName: string;
5135
+ errorMessage: string;
5136
+ constructor(error: object | Codes);
5137
+ }
5138
+
5101
5139
  declare const LBCLMM_PROGRAM_IDS: {
5102
5140
  devnet: string;
5103
5141
  localhost: string;
@@ -5128,4 +5166,4 @@ declare const MAX_CLAIM_ALL_ALLOWED = 3;
5128
5166
  declare const MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = 26;
5129
5167
  declare const MAX_ACTIVE_BIN_SLIPPAGE = 3;
5130
5168
 
5131
- export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, LBCLMM_PROGRAM_IDS, LMRewards, LbPairAccount, LbPairAccountsStruct, LiquidityOneSideParameter, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, Network, PRECISION, ParabolicParameter, Position, PositionAccount, PositionBinData, PositionData, PositionInfo, PositionVersion, SCALE, SCALE_OFFSET, SIMULATION_USER, SpotParameter, StrategyParameters, StrategyType, SwapFee, SwapParams, SwapQuote, TInitializePositionAndAddLiquidityParams, TokenReserve, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveOracle, derivePosition, derivePresetParameter, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromStrategyParamstoWeightDistribution, getBaseFee, getBinArrayLowerUpperBinId, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parabolicParameter, parseLogs, sParameters, spotParameter, swapQuoteAtBin, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
5169
+ export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, DLMMError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, LBCLMM_PROGRAM_IDS, LMRewards, LbPairAccount, LbPairAccountsStruct, LiquidityOneSideParameter, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, Network, PRECISION, ParabolicParameter, Position, PositionAccount, PositionBinData, PositionData, PositionInfo, PositionVersion, SCALE, SCALE_OFFSET, SIMULATION_USER, SpotParameter, StrategyParameters, StrategyType, SwapFee, SwapParams, SwapQuote, TInitializePositionAndAddLiquidityParams, TokenReserve, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveOracle, derivePosition, derivePresetParameter, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromStrategyParamstoWeightDistribution, getBaseFee, getBinArrayLowerUpperBinId, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parabolicParameter, parseLogs, sParameters, spotParameter, swapQuoteAtBin, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
package/dist/index.js 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
  }
@@ -6141,15 +6169,17 @@ var DLMM = class {
6141
6169
  "lbPair",
6142
6170
  lbPairAccountInfo.data
6143
6171
  );
6144
- const binArrayBitmapExtensionState = this.program.coder.accounts.decode(
6145
- "binArrayBitmapExtension",
6146
- binArrayBitmapExtensionAccountInfo.data
6147
- );
6148
- if (binArrayBitmapExtensionState) {
6149
- this.binArrayBitmapExtension = {
6150
- account: binArrayBitmapExtensionState,
6151
- publicKey: binArrayBitmapExtensionPubkey
6152
- };
6172
+ if (binArrayBitmapExtensionAccountInfo) {
6173
+ const binArrayBitmapExtensionState = this.program.coder.accounts.decode(
6174
+ "binArrayBitmapExtension",
6175
+ binArrayBitmapExtensionAccountInfo.data
6176
+ );
6177
+ if (binArrayBitmapExtensionState) {
6178
+ this.binArrayBitmapExtension = {
6179
+ account: binArrayBitmapExtensionState,
6180
+ publicKey: binArrayBitmapExtensionPubkey
6181
+ };
6182
+ }
6153
6183
  }
6154
6184
  const reserveXBalance = _spltoken.AccountLayout.decode(reserveXAccountInfo.data);
6155
6185
  const reserveYBalance = _spltoken.AccountLayout.decode(reserveYAccountInfo.data);
@@ -8158,6 +8188,37 @@ var DLMM = class {
8158
8188
 
8159
8189
  // src/dlmm/error.ts
8160
8190
 
8191
+ var DLMMError = class extends Error {
8192
+
8193
+
8194
+
8195
+ constructor(error) {
8196
+ let _errorCode = 0;
8197
+ let _errorName = "Something went wrong";
8198
+ let _errorMessage = "Something went wrong";
8199
+ if (error instanceof Error) {
8200
+ const anchorError = _anchor.AnchorError.parse(
8201
+ JSON.parse(JSON.stringify(error)).logs
8202
+ );
8203
+ if (_optionalChain([anchorError, 'optionalAccess', _55 => _55.program, 'access', _56 => _56.toBase58, 'call', _57 => _57()]) === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
8204
+ _errorCode = anchorError.error.errorCode.number;
8205
+ _errorName = anchorError.error.errorCode.code;
8206
+ _errorMessage = anchorError.error.errorMessage;
8207
+ }
8208
+ } else {
8209
+ const idlError = IDL.errors.find((err) => err.code === error);
8210
+ if (idlError) {
8211
+ _errorCode = idlError.code;
8212
+ _errorName = idlError.name;
8213
+ _errorMessage = idlError.msg;
8214
+ }
8215
+ }
8216
+ super(_errorMessage);
8217
+ this.errorCode = _errorCode;
8218
+ this.errorName = _errorName;
8219
+ this.errorMessage = _errorMessage;
8220
+ }
8221
+ };
8161
8222
 
8162
8223
  // src/index.ts
8163
8224
  var src_default = DLMM;
@@ -8225,5 +8286,6 @@ var src_default = DLMM;
8225
8286
 
8226
8287
 
8227
8288
 
8228
- exports.ADMIN = ADMIN; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BitmapType = BitmapType; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_BIN_PER_POSITION = MAX_BIN_PER_POSITION; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.Network = Network; exports.PRECISION = PRECISION; exports.PositionVersion = PositionVersion; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.StrategyType = StrategyType; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculateSpotDistribution = calculateSpotDistribution; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunks = chunks; exports.computeBudgetIx = computeBudgetIx; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveLbPair = deriveLbPair; exports.deriveOracle = deriveOracle; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.deriveReserve = deriveReserve; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromStrategyParamstoWeightDistribution = fromStrategyParamstoWeightDistribution; exports.getBaseFee = getBaseFee; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinFromBinArray = getBinFromBinArray; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.parabolicParameter = parabolicParameter; exports.parseLogs = parseLogs; exports.spotParameter = spotParameter; exports.swapQuoteAtBin = swapQuoteAtBin; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.wrapSOLInstruction = wrapSOLInstruction;
8289
+
8290
+ exports.ADMIN = ADMIN; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BitmapType = BitmapType; exports.DLMMError = DLMMError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.LBCLMM_PROGRAM_IDS = LBCLMM_PROGRAM_IDS; exports.MAX_ACTIVE_BIN_SLIPPAGE = MAX_ACTIVE_BIN_SLIPPAGE; exports.MAX_BIN_ARRAY_SIZE = MAX_BIN_ARRAY_SIZE; exports.MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX; exports.MAX_BIN_PER_POSITION = MAX_BIN_PER_POSITION; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.Network = Network; exports.PRECISION = PRECISION; exports.PositionVersion = PositionVersion; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.StrategyType = StrategyType; exports.binIdToBinArrayIndex = binIdToBinArrayIndex; exports.calculateBidAskDistribution = calculateBidAskDistribution; exports.calculateNormalDistribution = calculateNormalDistribution; exports.calculateSpotDistribution = calculateSpotDistribution; exports.chunkedFetchMultipleBinArrayBitmapExtensionAccount = chunkedFetchMultipleBinArrayBitmapExtensionAccount; exports.chunkedFetchMultiplePoolAccount = chunkedFetchMultiplePoolAccount; exports.chunkedGetMultipleAccountInfos = chunkedGetMultipleAccountInfos; exports.chunks = chunks; exports.computeBudgetIx = computeBudgetIx; exports.computeFee = computeFee; exports.computeFeeFromAmount = computeFeeFromAmount; exports.computeProtocolFee = computeProtocolFee; exports.default = src_default; exports.deriveBinArray = deriveBinArray; exports.deriveBinArrayBitmapExtension = deriveBinArrayBitmapExtension; exports.deriveLbPair = deriveLbPair; exports.deriveOracle = deriveOracle; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.deriveReserve = deriveReserve; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromStrategyParamstoWeightDistribution = fromStrategyParamstoWeightDistribution; exports.getBaseFee = getBaseFee; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinFromBinArray = getBinFromBinArray; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.parabolicParameter = parabolicParameter; exports.parseLogs = parseLogs; exports.spotParameter = spotParameter; exports.swapQuoteAtBin = swapQuoteAtBin; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.wrapSOLInstruction = wrapSOLInstruction;
8229
8291
  //# sourceMappingURL=index.js.map