1.0.1-alpha.0 • Published 1 year ago

@cross-nft-marketplace/auction-house-nft-hooks v1.0.1-alpha.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 year ago

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:

HookUsage
useNFTFetches on-chain NFT data for NFTs
useAuctionsFetches list of auctions given one or more curators from the auction house
useNFTMetadataFetches NFT metadata from a URL
useNFTContentFetches 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: 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