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

[Provider] Support fetching avatar metadata stored in ipfs #2527

Closed
wants to merge 2 commits into from

Conversation

christopherdro
Copy link

@christopherdro christopherdro commented Jan 11, 2022

The issue can be reproduced by trying to fetch the avatar for "vitalik.eth"

Error: contentScript.bundle.js:2155 Fetch API cannot load ipfs://ipfs/QmYTuHaoY1winNAxmf7JmCmSrkChuMAAnqgSuJBTiWZe9f. URL scheme "ipfs" is not supported.

The image url is still not entirely correct since the current logic expects the URI to be ipfs://{CID} but the URI returned from the metadata is ipfs://ipfs/{CID}. Any suggestions on the best way to handle this?

@christopherdro
Copy link
Author

Related #2271

@ricmoo
Copy link
Member

ricmoo commented Jan 13, 2022

Is that a valid format?

I also don’t mind extending the format to include this as it doesn’t collide with other IPFS and IPNS formats, but I’m curious if there are other common formats too.

@ricmoo
Copy link
Member

ricmoo commented Jan 13, 2022

Also keep in mind that ethers v5 must be ES3-compatible, so it cannot use the URL class.

I’ll make the necessary changes though.

@christopherdro
Copy link
Author

Is that a valid format?

Doesn't appear to be. https://docs.ipfs.io/how-to/address-ipfs-on-web/#native-urls

It looks like all the tokens from the Nyan Cat smart contract use this format.

@ricmoo
Copy link
Member

ricmoo commented Jan 31, 2022

This should be fixed as of 5.5.4. Try it out and let me know if there are still any issues.

Thanks! :)

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

Successfully merging this pull request may close these issues.

2 participants