Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

334
Visualizações
Add Meta Data To Solana Token with @solana/web3.js

I am trying to create an NFT using web3.js and spl-token.js.

However, i need to add meta data (like the name of the token or other attributes), otherwise it just shows up as "Unknown Token" in my wallet.

This is the relevant part of the code where I am minting the token:

let mint = await splToken.Token.createMint(
    connection,
    fromWallet,
    fromWallet.publicKey,
    null,
    0,
    splToken.TOKEN_PROGRAM_ID
);

Otherwise the code is similar to the answers on this question: I would like to mint a new token on solana. How can I do this using solana-web3.js?

There does not seem to be any documentation whatsoever, except for the structure of the meta data (which I found here: https://docs.phantom.app/integrating/tokens/on-chain-metadata).

If anyone could point me in the right direction with an example or documentation it would be really much appreciated. Thank you!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

In order to add metadata to NFT you need to invoke this program spl_token_metadata::instruction::create_metadata_accounts . You can find the documentation here https://docs.rs/spl-token-metadata/latest/spl_token_metadata/instruction/fn.create_metadata_accounts.html

about 4 years ago · Juan Pablo Isaza Relatório

0

Create a metadata for an NFT token in Solana is quite complicated. It is because in Solana SPL-token account would not carry the Metadata. Instead, you have to create another account to carry such data. So, I suggest you to use Metaplex's Candy Machine to make your own NFT with Metadata. You may get more information from their github: https://github.com/metaplex-foundation/metaplex/

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda