Overview
Collection management is at the core of CreateKit. This guide covers everything you need to know about creating, configuring, and managing NFT collections using the BaseMint protocol.
Every collection requires specific metadata that defines its characteristics:
Required Parameters
The name of your NFT collection (e.g., “Bored Ape Yacht Club”)
The symbol/ticker for your collection (e.g., “BAYC”)
The Ethereum address of the collection creator
The Ethereum address of the game owner (can be same as creator)
Optional Parameters
Maximum number of tokens that can be minted
Price per token in wei (use parseEther() for ETH values)
Maximum tokens that can be minted per wallet
Whether whitelist-only minting is enabled
Unix timestamp when minting starts (0 = immediate)
endTime
bigint
default: "BigInt(Date.now() / 1000 + 86400 * 365 * 100)"
Unix timestamp when minting ends
tokenStandard
'ERC721' | 'ERC1155'
default: "'ERC721'"
The token standard to use
Chain ID (1993 = B3 Testnet, 8333 = B3 Mainnet)
Creating Collections
Basic Collection
Basic Collection Creation
import { CollectionManager , b3Testnet } from '@b3dotfun/basemint'
import { createPublicClient , createWalletClient , http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
const account = privateKeyToAccount ( process . env . PRIVATE_KEY as `0x ${ string } ` )
const publicClient = createPublicClient ({
chain: b3Testnet ,
transport: http ()
})
const walletClient = createWalletClient ({
chain: b3Testnet ,
transport: http (),
account
})
const collectionManager = new CollectionManager ( publicClient )
// Define basic collection
const basicCollection = {
name: "My Art Collection" ,
symbol: "MAC" ,
creator: account . address ,
gameOwner: account . address ,
description: "A collection of digital art pieces" ,
image: "https://example.com/collection-image.png"
}
// Generate creator signature
const creatorSignature = await collectionManager . generateCreatorSignature (
walletClient ,
basicCollection
)
Advanced Collection Configuration
Advanced Collection Setup
import { parseEther } from 'viem'
const advancedCollection = {
// Required
name: "Premium Gaming Items" ,
symbol: "PGI" ,
creator: account . address ,
gameOwner: "0x1234567890123456789012345678901234567890" , // Different game owner
// Supply and pricing
maxSupply: 5000 n ,
mintPrice: parseEther ( "0.01" ), // 0.01 ETH
maxPerWallet: 5 n ,
// Timing controls
startTime: BigInt ( Math . floor ( Date . now () / 1000 ) + 3600 ), // Start in 1 hour
endTime: BigInt ( Math . floor ( Date . now () / 1000 ) + 86400 * 7 ), // End in 7 days
// Whitelist configuration
isWhitelistEnabled: true ,
whitelistMerkleRoot: "0x..." as `0x ${ string } ` ,
// Metadata
description: "Exclusive gaming items for premium players" ,
image: "https://example.com/premium-collection.png" ,
external_url: "https://mygame.com/premium-items" ,
animation_url: "https://example.com/collection-animation.mp4" ,
// Collection attributes
attributes: [
{ trait_type: "Category" , value: "Gaming" },
{ trait_type: "Rarity" , value: "Premium" },
{ trait_type: "Edition" , value: "First" }
],
// Technical
tokenStandard: "ERC1155" as const ,
chainId: 1993
}
Token Standards
CreateKit supports both ERC721 and ERC1155 standards:
ERC721 Collections
ERC1155 Collections
const erc721Collection = {
name: "Unique Art Pieces" ,
symbol: "UAP" ,
creator: account . address ,
gameOwner: account . address ,
tokenStandard: "ERC721" as const ,
maxSupply: 1000 n , // Each token is unique
description: "One-of-a-kind digital art pieces"
}
// ERC721 minting (quantity always 1)
const collection721 = collectionManager . createCollection (
predictedAddress ,
"ERC721"
)
await collection721 . mint (
walletClient ,
1 n , // Always 1 for ERC721
undefined , // metadata URI
mintPrice ,
proof
)
const collectionMetadata = {
name: "My Collection" ,
description: "A fantastic collection of digital assets" ,
image: "https://example.com/collection-image.png" ,
external_url: "https://mywebsite.com/collection" ,
// Background and banner for marketplaces
background_color: "ffffff" ,
banner_image_url: "https://example.com/banner.png" ,
// Collection attributes
attributes: [
{ trait_type: "Theme" , value: "Fantasy" },
{ trait_type: "Artist" , value: "Digital Creator" }
]
}
CreateKit automatically generates token metadata based on your collection settings:
Collection Validation
CreateKit provides built-in validation for collection parameters:
import { validateCollectionMetadata } from '@b3dotfun/basemint'
try {
// Validate collection metadata
const validation = validateCollectionMetadata ( collectionMetadata )
if ( ! validation . isValid ) {
console . error ( "Validation errors:" , validation . errors )
return
}
console . log ( "✅ Collection metadata is valid" )
// Proceed with signature generation
const signature = await collectionManager . generateCreatorSignature (
walletClient ,
collectionMetadata
)
} catch ( error ) {
console . error ( "Validation failed:" , error )
}
Address Prediction
One of CreateKit’s key features is deterministic address prediction:
// Generate creator signature first
const creatorSignature = await collectionManager . generateCreatorSignature (
walletClient ,
collectionMetadata
)
// Predict the collection address
const predictedAddress = collectionManager . predictCollectionAddress (
collectionMetadata ,
creatorSignature
)
console . log ( `Collection will be deployed at: ${ predictedAddress } ` )
// You can now use this address before deployment
// for marketplace integration, frontend display, etc.
Collection Management Operations
Checking Collection Status
const collection = collectionManager . createCollection (
predictedAddress ,
"ERC721"
)
// Check if collection is deployed
const isDeployed = await collection . isDeployed ()
console . log ( `Deployed: ${ isDeployed } ` )
// Get collection info (only works after deployment)
if ( isDeployed ) {
const info = await collection . getCollectionInfo ()
console . log ( "Collection Info:" , {
name: info . name ,
symbol: info . symbol ,
totalSupply: info . totalSupply . toString (),
maxSupply: info . maxSupply . toString (),
mintPrice: info . mintPrice . toString (),
maxPerWallet: info . maxPerWallet . toString ()
})
}
Updating Collection Settings
Most collection parameters cannot be changed after deployment. Plan your collection configuration carefully.
Post-Deployment Management
// Only certain operations are possible after deployment
// Check current mint price (if dynamic pricing is implemented)
const currentPrice = await collection . getCurrentMintPrice ()
// Check if minting is currently active
const isMintingActive = await collection . isMintingActive ()
// Get remaining supply
const remainingSupply = await collection . getRemainingSupply ()
console . log ({
currentPrice: currentPrice . toString (),
isMintingActive ,
remainingSupply: remainingSupply . toString ()
})
Best Practices
1. Collection Planning
Supply Strategy
Set appropriate max supply based on use case
Consider future demand and scarcity
Leave room for growth or special editions
Pricing Strategy
Research similar collections for pricing reference
Consider gas costs and transaction fees
Plan for different market conditions
const qualityCollection = {
name: "Professional Art Collection" ,
symbol: "PAC" ,
creator: account . address ,
gameOwner: account . address ,
// High-quality descriptions
description: "A curated collection of professional digital artworks featuring contemporary themes and innovative techniques." ,
// Professional imagery (minimum 640x640px)
image: "https://example.com/high-res-collection-image.png" ,
// Comprehensive attributes for better discoverability
attributes: [
{ trait_type: "Art Style" , value: "Contemporary" },
{ trait_type: "Medium" , value: "Digital" },
{ trait_type: "Artist Verification" , value: "Verified" },
{ trait_type: "Edition Type" , value: "Limited" }
],
// External links for credibility
external_url: "https://professionalartist.com/collection"
}
3. Security Considerations
Never hardcode private keys in source code
Use environment variables or secure key management
Consider using multi-signature wallets for valuable collections
Always validate signatures before deployment
Verify collection parameters match intended values
Test on testnet before mainnet deployment
Carefully choose creator and gameOwner addresses
Understand reward distribution implications
Plan for long-term collection management
Troubleshooting
Address prediction mismatch
Ensure all collection parameters are identical between signature generation and deployment. Even small changes will result in different addresses.
Invalid collection parameters
Check that all required fields are provided and that values are within acceptable ranges (e.g., maxSupply > 0, valid addresses).
Signature generation fails
Verify that your wallet client is properly configured and that you have sufficient funds for the signing transaction.
Next Steps
Now that you understand collection management, explore these related topics: