I would like to create a collection and then add nft to it. The code I use:
const a = (
await metaplex
.nfts()
.create({
name: "My off-chain name",
uri: "https://arweave.net/y5e5DJsiwH0s_ayfMwYk-SnrZtVZzHLQDSTZ5dNRUHA",
sellerFeeBasisPoints: 250,
isCollection: true,
})
.run()
).nft;
const { nft } = await metaplex
.nfts()
.create({
name: "My off-chain name",
uri: "https://metadata.degods.com/g/9999.json",
sellerFeeBasisPoints: 250,
collection: findMetadataPda(a.mint.address),
})
.run();
await metaplex.nfts().verifyCollection({
mintAddress: nft.mint.address,
collectionMintAddress: a.mint.address,
});
the problem is that the above code snippet creates 2 separate nft but I would like the first nft to be the nft collection