Deploy a new NFT collection on Solana with customizable parameters including name, metadata URI, and royalties.
Usage
const collection = await agent.deployCollection({
name: "My Collection",
uri: "https://arweave.net/collection.json",
royaltyBasisPoints: 500 // 5% royalty
});
console.log("Collection Address:", collection.collectionAddress.toString());
Parameters
Parameter | Type | Required | Description |
---|
name | string | Yes | Name of the collection |
uri | string | Yes | Metadata URI for the collection |
royaltyBasisPoints | number | No | Royalty percentage in basis points (100 = 1%) |
Example Prompts
Natural Language Prompts
"Create a new NFT collection called 'Awesome Art' with 5% royalties"
"Deploy an NFT collection with metadata from my Arweave URI"
"Launch a collection named 'Pixel Warriors' with 7.5% creator royalties"
"Create a free collection with no royalties for my community"
// Basic collection deployment
{
"name": "Awesome Art",
"uri": "https://arweave.net/collection.json"
}
// Collection with royalties
{
"name": "Pixel Warriors",
"uri": "https://arweave.net/metadata.json",
"royaltyBasisPoints": 750
}
// Community collection without royalties
{
"name": "Community Collection",
"uri": "https://arweave.net/community.json",
"royaltyBasisPoints": 0
}
Example Implementation
import { SolanaAgentKit } from "solana-agent-kit";
async function deployArtCollection(agent: SolanaAgentKit) {
try {
const collection = await agent.deployCollection({
name: "Digital Art Collection",
uri: "https://arweave.net/art-collection.json",
royaltyBasisPoints: 500 // 5% royalty
});
console.log("Collection deployed:", {
address: collection.collectionAddress.toString(),
name: "Digital Art Collection"
});
return collection;
} catch (error) {
console.error("Collection deployment failed:", error);
throw error;
}
}
Your collection URI should point to a JSON file with this structure:
{
"name": "My Collection",
"symbol": "MYCOL",
"description": "A unique collection of digital art",
"image": "https://arweave.net/collection-image.png",
"external_url": "https://example.com",
"properties": {
"files": [
{
"uri": "https://arweave.net/collection-image.png",
"type": "image/png"
}
]
}
}
Implementation Details
- Creates verified collection with Metaplex standards
- Supports custom royalty configurations
- Automatically handles token program initialization
- Supports collection-wide metadata
- Uses Metaplex’s certified collection standard
Error Handling
try {
const collection = await agent.deployCollection(options);
} catch (error) {
if (error.message.includes("invalid uri")) {
// Handle metadata issues
} else if (error.message.includes("insufficient funds")) {
// Handle balance issues
}
}
Best Practices
-
Metadata Preparation
- Host metadata on permanent storage (e.g., Arweave)
- Include high-quality collection image
- Provide comprehensive description
- Include all required properties
-
Royalty Configuration
- Consider market standards
- Plan distribution model
- Document royalty splits
- Verify basis points calculation
-
Collection Management
- Save collection address securely
- Document deployment details
- Plan update strategy
- Consider governance
-
Technical Considerations
- Verify metadata before deployment
- Test with small transactions
- Monitor network conditions
- Use reliable RPC endpoints
// Successful response
{
status: "success",
message: "Collection deployed successfully",
collectionAddress: "7nE9GvcwsqzYxmJLSrYmSB1V1YoJWVK1KWzAcWAzjXkN",
name: "My Collection"
}
// Error response
{
status: "error",
message: "Error message here",
code: "ERROR_CODE"
}
mintNFT
: Mint NFTs to the collection
getBalance
: Check wallet balance
transfer
: Transfer NFTs
fetchMetadata
: Get collection metadata
Common Issues
-
Metadata Issues
- Invalid URI format
- Missing required fields
- Temporary storage links
- Incorrect file types
-
Transaction Failures
- Insufficient funds
- Network congestion
- RPC node issues
- Invalid parameters
-
Royalty Configuration
- Invalid basis points
- Missing creator addresses
- Incorrect percentages
- Verification failures