0

I've been trying to build a simple script that pulls the metadata from Metaplex NFTs using the React code below:

import { Metaplex } from "@metaplex-foundation/js";
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("mainnet-beta"));
const metaplex = new Metaplex(connection);
const nft = await metaplex.nfts().findByMint({ mintAddress }).run();

async function App() {
  const [nftA, nftB] = await Metaplex(nftA.nfts(),
  nftA.findAllByMintList({ mints: ["mintA", "mintB"] }),
  nftB.run());
   
  resolve.fallback: { "path": false };

  console.log();
}

export default App;

The issue I've been running into is this error: Line 25:18: Parsing error: Missing semicolon. (25:18)

Any ideas on this one? A simple console log is what I'm looking for as I just need the info.

1 Answer 1

1

How about?

    const _f = async () => {
      const metaplex = new Metaplex(connection);
      const nftList = await metaplex.nfts().findAllByMintList([new PublicKey(`........Some NFT Address...........`)]);
      const nftsToLoad = nftList.filter((nft, index) => {
        return (nft != null && nft.metadataTask.isPending());
      });
      const promises = nftsToLoad.map((nft) => nft?.metadataTask.run());
      await Promise.all(promises);

      nftsToLoad.map((nft) => {
        console.log('metadata', nft?.metadata);
      });
    };
    _f();
3
  • still getting the error :/ its says it's in this section sync function App(nftA,nftB) { const [nftA, nftB] = await metaplex nftA.nfts() .findAllByMintList({ mints: ["mintA", "mintB"] }) nftB.run() resolve.fallback: = { "path": false };
    – Gamma1
    Commented Aug 29, 2022 at 13:23
  • I don't know Javascript well, I think resolve.fallback: = {"path": false}; invalid sentance. Do you mean resolve.fallback = {...resolve.fallback, path: false}; ?
    – James
    Commented Aug 30, 2022 at 1:43
  • I update answer.
    – James
    Commented Aug 30, 2022 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.