How to retrieve SRR metadata

The following is the method to retrieve the SRR metadata using the Subgraph.

For querying to subgraph, please check this doc.

Open the subgraph

Open the following page in your browser.

Subgraph startrail-polygon

Query

Paste the following query into the left pane of the screen and press the execute button.

{
  srrs(where: { tokenId: "469529826613"}) {
    tokenId
    metadataDigest
  }
}

The result of execution is here.

This metadataDigest is an IPFS CID. Please refer to this page for an explanation of IPFS. You can request the IPFS CID using an IPFS gateway as follows.

For example. Using Cloudflare's gateway

# https://cloudflare-ipfs.com/ipfs/{IPFS CID}

For example. NFT.Storage's gateway

# https://nftstorage.link/ipfs/{IPFS CID}

You can find more IPFS gateways in here.

Metadata in IPFS

Important note

For SRRs issued before 2023, the metadataDigest may contain a string starting with 0x. This can be verified with a tokenId like the one below:

{
  srrs(where: { tokenId: "38726816"}) {
    tokenId
    metadataDigest
  }
}
{
  "data": {
    "srrs": [
      {
        "tokenId": "38726816",
        "metadataDigest": "0x88466c2441cbe0751039298affb14257baea05f15f6c17ed98682de9ab643b06"
      }
    ]
  }
}

In this case, the metadata is not be uploaded to IPFS. To retrieve the metadata, use the Startrail API endpoint via Get Metadata by Token ID.

Last updated

©2023 Startbahn, Inc.