@quantabit/nft-sdk
v1.0.2
Published
QuantaBit NFT SDK - NFT minting, transferring, display, and digital collectible management
Maintainers
Readme
@quantabit/nft-sdk
QuantaBit NFT SDK - NFT minting, transferring, display, and digital collectible management
✨ Features
- 🎨 NFT Marketplace - Browse, buy, and sell NFTs
- ⛏️ Minting - Create and mint new NFTs
- 🏷️ Rarity System - Common, Rare, Epic, Legendary classifications
- 🔨 Auctions - Timed auction with bidding support
- ❤️ Favorites - NFT wishlist and collection management
- 🌍 Multi-Language - Built-in Chinese/English translations
📦 Installation
npm install @quantabit/nft-sdk
# or
yarn add @quantabit/nft-sdk🚀 Quick Start
1. Using Components
import {
NftMarketplace,
NftGrid,
NftCard,
NftDetail,
MyNftsPage,
AuctionCard,
} from '@quantabit/nft-sdk';
// Full NFT marketplace
<NftMarketplace />
// NFT grid
<NftGrid
columns={4}
onNftClick={(nft) => viewDetail(nft)}
showFilters
/>
// NFT card
<NftCard
nft={nftData}
onBuy={(nft) => handleBuy(nft)}
showRarity
/>
// NFT detail page
<NftDetail nftId="nft_123" onBuy={() => handleBuy()} />
// My NFTs page
<MyNftsPage onNftClick={(nft) => viewDetail(nft)} />
// Auction card
<AuctionCard
auction={auctionData}
onBid={(amount) => handleBid(amount)}
showCountdown
/>2. Using Hooks
import {
useNfts,
useNftDetail,
useMyNfts,
useFavoriteNfts,
useBuyNft,
useMintNft,
useNftAuction,
} from "@quantabit/nft-sdk";
function MyComponent() {
const { nfts, loading, loadNfts, filters } = useNfts();
const { nft, loadDetail } = useNftDetail("nft_123");
const { myNfts, loadMyNfts } = useMyNfts();
const { favorites, toggleFavorite } = useFavoriteNfts();
const { buyNft, buying } = useBuyNft();
const { mintNft, minting } = useMintNft();
const { auction, placeBid, bids } = useNftAuction("auction_123");
return <div>...</div>;
}3. API Client
import { nftApi } from "@quantabit/nft-sdk";
// Browse NFTs
const nfts = await nftApi.getNfts({ page: 1, limit: 20 });
// Get NFT detail
const nft = await nftApi.getNftDetail("nft_123");
// Get my NFTs
const myNfts = await nftApi.getMyNfts();
// Buy NFT
await nftApi.buyNft("nft_123");
// Mint new NFT
await nftApi.mintNft({
name: "My NFT",
description: "A unique digital collectible",
image: imageFile,
rarity: "epic",
});📚 Components
| Component | Description |
| ---------------- | ------------------------------------------------- |
| NftMarketplace | Complete NFT marketplace with browsing and search |
| NftGrid | NFT grid layout with filters and pagination |
| NftCard | Single NFT card with image, rarity, and price |
| NftDetail | NFT detail page with attributes and history |
| MyNftsPage | User's NFT collection page |
| AuctionCard | Auction card with countdown and bid history |
📖 Type Definitions
import { NftRarity, NftStatus } from "@quantabit/nft-sdk";
// NFT rarity
NftRarity.COMMON; // Common
NftRarity.RARE; // Rare
NftRarity.EPIC; // Epic
NftRarity.LEGENDARY; // Legendary
// NFT status
NftStatus.MINTED; // Minted
NftStatus.LISTED; // Listed for sale
NftStatus.SOLD; // Sold
NftStatus.TRANSFERRED; // Transferred
NftStatus.BURNED; // Burned📄 License
MIT License
🌐 Brand & Links
- Official Mainnet: QuantaBit Chain
- Developer Platform: Developer Platform
- Open Platform: Open Platform
- Payment Platform: Pay Platform
- Feedback: Feedback
