NFT Module
Complete NFT functionality for buying, selling, and managing digital collectibles with Tensor integration
The NFT module provides comprehensive functionality for interacting with Non-Fungible Tokens (NFTs) on the Solana blockchain. It integrates with the Tensor API for fetching NFT data, collection information, and performing buy/sell operations.
Core Functionalities
NFT Portfolio
View and manage all NFTs owned by a user with detailed metadata and pricing information
Collection Discovery
Search and browse NFT collections with floor price tracking and collection analytics
Buy NFTs
Purchase individual NFTs or floor NFTs from collections with integrated Tensor trading
Sell & List
List owned NFTs for sale with custom pricing and duration settings
Installation & Setup
API Configuration
Configure your Tensor API access in .env.local
:
Import Module
Import the components and hooks you need:
Wallet Integration
Ensure wallet providers are configured for transaction signing:
Tensor API: This module primarily uses Tensor’s API for NFT data and trading. Ensure you have appropriate API access and rate limits configured.
Module Architecture
Core Components
NftScreen
- Main NFT trading interface with buy/sell tabs
Features:
- Tabbed interface for buying and selling
- Collection search and discovery
- User’s NFT portfolio display
- Integrated trading functionality
NftScreen
- Main NFT trading interface with buy/sell tabs
Features:
- Tabbed interface for buying and selling
- Collection search and discovery
- User’s NFT portfolio display
- Integrated trading functionality
BuySection
- NFT discovery and purchase interface
Features:
- Collection search by name
- Floor NFT discovery
- Price comparison tools
- One-click floor purchases
SellSection
- NFT listing and management interface
Features:
- User’s NFT portfolio display
- Custom listing creation
- Active listing management
- Price and duration controls
NftDetailsSection
- Detailed NFT information display
Features:
- Comprehensive metadata display
- Image rendering with fallbacks
- Price history and analytics
- Social sharing capabilities
Core Hook: useFetchNFTs
The primary hook for fetching user’s NFT portfolio:
Hook Parameters:
walletAddress
- User’s wallet addressoptions
- Configuration object with:includeCompressed
- Include compressed NFTsincludeMetadata
- Fetch full metadatasortBy
- Sort order preference
Returns:
nfts
- Array of NFT itemsloading
- Loading stateerror
- Error message if anyrefetch
- Function to refresh data
NFT Service Functions
The nftService.ts
provides comprehensive Tensor API integration:
Quick Start Examples
NFT Utilities
The module includes specialized utilities for handling NFT data:
Advanced Features
NFT Sharing Integration
Real-time Floor Price Tracking
Batch NFT Operations
Integration with Other Modules
Wallet Providers
Transaction signing and wallet address management for NFT operations
Data Module
Enhanced NFT metadata and portfolio value calculations
Thread Module
Social sharing of NFT listings and collection discoveries
MoonPay
Purchase SOL to fund NFT acquisitions
Error Handling & Troubleshooting
Performance Considerations
Image Optimization: Use image caching and lazy loading for better performance when displaying large NFT collections.
API Limits: Be mindful of Tensor API rate limits, especially when fetching large collections or making frequent requests.
API Reference
For detailed API documentation, see:
The NFT module provides a complete digital collectibles trading platform, enabling users to discover, buy, sell, and manage NFTs with professional-grade tools and seamless Tensor integration.