fix: latest pull

This commit is contained in:
simplysabir
2025-01-01 17:17:24 +05:30
parent 42b64f2264
commit 376eaadffe
8 changed files with 184 additions and 36 deletions

View File

@@ -1825,6 +1825,67 @@ export class SolanaCancelNFTListingTool extends Tool {
}
}
export class SolanaFetchTokenReportSummaryTool extends Tool {
name = "solana_fetch_token_report_summary";
description = `Fetches a summary report for a specific token from RugCheck.
Inputs:
- mint: string, the mint address of the token, e.g., "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN" (required).`;
constructor(private solanaKit: SolanaAgentKit) {
super();
}
protected async _call(input: string): Promise<string> {
try {
const mint = input.trim();
const report = await this.solanaKit.fetchTokenReportSummary(mint);
return JSON.stringify({
status: "success",
message: "Token report summary fetched successfully",
report,
});
} catch (error: any) {
return JSON.stringify({
status: "error",
message: error.message,
code: error.code || "FETCH_TOKEN_REPORT_SUMMARY_ERROR",
});
}
}
}
export class SolanaFetchTokenDetailedReportTool extends Tool {
name = "solana_fetch_token_detailed_report";
description = `Fetches a detailed report for a specific token from RugCheck.
Inputs:
- mint: string, the mint address of the token, e.g., "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN" (required).`;
constructor(private solanaKit: SolanaAgentKit) {
super();
}
protected async _call(input: string): Promise<string> {
try {
const mint = input.trim();
const detailedReport =
await this.solanaKit.fetchTokenDetailedReport(mint);
return JSON.stringify({
status: "success",
message: "Detailed token report fetched successfully",
report: detailedReport,
});
} catch (error: any) {
return JSON.stringify({
status: "error",
message: error.message,
code: error.code || "FETCH_TOKEN_DETAILED_REPORT_ERROR",
});
}
}
}
export function createSolanaTools(solanaKit: SolanaAgentKit) {
return [
new SolanaBalanceTool(solanaKit),
@@ -1873,5 +1934,7 @@ export function createSolanaTools(solanaKit: SolanaAgentKit) {
new SolanaTipLinkTool(solanaKit),
new SolanaListNFTForSaleTool(solanaKit),
new SolanaCancelNFTListingTool(solanaKit),
new SolanaFetchTokenReportSummaryTool(solanaKit),
new SolanaFetchTokenDetailedReportTool(solanaKit),
];
}