remove unnecessary imports, rename to send_compressed_airdrop

This commit is contained in:
Swenschaeferjohann
2024-12-20 06:17:42 +00:00
parent c13ab12aee
commit 2bac6399fc
5 changed files with 9 additions and 783 deletions

View File

@@ -702,15 +702,15 @@ export class SolanaTokenDataByTickerTool extends Tool {
}
}
export class SolanaAirdropCompressedTokensTool extends Tool {
name = "solana_airdrop_compressed_tokens";
description = `Airdrop tokens with zk compression
export class SolanaCompressedAirdropTool extends Tool {
name = "solana_compressed_airdrop";
description = `Airdrop SPL tokens with ZK Compression
Inputs:
- mintAddress: string, the mint address of the token, e.g., "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
- amount: number, the amount of tokens to airdrop per recipient, e.g., 42
- recipients: string[], the recipient addresses, e.g., ["JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN", "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"]
- priorityFeeInLamports: number, the priority fee in lamports, e.g., 10_000. Default is 30_000.
- recipients: string[], the recipient addresses, e.g., ["1nc1nerator11111111111111111111111111111111", "1nc1nerator11111111111111111111111111111111"]
- priorityFeeInLamports: number, the priority fee in lamports. Default is 30_000.
`;
constructor(private solanaKit: SolanaAgentKit) {
@@ -765,6 +765,6 @@ export function createSolanaTools(solanaKit: SolanaAgentKit) {
new SolanaGetDomainTool(solanaKit),
new SolanaTokenDataTool(solanaKit),
new SolanaTokenDataByTickerTool(solanaKit),
new SolanaAirdropCompressedTokensTool(solanaKit),
new SolanaCompressedAirdropTool(solanaKit),
];
}

View File

@@ -14,4 +14,4 @@ export * from "./get_tps";
export * from "./get_token_data";
export * from "./stake_with_jup";
export * from "./fetch_price";
export * from "./airdrop_compressed_tokens";
export * from "./send_compressed_airdrop";

View File

@@ -6,7 +6,7 @@ import {
PublicKey,
TransactionInstruction,
} from "@solana/web3.js";
import { SolanaAgentKit } from "../../agent/index.js";
import { SolanaAgentKit } from "../agent/index.js";
import {
buildAndSignTx,
calculateComputeUnitPrice,
@@ -81,6 +81,7 @@ export async function sendCompressedAirdrop(
shouldLog
);
}
async function processAll(
agent: SolanaAgentKit,
amount: number,