@meteora-ag/dlmm 1.6.0-rc.3 → 1.6.0-rc.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.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18361,6 +18361,27 @@ var DLMM = class {
|
|
|
18361
18361
|
]);
|
|
18362
18362
|
createUserTokenXIx && preInstructions.push(createUserTokenXIx);
|
|
18363
18363
|
createUserTokenYIx && preInstructions.push(createUserTokenYIx);
|
|
18364
|
+
const postInstructions = [];
|
|
18365
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountXDeposited.isZero()) {
|
|
18366
|
+
const wrapSOLIx = wrapSOLInstruction(
|
|
18367
|
+
owner,
|
|
18368
|
+
userTokenX,
|
|
18369
|
+
BigInt(simulationResult.actualAmountXDeposited.toString())
|
|
18370
|
+
);
|
|
18371
|
+
preInstructions.push(...wrapSOLIx);
|
|
18372
|
+
}
|
|
18373
|
+
if (this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT) && !simulationResult.actualAmountYDeposited.isZero()) {
|
|
18374
|
+
const wrapSOLIx = wrapSOLInstruction(
|
|
18375
|
+
owner,
|
|
18376
|
+
userTokenY,
|
|
18377
|
+
BigInt(simulationResult.actualAmountYDeposited.toString())
|
|
18378
|
+
);
|
|
18379
|
+
preInstructions.push(...wrapSOLIx);
|
|
18380
|
+
}
|
|
18381
|
+
if (this.tokenX.publicKey.equals(_spltoken.NATIVE_MINT) || this.tokenY.publicKey.equals(_spltoken.NATIVE_MINT)) {
|
|
18382
|
+
const closeWrappedSOLIx = await unwrapSOLInstruction(owner);
|
|
18383
|
+
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
18384
|
+
}
|
|
18364
18385
|
slippage = capSlippagePercentage(slippage);
|
|
18365
18386
|
const applySlippageMaxAmount = (amount, slippage2) => {
|
|
18366
18387
|
return slippage2 == 100 ? U64_MAX : amount.muln(100 + slippage2).divn(100);
|
|
@@ -18433,7 +18454,8 @@ var DLMM = class {
|
|
|
18433
18454
|
const rebalancePositionInstruction = [
|
|
18434
18455
|
setCUIX,
|
|
18435
18456
|
...preInstructions,
|
|
18436
|
-
instruction
|
|
18457
|
+
instruction,
|
|
18458
|
+
...postInstructions
|
|
18437
18459
|
];
|
|
18438
18460
|
return {
|
|
18439
18461
|
initBinArrayInstructions,
|