Git Product home page Git Product logo

Comments (3)

SolBugz avatar SolBugz commented on July 20, 2024

On second thought, it could be just a display problem with "spl-token display", in which case the downstream issues are due to other causes. It's hard to tell because while that command shows commas, and solscan.io shows the same, solana.fm shows colons.

from solana-program-library.

buffalojoec avatar buffalojoec commented on July 20, 2024

@SolBugz The Token Metadata additional metadata is one field with a Vec<(String, String)>. To put this in JavaScript terms (closer to JSON) it looks like: [string, string][].

So the JSON you've pasted here appears correct. It's a list of tuples [string, string]. ie:

{
  "additionalMetadata": [
    ["animal", "horse"],
    ["plant", "daisy"],
    ["rock", "granite"]
  ]
}

It's hard to tell because while that command shows commas, and solscan.io shows the same, solana.fm shows colons.

SolanaFM may be trying to map this to key-value display, since that's what the intention is with this field, but it must be tuples in order to be dynamic for key names!

from solana-program-library.

SolBugz avatar SolBugz commented on July 20, 2024

@buffalojoec Thanks but I'm not sure what "dynamic for" means in this context. You can have the exact same dynamically-sized, updateable structure in your example with colons instead of commas. They wouldn't be Vecs in the Rust sense but the format would be consistent with all the metadata already out there.

This might explain why it seems that no explorer or wallet currently picks up "image" when it resides in "additionalMetadata". This is problematic because it forces the existence of off-chain metadata, at least for tokens with images, when in fact Token-2022 would allow one to implement an SPL token entirely on-chain.

I suppose it's too late to change this (unless comma-vs-colon is left undefined in the Token-2022 spec). If that's the case then it's an awareness problem on the part of all the explorers and wallets, both in terms of the punctuation and also that "additionalMetadata" should be imported just like off-chain metadata.

from solana-program-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.