Error: required param address not provided

When trying to fetch bayc collection I get the error Error: required param address not provided - not sure where I am going wrong

const {Web3Api} = useMoralisWeb3Api()
  const {isInitialized} = useMoralis()
 const fetchNFTsForContract = async () => {
    const options = {
      chain: "eth",
      token_address: "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
    };
    
  const bayc = await Web3Api.account.getNFTsForContract(options);
  console.log(bayc);
  }
  useEffect(() => {
    if (isInitialized) {
        fetchNFTsForContract()
    }
}, [isInitialized])

you need an address parameter too, it may also work if the user is authenticated with metamask

It says the address parameter is optional in the moralis docs… Is there no way to fetch an entire collection?

There are ways, different endpoints. There is an api endpoint called something similar to getNFTTokenIds that may be what you are looking for