js
js copied to clipboard
Setting Collection for NFT
Bit confused here, I'm trying to add a collection to a NFT i'm creating, but getting an error.
Cannot read property 'toBytes' of undefined
I have the address using PublicKey()
, from web3.js but guessing I'm not formatting it properly somehow else? Thanks for any insight here!
Figured out the first part.
Was just a little fuzzy on the needed structure. I imported
import { Collection } from '@metaplex-foundation/mpl-token-metadata';
and saw the structure from the types.
{
verified: false,
key: new PublicKey("mypubkey")
}
Next step is to figure out how to verify collection for an nft i've created.