Skip to content

feat: Display NFTs from contracts with null base_uri#2995

Open
cif wants to merge 2 commits intonear:masterfrom
Mintbase:handle-null-base-uris
Open

feat: Display NFTs from contracts with null base_uri#2995
cif wants to merge 2 commits intonear:masterfrom
Mintbase:handle-null-base-uris

Conversation

@cif
Copy link
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

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