2

I'm extending the smartpy FA2 template

# 
FA2 = sp.import_script_from_url("https://smartpy.io/dev/templates/FA2.py")
class TezosLandNft(FA2.FA2):
...

which has the following offchain views defined

# ex:
class FA2_token_metadata(FA2_core):
    @sp.offchain_view(pure = True)
    def token_metadata(self, tok):
...

However, when querying for these views using taquito, none of the offchain_views are appearing

const token_contract = await Tezos.wallet.at(WALLET_ADDRESS, compose(tzip12, tzip16));
const views = await token_contract.tzip16().metadataViews()
# views === {}
2

The issue is caused by an invalid IPFS link.

Steps to FIX the issue:

  1. Update the metadata (including views, etc...) enter image description here
  2. Copy the generated JSON enter image description here
  3. Upload the metadata JSON to IPFS

You can use Pinata for this.

  1. Update the metadata link in the code

Replace all occurences of sp.metadata_of_url("https://example.com") with sp.metadata_of_url("<ipfs_link>")

1
  • 1
    That did it. Thanks for step by step instructions! – Jaime Apr 7 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.