mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-06-04 07:36:45 +00:00
Fix formatting issues and removing unusued libaries
This commit is contained in:
@@ -11,7 +11,7 @@ const mintNFTAction: Action = {
|
||||
"create nft",
|
||||
"mint token",
|
||||
"create token",
|
||||
"add nft to collection"
|
||||
"add nft to collection",
|
||||
],
|
||||
description: `Mint a new NFT in a collection on Solana blockchain.`,
|
||||
examples: [
|
||||
@@ -20,7 +20,7 @@ const mintNFTAction: Action = {
|
||||
input: {
|
||||
collectionMint: "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
|
||||
name: "My NFT",
|
||||
uri: "https://example.com/nft.json"
|
||||
uri: "https://example.com/nft.json",
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
@@ -28,12 +28,12 @@ const mintNFTAction: Action = {
|
||||
mintAddress: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
metadata: {
|
||||
name: "My NFT",
|
||||
uri: "https://example.com/nft.json"
|
||||
uri: "https://example.com/nft.json",
|
||||
},
|
||||
recipient: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN"
|
||||
recipient: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
|
||||
},
|
||||
explanation: "Mint an NFT to the default wallet"
|
||||
}
|
||||
explanation: "Mint an NFT to the default wallet",
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
@@ -41,7 +41,7 @@ const mintNFTAction: Action = {
|
||||
collectionMint: "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
|
||||
name: "Gift NFT",
|
||||
uri: "https://example.com/gift.json",
|
||||
recipient: "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u"
|
||||
recipient: "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u",
|
||||
},
|
||||
output: {
|
||||
status: "success",
|
||||
@@ -49,19 +49,19 @@ const mintNFTAction: Action = {
|
||||
mintAddress: "8nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkM",
|
||||
metadata: {
|
||||
name: "Gift NFT",
|
||||
uri: "https://example.com/gift.json"
|
||||
uri: "https://example.com/gift.json",
|
||||
},
|
||||
recipient: "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u"
|
||||
recipient: "9aUn5swQzUTRanaaTwmszxiv89cvFwUCjEBv1vZCoT1u",
|
||||
},
|
||||
explanation: "Mint an NFT to a specific recipient"
|
||||
}
|
||||
]
|
||||
explanation: "Mint an NFT to a specific recipient",
|
||||
},
|
||||
],
|
||||
],
|
||||
schema: z.object({
|
||||
collectionMint: z.string().min(32, "Invalid collection mint address"),
|
||||
name: z.string().min(1, "Name is required"),
|
||||
uri: z.string().url("URI must be a valid URL"),
|
||||
recipient: z.string().min(32, "Invalid recipient address")
|
||||
recipient: z.string().min(32, "Invalid recipient address"),
|
||||
}),
|
||||
handler: async (agent: SolanaAgentKit, input: Record<string, any>) => {
|
||||
const result = await mintCollectionNFT(
|
||||
@@ -69,9 +69,9 @@ const mintNFTAction: Action = {
|
||||
new PublicKey(input.collectionMint),
|
||||
{
|
||||
name: input.name,
|
||||
uri: input.uri
|
||||
uri: input.uri,
|
||||
},
|
||||
input.recipient ? new PublicKey(input.recipient) : undefined
|
||||
input.recipient ? new PublicKey(input.recipient) : undefined,
|
||||
);
|
||||
|
||||
return {
|
||||
@@ -80,11 +80,11 @@ const mintNFTAction: Action = {
|
||||
mintAddress: result.mint.toString(),
|
||||
metadata: {
|
||||
name: input.name,
|
||||
uri: input.uri
|
||||
uri: input.uri,
|
||||
},
|
||||
recipient: input.recipient || result.mint.toString()
|
||||
recipient: input.recipient || result.mint.toString(),
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default mintNFTAction;
|
||||
export default mintNFTAction;
|
||||
|
||||
Reference in New Issue
Block a user