如何使用solana网络上的web3.js通过名称获取NFTS信息

发布于 2025-02-04 08:07:15 字数 367 浏览 2 评论 0 原文

我会开始说我是这个Web3世界的新手。 我想做的是:

从Solana Network中检索NFT的信息。我想通过名称检索信息。

从阅读Metaplex文档和 https://docs.solana.com/ 我想这是不可能的。

那么,我是否必须做类似的事情:

连接到糖果机,找到所有NFT,并用所有信息保存在DB中,并且显然用名称打电话给DB?

我的目标是拥有NFT的所有信息,并允许最终用户按名称进行搜索。

任何帮助都将受到赞赏。只需要一条路或任何小建议即可。谢谢

I would start saying that i'm completely new to this world of web3.
What i would like to do is :

Retrieve info's of NFTs from solana network.I would like to retrieve the info by the name.

From reading metaplex documentation and https://docs.solana.com/ i guess it's impossible to do so.

So does i have to do something like this:

Connect to candy machine and find all the nfts and save them in the db with all info's and than obviously make calls to db by name?

My goal is to have all the info's of nft and allow end user to search it by the name.

Any help is appreciated. Just need a path or any little suggestion. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱的故事 2025-02-11 08:07:15

为了在Solana上搜索内容,您必须提供要搜索的帐户,然后估算其信息。在这种情况下,每个NFT都有自己对Solana的帐户(您可以从candymachine(所有NFTS)中获取所有铸造的帐户。

使用 js-next 由metaplex提供的库。因此,您只需要找到从candymachine造成的所有nfts(您可以使用 metaboss 或a rpc调用)。

当您对NFT进行验证时,您将可以访问其名称和JSON元数据URL,以便您可以使用该信息来完成任何操作。

In order to search things on Solana, you have to give the account that you want to search and then deserialize its info. In this case each NFT has its own account on solana (you can get all accounts that were minted from a CandyMachine (all NFTs).

The deserialization part given an ID is really easy using js-next library provided by metaplex. So you just have to find all NFTs that were minted from a CandyMachine (you can use metaboss or a rpc call).

When you deserialize the NFT you will have access to its name and json metadata url so you can do whatever you want with that info.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文