[英]Getting Solana Metaplex Candy Machine Config Data
I have been looking for the best way to find mainnet config data given a Candy Machine ID.我一直在寻找在给定 Candy Machine ID 的情况下查找主网配置数据的最佳方法。 This config data would consist of mint price, supply, items available, and go live date.
此配置数据将包括铸币厂价格、供应、可用物品和上线日期。 I have seen some webapps display this kind of data to a front end but I can't remember which webapp it was.
我见过一些 webapp 向前端显示这种数据,但我不记得它是哪个 webapp。
After searching, it seems like I will need to do some sort of web3 RPC magic.搜索后,似乎我需要做一些 web3 RPC 魔术。
You can use the @metaplex-foundation/mpl-candy-machine
package https://www.npmjs.com/package/@metaplex-foundation/mpl-candy-machine您可以使用
@metaplex-foundation/mpl-candy-machine
包https://www.npmjs.com/package/@metaplex-foundation/mpl-candy-machine
Here is the CandyMachine
class for reference https://github.com/metaplex-foundation/metaplex-program-library/blob/master/candy-machine/js/src/generated/accounts/CandyMachine.ts#L34=这是供参考的
CandyMachine
类https://github.com/metaplex-foundation/metaplex-program-library/blob/master/candy-machine/js/src/generated/accounts/CandyMachine.ts#L34=
The easiest way to do it is using project-serum anchor with the CandyMachineIDL (you can fetch it using this ).最简单的方法是使用带有 CandyMachineIDL 的项目血清锚(您可以使用this获取它)。 Then you just have to use the fetch function over the CandyMachine Account, in order to have an already decoded data of the CandyMachine state (check that the data that you wanna look is inside
candyMachine.data
).然后你只需要在 CandyMachine 帐户上使用fetch 函数,以获得已经解码的CandyMachine 状态数据(检查你想要查看的数据是否在
candyMachine.data
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.