Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

fix metaplex metadata already parsed - #149

Open
swaggymarie wants to merge 1 commit into
mainfrom
fix/token-metadata
Open

fix metaplex metadata already parsed#149
swaggymarie wants to merge 1 commit into
mainfrom
fix/token-metadata

Conversation

@swaggymarie

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread lib/tokens.ts
const decodedMetadata = deserializeMetadata(
tokenMetaDataAccount as unknown as RpcAccount
);
const uriRes = await fetch(decodedMetadata.uri);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually needed as the URI contains parts of the data not just the token metadata. Its actually the URI that contains the image url.
Screenshot 2024-06-07 at 9 34 43 PM

Screenshot 2024-06-07 at 9 34 58 PM Screenshot 2024-06-07 at 9 35 03 PM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And ONLY for the image is why we do it this way..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the uri is actually only the image link, so we were trying to parse the png format as json (what's inside the image url)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@swaggymarie swaggymarie Jun 7, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

you can see here uri is the right url

@swaggymarie swaggymarie Jun 7, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the standard and should we change our way to create metadata to align?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata there isn't standard... So it's not following it, yes I'd encourage our adherence to the metadata standard.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants