简体   繁体   English

将元数据帐户关联到令牌

[英]Associate metadata account to token

I have token X in solana with a token address and an associated token account.我在 solana 中有令牌 X,带有令牌地址和关联的令牌帐户。 I want to add a metadata account to that token X, meaning token X will have metadata pointing to an off-chain (external) json file .我想将元数据帐户添加到该令牌 X,这意味着令牌 X 将具有指向链外(外部)json 文件的元数据。 I only familiar with cli and I didn't find any other tool enabling this request.我只熟悉 cli,没有找到任何其他支持此请求的工具。

How can I create this metadata account and associate it to the token ?如何创建此元数据帐户并将其与令牌相关联?

Your help is much appreciated非常感谢您的帮助

This may not be the official way, but if you want to create metadata for your token using the Metaplex standard, they have a CLI that you can use for it: https://github.com/metaplex-foundation/metaplex-program-library/tree/master/token-metadata/cli这可能不是官方方式,但如果您想使用 Metaplex 标准为您的令牌创建元数据,他们有一个 CLI 可供您使用: https ://github.com/metaplex-foundation/metaplex-program- 库/树/主/令牌元数据/cli

You can check out and try running:您可以检查并尝试运行:

$ cargo run -- create_metadata_accounts --name TokenName --symbol SYMB --mint your_token_mint_here --uri https://uri.to.point.to --mutable

Source code can be found at: https://github.com/metaplex-foundation/metaplex-program-library/blob/ed7c5c0202088fd60e43a532a2a73cb98eea5c58/token-metadata/cli/src/main.rs#L648源代码可以在以下位置找到: https ://github.com/metaplex-foundation/metaplex-program-library/blob/ed7c5c0202088fd60e43a532a2a73cb98eea5c58/token-metadata/cli/src/main.rs#L648

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM