Closed zikyfranky closed 5 months ago
The error you are running into is here. See the note above that says that these legacy handlers do not work for pNFTs or Token 2022 tokens; the latter seems to be your issue.
You will need to use one of the new Create
handlers, for example this one. If your mint is already created you should set the as_signer
to false
for the mint.
The error message is a bit incomplete and should probably mention Token 2022
tokens as well. The error is here and that would be a nice simple PR you could make so someone else doesn't have to deal with the same confusion.
Thanks for pointing me in the right direction, was just a misleading error message.
While I was waiting for a solution, I switched to the CreateV1Builder following this guide https://developers.metaplex.com/token-metadata/token-2022, however, I couldn't get it working as I needed an AccountInfo of the SysVar Instructions, I can see the Create
handlers need this.
How do I get that? I tried adding it to my context, the same way Rent
/Clock
is added, but for some reason, Instructions
lacks the SysVar trait, what other way can I specify the SysInstruction to Metaplex?
Sticking to UncheckedAccount.
Thanks for pointing me in the right direction, was just a misleading error message.
~While I was waiting for a solution, I switched to the CreateV1Builder following this guide https://developers.metaplex.com/token-metadata/token-2022, however, I couldn't get it working as I needed an AccountInfo of the SysVar Instructions, I can see the
Create
handlers need this.~~How do I get that? I tried adding it to my context, the same way
Rent
/Clock
is added, but for some reason,Instructions
lacks the SysVar trait, what other way can I specify the SysInstruction to Metaplex?~Sticking to UncheckedAccount.
You need to use an UncheckedAccount
and then use the address
constraint to assert that it's actually the Sysvar1nstructions1111111111111111111111111
address.
Yeah, updated my comment.
PR has been created here, thanks again.
I'm trying to initialize metadata for my FUNGIBLE token (no edition + has decimals), but whenever I call the instruction, I get the 0x99 error message, for some reason, metadata thinks my token is a ProgrammableNonFungible token.
Here's the transaction log
"Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [2]" "Program log: Instruction not supported for ProgrammableNonFungible assets" "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 6199 of 313203 compute units" "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: custom program error: 0x99"
Here is my initializer code
If it's any difference, my mint is already created and initialized, it also has token2022 extensions attached to it
This works however if the mint wasn't already created. Is there something I'm missing? how do I create a metadata?