@htsoft/reactjs-hooks
v1.0.4
Published
NFT information hepler for ReactJS
Downloads
50
Maintainers
Readme
Aiza ReactJS hooks helper
- React hooks to load Aiza NFT data, metadata and content.
- @htsoft/aiza-react-ui a library to render NFT components/pages on a ReactJS webpage.
Environment
- NodeJS version >=
v14.17.5
How to use
First install by run
yarn add @htsoft/reactjs-hooks
Import and use the hooks in your react:
import { useNFT, useNFTMetadata } from '@htsoft/reactjs-hooks'; function MyNFT() { const { data } = useNFT('88'); const { metadata } = useNFTMetadata(data && data.metadataURI); return ( <div> <p> { metadata.description } </p> <p> Owned by: {data.owner.id } </p> </div> ); }
List of hooks: | Hook | Usage | | -- | -- | | useNFT | Fetches on-chain NFT data | | useAuctions | Fetches list of auctions given one or more curators from the Aiza auction house | | useNFTMetadata | Fetches NFT metadata from a URL | | useNFTContent | Fetches text from server to render content URL |
Network configuration is wrapped by
NFTFetchConfiguration
component.import { NFTFetchConfiguration } from '@htsoft/reactjs-hooks';
Data is fetched from:
- TheGraph for auction information, NFT information and currency information
- Direct metadata URIs for NFT metadata
- Opensea tracked NFTs