-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
token_metadata.CreateVerifyCollection() function is not available? #186
Comments
I have implemented the type VerifyCollectionParams struct {} and func CreateVerifyCollection(param VerifyCollectionParams) types.Instruction {} directly to my codes. setCollectionIx := CreateVerifyCollection(VerifyCollectionParams{ But following error occurred. failed to send tx2, err: {"code":-32002,"message":"Transaction simulation failed: Error processing Instruction 0: insufficient account keys for instruction","data":{"accounts":null,"err":{"InstructionError":[0,"NotEnoughAccountKeys"]},"innerInstructions":null,"logs":["Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]","Program log: IX: Set and Verify Collection","Program log: Error: NotEnoughAccountKeys","Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 13317 of 200000 compute units","Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: insufficient account keys for instruction"],"replacementBlockhash":null,"returnData":null,"unitsConsumed":13317}} Seems like the instruction requires all 7 values and param.CollectionAuthorityRecord cannot be omitted even though it's value is nil. and so, I updated the function as follows to add dummy value in case of nil instead of omitting. if param.CollectionAuthorityRecord != nil { Now, this error occurred. failed to send tx2, err: {"code":-32002,"message":"Transaction simulation failed: Error processing Instruction 0: custom program error: 0x39","data":{"accounts":null,"err":{"InstructionError":[0,{"Custom":57}]},"innerInstructions":null,"logs":["Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]","Program log: IX: Set and Verify Collection","Program log: Incorrect account owner","Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 14770 of 200000 compute units","Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: custom program error: 0x39"],"replacementBlockhash":null,"returnData":null,"unitsConsumed":14770}} If anyone has some experience about flipping Verified: option from 'false' to 'true' of collection NFT, please advise. |
I have tested VerifyCollection using simple Node.js as attached to make sure my information for the verification has no problem. import { createUmi } from '@metaplex-foundation/umi-bundle-defaults' const umi = createUmi('https://api.devnet.solana.com') const privateKeyStr = "My Private Key"; let keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(walletFile)); const signer = createSignerFromKeypair(umi, keypair); umi.use(signerIdentity(signer)) // first find the metadata PDA to use later await verifyCollectionV1(umi, { |
The function is defined in this document as attached but VS Code says 'undefined: token_metadata.CreateVerifyCollection'
/solana-go-sdk/program/metaplex/token_metadata/instruction.go
Please advise. Thanks.
type VerifyCollectionParams struct {
Metadata common.PublicKey
CollectionUpdateAuthority common.PublicKey
Payer common.PublicKey
CollectionMint common.PublicKey
Collection common.PublicKey
CollectionMasterEditionAccount common.PublicKey
CollectionAuthorityRecord *common.PublicKey
}
func CreateVerifyCollection(param VerifyCollectionParams) types.Instruction {
data, err := borsh.Serialize(struct {
Instruction Instruction
}{
Instruction: InstructionVerifyCollection,
})
if err != nil {
panic(err)
}
accounts := []types.AccountMeta{
{
PubKey: param.Metadata,
IsWritable: true,
IsSigner: false,
},
{
PubKey: param.CollectionUpdateAuthority,
IsWritable: true,
IsSigner: true,
},
{
PubKey: param.Payer,
IsWritable: true,
IsSigner: true,
},
{
PubKey: param.CollectionMint,
IsWritable: false,
IsSigner: false,
},
{
PubKey: param.Collection,
IsWritable: false,
IsSigner: false,
},
{
PubKey: param.CollectionMasterEditionAccount,
IsWritable: false,
IsSigner: false,
},
}
if param.CollectionAuthorityRecord != nil {
accounts = append(accounts, types.AccountMeta{
PubKey: *param.CollectionAuthorityRecord,
IsWritable: false,
IsSigner: false,
})
}
return types.Instruction{
ProgramID: common.MetaplexTokenMetaProgramID,
Accounts: accounts,
Data: data,
}
}
The text was updated successfully, but these errors were encountered: