JSPM

@htsoft/reactjs-hooks

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q28800F
  • License GPL-3.0-or-later

NFT information hepler for ReactJS

Package Exports

  • @htsoft/reactjs-hooks

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@htsoft/reactjs-hooks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

  1. First install by run

    yarn add @htsoft/reactjs-hooks
  2. 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>
      );
    }
  3. 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
  4. Network configuration is wrapped by NFTFetchConfiguration component.

    import { NFTFetchConfiguration } from '@htsoft/reactjs-hooks';

Data is fetched from:

  1. TheGraph for auction information, NFT information and currency information
  2. Direct metadata URIs for NFT metadata
  3. Opensea tracked NFTs