import { IdentifiableLiquidityPool } from '@saturnbtcio/pool-serde-sdk'; import { MempoolInfoMap } from '../../providers/bitcoin.provider'; import { UtxoMetaData } from '@saturnbtcio/arch-sdk'; import { BitcoinData, BitcoinMessageRequest } from '../pool.dto'; export interface DecreaseLiquidityRequest { /** * The pubkey of the pool. */ poolId: string; /** * The pubkey of the position. */ positionPubKey: string; /** * The amount of liquidity to withdraw. */ liquidityAmount: bigint; /** * The minimum amount of the first token to withdraw. */ minToken0: bigint; /** * The minimum amount of the second token to withdraw. */ minToken1: bigint; /** * The address to withdraw the first token to. */ withdrawAddressToken0: string; /** * The address to withdraw the second token to. */ withdrawAddressToken1: string; /** * The fee rate for the transaction (in sats per byte). */ feeRate: bigint; } export interface FindUtxoForDecreaseLiquidityRequest extends DecreaseLiquidityRequest { /** * User public key compatible with arch network. */ publicKey: string; } export type DecreaseLiquidityPsbtRequest = DecreaseLiquidityRequest & BitcoinData; /** * Payment method for decrease liquidity operations */ export type DecreaseLiquidityPaymentMethod = | { type: 'fee_utxo'; feeUtxo: UtxoMetaData } | { type: 'signed_psbt'; signedPsbt: string } | { type: 'none' }; export type DecreaseLiquidityMessageRequest = DecreaseLiquidityRequest & BitcoinMessageRequest & { /** * The payment method for transaction fees */ paymentMethod: DecreaseLiquidityPaymentMethod; }; export interface PoolAndPositionState { pool: IdentifiableLiquidityPool; token0Amount: bigint; token1Amount: bigint; currentBlockHeight: number; shardMempoolInfoMap: MempoolInfoMap; } export interface CanPoolCoverFeesResponse { /** * Whether the pool can cover the fees. */ canPoolCoverFees: boolean; /** * The total amount of fees that need to be paid. */ feesAmount: bigint; /** * The amount of fees that the pool can cover. */ poolCoveringFeesAmount: bigint; }