@meteora-ag/dlmm 1.6.1 → 1.7.0-rc.1
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 +3 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10705,15 +10705,17 @@ declare class DLMM {
|
|
|
10705
10705
|
* - `toBinId`: The ID of the ending bin to remove liquidity from. Must within position range.
|
|
10706
10706
|
* - `liquiditiesBpsToRemove`: An array of numbers (percentage) that represent the liquidity to remove from each bin.
|
|
10707
10707
|
* - `shouldClaimAndClose`: A boolean flag that indicates whether to claim rewards and close the position.
|
|
10708
|
+
* - `skipUnwrapSOL`: A boolean flag that indicates whether to skip unwrapping SOL. Enable this when using zap-sdk to ensure accuracy in SOL zap out amount when SOL is in token
|
|
10708
10709
|
* @returns {Promise<Transaction[]>}
|
|
10709
10710
|
*/
|
|
10710
|
-
removeLiquidity({ user, position, fromBinId, toBinId, bps, shouldClaimAndClose, }: {
|
|
10711
|
+
removeLiquidity({ user, position, fromBinId, toBinId, bps, shouldClaimAndClose, skipUnwrapSOL, }: {
|
|
10711
10712
|
user: PublicKey;
|
|
10712
10713
|
position: PublicKey;
|
|
10713
10714
|
fromBinId: number;
|
|
10714
10715
|
toBinId: number;
|
|
10715
10716
|
bps: BN$1;
|
|
10716
10717
|
shouldClaimAndClose?: boolean;
|
|
10718
|
+
skipUnwrapSOL?: boolean;
|
|
10717
10719
|
}): Promise<Transaction[]>;
|
|
10718
10720
|
/**
|
|
10719
10721
|
* The `closePositionIfEmpty` function closes a position if it is empty. Else, it does nothing.
|
package/dist/index.js
CHANGED
|
@@ -16785,6 +16785,7 @@ var DLMM = class {
|
|
|
16785
16785
|
* - `toBinId`: The ID of the ending bin to remove liquidity from. Must within position range.
|
|
16786
16786
|
* - `liquiditiesBpsToRemove`: An array of numbers (percentage) that represent the liquidity to remove from each bin.
|
|
16787
16787
|
* - `shouldClaimAndClose`: A boolean flag that indicates whether to claim rewards and close the position.
|
|
16788
|
+
* - `skipUnwrapSOL`: A boolean flag that indicates whether to skip unwrapping SOL. Enable this when using zap-sdk to ensure accuracy in SOL zap out amount when SOL is in token
|
|
16788
16789
|
* @returns {Promise<Transaction[]>}
|
|
16789
16790
|
*/
|
|
16790
16791
|
async removeLiquidity({
|
|
@@ -16793,7 +16794,8 @@ var DLMM = class {
|
|
|
16793
16794
|
fromBinId,
|
|
16794
16795
|
toBinId,
|
|
16795
16796
|
bps,
|
|
16796
|
-
shouldClaimAndClose = false
|
|
16797
|
+
shouldClaimAndClose = false,
|
|
16798
|
+
skipUnwrapSOL = false
|
|
16797
16799
|
}) {
|
|
16798
16800
|
const positionAccount = await this.program.provider.connection.getAccountInfo(position);
|
|
16799
16801
|
const positionState = wrapPosition(this.program, position, positionAccount);
|
|
@@ -16950,7 +16952,7 @@ var DLMM = class {
|
|
|
16950
16952
|
if ([
|
|
16951
16953
|
this.tokenX.publicKey.toBase58(),
|
|
16952
16954
|
this.tokenY.publicKey.toBase58()
|
|
16953
|
-
].includes(_spltoken.NATIVE_MINT.toBase58())) {
|
|
16955
|
+
].includes(_spltoken.NATIVE_MINT.toBase58()) && !skipUnwrapSOL) {
|
|
16954
16956
|
const closeWrappedSOLIx = await unwrapSOLInstruction(user);
|
|
16955
16957
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
16956
16958
|
}
|