Hey guy,
What is the best solution to get a single NFT owned by the user  (like eg. only the punks nfts)?
Currently I am using Moralis.Web3API.account.getNFTs and then I am filtering all the NFTs the user has with .map. I have this custom React hook:
import {useEffect, useState} from "react";
import {useMoralis} from "react-moralis";
function useNFTs(chain, address) {
    const [value, setValue] = useState([]);
    const [total, setTotal] = useState(null);
    const [isLoading, setIsLoading] = useState(false);
    const {isAuthenticated, Moralis} = useMoralis();
    useEffect( () => {
        if (isAuthenticated) {
            setIsLoading(true);
            Moralis.Web3API.account.getNFTs({chain: chain, address: address})
                .then(data => {
                    let gear = data.result.filter(data => data.symbol === "GEAR")
                    setValue(gear);
                    setTotal(gear.length);
                    setIsLoading(false);
                });
        }
    }, [isAuthenticated, Moralis, chain, address])
    return [value, total, isLoading];
}
export default useNFTs;
Is this a good solution? should I put this into a cloud function?
 
      
    



