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.
View and manage all NFTs owned by a user with detailed metadata and pricing information
Search and browse NFT collections with floor price tracking and collection analytics
Purchase individual NFTs or floor NFTs from collections with integrated Tensor trading
List owned NFTs for sale with custom pricing and duration settings
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.
NftScreen
- Main NFT trading interface with buy/sell tabs
Features:
NftScreen
- Main NFT trading interface with buy/sell tabs
Features:
BuySection
- NFT discovery and purchase interface
Features:
SellSection
- NFT listing and management interface
Features:
NftDetailsSection
- Detailed NFT information display
Features:
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 preferenceReturns:
nfts
- Array of NFT itemsloading
- Loading stateerror
- Error message if anyrefetch
- Function to refresh dataThe nftService.ts
provides comprehensive Tensor API integration:
The module includes specialized utilities for handling NFT data:
Transaction signing and wallet address management for NFT operations
Enhanced NFT metadata and portfolio value calculations
Social sharing of NFT listings and collection discoveries
Purchase SOL to fund NFT acquisitions
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.
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.