title: Filter NFT's in wallet by metaplex candy machine id
body: <p>Is there any way to filter a users wallet by metaplex candy machine id?</p>
  <p>I know how to get all of a users nfts via <code>getParsedTokenAccountsByOwner</code>.</p>
  <pre><code> const tokens = await connection.getParsedTokenAccountsByOwner(publicKey, {
     mint: mintAccount,
     programId,
   });
  
   const nftList = tokens.value.filter((row) =&gt; {
     return row.account.data.parsed.info.tokenAmount.amount === &quot;1&quot;;
   });
  
  </code></pre>
  <p>The problem, I'd have to get the metadata for each token and then filter it from there, which is a lot of unneeded hits to the the chain. I know I can get all the addresses for a candy machine via <code>getProgramAccounts</code> but this is slow, and can take about <code>30 seconds</code> to run.</p>
  <p>This def makes a front end display of a specific candy machine tokens frustrating with out any sort of caching layer + regular polling which I'm trying to avoid if possible.</p>