@cetusprotocol/dlmm-sdk 0.2.0 → 1.0.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/dist/index.d.mts CHANGED
@@ -159,6 +159,8 @@ type BaseAddLiquidityOption = {
159
159
  * - false: Pass strategy_type to contract for automatic liquidity distribution calculation
160
160
  */
161
161
  use_bin_infos?: boolean;
162
+ coin_object_id_a?: TransactionObjectArgument;
163
+ coin_object_id_b?: TransactionObjectArgument;
162
164
  } & CoinPairType;
163
165
  type BaseCalculateAddLiquidityOption = {
164
166
  pool_id?: string;
@@ -536,6 +538,16 @@ declare class PositionModule implements IModule<CetusDlmmSDK> {
536
538
  * @returns The transaction object
537
539
  */
538
540
  closePositionPayload(option: ClosePositionOption, tx?: Transaction): Transaction;
541
+ /**
542
+ * Close a position without transferring the coins to the sender
543
+ * @param option - The option for closing a position
544
+ * @param tx
545
+ * @returns The transaction object
546
+ */
547
+ closePositionNoTransferPayload(option: ClosePositionOption, tx: Transaction): {
548
+ coin_a_obj: TransactionObjectArgument;
549
+ coin_b_obj: TransactionObjectArgument;
550
+ };
539
551
  /**
540
552
  * Get the amounts in the active bin if in range
541
553
  * @param bin_manager_handle - The bin manager handle
@@ -563,6 +575,10 @@ declare class PositionModule implements IModule<CetusDlmmSDK> {
563
575
  * @returns The transaction
564
576
  */
565
577
  removeLiquidityPayload(option: RemoveLiquidityOption): Transaction;
578
+ removeLiquidityNoTransferPayload(option: RemoveLiquidityOption, tx: Transaction): {
579
+ coin_a_obj: TransactionObjectArgument;
580
+ coin_b_obj: TransactionObjectArgument;
581
+ };
566
582
  /**
567
583
  * Add liquidity with price
568
584
  * @param option - The option for adding liquidity with price
@@ -786,10 +802,7 @@ declare class BinUtils {
786
802
  * @param rate - The rate to be applied
787
803
  * @returns The processed bins
788
804
  */
789
- static processBinsByRate(bins: BinAmount[], rate: string): {
790
- bins: BinLiquidityInfo;
791
- has_invalid_amount: boolean;
792
- };
805
+ static processBinsByRate(bins: BinAmount[], rate: string): BinLiquidityInfo;
793
806
  /**
794
807
  * Calculate the amount of token A and token B to be removed from a bin
795
808
  * @param bin - The bin information
package/dist/index.d.ts CHANGED
@@ -159,6 +159,8 @@ type BaseAddLiquidityOption = {
159
159
  * - false: Pass strategy_type to contract for automatic liquidity distribution calculation
160
160
  */
161
161
  use_bin_infos?: boolean;
162
+ coin_object_id_a?: TransactionObjectArgument;
163
+ coin_object_id_b?: TransactionObjectArgument;
162
164
  } & CoinPairType;
163
165
  type BaseCalculateAddLiquidityOption = {
164
166
  pool_id?: string;
@@ -536,6 +538,16 @@ declare class PositionModule implements IModule<CetusDlmmSDK> {
536
538
  * @returns The transaction object
537
539
  */
538
540
  closePositionPayload(option: ClosePositionOption, tx?: Transaction): Transaction;
541
+ /**
542
+ * Close a position without transferring the coins to the sender
543
+ * @param option - The option for closing a position
544
+ * @param tx
545
+ * @returns The transaction object
546
+ */
547
+ closePositionNoTransferPayload(option: ClosePositionOption, tx: Transaction): {
548
+ coin_a_obj: TransactionObjectArgument;
549
+ coin_b_obj: TransactionObjectArgument;
550
+ };
539
551
  /**
540
552
  * Get the amounts in the active bin if in range
541
553
  * @param bin_manager_handle - The bin manager handle
@@ -563,6 +575,10 @@ declare class PositionModule implements IModule<CetusDlmmSDK> {
563
575
  * @returns The transaction
564
576
  */
565
577
  removeLiquidityPayload(option: RemoveLiquidityOption): Transaction;
578
+ removeLiquidityNoTransferPayload(option: RemoveLiquidityOption, tx: Transaction): {
579
+ coin_a_obj: TransactionObjectArgument;
580
+ coin_b_obj: TransactionObjectArgument;
581
+ };
566
582
  /**
567
583
  * Add liquidity with price
568
584
  * @param option - The option for adding liquidity with price
@@ -786,10 +802,7 @@ declare class BinUtils {
786
802
  * @param rate - The rate to be applied
787
803
  * @returns The processed bins
788
804
  */
789
- static processBinsByRate(bins: BinAmount[], rate: string): {
790
- bins: BinLiquidityInfo;
791
- has_invalid_amount: boolean;
792
- };
805
+ static processBinsByRate(bins: BinAmount[], rate: string): BinLiquidityInfo;
793
806
  /**
794
807
  * Calculate the amount of token A and token B to be removed from a bin
795
808
  * @param bin - The bin information