Getting the error below trying to get the asset Id when minting a compressed NFT
NotEnoughBytesError: Serializer [publicKey] expected 32 bytes, got 11.
at Object.deserialize (/home/jimii/Documents/webcode/test-umi/node_modules/@metaplex-foundation/umi-serializers/src/publicKey.ts:41:15)
at forEach (/home/jimii/Documents/webcode/test-umi/node_modules/@metaplex-foundation/umi-serializers/src/struct.ts:51:47)
at Array.forEach (<anonymous>)
at Object.deserialize (/home/jimii/Documents/webcode/test-umi/node_modules/@metaplex-foundation/umi-serializers/src/struct.ts:50:14)
at Object.deserialize (/home/jimii/Documents/webcode/test-umi/node_modules/@metaplex-foundation/umi-serializers/src/dataEnum.ts:165:50)
at parseLeafFromMintV1Transaction (/home/jimii/Documents/webcode/test-umi/node_modules/@metaplex-foundation/mpl-bubblegum/src/leafAssetId.ts:40:44)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async findAssetId (/home/jimii/Documents/webcode/test-umi/src/bubblegum.ts:108:27)
Below is the code I am using to find the asset id
async function findAssetId() {
const merkleTree = publicKey("mzHgYPtHWb3e6XphQuomD2KsAtJoPbzpMriK9ow3Gs7");
const leaf: LeafSchema = await parseLeafFromMintV1Transaction(
umi,
base58.serialize(
"54TgSmMMLZLTFjTHTFPvmThJ3kyV2CvBiAoro962aQNpQCCqVHtuf7baEcfYyrPZnQuifoGCMFAQkZTkchSDD2KB"
)
);
console.log("asset id from leaf id", leaf.id);
const assetId = findLeafAssetIdPda(umi, {
merkleTree: merkleTree,
leafIndex: leaf.nonce,
});
console.log("asset Id from find pda", assetId);
}
findAssetId().then().catch(console.error);