Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add optional media to the TokenMetadata type #7155

Open
mikemaccana opened this issue Aug 15, 2024 · 1 comment
Open

Feature request: add optional media to the TokenMetadata type #7155

mikemaccana opened this issue Aug 15, 2024 · 1 comment

Comments

@mikemaccana
Copy link
Contributor

mikemaccana commented Aug 15, 2024

The token extensions with metadata example uses this TokenMetadata

From @solana/spl-token-metadata/src/state.ts

export interface TokenMetadata {
  // The authority that can sign to update the metadata
  updateAuthority?: PublicKey;
  // The associated mint, used to counter spoofing to be sure that metadata belongs to a particular mint
  mint: PublicKey;
  // The longer name of the token
  name: string;
  // The shortened symbol for the token
  symbol: string;
  // The URI pointing to richer metadata
  uri: string;
  // Any additional metadata about the token as key-value pairs
  additionalMetadata: [string, string][];
}

Almost all the old things that used to be in the JSON file - name, symbol, description, key/value attribute pairs - are now in the TokenMetadata object.

Why not add image?

Use case

Someone wishes to make an SPL token with minimum features. Right now they need to make a JSON file with:

{
  "image": "https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/CompressedCoil/image.png",
}

As the only contents, and add that as a uri in their TokenMetadata instance.

Instead, we could allow image (or some other other equivalent) to the TokenMetadata instance and save people the effort.

@joncinque
Copy link
Contributor

It'll be a breaking change to add a new default field, so I don't think it's the best idea, but couldn't someone just use the additionalMetadata and add "image" there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants