So the tree is being created by the user on the client side (as they are gonna pay gas haha) but my application needs to allow one public key (that is my application's wallet) to mint compressed NFTs (that is make changes to the merkle tree).
How do I add a second tree delegate or authority or whatever when creating the tree/update this after creating the tree?
Currently this is the error I am getting with the bubblegum program (using metaplex's SDK)
Program Logs:
| Program BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY invoke [1]
| Program log: Instruction: MintToCollectionV1
| Program log: AnchorError thrown in src/lib.rs:1003. Error Code: TreeAuthorityIncorrect. Error Number: 6016. Error Message: Tree creator or tree delegate must sign..
Instruction for creating the tree -
const createTreeIx = createCreateTreeInstruction(
{
payer: payerPublicKey,
treeCreator: payerPublicKey,
treeAuthority,
merkleTree: treeKeypair.publicKey,
compressionProgram: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
// NOTE: this is used for some on chain logging
logWrapper: SPL_NOOP_PROGRAM_ID,
},
{
maxBufferSize: maxDepthSizePair.maxBufferSize,
maxDepth: maxDepthSizePair.maxDepth,
public: false,
},
BUBBLEGUM_PROGRAM_ID
);
payerPublickey
here is the user's public key (client side)
const metaplex = Metaplex.make(connection).use(keypairIdentity(identity));
const { response, nft } = await metaplex.nfts().create({
name,
uri,
sellerFeeBasisPoints: 0,
collection: collectionMint,
collectionAuthority: identity,
tree,
tokenOwner: receiverAddress,
});
identity
here is the application wallet's keypair (server-side use).
I want identity
to be able to mint compressed NFTs for the tree created by payerPublickey