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

feat: Display NFTs from contracts with null base_uri #2995

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cif
Copy link

@cif cif commented Jan 13, 2023

Handle tokens with null contract base_uri

This PR changes the logic responsible for resolving NFT reference material for display in the collectibles tab.

Why the current implementation doesn't work

A JS template literal will render null inside of the string if the value is null rather than empty string. Even if the + concatenation operator is used instead, base_uri + '/' + reference would cause clients to attempt to load from the current host.

Motivation

While maintaining a shared base_url on the token contract can save storage and promote continuity between tokens, it is also advantageous allow a token to host its reference wherever it chooses.

The NEP 177 specification provides for this, and should be handled if a token contract prefers to behave this way.

@netlify
Copy link

netlify bot commented Jan 13, 2023

👷 Deploy request for glittering-pavlova-0e9247 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5829c67

@netlify
Copy link

netlify bot commented Jan 13, 2023

👷 Deploy request for near-wallet-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5829c67

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.

1 participant