@cross-nft-marketplace/auction-house-nft-hooks
Version:
Generic react hooks for fetching cross-nft-marketplace auctions, nfts, and data on arbitary 721s. Powers nft-components.
53 lines (38 loc) • 1.8 kB
Markdown
## cross-nft-marketplace - Auction House Hooks
The cross-nft-marketplace Auction House Hooks based on [@zoralabs/nft-hooks](https://github.com/ourzora/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:
```bash
yarn add @cross-nft-marketplace/auction-house-nft-hooks
```
### All hooks:
| Hook | Usage |
| -- | -- |
| [useNFT](docs/useNFT.md) | Fetches on-chain NFT data for NFTs |
| [useAuctions](docs/useAuctions.md) | Fetches list of auctions given one or more curators from the auction house |
| [useNFTMetadata](docs/useNFTMetadata.md) | Fetches NFT metadata from a URL |
| [useNFTContent](docs/useNFTContent.md) | Fetches text content from server for rendering from content URL |
### Configuration:
To set the network configuration, wrap the hooks used with the `NFTFetchConfiguration` component.
```ts
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:
1. TheGraph for auction information and currency information
2. Opensea
3. Blockchain
4. Zora Indexer
### Development:
1. `git clone https://github.com/cross-nft-marketplace/auction-house-nft-hooks`
2. `cd nft-hooks`
3. `npm i -g yarn` if you don't have yarn installed
4. `yarn`