import api, { IConnection } from "codemelt-retro-api-sdk"
import { ChangeLiquidityDTO } from 'codemelt-retro-api-sdk/structures/ChangeLiquidityDTO'
const connection: IConnection = {
host: '<enter your host url here>',
headers: {
'x-api-key': '<enter your api key here>'
}
}
const networkName = 'Zeta Mainnet'
const input: ChangeLiquidityDTO = {
tickLower: Number(position.tickRange.lower),
tickUpper: Number(position.tickRange.upper),
networkName: networkName,
tokenId: Number(position.tokenId),
amountA: Number(firstTokenAmount),
amountB: Number(secondTokenAmount),
tokenAId: tokenA.id,
tokenBId: tokenB.id,
liquidity: position.liquidity,
recipient: signer.address,
// Percentage of liquidity to remove (0-100)
//Percentage 100 will also burn the position
liquidityPercent: 50
}
const resp = await api.functional.api.algebra.interactions.decrease.decreaseLiquidity(
connection,
input
)