cross-nft-marketplace - Auction House Hooks
The cross-nft-marketplace Auction House Hooks based on @zoralabs/nft-hooks.
Simple React hooks to load NFT data. Includes on-chain data, NFT metadata, and tools for fetching NFT content if needed.
This library consists of a data fetch class and associated React hooks to load NFT data is an easy, efficient manner. The API both batches and caches requests, meaning you can use the hooks across a page without needing to worry about significant performance penalties.
Install:
yarn add @cross-nft-marketplace/auction-house-nft-hooks
All hooks:
Hook | Usage |
---|---|
useNFT | Fetches on-chain NFT data for NFTs |
useAuctions | Fetches list of auctions given one or more curators from the auction house |
useNFTMetadata | Fetches NFT metadata from a URL |
useNFTContent | Fetches text content from server for rendering from content URL |
Configuration:
To set the network configuration, wrap the hooks used with the NFTFetchConfiguration
component.
import {Networks, NFTFetchConfiguration} from '@cross-nft-marketplace/auction-house-nft-hooks';
function NFTGallery() {
return (
<NFTFetchConfiguration network={Networks.MAINNET}>
<NFTList>
</NFTFetchConfiguration>
);
}
Data sources:
Currently data is fetched from:
- TheGraph for auction information and currency information
- Opensea
- Blockchain
- Zora Indexer
Development:
git clone https://github.com/cross-nft-marketplace/auction-house-nft-hooks
cd nft-hooks
-
npm i -g yarn
if you don't have yarn installed yarn