# @htsoft/reactjs-hooks

> NFT information hepler for ReactJS

Latest version **1.0.4** (published 2021-09-11) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @htsoft/reactjs-hooks
pnpm add @htsoft/reactjs-hooks
yarn add @htsoft/reactjs-hooks
bun add @htsoft/reactjs-hooks
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-09-11 |
| First published | 2021-09-08 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 664.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jack |
| Maintainers | htsoft |
| Keywords | Aiza, GameFi, NFT, Play2Earn, Dapp, SmartContract, BlockChain |

## Links

- npm: https://www.npmjs.com/package/@htsoft/reactjs-hooks
- Repository: https://github.com/jack-ht/aiza-react-hooks
- Homepage: https://github.com/jack-ht/aiza-react-hooks#ReadMe
- Issues: https://github.com/jack-ht/aiza-react-hooks/issues
- npm.io page: https://npm.io/package/@htsoft/reactjs-hooks

## Dependencies (11)

- [swr](https://npm.io/package/swr.md) ^0.5.6
- [react](https://npm.io/package/react.md) ^17.0.2
- [tslib](https://npm.io/package/tslib.md) ^2.2.0
- [big.js](https://npm.io/package/big.js.md) ^6.1.0
- [graphql](https://npm.io/package/graphql.md) ^15.5.0
- [dataloader](https://npm.io/package/dataloader.md) ^2.0.0
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.1.4
- [graphql-request](https://npm.io/package/graphql-request.md) ^3.4.0
- [react-test-renderer](https://npm.io/package/react-test-renderer.md) ^17.0.2
- [node-abort-controller](https://npm.io/package/node-abort-controller.md) ^2.0.0
- [@ethersproject/address](https://npm.io/package/@ethersproject/address.md) ^5.4.0

## Recent versions

- 1.0.4 (latest) — 2021-09-11
- 1.0.1-0 (next) — 2021-09-08
- 1.0.3 — 2021-09-09
- 1.0.2 — 2021-09-08
- 1.0.0 — 2021-09-08

## README

# Aiza ReactJS hooks helper

- React hooks to load Aiza NFT data, metadata and content.
- [@htsoft/aiza-react-ui](https://github.com/jack-ht/aiza-react-ui) a library to render NFT components/pages on a ReactJS webpage.  
  <br/>

## Environment

- NodeJS version >= `v14.17.5`

## How to use

1.  First install by run

    ```bash
    yarn add @htsoft/reactjs-hooks
    ```

1.  Import and use the hooks in your react:

    ```ts
    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>
      );
    }
    ```

1.  List of hooks:
    | Hook | Usage |
    | -- | -- |
    | [useNFT](docs/useNFT.md) | Fetches on-chain NFT data |
    | [useAuctions](docs/useAuctions.md) | Fetches list of auctions given one or more curators from the Aiza auction house |
    | [useNFTMetadata](docs/useNFTMetadata.md) | Fetches NFT metadata from a URL |
    | [useNFTContent](docs/useNFTContent.md) | Fetches text from server to render content URL |

1.  Network configuration is wrapped by `NFTFetchConfiguration` component.

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

## Data is fetched from:

1. TheGraph for auction information, NFT information and currency information
1. Direct metadata URIs for NFT metadata
1. Opensea tracked NFTs
   <br/>

---
_Source: https://npm.io/package/@htsoft/reactjs-hooks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
