@meteora-ag/dlmm 1.1.3-rc.1 → 1.1.3
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 +10 -1
- package/dist/index.js +106 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5789,6 +5789,8 @@ declare class DLMM {
|
|
|
5789
5789
|
* - `protocolFee`: Protocol fee amount
|
|
5790
5790
|
* - `maxInAmount`: Maximum amount of lamport to swap in
|
|
5791
5791
|
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
5792
|
+
* @throws {DlmmSdkError}
|
|
5793
|
+
*
|
|
5792
5794
|
*/
|
|
5793
5795
|
swapQuoteExactOut(outAmount: BN, swapForY: boolean, allowedSlippage: BN, binArrays: BinArrayAccount[]): SwapQuoteExactOut;
|
|
5794
5796
|
/**
|
|
@@ -5807,6 +5809,7 @@ declare class DLMM {
|
|
|
5807
5809
|
* - `minOutAmount`: Minimum amount of lamport to swap out
|
|
5808
5810
|
* - `priceImpact`: Price impact of the swap
|
|
5809
5811
|
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
5812
|
+
* @throws {DlmmSdkError}
|
|
5810
5813
|
*/
|
|
5811
5814
|
swapQuote(inAmount: BN, swapForY: boolean, allowedSlippage: BN, binArrays: BinArrayAccount[], isPartialFill?: boolean): SwapQuote;
|
|
5812
5815
|
swapExactOut({ inToken, outToken, outAmount, maxInAmount, lbPair, user, binArraysPubkey, }: SwapExactOutParams): Promise<Transaction>;
|
|
@@ -6371,6 +6374,12 @@ declare class DLMMError extends Error {
|
|
|
6371
6374
|
errorMessage: string;
|
|
6372
6375
|
constructor(error: object | Codes);
|
|
6373
6376
|
}
|
|
6377
|
+
type ErrorName = "SWAP_QUOTE_INSUFFICIENT_LIQUIDITY";
|
|
6378
|
+
declare class DlmmSdkError extends Error {
|
|
6379
|
+
name: ErrorName;
|
|
6380
|
+
message: string;
|
|
6381
|
+
constructor(name: ErrorName, message: string);
|
|
6382
|
+
}
|
|
6374
6383
|
|
|
6375
6384
|
declare const LBCLMM_PROGRAM_IDS: {
|
|
6376
6385
|
devnet: string;
|
|
@@ -6405,4 +6414,4 @@ declare const MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = 26;
|
|
|
6405
6414
|
declare const MAX_BIN_PER_TX = 69;
|
|
6406
6415
|
declare const MAX_ACTIVE_BIN_SLIPPAGE = 3;
|
|
6407
6416
|
|
|
6408
|
-
export { ADMIN, ActivationType, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, LiquidityParameterByStrategy, LiquidityParameterByStrategyOneSide, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_BIN_PER_TX, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, Network, POSITION_FEE, PRECISION, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionV2, PositionVersion, ProgramStrategyParameter, ProgramStrategyType, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityResponse, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TQuoteCreatePositionParams, TokenReserve, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveLbPair2, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toAmountsOneSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
|
|
6417
|
+
export { ADMIN, ActivationType, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, Clock, ClockLayout, CompressedBinDepositAmount, CompressedBinDepositAmounts, DLMMError, DlmmSdkError, EXTENSION_BINARRAY_BITMAP_SIZE, EmissionRate, FEE_PRECISION, FeeInfo, GetOrCreateATAResponse, IAccountsCache, IDL, InitPermissionPairIx, LBCLMM_PROGRAM_IDS, LMRewards, LbClmm, LbPair, LbPairAccount, LbPosition, LiquidityOneSideParameter, LiquidityParameterByStrategy, LiquidityParameterByStrategyOneSide, LiquidityParameterByWeight, MAX_ACTIVE_BIN_SLIPPAGE, MAX_BIN_ARRAY_SIZE, MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX, MAX_BIN_PER_POSITION, MAX_BIN_PER_TX, MAX_CLAIM_ALL_ALLOWED, MAX_FEE_RATE, Network, POSITION_FEE, PRECISION, PairStatus, PairType, Position, PositionBinData, PositionData, PositionInfo, PositionV2, PositionVersion, ProgramStrategyParameter, ProgramStrategyType, SCALE, SCALE_OFFSET, SIMULATION_USER, SeedLiquidityResponse, Strategy, StrategyParameters, StrategyType, SwapExactOutParams, SwapFee, SwapParams, SwapQuote, SwapQuoteExactOut, SwapWithPriceImpactParams, TInitializePositionAndAddLiquidityParams, TInitializePositionAndAddLiquidityParamsByStrategy, TQuoteCreatePositionParams, TokenReserve, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, binIdToBinArrayIndex, calculateBidAskDistribution, calculateNormalDistribution, calculateSpotDistribution, chunkedFetchMultipleBinArrayBitmapExtensionAccount, chunkedFetchMultiplePoolAccount, chunkedGetMultipleAccountInfos, chunks, computeBudgetIx, computeFee, computeFeeFromAmount, computeProtocolFee, DLMM as default, deriveBinArray, deriveBinArrayBitmapExtension, deriveLbPair, deriveLbPair2, deriveOracle, derivePermissionLbPair, derivePosition, derivePresetParameter, derivePresetParameter2, deriveReserve, findNextBinArrayIndexWithLiquidity, findNextBinArrayWithLiquidity, fromWeightDistributionToAmount, fromWeightDistributionToAmountOneSide, getBaseFee, getBinArrayLowerUpperBinId, getBinArraysRequiredByPositionRange, getBinFromBinArray, getOrCreateATAInstruction, getOutAmount, getPriceOfBinByBinId, getTokenBalance, getTokenDecimals, getTokensMintFromPoolAddress, getTotalFee, getVariableFee, isBinIdWithinBinArray, isOverflowDefaultBinArrayBitmap, parseLogs, sParameters, swapExactInQuoteAtBin, swapExactOutQuoteAtBin, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toAmountsOneSideByStrategy, toStrategyParameters, toWeightDistribution, unwrapSOLInstruction, vParameters, wrapSOLInstruction };
|
package/dist/index.js
CHANGED
|
@@ -6588,7 +6588,7 @@ function findNextBinArrayWithLiquidity(swapForY, activeBinId, lbPairState, binAr
|
|
|
6588
6588
|
(ba) => ba.account.index.eq(nearestBinArrayIndexWithLiquidity)
|
|
6589
6589
|
);
|
|
6590
6590
|
if (!binArrayAccount) {
|
|
6591
|
-
|
|
6591
|
+
return null;
|
|
6592
6592
|
}
|
|
6593
6593
|
return binArrayAccount;
|
|
6594
6594
|
}
|
|
@@ -7492,6 +7492,51 @@ var _bytes = require('@coral-xyz/anchor/dist/cjs/utils/bytes');
|
|
|
7492
7492
|
|
|
7493
7493
|
|
|
7494
7494
|
|
|
7495
|
+
|
|
7496
|
+
// src/dlmm/error.ts
|
|
7497
|
+
|
|
7498
|
+
var DLMMError = class extends Error {
|
|
7499
|
+
|
|
7500
|
+
|
|
7501
|
+
|
|
7502
|
+
constructor(error) {
|
|
7503
|
+
let _errorCode = 0;
|
|
7504
|
+
let _errorName = "Something went wrong";
|
|
7505
|
+
let _errorMessage = "Something went wrong";
|
|
7506
|
+
if (error instanceof Error) {
|
|
7507
|
+
const anchorError = _anchor.AnchorError.parse(
|
|
7508
|
+
JSON.parse(JSON.stringify(error)).logs
|
|
7509
|
+
);
|
|
7510
|
+
if (_optionalChain([anchorError, 'optionalAccess', _21 => _21.program, 'access', _22 => _22.toBase58, 'call', _23 => _23()]) === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
|
|
7511
|
+
_errorCode = anchorError.error.errorCode.number;
|
|
7512
|
+
_errorName = anchorError.error.errorCode.code;
|
|
7513
|
+
_errorMessage = anchorError.error.errorMessage;
|
|
7514
|
+
}
|
|
7515
|
+
} else {
|
|
7516
|
+
const idlError = IDL.errors.find((err) => err.code === error);
|
|
7517
|
+
if (idlError) {
|
|
7518
|
+
_errorCode = idlError.code;
|
|
7519
|
+
_errorName = idlError.name;
|
|
7520
|
+
_errorMessage = idlError.msg;
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
super(_errorMessage);
|
|
7524
|
+
this.errorCode = _errorCode;
|
|
7525
|
+
this.errorName = _errorName;
|
|
7526
|
+
this.errorMessage = _errorMessage;
|
|
7527
|
+
}
|
|
7528
|
+
};
|
|
7529
|
+
var DlmmSdkError = class extends Error {
|
|
7530
|
+
|
|
7531
|
+
|
|
7532
|
+
constructor(name, message) {
|
|
7533
|
+
super();
|
|
7534
|
+
this.name = name;
|
|
7535
|
+
this.message = message;
|
|
7536
|
+
}
|
|
7537
|
+
};
|
|
7538
|
+
|
|
7539
|
+
// src/dlmm/index.ts
|
|
7495
7540
|
var DLMM = class {
|
|
7496
7541
|
constructor(pubkey, program, lbPair, binArrayBitmapExtension, tokenX, tokenY, clock, opt) {
|
|
7497
7542
|
this.pubkey = pubkey;
|
|
@@ -7522,13 +7567,13 @@ var DLMM = class {
|
|
|
7522
7567
|
);
|
|
7523
7568
|
const program = new (0, _anchor.Program)(
|
|
7524
7569
|
IDL,
|
|
7525
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7570
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _24 => _24.programId]), () => ( LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _25 => _25.cluster]), () => ( "mainnet-beta"))])),
|
|
7526
7571
|
provider
|
|
7527
7572
|
);
|
|
7528
7573
|
return program.account.lbPair.all();
|
|
7529
7574
|
}
|
|
7530
7575
|
static async getPairPubkeyIfExists(connection, tokenX, tokenY, binStep, baseFactor, opt) {
|
|
7531
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7576
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _26 => _26.cluster]) || "mainnet-beta";
|
|
7532
7577
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7533
7578
|
connection,
|
|
7534
7579
|
{},
|
|
@@ -7536,7 +7581,7 @@ var DLMM = class {
|
|
|
7536
7581
|
);
|
|
7537
7582
|
const program = new (0, _anchor.Program)(
|
|
7538
7583
|
IDL,
|
|
7539
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7584
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _27 => _27.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7540
7585
|
provider
|
|
7541
7586
|
);
|
|
7542
7587
|
try {
|
|
@@ -7575,7 +7620,7 @@ var DLMM = class {
|
|
|
7575
7620
|
* @returns The `create` function returns a `Promise` that resolves to a `DLMM` object.
|
|
7576
7621
|
*/
|
|
7577
7622
|
static async create(connection, dlmm, opt) {
|
|
7578
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7623
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _28 => _28.cluster]) || "mainnet-beta";
|
|
7579
7624
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7580
7625
|
connection,
|
|
7581
7626
|
{},
|
|
@@ -7583,7 +7628,7 @@ var DLMM = class {
|
|
|
7583
7628
|
);
|
|
7584
7629
|
const program = new (0, _anchor.Program)(
|
|
7585
7630
|
IDL,
|
|
7586
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7631
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _29 => _29.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7587
7632
|
provider
|
|
7588
7633
|
);
|
|
7589
7634
|
const binArrayBitMapExtensionPubkey = deriveBinArrayBitmapExtension(
|
|
@@ -7599,14 +7644,14 @@ var DLMM = class {
|
|
|
7599
7644
|
connection,
|
|
7600
7645
|
accountsToFetch
|
|
7601
7646
|
);
|
|
7602
|
-
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7647
|
+
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _30 => _30[0], 'optionalAccess', _31 => _31.data]);
|
|
7603
7648
|
if (!lbPairAccountInfoBuffer)
|
|
7604
7649
|
throw new Error(`LB Pair account ${dlmm.toBase58()} not found`);
|
|
7605
7650
|
const lbPairAccInfo = program.coder.accounts.decode(
|
|
7606
7651
|
"lbPair",
|
|
7607
7652
|
lbPairAccountInfoBuffer
|
|
7608
7653
|
);
|
|
7609
|
-
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7654
|
+
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _32 => _32[1], 'optionalAccess', _33 => _33.data]);
|
|
7610
7655
|
let binArrayBitMapExtensionAccInfo = null;
|
|
7611
7656
|
if (binArrayBitMapAccountInfoBuffer) {
|
|
7612
7657
|
binArrayBitMapExtensionAccInfo = program.coder.accounts.decode(
|
|
@@ -7614,7 +7659,7 @@ var DLMM = class {
|
|
|
7614
7659
|
binArrayBitMapAccountInfoBuffer
|
|
7615
7660
|
);
|
|
7616
7661
|
}
|
|
7617
|
-
const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7662
|
+
const clockAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _34 => _34[2], 'optionalAccess', _35 => _35.data]);
|
|
7618
7663
|
if (!clockAccountInfoBuffer)
|
|
7619
7664
|
throw new Error(`Clock account not found`);
|
|
7620
7665
|
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
@@ -7675,7 +7720,7 @@ var DLMM = class {
|
|
|
7675
7720
|
* objects.
|
|
7676
7721
|
*/
|
|
7677
7722
|
static async createMultiple(connection, dlmmList, opt) {
|
|
7678
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7723
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _36 => _36.cluster]) || "mainnet-beta";
|
|
7679
7724
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7680
7725
|
connection,
|
|
7681
7726
|
{},
|
|
@@ -7683,7 +7728,7 @@ var DLMM = class {
|
|
|
7683
7728
|
);
|
|
7684
7729
|
const program = new (0, _anchor.Program)(
|
|
7685
7730
|
IDL,
|
|
7686
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7731
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _37 => _37.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7687
7732
|
provider
|
|
7688
7733
|
);
|
|
7689
7734
|
const binArrayBitMapExtensions = dlmmList.map(
|
|
@@ -7699,14 +7744,14 @@ var DLMM = class {
|
|
|
7699
7744
|
accountsToFetch
|
|
7700
7745
|
);
|
|
7701
7746
|
const clockAccount = accountsInfo.pop();
|
|
7702
|
-
const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess',
|
|
7747
|
+
const clockAccountInfoBuffer = _optionalChain([clockAccount, 'optionalAccess', _38 => _38.data]);
|
|
7703
7748
|
if (!clockAccountInfoBuffer)
|
|
7704
7749
|
throw new Error(`Clock account not found`);
|
|
7705
7750
|
const clock = ClockLayout.decode(clockAccountInfoBuffer);
|
|
7706
7751
|
const lbPairArraysMap = /* @__PURE__ */ new Map();
|
|
7707
7752
|
for (let i = 0; i < dlmmList.length; i++) {
|
|
7708
7753
|
const lbPairPubKey = dlmmList[i];
|
|
7709
|
-
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7754
|
+
const lbPairAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _39 => _39[i], 'optionalAccess', _40 => _40.data]);
|
|
7710
7755
|
if (!lbPairAccountInfoBuffer)
|
|
7711
7756
|
throw new Error(`LB Pair account ${lbPairPubKey.toBase58()} not found`);
|
|
7712
7757
|
const binArrayAccInfo = program.coder.accounts.decode(
|
|
@@ -7719,7 +7764,7 @@ var DLMM = class {
|
|
|
7719
7764
|
for (let i = dlmmList.length; i < accountsInfo.length; i++) {
|
|
7720
7765
|
const index = i - dlmmList.length;
|
|
7721
7766
|
const lbPairPubkey = dlmmList[index];
|
|
7722
|
-
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access',
|
|
7767
|
+
const binArrayBitMapAccountInfoBuffer = _optionalChain([accountsInfo, 'access', _41 => _41[i], 'optionalAccess', _42 => _42.data]);
|
|
7723
7768
|
if (binArrayBitMapAccountInfoBuffer) {
|
|
7724
7769
|
const binArrayBitMapExtensionAccInfo = program.coder.accounts.decode(
|
|
7725
7770
|
"binArrayBitmapExtension",
|
|
@@ -7803,7 +7848,7 @@ var DLMM = class {
|
|
|
7803
7848
|
);
|
|
7804
7849
|
const program = new (0, _anchor.Program)(
|
|
7805
7850
|
IDL,
|
|
7806
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7851
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _43 => _43.programId]), () => ( LBCLMM_PROGRAM_IDS[_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _44 => _44.cluster]), () => ( "mainnet-beta"))])),
|
|
7807
7852
|
provider
|
|
7808
7853
|
);
|
|
7809
7854
|
const presetParameter = await program.account.presetParameter.all();
|
|
@@ -7821,7 +7866,7 @@ var DLMM = class {
|
|
|
7821
7866
|
* Pair account, and the value is an object of PositionInfo
|
|
7822
7867
|
*/
|
|
7823
7868
|
static async getAllLbPairPositionsByUser(connection, userPubKey, opt) {
|
|
7824
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
7869
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _45 => _45.cluster]) || "mainnet-beta";
|
|
7825
7870
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
7826
7871
|
connection,
|
|
7827
7872
|
{},
|
|
@@ -7829,7 +7874,7 @@ var DLMM = class {
|
|
|
7829
7874
|
);
|
|
7830
7875
|
const program = new (0, _anchor.Program)(
|
|
7831
7876
|
IDL,
|
|
7832
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
7877
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _46 => _46.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
7833
7878
|
provider
|
|
7834
7879
|
);
|
|
7835
7880
|
const [positions, positionsV2] = await Promise.all([
|
|
@@ -8062,8 +8107,8 @@ var DLMM = class {
|
|
|
8062
8107
|
const { mintXDecimal, mintYDecimal } = lbPairMintMap.get(
|
|
8063
8108
|
lbPair.toBase58()
|
|
8064
8109
|
);
|
|
8065
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
8066
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access',
|
|
8110
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _47 => _47.get, 'call', _48 => _48(lbPair.toBase58()), 'optionalAccess', _49 => _49.reserveX]), () => ( BigInt(0)));
|
|
8111
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMap, 'access', _50 => _50.get, 'call', _51 => _51(lbPair.toBase58()), 'optionalAccess', _52 => _52.reserveY]), () => ( BigInt(0)));
|
|
8067
8112
|
const tokenX = {
|
|
8068
8113
|
publicKey: lbPairAcc.tokenXMint,
|
|
8069
8114
|
reserve: lbPairAcc.reserveX,
|
|
@@ -8095,7 +8140,7 @@ var DLMM = class {
|
|
|
8095
8140
|
tokenX,
|
|
8096
8141
|
tokenY,
|
|
8097
8142
|
lbPairPositionsData: [
|
|
8098
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
8143
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _53 => _53.get, 'call', _54 => _54(lbPair.toBase58()), 'optionalAccess', _55 => _55.lbPairPositionsData]), () => ( [])),
|
|
8099
8144
|
{
|
|
8100
8145
|
publicKey: positionPubKey,
|
|
8101
8146
|
positionData,
|
|
@@ -8131,8 +8176,8 @@ var DLMM = class {
|
|
|
8131
8176
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenXMint),
|
|
8132
8177
|
getTokenDecimals(program.provider.connection, lbPairAcc.tokenYMint)
|
|
8133
8178
|
]);
|
|
8134
|
-
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8135
|
-
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access',
|
|
8179
|
+
const reserveXBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _56 => _56.get, 'call', _57 => _57(lbPair.toBase58()), 'optionalAccess', _58 => _58.reserveX]), () => ( BigInt(0)));
|
|
8180
|
+
const reserveYBalance = _nullishCoalesce(_optionalChain([lbPairReserveMapV2, 'access', _59 => _59.get, 'call', _60 => _60(lbPair.toBase58()), 'optionalAccess', _61 => _61.reserveY]), () => ( BigInt(0)));
|
|
8136
8181
|
const tokenX = {
|
|
8137
8182
|
publicKey: lbPairAcc.tokenXMint,
|
|
8138
8183
|
reserve: lbPairAcc.reserveX,
|
|
@@ -8164,7 +8209,7 @@ var DLMM = class {
|
|
|
8164
8209
|
tokenX,
|
|
8165
8210
|
tokenY,
|
|
8166
8211
|
lbPairPositionsData: [
|
|
8167
|
-
..._nullishCoalesce(_optionalChain([positionsMap, 'access',
|
|
8212
|
+
..._nullishCoalesce(_optionalChain([positionsMap, 'access', _62 => _62.get, 'call', _63 => _63(lbPair.toBase58()), 'optionalAccess', _64 => _64.lbPairPositionsData]), () => ( [])),
|
|
8168
8213
|
{
|
|
8169
8214
|
publicKey: positionPubKey,
|
|
8170
8215
|
positionData,
|
|
@@ -8177,7 +8222,7 @@ var DLMM = class {
|
|
|
8177
8222
|
return positionsMap;
|
|
8178
8223
|
}
|
|
8179
8224
|
static async migratePosition(connection, positions, newPositions, walletPubkey, opt) {
|
|
8180
|
-
const cluster = _optionalChain([opt, 'optionalAccess',
|
|
8225
|
+
const cluster = _optionalChain([opt, 'optionalAccess', _65 => _65.cluster]) || "mainnet-beta";
|
|
8181
8226
|
const provider = new (0, _anchor.AnchorProvider)(
|
|
8182
8227
|
connection,
|
|
8183
8228
|
{},
|
|
@@ -8185,7 +8230,7 @@ var DLMM = class {
|
|
|
8185
8230
|
);
|
|
8186
8231
|
const program = new (0, _anchor.Program)(
|
|
8187
8232
|
IDL,
|
|
8188
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8233
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _66 => _66.programId]), () => ( LBCLMM_PROGRAM_IDS[cluster])),
|
|
8189
8234
|
provider
|
|
8190
8235
|
);
|
|
8191
8236
|
const positionsState = await program.account.position.fetchMultiple(
|
|
@@ -8243,7 +8288,7 @@ var DLMM = class {
|
|
|
8243
8288
|
);
|
|
8244
8289
|
const program = new (0, _anchor.Program)(
|
|
8245
8290
|
IDL,
|
|
8246
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8291
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _67 => _67.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8247
8292
|
provider
|
|
8248
8293
|
);
|
|
8249
8294
|
const [lbPair] = derivePermissionLbPair(
|
|
@@ -8293,7 +8338,7 @@ var DLMM = class {
|
|
|
8293
8338
|
);
|
|
8294
8339
|
const program = new (0, _anchor.Program)(
|
|
8295
8340
|
IDL,
|
|
8296
|
-
_nullishCoalesce(_optionalChain([opt, 'optionalAccess',
|
|
8341
|
+
_nullishCoalesce(_optionalChain([opt, 'optionalAccess', _68 => _68.programId]), () => ( LBCLMM_PROGRAM_IDS[opt.cluster])),
|
|
8297
8342
|
provider
|
|
8298
8343
|
);
|
|
8299
8344
|
const existsPool = await this.getPairPubkeyIfExists(
|
|
@@ -8429,7 +8474,7 @@ var DLMM = class {
|
|
|
8429
8474
|
swapForY,
|
|
8430
8475
|
new (0, _anchor.BN)(activeIdToLoop),
|
|
8431
8476
|
this.lbPair,
|
|
8432
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
8477
|
+
_nullishCoalesce(_optionalChain([this, 'access', _69 => _69.binArrayBitmapExtension, 'optionalAccess', _70 => _70.account]), () => ( null))
|
|
8433
8478
|
);
|
|
8434
8479
|
if (binArrayIndex === null)
|
|
8435
8480
|
shouldStop = true;
|
|
@@ -9766,10 +9811,11 @@ var DLMM = class {
|
|
|
9766
9811
|
user
|
|
9767
9812
|
);
|
|
9768
9813
|
createPayerTokenIx && preInstructions.push(createPayerTokenIx);
|
|
9769
|
-
const reserve = removeLiquidityForY ? reserveY : reserveX;
|
|
9770
|
-
const tokenMint = removeLiquidityForY ? tokenYMint : tokenXMint;
|
|
9771
9814
|
const postInstructions = [];
|
|
9772
|
-
if (
|
|
9815
|
+
if ([
|
|
9816
|
+
this.tokenX.publicKey.toBase58(),
|
|
9817
|
+
this.tokenY.publicKey.toBase58()
|
|
9818
|
+
].includes(_spltoken.NATIVE_MINT.toBase58())) {
|
|
9773
9819
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
9774
9820
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
9775
9821
|
}
|
|
@@ -9779,6 +9825,8 @@ var DLMM = class {
|
|
|
9779
9825
|
const maxBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId));
|
|
9780
9826
|
const useExtension = isOverflowDefaultBinArrayBitmap(minBinArrayIndex) || isOverflowDefaultBinArrayBitmap(maxBinArrayIndex);
|
|
9781
9827
|
const binArrayBitmapExtension = useExtension ? deriveBinArrayBitmapExtension(this.pubkey, this.program.programId)[0] : null;
|
|
9828
|
+
const reserve = removeLiquidityForY ? reserveY : reserveX;
|
|
9829
|
+
const tokenMint = removeLiquidityForY ? tokenYMint : tokenXMint;
|
|
9782
9830
|
const removeLiquiditySingleSideTx = await this.program.methods.removeLiquiditySingleSide().accounts({
|
|
9783
9831
|
position,
|
|
9784
9832
|
lbPair,
|
|
@@ -9790,7 +9838,7 @@ var DLMM = class {
|
|
|
9790
9838
|
binArrayUpper,
|
|
9791
9839
|
sender: user,
|
|
9792
9840
|
tokenProgram: _spltoken.TOKEN_PROGRAM_ID
|
|
9793
|
-
}).preInstructions(preInstructions).
|
|
9841
|
+
}).preInstructions(preInstructions).transaction();
|
|
9794
9842
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
9795
9843
|
return new (0, _web3js.Transaction)({
|
|
9796
9844
|
blockhash,
|
|
@@ -9852,6 +9900,8 @@ var DLMM = class {
|
|
|
9852
9900
|
* - `protocolFee`: Protocol fee amount
|
|
9853
9901
|
* - `maxInAmount`: Maximum amount of lamport to swap in
|
|
9854
9902
|
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
9903
|
+
* @throws {DlmmSdkError}
|
|
9904
|
+
*
|
|
9855
9905
|
*/
|
|
9856
9906
|
swapQuoteExactOut(outAmount, swapForY, allowedSlippage, binArrays) {
|
|
9857
9907
|
const currentTimestamp = Date.now() / 1e3;
|
|
@@ -9876,11 +9926,14 @@ var DLMM = class {
|
|
|
9876
9926
|
swapForY,
|
|
9877
9927
|
activeId,
|
|
9878
9928
|
this.lbPair,
|
|
9879
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
9929
|
+
_nullishCoalesce(_optionalChain([this, 'access', _71 => _71.binArrayBitmapExtension, 'optionalAccess', _72 => _72.account]), () => ( null)),
|
|
9880
9930
|
binArrays
|
|
9881
9931
|
);
|
|
9882
9932
|
if (binArrayAccountToSwap == null) {
|
|
9883
|
-
throw new
|
|
9933
|
+
throw new DlmmSdkError(
|
|
9934
|
+
"SWAP_QUOTE_INSUFFICIENT_LIQUIDITY",
|
|
9935
|
+
"Insufficient liquidity in binArrays"
|
|
9936
|
+
);
|
|
9884
9937
|
}
|
|
9885
9938
|
binArraysForSwap.set(binArrayAccountToSwap.publicKey, true);
|
|
9886
9939
|
this.updateVolatilityAccumulator(
|
|
@@ -9952,6 +10005,7 @@ var DLMM = class {
|
|
|
9952
10005
|
* - `minOutAmount`: Minimum amount of lamport to swap out
|
|
9953
10006
|
* - `priceImpact`: Price impact of the swap
|
|
9954
10007
|
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
10008
|
+
* @throws {DlmmSdkError}
|
|
9955
10009
|
*/
|
|
9956
10010
|
swapQuote(inAmount, swapForY, allowedSlippage, binArrays, isPartialFill) {
|
|
9957
10011
|
const currentTimestamp = Date.now() / 1e3;
|
|
@@ -9976,14 +10030,17 @@ var DLMM = class {
|
|
|
9976
10030
|
swapForY,
|
|
9977
10031
|
activeId,
|
|
9978
10032
|
this.lbPair,
|
|
9979
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10033
|
+
_nullishCoalesce(_optionalChain([this, 'access', _73 => _73.binArrayBitmapExtension, 'optionalAccess', _74 => _74.account]), () => ( null)),
|
|
9980
10034
|
binArrays
|
|
9981
10035
|
);
|
|
9982
10036
|
if (binArrayAccountToSwap == null) {
|
|
9983
10037
|
if (isPartialFill) {
|
|
9984
10038
|
break;
|
|
9985
10039
|
} else {
|
|
9986
|
-
throw new
|
|
10040
|
+
throw new DlmmSdkError(
|
|
10041
|
+
"SWAP_QUOTE_INSUFFICIENT_LIQUIDITY",
|
|
10042
|
+
"Insufficient liquidity in binArrays for swapQuote"
|
|
10043
|
+
);
|
|
9987
10044
|
}
|
|
9988
10045
|
}
|
|
9989
10046
|
binArraysForSwap.set(binArrayAccountToSwap.publicKey, true);
|
|
@@ -10023,8 +10080,12 @@ var DLMM = class {
|
|
|
10023
10080
|
}
|
|
10024
10081
|
}
|
|
10025
10082
|
}
|
|
10026
|
-
if (!startBin)
|
|
10027
|
-
throw new
|
|
10083
|
+
if (!startBin) {
|
|
10084
|
+
throw new DlmmSdkError(
|
|
10085
|
+
"SWAP_QUOTE_INSUFFICIENT_LIQUIDITY",
|
|
10086
|
+
"Insufficient liquidity"
|
|
10087
|
+
);
|
|
10088
|
+
}
|
|
10028
10089
|
inAmount = inAmount.sub(inAmountLeft);
|
|
10029
10090
|
const outAmountWithoutSlippage = getOutAmount(
|
|
10030
10091
|
startBin,
|
|
@@ -10913,7 +10974,7 @@ var DLMM = class {
|
|
|
10913
10974
|
swapForY,
|
|
10914
10975
|
new (0, _anchor.BN)(activeBinId),
|
|
10915
10976
|
this.lbPair,
|
|
10916
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
10977
|
+
_nullishCoalesce(_optionalChain([this, 'access', _75 => _75.binArrayBitmapExtension, 'optionalAccess', _76 => _76.account]), () => ( null))
|
|
10917
10978
|
);
|
|
10918
10979
|
if (toBinArrayIndex === null)
|
|
10919
10980
|
return true;
|
|
@@ -10950,7 +11011,7 @@ var DLMM = class {
|
|
|
10950
11011
|
swapForY,
|
|
10951
11012
|
new (0, _anchor.BN)(activeBinId),
|
|
10952
11013
|
this.lbPair,
|
|
10953
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
11014
|
+
_nullishCoalesce(_optionalChain([this, 'access', _77 => _77.binArrayBitmapExtension, 'optionalAccess', _78 => _78.account]), () => ( null))
|
|
10954
11015
|
);
|
|
10955
11016
|
const accountsToFetch = [];
|
|
10956
11017
|
const [binArrayBitMapExtensionPubkey] = deriveBinArrayBitmapExtension(
|
|
@@ -10981,13 +11042,13 @@ var DLMM = class {
|
|
|
10981
11042
|
let fromBinArray = null;
|
|
10982
11043
|
let toBinArray = null;
|
|
10983
11044
|
let binArrayBitmapExtension = null;
|
|
10984
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11045
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _79 => _79[0]])) {
|
|
10985
11046
|
binArrayBitmapExtension = binArrayBitMapExtensionPubkey;
|
|
10986
11047
|
}
|
|
10987
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11048
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _80 => _80[1]])) {
|
|
10988
11049
|
fromBinArray = fromBinArrayPubkey;
|
|
10989
11050
|
}
|
|
10990
|
-
if (!!_optionalChain([binArrayAccounts, 'optionalAccess',
|
|
11051
|
+
if (!!_optionalChain([binArrayAccounts, 'optionalAccess', _81 => _81[2]]) && !!toBinArrayIndex) {
|
|
10991
11052
|
toBinArray = toBinArrayPubkey;
|
|
10992
11053
|
}
|
|
10993
11054
|
const { blockhash, lastValidBlockHeight } = await this.program.provider.connection.getLatestBlockhash("confirmed");
|
|
@@ -11734,40 +11795,6 @@ var DLMM = class {
|
|
|
11734
11795
|
}
|
|
11735
11796
|
};
|
|
11736
11797
|
|
|
11737
|
-
// src/dlmm/error.ts
|
|
11738
|
-
|
|
11739
|
-
var DLMMError = class extends Error {
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
constructor(error) {
|
|
11744
|
-
let _errorCode = 0;
|
|
11745
|
-
let _errorName = "Something went wrong";
|
|
11746
|
-
let _errorMessage = "Something went wrong";
|
|
11747
|
-
if (error instanceof Error) {
|
|
11748
|
-
const anchorError = _anchor.AnchorError.parse(
|
|
11749
|
-
JSON.parse(JSON.stringify(error)).logs
|
|
11750
|
-
);
|
|
11751
|
-
if (_optionalChain([anchorError, 'optionalAccess', _79 => _79.program, 'access', _80 => _80.toBase58, 'call', _81 => _81()]) === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
|
|
11752
|
-
_errorCode = anchorError.error.errorCode.number;
|
|
11753
|
-
_errorName = anchorError.error.errorCode.code;
|
|
11754
|
-
_errorMessage = anchorError.error.errorMessage;
|
|
11755
|
-
}
|
|
11756
|
-
} else {
|
|
11757
|
-
const idlError = IDL.errors.find((err) => err.code === error);
|
|
11758
|
-
if (idlError) {
|
|
11759
|
-
_errorCode = idlError.code;
|
|
11760
|
-
_errorName = idlError.name;
|
|
11761
|
-
_errorMessage = idlError.msg;
|
|
11762
|
-
}
|
|
11763
|
-
}
|
|
11764
|
-
super(_errorMessage);
|
|
11765
|
-
this.errorCode = _errorCode;
|
|
11766
|
-
this.errorName = _errorName;
|
|
11767
|
-
this.errorMessage = _errorMessage;
|
|
11768
|
-
}
|
|
11769
|
-
};
|
|
11770
|
-
|
|
11771
11798
|
// src/index.ts
|
|
11772
11799
|
var src_default = DLMM;
|
|
11773
11800
|
|
|
@@ -11858,5 +11885,6 @@ var src_default = DLMM;
|
|
|
11858
11885
|
|
|
11859
11886
|
|
|
11860
11887
|
|
|
11861
|
-
|
|
11888
|
+
|
|
11889
|
+
exports.ADMIN = ADMIN; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_ARRAY_BITMAP_SIZE = BIN_ARRAY_BITMAP_SIZE; exports.BIN_ARRAY_FEE = BIN_ARRAY_FEE; exports.BitmapType = BitmapType; exports.ClockLayout = ClockLayout; exports.DLMMError = DLMMError; exports.DlmmSdkError = DlmmSdkError; exports.EXTENSION_BINARRAY_BITMAP_SIZE = EXTENSION_BINARRAY_BITMAP_SIZE; exports.FEE_PRECISION = FEE_PRECISION; exports.IDL = IDL; 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_BIN_PER_TX = MAX_BIN_PER_TX; exports.MAX_CLAIM_ALL_ALLOWED = MAX_CLAIM_ALL_ALLOWED; exports.MAX_FEE_RATE = MAX_FEE_RATE; exports.Network = Network; exports.POSITION_FEE = POSITION_FEE; exports.PRECISION = PRECISION; exports.PairStatus = PairStatus; exports.PairType = PairType; exports.PositionVersion = PositionVersion; exports.SCALE = SCALE; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SIMULATION_USER = SIMULATION_USER; exports.Strategy = Strategy; exports.StrategyType = StrategyType; exports.autoFillXByStrategy = autoFillXByStrategy; exports.autoFillXByWeight = autoFillXByWeight; exports.autoFillYByStrategy = autoFillYByStrategy; exports.autoFillYByWeight = autoFillYByWeight; 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.deriveLbPair2 = deriveLbPair2; exports.deriveOracle = deriveOracle; exports.derivePermissionLbPair = derivePermissionLbPair; exports.derivePosition = derivePosition; exports.derivePresetParameter = derivePresetParameter; exports.derivePresetParameter2 = derivePresetParameter2; exports.deriveReserve = deriveReserve; exports.findNextBinArrayIndexWithLiquidity = findNextBinArrayIndexWithLiquidity; exports.findNextBinArrayWithLiquidity = findNextBinArrayWithLiquidity; exports.fromWeightDistributionToAmount = fromWeightDistributionToAmount; exports.fromWeightDistributionToAmountOneSide = fromWeightDistributionToAmountOneSide; exports.getBaseFee = getBaseFee; exports.getBinArrayLowerUpperBinId = getBinArrayLowerUpperBinId; exports.getBinArraysRequiredByPositionRange = getBinArraysRequiredByPositionRange; exports.getBinFromBinArray = getBinFromBinArray; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getOutAmount = getOutAmount; exports.getPriceOfBinByBinId = getPriceOfBinByBinId; exports.getTokenBalance = getTokenBalance; exports.getTokenDecimals = getTokenDecimals; exports.getTokensMintFromPoolAddress = getTokensMintFromPoolAddress; exports.getTotalFee = getTotalFee; exports.getVariableFee = getVariableFee; exports.isBinIdWithinBinArray = isBinIdWithinBinArray; exports.isOverflowDefaultBinArrayBitmap = isOverflowDefaultBinArrayBitmap; exports.parseLogs = parseLogs; exports.swapExactInQuoteAtBin = swapExactInQuoteAtBin; exports.swapExactOutQuoteAtBin = swapExactOutQuoteAtBin; exports.toAmountAskSide = toAmountAskSide; exports.toAmountBidSide = toAmountBidSide; exports.toAmountBothSide = toAmountBothSide; exports.toAmountsBothSideByStrategy = toAmountsBothSideByStrategy; exports.toAmountsOneSideByStrategy = toAmountsOneSideByStrategy; exports.toStrategyParameters = toStrategyParameters; exports.toWeightDistribution = toWeightDistribution; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.wrapSOLInstruction = wrapSOLInstruction;
|
|
11862
11890
|
//# sourceMappingURL=index.js.map
|