@cross-nft-marketplace/auction-house-nft-hooks
TypeScript icon, indicating that this package has built-in type declarations

1.0.1-alpha.0 • Public • Published

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:

  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

Package Sidebar

Install

npm i @cross-nft-marketplace/auction-house-nft-hooks

Weekly Downloads

1

Version

1.0.1-alpha.0

License

GPL-3.0

Unpacked Size

847 kB

Total Files

91

Last publish

Collaborators

  • cross-nft-marketplace