hashlips-lab / safe-nft-metadata-provider

A safe metadata provider for your NFT collection.
MIT License
74 stars 77 forks source link

Implementing code-less metadata updater and updating dependencies #15

Closed liarco closed 2 years ago

liarco commented 2 years ago

The new TemplatedMetadataUpdater allows to deploy this solution without touching a single line of code in most of the cases (even when shuffling the tokens).

Usage

The new METADATA_TEMPLATE env variable can be set to null (metadata is kept as is) or a JSON object that is used in order to update the metadata for each token.

Some placeholder keys are also provided for dynamic replacement:

Example:

In a collection where tokens have been shuffled (e.g. token number 1234 becomes 5678), you may have the need to update that ID in some properties such as name.

Original metadata:

{
  ..
  "name": "My awesome token (#1234)"
  ..
}

Metadata template:

{
  "name": "My awesome token (#{TOKEN_ID})"
}

App output:

{
  ..
  "name": "My awesome token (#4567)"
  ..
}