alf*_*ngj 9 solana metaplex candy-machine
我从锚点 0.17 更新到版本 0.24,从那时起,获取收款帐户失败并出现锚点错误,如下所示:
Error: Invalid account discriminator
这是我的代码
export const getCollectionPDA = async (candyMachineAddress: string): Promise<anchor.web3.PublicKey> => {
return (
await anchor.web3.PublicKey.findProgramAddress(
[Buffer.from("collection"), new PublicKey(candyMachineAddress).toBuffer()],
new PublicKey(CANDY_MACHINE_PROGRAM_V2)
)
)[0];
};
const provider = new AnchorProvider(connection, getmywallet(), {
preflightCommitment: "finalized",
commitment: "finalized",
});
const idl = await Program.fetchIdl(CANDY_MACHINE_PROGRAM_V2, provider);
const anchorProgram = new Program(idl, CANDY_MACHINE_PROGRAM_V2, provider);
const candyMachineId = "63gzhYWxJ4Yfc5QahLxV6NChSjJZNWW93Sy9CHz8YkCe";
const collectionPDA = await getCollectionPDA(candyMachineId);
const collectionPDAAccount = await connection.getAccountInfo(collectionPDA);
const collectionData = await anchorProgram.account.collectionPda.fetch(new PublicKey(collectionPDA.toString()));
Run Code Online (Sandbox Code Playgroud)
我想知道这是怎么回事。也许集合帐户结构已更新并且区块链包含旧结构?直到最近主播才开始检查这一点?
| 归档时间: |
|
| 查看次数: |
306 次 |
| 最近记录: |