@meteora-ag/dlmm 1.0.7-abc1234.0 → 1.0.7
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 +15 -15
- package/dist/index.js +28 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4896,21 +4896,21 @@ declare class DLMM {
|
|
|
4896
4896
|
position: LbPosition;
|
|
4897
4897
|
}): Promise<Transaction>;
|
|
4898
4898
|
/**
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4899
|
+
* The `swapQuoteWithCap` function returns a quote for a swap in permission pool
|
|
4900
|
+
* @param
|
|
4901
|
+
* - `inAmount`: Amount of lamport to swap in
|
|
4902
|
+
* - `swapForY`: Swap token X to Y when it is true, else reversed.
|
|
4903
|
+
* - `allowedSlipage`: Allowed slippage for the swap. Expressed in BPS. To convert from slippage percentage to BPS unit: SLIPPAGE_PERCENTAGE * 100
|
|
4904
|
+
* - `maxSwappedAmount`: Max swapped amount
|
|
4905
|
+
* @returns {SwapQuote}
|
|
4906
|
+
* - `consumedInAmount`: Amount of lamport to swap in
|
|
4907
|
+
* - `outAmount`: Amount of lamport to swap out
|
|
4908
|
+
* - `fee`: Fee amount
|
|
4909
|
+
* - `protocolFee`: Protocol fee amount
|
|
4910
|
+
* - `minOutAmount`: Minimum amount of lamport to swap out
|
|
4911
|
+
* - `priceImpact`: Price impact of the swap
|
|
4912
|
+
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
4913
|
+
*/
|
|
4914
4914
|
swapQuoteWithCap(inAmount: BN, swapForY: boolean, allowedSlippage: BN, maxSwappedAmount: BN, binArrays: BinArrayAccount[]): SwapQuote;
|
|
4915
4915
|
/**
|
|
4916
4916
|
* The `swapQuote` function returns a quote for a swap
|
package/dist/index.js
CHANGED
|
@@ -5684,7 +5684,12 @@ var DLMM = class {
|
|
|
5684
5684
|
}
|
|
5685
5685
|
const reserveAccountsInfo = await chunkedGetMultipleAccountInfos(
|
|
5686
5686
|
program.provider.connection,
|
|
5687
|
-
[
|
|
5687
|
+
[
|
|
5688
|
+
lbPairAccInfo.reserveX,
|
|
5689
|
+
lbPairAccInfo.reserveY,
|
|
5690
|
+
lbPairAccInfo.tokenXMint,
|
|
5691
|
+
lbPairAccInfo.tokenYMint
|
|
5692
|
+
]
|
|
5688
5693
|
);
|
|
5689
5694
|
let binArrayBitmapExtension;
|
|
5690
5695
|
if (binArrayBitMapExtensionAccInfo) {
|
|
@@ -5695,10 +5700,12 @@ var DLMM = class {
|
|
|
5695
5700
|
}
|
|
5696
5701
|
const reserveXBalance = _spltoken.AccountLayout.decode(reserveAccountsInfo[0].data);
|
|
5697
5702
|
const reserveYBalance = _spltoken.AccountLayout.decode(reserveAccountsInfo[1].data);
|
|
5698
|
-
const
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5703
|
+
const tokenXDecimal = _spltoken.MintLayout.decode(
|
|
5704
|
+
reserveAccountsInfo[2].data
|
|
5705
|
+
).decimals;
|
|
5706
|
+
const tokenYDecimal = _spltoken.MintLayout.decode(
|
|
5707
|
+
reserveAccountsInfo[3].data
|
|
5708
|
+
).decimals;
|
|
5702
5709
|
const tokenX = {
|
|
5703
5710
|
publicKey: lbPairAccInfo.tokenXMint,
|
|
5704
5711
|
reserve: lbPairAccInfo.reserveX,
|
|
@@ -5774,12 +5781,7 @@ var DLMM = class {
|
|
|
5774
5781
|
);
|
|
5775
5782
|
}
|
|
5776
5783
|
}
|
|
5777
|
-
const reservePublicKeys = Array.from(lbPairArraysMap.values()).map(({ reserveX, reserveY
|
|
5778
|
-
reserveX,
|
|
5779
|
-
reserveY,
|
|
5780
|
-
tokenXMint,
|
|
5781
|
-
tokenYMint
|
|
5782
|
-
]).flat();
|
|
5784
|
+
const reservePublicKeys = Array.from(lbPairArraysMap.values()).map(({ reserveX, reserveY }) => [reserveX, reserveY]).flat();
|
|
5783
5785
|
const tokenMintPublicKeys = Array.from(lbPairArraysMap.values()).map(({ tokenXMint, tokenYMint }) => [tokenXMint, tokenYMint]).flat();
|
|
5784
5786
|
const reserveAndTokenMintAccountsInfo = await chunkedGetMultipleAccountInfos(program.provider.connection, [
|
|
5785
5787
|
...reservePublicKeys,
|
|
@@ -7392,21 +7394,21 @@ var DLMM = class {
|
|
|
7392
7394
|
}).add(closePositionTx);
|
|
7393
7395
|
}
|
|
7394
7396
|
/**
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7397
|
+
* The `swapQuoteWithCap` function returns a quote for a swap in permission pool
|
|
7398
|
+
* @param
|
|
7399
|
+
* - `inAmount`: Amount of lamport to swap in
|
|
7400
|
+
* - `swapForY`: Swap token X to Y when it is true, else reversed.
|
|
7401
|
+
* - `allowedSlipage`: Allowed slippage for the swap. Expressed in BPS. To convert from slippage percentage to BPS unit: SLIPPAGE_PERCENTAGE * 100
|
|
7402
|
+
* - `maxSwappedAmount`: Max swapped amount
|
|
7403
|
+
* @returns {SwapQuote}
|
|
7404
|
+
* - `consumedInAmount`: Amount of lamport to swap in
|
|
7405
|
+
* - `outAmount`: Amount of lamport to swap out
|
|
7406
|
+
* - `fee`: Fee amount
|
|
7407
|
+
* - `protocolFee`: Protocol fee amount
|
|
7408
|
+
* - `minOutAmount`: Minimum amount of lamport to swap out
|
|
7409
|
+
* - `priceImpact`: Price impact of the swap
|
|
7410
|
+
* - `binArraysPubkey`: Array of bin arrays involved in the swap
|
|
7411
|
+
*/
|
|
7410
7412
|
swapQuoteWithCap(inAmount, swapForY, allowedSlippage, maxSwappedAmount, binArrays) {
|
|
7411
7413
|
const currentTimestamp = Date.now() / 1e3;
|
|
7412
7414
|
let inAmountLeft = inAmount;
|