mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-22 07:36:44 +00:00
Fix formatting issues and removing unusued libaries
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { Action, ActionExample } from "../types/action";
|
||||
import { Action } from "../types/action";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { z } from "zod";
|
||||
import { deploy_token } from "../tools";
|
||||
@@ -13,7 +12,8 @@ const deployTokenAction: Action = {
|
||||
"create new token",
|
||||
"mint token",
|
||||
],
|
||||
description: "Deploy a new SPL token on the Solana blockchain with specified parameters",
|
||||
description:
|
||||
"Deploy a new SPL token on the Solana blockchain with specified parameters",
|
||||
examples: [
|
||||
[
|
||||
{
|
||||
@@ -22,38 +22,38 @@ const deployTokenAction: Action = {
|
||||
uri: "https://example.com/token.json",
|
||||
symbol: "MTK",
|
||||
decimals: 9,
|
||||
initialSupply: 1000000
|
||||
initialSupply: 1000000,
|
||||
},
|
||||
output: {
|
||||
mint: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
status: "success",
|
||||
message: "Token deployed successfully"
|
||||
message: "Token deployed successfully",
|
||||
},
|
||||
explanation: "Deploy a token with initial supply and metadata"
|
||||
}
|
||||
explanation: "Deploy a token with initial supply and metadata",
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: {
|
||||
name: "Basic Token",
|
||||
uri: "https://example.com/basic.json",
|
||||
symbol: "BASIC"
|
||||
symbol: "BASIC",
|
||||
},
|
||||
output: {
|
||||
mint: "8nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkM",
|
||||
status: "success",
|
||||
message: "Token deployed successfully"
|
||||
message: "Token deployed successfully",
|
||||
},
|
||||
explanation: "Deploy a basic token with minimal parameters"
|
||||
}
|
||||
]
|
||||
explanation: "Deploy a basic token with minimal parameters",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
uri: z.string().url("URI must be a valid URL"),
|
||||
symbol: z.string().min(1, "Symbol is required"),
|
||||
decimals: z.number().optional(),
|
||||
initialSupply: z.number().optional()
|
||||
initialSupply: z.number().optional(),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
try {
|
||||
@@ -63,21 +63,21 @@ const deployTokenAction: Action = {
|
||||
input.uri,
|
||||
input.symbol,
|
||||
input.decimals,
|
||||
input.initialSupply
|
||||
input.initialSupply,
|
||||
);
|
||||
|
||||
return {
|
||||
mint: result.mint.toString(),
|
||||
status: "success",
|
||||
message: "Token deployed successfully"
|
||||
message: "Token deployed successfully",
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
status: "error",
|
||||
message: `Token deployment failed: ${error.message}`
|
||||
message: `Token deployment failed: ${error.message}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default deployTokenAction;
|
||||
export default deployTokenAction;
|
||||
|
||||
Reference in New Issue
Block a user