@meteora-ag/dlmm 1.0.36-rc.1 → 1.0.37-rc.0
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/README.md +29 -32
- package/dist/index.d.ts +2883 -2855
- package/dist/index.js +3500 -3078
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3470 -3048
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -204,35 +204,32 @@ try {
|
|
|
204
204
|
|
|
205
205
|
## DLMM instance functions
|
|
206
206
|
|
|
207
|
-
| Function | Description | Return
|
|
208
|
-
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
209
|
-
| `refetchStates` | Update onchain state of DLMM instance. It's recommend to call this before interact with the program (Deposit/ Withdraw/ Swap) | `Promise<void>`
|
|
210
|
-
| `getBinArrays` | Retrieves List of Bin Arrays | `Promise<BinArrayAccount[]>`
|
|
211
|
-
| `getBinArrayForSwap` | Retrieves List of Bin Arrays for swap purpose | `Promise<BinArrayAccount[]>`
|
|
212
|
-
| `getFeeInfo` | Retrieves LbPair's fee info including `base fee`, `protocol fee` & `max fee` | `FeeInfo`
|
|
213
|
-
| `getDynamicFee` | Retrieves LbPair's dynamic fee | `Decimal`
|
|
214
|
-
| `getBinsAroundActiveBin` | retrieves a specified number of bins to the left and right of the active bin and returns them along with the active bin ID. | `Promise<{ activeBin: number; bins: BinLiquidity[] }>`
|
|
215
|
-
| `getBinsBetweenMinAndMaxPrice` | Retrieves a list of bins within a specified price | `Promise<{ activeBin: number; bins: BinLiquidity[] }>`
|
|
216
|
-
| `getBinsBetweenLowerAndUpperBound` | retrieves a list of bins between a lower and upper bin ID and returns the active bin ID and the list of bins. | `Promise<{ activeBin: number; bins: BinLiquidity[] }>`
|
|
217
|
-
| `toPricePerLamport` | Converts a real price of bin to lamport price | `string`
|
|
218
|
-
| `fromPricePerLamport` | converts a price per lamport value to a real price of bin | `string`
|
|
219
|
-
| `getActiveBin` | Retrieves the active bin ID and its corresponding price | `Promise<{ binId: number; price: string }>`
|
|
220
|
-
| `getPriceOfBinByBinId` | Get the price of a bin based on its bin ID | `string`
|
|
221
|
-
| `getBinIdFromPrice` | get bin ID based on a given price and a boolean flag indicating whether to round down or up. | `number`
|
|
222
|
-
| `getPositionsByUserAndLbPair` | Retrieves positions by user and LB pair, including active bin and user positions. | `Promise<{ activeBin: { binId: any; price: string; }; userPositions: Array<Position>;}>`
|
|
223
|
-
| `initializePositionAndAddLiquidityByStrategy` | Initializes a position and adds liquidity | `Promise<Transaction\|Transaction[]>`
|
|
224
|
-
| `addLiquidityByStrategy` | Add liquidity to existing position | `Promise<Transaction\|Transaction[]>`
|
|
225
|
-
| `removeLiquidity` | function is used to remove liquidity from a position, with the option to claim rewards and close the position. | `Promise<Transaction\|Transaction[]>`
|
|
226
|
-
| `closePosition` | Closes a position | `Promise<Transaction\|Transaction[]>`
|
|
227
|
-
| `swapQuote` | Quote for a swap | `SwapQuote`
|
|
228
|
-
| `swap` | Swap token within the LbPair | `Promise<Transaction>`
|
|
229
|
-
| `claimLMReward` | Claim rewards for a specific position owned by a specific owner | `Promise<Transaction>`
|
|
230
|
-
| `claimAllLMRewards` | Claim all liquidity mining rewards for a given owner and their positions. | `Promise<Transaction[]>`
|
|
231
|
-
| `claimSwapFee` | Claim swap fees for a specific position owned by a specific owner | `Promise<Transaction>`
|
|
232
|
-
| `claimAllSwapFee` | Claim swap fees for multiple positions owned by a specific owner | `Promise<Transaction>`
|
|
233
|
-
| `claimAllRewards` | Claim swap fees and LM rewards for multiple positions owned by a specific owner | `Promise<Transaction[]>`
|
|
234
|
-
| `syncWithMarketPrice` | Sync the pool current active bin to match nearest market price bin | `Promise<Transaction>`
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
```
|
|
207
|
+
| Function | Description | Return |
|
|
208
|
+
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
209
|
+
| `refetchStates` | Update onchain state of DLMM instance. It's recommend to call this before interact with the program (Deposit/ Withdraw/ Swap) | `Promise<void>` |
|
|
210
|
+
| `getBinArrays` | Retrieves List of Bin Arrays | `Promise<BinArrayAccount[]>` |
|
|
211
|
+
| `getBinArrayForSwap` | Retrieves List of Bin Arrays for swap purpose | `Promise<BinArrayAccount[]>` |
|
|
212
|
+
| `getFeeInfo` | Retrieves LbPair's fee info including `base fee`, `protocol fee` & `max fee` | `FeeInfo` |
|
|
213
|
+
| `getDynamicFee` | Retrieves LbPair's dynamic fee | `Decimal` |
|
|
214
|
+
| `getBinsAroundActiveBin` | retrieves a specified number of bins to the left and right of the active bin and returns them along with the active bin ID. | `Promise<{ activeBin: number; bins: BinLiquidity[] }>` |
|
|
215
|
+
| `getBinsBetweenMinAndMaxPrice` | Retrieves a list of bins within a specified price | `Promise<{ activeBin: number; bins: BinLiquidity[] }>` |
|
|
216
|
+
| `getBinsBetweenLowerAndUpperBound` | retrieves a list of bins between a lower and upper bin ID and returns the active bin ID and the list of bins. | `Promise<{ activeBin: number; bins: BinLiquidity[] }>` |
|
|
217
|
+
| `toPricePerLamport` | Converts a real price of bin to lamport price | `string` |
|
|
218
|
+
| `fromPricePerLamport` | converts a price per lamport value to a real price of bin | `string` |
|
|
219
|
+
| `getActiveBin` | Retrieves the active bin ID and its corresponding price | `Promise<{ binId: number; price: string }>` |
|
|
220
|
+
| `getPriceOfBinByBinId` | Get the price of a bin based on its bin ID | `string` |
|
|
221
|
+
| `getBinIdFromPrice` | get bin ID based on a given price and a boolean flag indicating whether to round down or up. | `number` |
|
|
222
|
+
| `getPositionsByUserAndLbPair` | Retrieves positions by user and LB pair, including active bin and user positions. | `Promise<{ activeBin: { binId: any; price: string; }; userPositions: Array<Position>;}>` |
|
|
223
|
+
| `initializePositionAndAddLiquidityByStrategy` | Initializes a position and adds liquidity | `Promise<Transaction\|Transaction[]>` |
|
|
224
|
+
| `addLiquidityByStrategy` | Add liquidity to existing position | `Promise<Transaction\|Transaction[]>` |
|
|
225
|
+
| `removeLiquidity` | function is used to remove liquidity from a position, with the option to claim rewards and close the position. | `Promise<Transaction\|Transaction[]>` |
|
|
226
|
+
| `closePosition` | Closes a position | `Promise<Transaction\|Transaction[]>` |
|
|
227
|
+
| `swapQuote` | Quote for a swap | `SwapQuote` |
|
|
228
|
+
| `swap` | Swap token within the LbPair | `Promise<Transaction>` |
|
|
229
|
+
| `claimLMReward` | Claim rewards for a specific position owned by a specific owner | `Promise<Transaction>` |
|
|
230
|
+
| `claimAllLMRewards` | Claim all liquidity mining rewards for a given owner and their positions. | `Promise<Transaction[]>` |
|
|
231
|
+
| `claimSwapFee` | Claim swap fees for a specific position owned by a specific owner | `Promise<Transaction>` |
|
|
232
|
+
| `claimAllSwapFee` | Claim swap fees for multiple positions owned by a specific owner | `Promise<Transaction>` |
|
|
233
|
+
| `claimAllRewards` | Claim swap fees and LM rewards for multiple positions owned by a specific owner | `Promise<Transaction[]>` |
|
|
234
|
+
| `syncWithMarketPrice` | Sync the pool current active bin to match nearest market price bin | `Promise<Transaction>` |
|
|
235
|
+
| `getPairPubkeyIfExists` | Get existing pool address given parameter, if not return null | `Promise<PublicKey \| null>` |
|