我正在将nft资产上传到 Solana 网络并收到此错误。
TypeError: Cannot read properties of undefined (reading 'map')
尽管我参考了许多教程,但我不确定要调整什么。以下是metaplex上传脚本中的代码片段:
if (i === 0 && !cacheContent.program.uuid) {
// initialize config
log.info(`initializing config`);
try {
const res = await createConfig(anchorProgram, walletKeyPair, {
maxNumberOfLines: new BN(totalNFTs),
symbol: manifest.symbol,
sellerFeeBasisPoints: manifest.seller_fee_basis_points,
isMutable: mutable,
maxSupply: new BN(0),
retainAuthority: retainAuthority,
creators: manifest.properties.creators.map(creator => {
return {
address: new PublicKey(creator.address),
verified: true,
share: creator.share,
};
}),
});
cacheContent.program.uuid = res.uuid;
cacheContent.program.config = res.config.toBase58();
config = res.config;
log.info(
`initialized config for a candy machine with publickey: ${res.config.toBase58()}`,
);
saveCache(cacheName, env, cacheContent);
} catch (exx) {
log.error('Error deploying config to Solana network.', exx);
throw exx;
}
}
我正在使用以下命令通过 CLI 上传资产:
ts-node ~/metaplex-master/js/packages/cli/src/candy-machine-cli.ts upload /nft-assets --env devnet --keypair ~/.config/solana/devnet.json