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:
- https://
- ipfs://ip[fn]s/
- ipfs://
- /ip[fn]s/
-
most of the stuff is handled by @kodadot/minipfs but happy to deduplicate the code into some other common package
REF
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:
REF