@meteora-ag/dlmm 1.0.39-rc.1 → 1.0.39-rc.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.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9090,6 +9090,7 @@ var DLMM = class {
|
|
|
9090
9090
|
_optionalChain([this, 'access', _58 => _58.binArrayBitmapExtension, 'optionalAccess', _59 => _59.account]),
|
|
9091
9091
|
binArrays
|
|
9092
9092
|
);
|
|
9093
|
+
console.log("\u{1F680} ~ DLMM ~ binArrayAccountToSwap:", binArrayAccountToSwap);
|
|
9093
9094
|
if (binArrayAccountToSwap == null) {
|
|
9094
9095
|
throw new Error("Insufficient liquidity");
|
|
9095
9096
|
}
|
|
@@ -9904,10 +9905,10 @@ var DLMM = class {
|
|
|
9904
9905
|
}).add(syncWithMarketPriceTx);
|
|
9905
9906
|
}
|
|
9906
9907
|
async getLastPrice() {
|
|
9907
|
-
const {
|
|
9908
|
+
const { price } = await this.getActiveBin();
|
|
9908
9909
|
const binArrays = await this.getBinArrays();
|
|
9909
9910
|
let count = 0;
|
|
9910
|
-
let binPriceWithLastLiquidity =
|
|
9911
|
+
let binPriceWithLastLiquidity = price;
|
|
9911
9912
|
while (count <= binArrays.length - 1) {
|
|
9912
9913
|
const binArray = binArrays[count];
|
|
9913
9914
|
if (binArray) {
|
|
@@ -9918,9 +9919,7 @@ var DLMM = class {
|
|
|
9918
9919
|
const lastBinWithLiquidityIndex = bins.findIndex(
|
|
9919
9920
|
({ liquiditySupply }) => liquiditySupply.isZero()
|
|
9920
9921
|
);
|
|
9921
|
-
binPriceWithLastLiquidity =
|
|
9922
|
-
bins[lastBinWithLiquidityIndex - 1].price.toNumber()
|
|
9923
|
-
);
|
|
9922
|
+
binPriceWithLastLiquidity = bins[lastBinWithLiquidityIndex - 1].price.toString();
|
|
9924
9923
|
count = binArrays.length;
|
|
9925
9924
|
}
|
|
9926
9925
|
}
|