Removed tooling added

This commit is contained in:
0xCipherCoder
2025-01-10 19:15:37 +05:30
193 changed files with 1475 additions and 722 deletions

View File

@@ -0,0 +1,29 @@
import { PublicKey } from "@solana/web3.js";
import { BaseSolanaTool } from "../common/base";
import { OrcaPositionInput, LiquidityResponse } from "./types";
export class SolanaOrcaClosePosition extends BaseSolanaTool {
name = "orca_close_position";
description = `Closes an existing liquidity position in an Orca Whirlpool. This function fetches the position
details using the provided mint address and closes the position with a 1% slippage.
Inputs (JSON string):
- positionMintAddress: string, the address of the position mint that represents the liquidity position.`;
async _call(input: string): Promise<string> {
try {
const params: OrcaPositionInput = JSON.parse(input);
const txId = await this.solanaKit.orcaClosePosition(
new PublicKey(params.positionMintAddress),
);
return JSON.stringify({
status: "success",
message: "Liquidity position closed successfully.",
transaction: txId,
} as LiquidityResponse);
} catch (error: any) {
return this.handleError(error);
}
}
}