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

Validator for urls #171

Open
vikiival opened this issue Oct 19, 2023 · 0 comments
Open

Validator for urls #171

vikiival opened this issue Oct 19, 2023 · 0 comments
Labels
enhancement New feature or request hyperdata kodadot/hyperdata

Comments

@vikiival
Copy link
Member

Context

Someone was able to mint NFT with the broken metadata and yet we are unable to parse them.

https://canary.kodadot.xyz/ahk/gallery/180-3691204538

Seems their metadata has wrong format?

"image": "ipfs://ipfs/ipfs://ipfs/QmbM7cNWybBCCxyzUBQxhJ25qJ4Ecv7fGDgbFtFnhaSvaT",

"mediaUri": "ipfs://ipfs/ipfs://ipfs/QmbM7cNWybBCCxyzUBQxhJ25qJ4Ecv7fGDgbFtFnhaSvaT",

https://image-beta.w.kodadot.xyz/ipfs/bafkreidpi55n4lhjsn45eg6jopsiwptenyqarl7pyfg2xa52erpt4qhvwe

Task

Write a simple validator that returns '' when the image and animation url content is not correct.

Valid cases:

  1. https://
  2. ipfs://ip[fn]s/
  3. ipfs://
  4. /ip[fn]s/

most of the stuff is handled by @kodadot/minipfs but happy to deduplicate the code into some other common package

REF

@vikiival vikiival added enhancement New feature or request hyperdata kodadot/hyperdata labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hyperdata kodadot/hyperdata
Projects
None yet
Development

No branches or pull requests

1 participant