3 ms·
Show HN: useNft() is a React Hook to fetch NFT metadata
- lioeters 6y agoPersonally, I would prefer to use a library without the React Hook wrapper - and do the wrapping myself, if/when needed. The main functionality is provided by: https://github.com/ethers-io/ethers.js https://github.com/ethers-io/ethers.js ..But useNft seems to contain some useful methods, like "normalizeTokenUrl". It would be nice if all those were packaged up as a general-purpose library, separate from the React Hook itself.
- bpierre 6y agoThanks for the feedback! Releasing a “core” version of this library sounds like a good idea: as you said, it’s mostly about normalizing the variations in how NFT data is being stored, and the different utility functions are already isolated from React anyway. And yes the only fetcher is the Ethers.js one at the moment, but more will be added soon [1][2]. [1] https://github.com/spectrexyz/use-nft/issues/2 https://github.com/spectrexyz/use-nft/issues/2 [2] https://github.com/spectrexyz/use-nft/issues/3 https://github.com/spectrexyz/use-nft/issues/3