@meteora-ag/dlmm 1.0.39-rc.26 → 1.0.39-rc.27
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 +2 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9903,22 +9903,12 @@ var DLMM = class {
|
|
|
9903
9903
|
const sortedBinArrays = _binArrays.sort(
|
|
9904
9904
|
({ account: { index: indexA } }, { account: { index: indexB } }) => indexA.toNumber() - indexB.toNumber()
|
|
9905
9905
|
);
|
|
9906
|
-
console.log(
|
|
9907
|
-
"\u{1F680} ~ binArrays:",
|
|
9908
|
-
_optionalChain([sortedBinArrays, 'optionalAccess', _67 => _67.flatMap, 'call', _68 => _68(
|
|
9909
|
-
({ account: { bins } }) => bins.map(({ amountX, amountY, price }) => ({
|
|
9910
|
-
amountX: amountX.toString(),
|
|
9911
|
-
amountY: amountY.toString(),
|
|
9912
|
-
price: this.fromPricePerLamport(Number(price) / (2 ** 64 - 1))
|
|
9913
|
-
}))
|
|
9914
|
-
)])
|
|
9915
|
-
);
|
|
9916
9906
|
let count = sortedBinArrays.length - 1;
|
|
9917
9907
|
let binPriceWithLastLiquidity;
|
|
9918
9908
|
while (count >= 0) {
|
|
9919
9909
|
const binArray = sortedBinArrays[count];
|
|
9920
9910
|
if (binArray) {
|
|
9921
|
-
const bins = binArray.account
|
|
9911
|
+
const { bins } = binArray.account;
|
|
9922
9912
|
if (bins.every(({ amountX }) => amountX.isZero())) {
|
|
9923
9913
|
count--;
|
|
9924
9914
|
} else {
|
|
@@ -9930,7 +9920,6 @@ var DLMM = class {
|
|
|
9930
9920
|
}
|
|
9931
9921
|
}
|
|
9932
9922
|
}
|
|
9933
|
-
console.log(binPriceWithLastLiquidity);
|
|
9934
9923
|
return this.fromPricePerLamport(
|
|
9935
9924
|
Number(binPriceWithLastLiquidity) / (2 ** 64 - 1)
|
|
9936
9925
|
);
|
|
@@ -10531,7 +10520,7 @@ var DLMMError = class extends Error {
|
|
|
10531
10520
|
const anchorError = _anchor.AnchorError.parse(
|
|
10532
10521
|
JSON.parse(JSON.stringify(error)).logs
|
|
10533
10522
|
);
|
|
10534
|
-
if (_optionalChain([anchorError, 'optionalAccess',
|
|
10523
|
+
if (_optionalChain([anchorError, 'optionalAccess', _67 => _67.program, 'access', _68 => _68.toBase58, 'call', _69 => _69()]) === LBCLMM_PROGRAM_IDS["mainnet-beta"]) {
|
|
10535
10524
|
_errorCode = anchorError.error.errorCode.number;
|
|
10536
10525
|
_errorName = anchorError.error.errorCode.code;
|
|
10537
10526
|
_errorMessage = anchorError.error.errorMessage;
|