@meteora-ag/dlmm 1.2.2-rc.0 → 1.2.2
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 +5 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8926,7 +8926,10 @@ var DLMM = class {
|
|
|
8926
8926
|
async quoteCreatePosition({ strategy }) {
|
|
8927
8927
|
const { minBinId, maxBinId } = strategy;
|
|
8928
8928
|
const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
|
|
8929
|
-
const upperBinArrayIndex =
|
|
8929
|
+
const upperBinArrayIndex = _anchor.BN.max(
|
|
8930
|
+
binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId)),
|
|
8931
|
+
lowerBinArrayIndex.add(new (0, _anchor.BN)(1))
|
|
8932
|
+
);
|
|
8930
8933
|
const binArraysCount = (await this.binArraysToBeCreate(lowerBinArrayIndex, upperBinArrayIndex)).length;
|
|
8931
8934
|
const positionCount = Math.ceil((maxBinId - minBinId + 1) / MAX_BIN_PER_TX);
|
|
8932
8935
|
const binArrayCost = binArraysCount * BIN_ARRAY_FEE;
|
|
@@ -11587,12 +11590,7 @@ var DLMM = class {
|
|
|
11587
11590
|
binArrays.push(binArrayPubKey);
|
|
11588
11591
|
}
|
|
11589
11592
|
const binArrayAccounts = await this.program.provider.connection.getMultipleAccountsInfo(binArrays);
|
|
11590
|
-
|
|
11591
|
-
binArrays.map((binArray, index) => ({
|
|
11592
|
-
[binArray.toBase58()]: binArrayAccounts[index]
|
|
11593
|
-
}))
|
|
11594
|
-
);
|
|
11595
|
-
return binArrayAccounts.filter((binArray) => binArray === null);
|
|
11593
|
+
return binArrayAccounts.filter((binArray) => binArray === null).map((_, index) => binArrays[index]);
|
|
11596
11594
|
}
|
|
11597
11595
|
async createBinArraysIfNeeded(upperBinArrayIndex, lowerBinArrayIndex, funder) {
|
|
11598
11596
|
const ixs = [];
|