I am trying to find out what is the candy machine id or address for a specific nft.
So far I have tried looping through wallet accounts using @solana/web3.js
const tokenAccounts = await connection
.getParsedTokenAccountsByOwner(publicKey, {
programId: TOKEN_PROGRAM_ID,
})
.then((context) => context.value);
Also tried metaplex/js, I got some more info like creators:
const mintAccount = new metaplex.Account(searchNftAddress, mintAccInfo);
if (mintAccount) {
const metadata = metaplex.programs.metadata.Metadata.from(mintAccount);
console.log(metadata.data?.data?.creators);
}
But I do not find candy machine info.