@meteora-ag/dlmm 1.0.50 → 1.0.52-rc.6
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 +125 -32
- package/dist/index.js +245 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +244 -51
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2044,6 +2044,73 @@ type LbClmm = {
|
|
|
2044
2044
|
];
|
|
2045
2045
|
"args": [];
|
|
2046
2046
|
},
|
|
2047
|
+
{
|
|
2048
|
+
"name": "removeLiquiditySingleSide";
|
|
2049
|
+
"accounts": [
|
|
2050
|
+
{
|
|
2051
|
+
"name": "position";
|
|
2052
|
+
"isMut": true;
|
|
2053
|
+
"isSigner": false;
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"name": "lbPair";
|
|
2057
|
+
"isMut": true;
|
|
2058
|
+
"isSigner": false;
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
"name": "binArrayBitmapExtension";
|
|
2062
|
+
"isMut": true;
|
|
2063
|
+
"isSigner": false;
|
|
2064
|
+
"isOptional": true;
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
"name": "userToken";
|
|
2068
|
+
"isMut": true;
|
|
2069
|
+
"isSigner": false;
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
"name": "reserve";
|
|
2073
|
+
"isMut": true;
|
|
2074
|
+
"isSigner": false;
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
"name": "tokenMint";
|
|
2078
|
+
"isMut": false;
|
|
2079
|
+
"isSigner": false;
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
"name": "binArrayLower";
|
|
2083
|
+
"isMut": true;
|
|
2084
|
+
"isSigner": false;
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
"name": "binArrayUpper";
|
|
2088
|
+
"isMut": true;
|
|
2089
|
+
"isSigner": false;
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
"name": "sender";
|
|
2093
|
+
"isMut": false;
|
|
2094
|
+
"isSigner": true;
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"name": "tokenProgram";
|
|
2098
|
+
"isMut": false;
|
|
2099
|
+
"isSigner": false;
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
"name": "eventAuthority";
|
|
2103
|
+
"isMut": false;
|
|
2104
|
+
"isSigner": false;
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
"name": "program";
|
|
2108
|
+
"isMut": false;
|
|
2109
|
+
"isSigner": false;
|
|
2110
|
+
}
|
|
2111
|
+
];
|
|
2112
|
+
"args": [];
|
|
2113
|
+
},
|
|
2047
2114
|
{
|
|
2048
2115
|
"name": "togglePairStatus";
|
|
2049
2116
|
"accounts": [
|
|
@@ -2555,7 +2622,7 @@ type LbClmm = {
|
|
|
2555
2622
|
];
|
|
2556
2623
|
"accounts": [
|
|
2557
2624
|
{
|
|
2558
|
-
"name": "
|
|
2625
|
+
"name": "BinArrayBitmapExtension";
|
|
2559
2626
|
"type": {
|
|
2560
2627
|
"kind": "struct";
|
|
2561
2628
|
"fields": [
|
|
@@ -2601,7 +2668,7 @@ type LbClmm = {
|
|
|
2601
2668
|
};
|
|
2602
2669
|
},
|
|
2603
2670
|
{
|
|
2604
|
-
"name": "
|
|
2671
|
+
"name": "BinArray";
|
|
2605
2672
|
"docs": [
|
|
2606
2673
|
"An account to contain a range of bin. For example: Bin 100 <-> 200.",
|
|
2607
2674
|
"For example:",
|
|
@@ -2650,7 +2717,7 @@ type LbClmm = {
|
|
|
2650
2717
|
};
|
|
2651
2718
|
},
|
|
2652
2719
|
{
|
|
2653
|
-
"name": "
|
|
2720
|
+
"name": "LbPair";
|
|
2654
2721
|
"type": {
|
|
2655
2722
|
"kind": "struct";
|
|
2656
2723
|
"fields": [
|
|
@@ -2898,7 +2965,7 @@ type LbClmm = {
|
|
|
2898
2965
|
};
|
|
2899
2966
|
},
|
|
2900
2967
|
{
|
|
2901
|
-
"name": "
|
|
2968
|
+
"name": "Oracle";
|
|
2902
2969
|
"type": {
|
|
2903
2970
|
"kind": "struct";
|
|
2904
2971
|
"fields": [
|
|
@@ -2927,7 +2994,7 @@ type LbClmm = {
|
|
|
2927
2994
|
};
|
|
2928
2995
|
},
|
|
2929
2996
|
{
|
|
2930
|
-
"name": "
|
|
2997
|
+
"name": "Position";
|
|
2931
2998
|
"type": {
|
|
2932
2999
|
"kind": "struct";
|
|
2933
3000
|
"fields": [
|
|
@@ -3048,7 +3115,7 @@ type LbClmm = {
|
|
|
3048
3115
|
};
|
|
3049
3116
|
},
|
|
3050
3117
|
{
|
|
3051
|
-
"name": "
|
|
3118
|
+
"name": "PositionV2";
|
|
3052
3119
|
"type": {
|
|
3053
3120
|
"kind": "struct";
|
|
3054
3121
|
"fields": [
|
|
@@ -3197,7 +3264,7 @@ type LbClmm = {
|
|
|
3197
3264
|
};
|
|
3198
3265
|
},
|
|
3199
3266
|
{
|
|
3200
|
-
"name": "
|
|
3267
|
+
"name": "PresetParameter";
|
|
3201
3268
|
"type": {
|
|
3202
3269
|
"kind": "struct";
|
|
3203
3270
|
"fields": [
|
|
@@ -3720,38 +3787,38 @@ type LbClmm = {
|
|
|
3720
3787
|
};
|
|
3721
3788
|
},
|
|
3722
3789
|
{
|
|
3723
|
-
"name": "
|
|
3790
|
+
"name": "FeeParameter";
|
|
3724
3791
|
"type": {
|
|
3725
3792
|
"kind": "struct";
|
|
3726
3793
|
"fields": [
|
|
3727
3794
|
{
|
|
3728
|
-
"name": "
|
|
3729
|
-
"
|
|
3795
|
+
"name": "protocolShare";
|
|
3796
|
+
"docs": [
|
|
3797
|
+
"Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
|
|
3798
|
+
];
|
|
3799
|
+
"type": "u16";
|
|
3730
3800
|
},
|
|
3731
3801
|
{
|
|
3732
|
-
"name": "
|
|
3802
|
+
"name": "baseFactor";
|
|
3803
|
+
"docs": [
|
|
3804
|
+
"Base factor for base fee rate"
|
|
3805
|
+
];
|
|
3733
3806
|
"type": "u16";
|
|
3734
3807
|
}
|
|
3735
3808
|
];
|
|
3736
3809
|
};
|
|
3737
3810
|
},
|
|
3738
3811
|
{
|
|
3739
|
-
"name": "
|
|
3812
|
+
"name": "BinLiquidityReduction";
|
|
3740
3813
|
"type": {
|
|
3741
3814
|
"kind": "struct";
|
|
3742
3815
|
"fields": [
|
|
3743
3816
|
{
|
|
3744
|
-
"name": "
|
|
3745
|
-
"
|
|
3746
|
-
"Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee"
|
|
3747
|
-
];
|
|
3748
|
-
"type": "u16";
|
|
3817
|
+
"name": "binId";
|
|
3818
|
+
"type": "i32";
|
|
3749
3819
|
},
|
|
3750
3820
|
{
|
|
3751
|
-
"name": "
|
|
3752
|
-
"docs": [
|
|
3753
|
-
"Base factor for base fee rate"
|
|
3754
|
-
];
|
|
3821
|
+
"name": "bpsToRemove";
|
|
3755
3822
|
"type": "u16";
|
|
3756
3823
|
}
|
|
3757
3824
|
];
|
|
@@ -5080,20 +5147,20 @@ interface TokenReserve {
|
|
|
5080
5147
|
decimal: number;
|
|
5081
5148
|
}
|
|
5082
5149
|
type ClmmProgram = Program<LbClmm>;
|
|
5083
|
-
type LbPair = IdlAccounts<LbClmm>["
|
|
5084
|
-
type LbPairAccount = ProgramAccount<IdlAccounts<LbClmm>["
|
|
5150
|
+
type LbPair = IdlAccounts<LbClmm>["LbPair"];
|
|
5151
|
+
type LbPairAccount = ProgramAccount<IdlAccounts<LbClmm>["LbPair"]>;
|
|
5085
5152
|
type Bin = IdlTypes<LbClmm>["Bin"];
|
|
5086
|
-
type BinArray = IdlAccounts<LbClmm>["
|
|
5087
|
-
type BinArrayAccount = ProgramAccount<IdlAccounts<LbClmm>["
|
|
5088
|
-
type Position = IdlAccounts<LbClmm>["
|
|
5089
|
-
type PositionV2 = IdlAccounts<LbClmm>["
|
|
5090
|
-
type vParameters = IdlAccounts<LbClmm>["
|
|
5091
|
-
type sParameters = IdlAccounts<LbClmm>["
|
|
5153
|
+
type BinArray = IdlAccounts<LbClmm>["BinArray"];
|
|
5154
|
+
type BinArrayAccount = ProgramAccount<IdlAccounts<LbClmm>["BinArray"]>;
|
|
5155
|
+
type Position = IdlAccounts<LbClmm>["Position"];
|
|
5156
|
+
type PositionV2 = IdlAccounts<LbClmm>["PositionV2"];
|
|
5157
|
+
type vParameters = IdlAccounts<LbClmm>["LbPair"]["vParameters"];
|
|
5158
|
+
type sParameters = IdlAccounts<LbClmm>["LbPair"]["parameters"];
|
|
5092
5159
|
type InitPermissionPairIx = IdlTypes<LbClmm>["InitPermissionPairIx"];
|
|
5093
5160
|
type BinLiquidityDistribution = IdlTypes<LbClmm>["BinLiquidityDistribution"];
|
|
5094
5161
|
type BinLiquidityReduction = IdlTypes<LbClmm>["BinLiquidityReduction"];
|
|
5095
|
-
type BinArrayBitmapExtensionAccount = ProgramAccount<IdlAccounts<LbClmm>["
|
|
5096
|
-
type BinArrayBitmapExtension = IdlAccounts<LbClmm>["
|
|
5162
|
+
type BinArrayBitmapExtensionAccount = ProgramAccount<IdlAccounts<LbClmm>["BinArrayBitmapExtension"]>;
|
|
5163
|
+
type BinArrayBitmapExtension = IdlAccounts<LbClmm>["BinArrayBitmapExtension"];
|
|
5097
5164
|
type LiquidityParameterByWeight = IdlTypes<LbClmm>["LiquidityParameterByWeight"];
|
|
5098
5165
|
type LiquidityOneSideParameter = IdlTypes<LbClmm>["LiquidityOneSideParameter"];
|
|
5099
5166
|
type LiquidityParameterByStrategy = IdlTypes<LbClmm>["LiquidityParameterByStrategy"];
|
|
@@ -5648,6 +5715,12 @@ declare class DLMM {
|
|
|
5648
5715
|
bps: BN;
|
|
5649
5716
|
shouldClaimAndClose?: boolean;
|
|
5650
5717
|
}): Promise<Transaction | Transaction[]>;
|
|
5718
|
+
removeLiquiditySingleSide({ user, position, binIds, removeLiquidityForY, }: {
|
|
5719
|
+
user: PublicKey;
|
|
5720
|
+
position: PublicKey;
|
|
5721
|
+
binIds: number[];
|
|
5722
|
+
removeLiquidityForY?: boolean;
|
|
5723
|
+
}): Promise<Transaction | Transaction[]>;
|
|
5651
5724
|
/**
|
|
5652
5725
|
* The `closePosition` function closes a position
|
|
5653
5726
|
* @param
|
|
@@ -5798,6 +5871,14 @@ declare class DLMM {
|
|
|
5798
5871
|
* @returns {Promise<SeedLiquidityResponse>}
|
|
5799
5872
|
*/
|
|
5800
5873
|
seedLiquidity(owner: PublicKey, operator: PublicKey, feeOwner: PublicKey, seedAmount: BN, curvature: number, minPrice: number, maxPrice: number, base: PublicKey): Promise<SeedLiquidityResponse>;
|
|
5874
|
+
/**
|
|
5875
|
+
* Initializes bin arrays for the given bin array indexes if it wasn't initialized.
|
|
5876
|
+
*
|
|
5877
|
+
* @param {BN[]} binArrayIndexes - An array of bin array indexes to initialize.
|
|
5878
|
+
* @param {PublicKey} funder - The public key of the funder.
|
|
5879
|
+
* @return {Promise<TransactionInstruction[]>} An array of transaction instructions to initialize the bin arrays.
|
|
5880
|
+
*/
|
|
5881
|
+
initializeBinArrays(binArrayIndexes: BN[], funder: PublicKey): Promise<TransactionInstruction[]>;
|
|
5801
5882
|
/**
|
|
5802
5883
|
*
|
|
5803
5884
|
* @param
|
|
@@ -5886,6 +5967,18 @@ declare function isBinIdWithinBinArray(activeId: BN, binArrayIndex: BN): boolean
|
|
|
5886
5967
|
declare function getBinFromBinArray(binId: number, binArray: BinArray): Bin;
|
|
5887
5968
|
declare function findNextBinArrayIndexWithLiquidity(swapForY: boolean, activeId: BN, lbPairState: LbPair, binArrayBitmapExtension: BinArrayBitmapExtension | null): BN | null;
|
|
5888
5969
|
declare function findNextBinArrayWithLiquidity(swapForY: boolean, activeBinId: BN, lbPairState: LbPair, binArrayBitmapExtension: BinArrayBitmapExtension | null, binArrays: BinArrayAccount[]): BinArrayAccount | null;
|
|
5970
|
+
/**
|
|
5971
|
+
* Retrieves the bin arrays required to initialize multiple positions in continuous range.
|
|
5972
|
+
*
|
|
5973
|
+
* @param {PublicKey} pair - The public key of the pair.
|
|
5974
|
+
* @param {BN} fromBinId - The starting bin ID.
|
|
5975
|
+
* @param {BN} toBinId - The ending bin ID.
|
|
5976
|
+
* @return {[{key: PublicKey, index: BN }]} An array of bin arrays required for the given position range.
|
|
5977
|
+
*/
|
|
5978
|
+
declare function getBinArraysRequiredByPositionRange(pair: PublicKey, fromBinId: BN, toBinId: BN, programId: PublicKey): {
|
|
5979
|
+
key: PublicKey;
|
|
5980
|
+
index: BN;
|
|
5981
|
+
}[];
|
|
5889
5982
|
|
|
5890
5983
|
declare function getPriceOfBinByBinId(binId: number, binStep: number): Decimal;
|
|
5891
5984
|
/** private */
|
|
@@ -6258,4 +6351,4 @@ declare const MAX_BIN_LENGTH_ALLOWED_IN_ONE_TX = 26;
|
|
|
6258
6351
|
declare const MAX_BIN_PER_TX = 69;
|
|
6259
6352
|
declare const MAX_ACTIVE_BIN_SLIPPAGE = 3;
|
|
6260
6353
|
|
|
6261
|
-
export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, 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, 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, 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 };
|
|
6354
|
+
export { ADMIN, BASIS_POINT_MAX, BIN_ARRAY_BITMAP_SIZE, BIN_ARRAY_FEE, Bin, BinAndAmount, BinArray, BinArrayAccount, BinArrayBitmapExtension, BinArrayBitmapExtensionAccount, BinLiquidity, BinLiquidityDistribution, BinLiquidityReduction, BitmapType, ClmmProgram, 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, 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 };
|