Startrail APIs
  • 🛫Startrail PORT: All in one document for API/SDK
    • 🔀URL per environment
  • Issue transfer api
    • 📬Issue & Transfer SRR (NFT)
      • Request Signed URL for Upload/Download Files
      • File Information Metadata
      • Issue & Transfer
      • Webhook Setup
    • 📂Collection
      • Create Collection
      • Get Collection of LUW
    • 📢Change Logs
      • v1.2.0
      • v1.1.0
      • v1.0.1
  • Metadata Schema
    • 🪅Startrail Registry (SRR)
      • Version 2.2
      • Version 2.1
      • Version 2.0
    • 📤Transfer
      • Version 1.2
      • Version 1.1
      • Version 1.0
    • ☸️Custom History
      • Custom History of Exhibition
        • Version 1.2
      • Custom History of Auction
        • Version 1.3
      • Custom History of Appraisal
        • Version 1.1
      • Custom History of Restoration
        • Version 1.0
      • Custom History of Offchain
        • Version 1.1
  • Get SRR API
    • Get Owned SRRs
    • Get SRR by Collection contract address and Token Id
      • 🚫Get SRR by Token Id
    • Description Of SRR Data
  • Ethereum Signature Validator API
    • 🔏Ethereum Signature Validator API
      • Change Logs
  • Startrail SDK Js
    • 🔰Introduction
    • 🏃Getting Started
      • RPC endpoint and chainId
    • 💳Wallet Methods
    • 🔮Startrail API Methods
      • Add Custom Histories To SRRs
      • Approve SRR By Commitment
      • Bulk
      • Check ERC2981 Royalty
      • Create Collection
      • Convert Metadata
      • Create SRR
      • Transfer Collection Ownership
      • Transfer SRR To Ethereum Address
      • Transfer From With Provenance
      • Update Metadata
    • 📱Login Providers
      • Interface
      • Whitelabeling/Customizing
        • Email Password
      • Hints
      • Multi Factor Account Management
    • 🦊MetaMask
    • 🎎Authentication Integration
    • 👾Errors
    • 📢Change logs
      • v1.35.0
      • v1.34.0
      • v1.33.2
      • v1.33.1
      • v1.32.0
      • v1.31.1
      • v1.30.6
      • v1.30.5
      • v1.30.4
      • v1.30.3
      • v1.30.2
      • v1.30.1
      • v1.30.0
      • v1.29.1
      • v1.29.0
      • v1.28.2
      • v1.28.1
      • v1.28.0
      • v1.27.1
      • v1.27.0
      • v1.26.0
      • v1.25.2(Security Patch)
  • Startrail API
    • 💱Transfer SRR Ownership By RevealHash
    • Get Transaction Data
    • Get Metadata By tokenid
  • Subgraph
    • 📊A introduction of subgraph
    • How to retrieve SRR metadata
Powered by GitBook

©2023 Startbahn, Inc.

On this page
  • convertMetadata()
  • Method parameters
  • MetadataBatch
  • Parameters Example
  • Returns
  • Response
  • Error
  • Response Example

Was this helpful?

  1. Startrail SDK Js
  2. Startrail API Methods

Convert Metadata

To know the methods calling to Startrail API from Startrail-Sdk-Js

convertMetadata()

Metadata JSON is converted to the latest version according to the version schema

Method parameters

Variable
Type
Description

metadataBatch

MetadataBatch[]

Refer MetadataBatch for all possible data

MetadataBatch

Variable
Type
Description

metadata

MetadataBatch

tokenId

string

Startrail Registry Record Token ID

externalUrl

string

artistName

string

issuerName

string

contractAddress

string

The address of collection contract associated to the SRR

Parameters Example

await sdk.convertMetadata(
  {
    "metadataBatch": [
      {
        "metadata": {
          "$schema": "https://api.startrail.io/api/v1/schema/registry-record-metadata.v1.1.schema.json",
          "$schemaIntegrity": "sha256-fff288406b907ee6472585388bf519573628e45592be368f128b5b1e37a947c9",
          "startbahnCertICTagUIDs": [
            "1234567890abcdef"
          ],
          "title": {
            "en": "A title",
            "ja": "タイトル",
            "zh": "一个标题"
          },
          "size": {
            "width": 200,
            "height": 400,
            "depth": 12.4,
            "unit": "pixel",
            "flexibleDescription": {
              "en": "flexibleDescription comes here",
              "ja": "自由だーーー"
            }
          },
          "medium": {
            "en": "Oil on canvas",
            "ja": "キャンバスに油彩",
            "zh": "布面油画"
          },
          "edition": {
            "uniqueness": "unique work",
            "proofType": "ED",
            "number": 1,
            "totalNumber": 3,
            "note": {
              "en": "some extra notes in 1 or more languages"
            }
          },
          "contractTerms": {
            "royaltyRate": 15.7,
            "fileURL": "https://startrail.io/whitepaper/startrail_wp_en_v1.1.pdf"
          },
          "note": {
            "en": "note",
            "zh": "注意"
          },
          "thumbnailURL": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
          "yearOfCreation": {
            "en": "around 2010-2020",
            "ja": "2010年から2020年頃"
          },
          "isDigital": true,
          "digitalDataHash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5"
        },
        "artistName": "string",
        "externalUrl": "https://sample.com",
        "issuerName": "string",
        "tokenId": "string",
        "contractAddress": "string"
      }
    ]
  }
)

Returns

Promise will be returned which resolves with a Response object upon a successful confirmation. false will be returned when user flow is cancelled in such a case that a user closes the popup modal.

If the confirmation fails, the Promise will resolve with an {error} object that describes the failure.

Promise<Response[] | false>

Response

Variable
Type
Description

metadata

object

isConverted

TxDetails

True is returned if metadata is converted

message

TxDetails

Error message is returned if any.

Error

Response Example

{
  metadata: [
    {
      "$schema": "ipfs://bafkreif77ionobe56gawqnplet46x3sjfinx3krm4reldzn7v6c2nfrmy4",
      "startbahnCertICTagUIDs": [
        "1234567890abcdef"
      ],
      "chipUIDs": [
        "1234567890abcdef"
      ],
      "title": {
        "en": "A title",
        "ja": "タイトル",
        "zh": "一个标题"
      },
      "size": {
        "width": 200.0,
        "height": 400.0,
        "depth": 12.4,
        "unit": "pixel",
        "flexibleDescription": {
          "en": "flexibleDescription comes here",
          "ja": "自由だーーー"
        }
      },
      "attributes": [
        {
          "trait_type": "Mouth",
          "value": "Surprised"
        }
      ],
      "medium": {
        "en": "Oil on canvas",
        "ja": "キャンバスに油彩",
        "zh": "布面油画"
      },
      "edition": {
        "uniqueness": "unique work",
        "proofType": "ED",
        "number": 1,
        "totalNumber": 3,
        "note": {
          "en": "some extra notes in 1 or more languages"
        }
      },
      "contractTerms": {
        "royaltyRate": 15.7,
        "fileURL": "https://startrail.io/whitepaper/startrail_wp_en_v1.1.pdf"
      },
      "note": {
        "en": "note",
        "zh": "注意"
      },
      "thumbnailURL": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
      "yearOfCreation": {
        "en": "around 2010-2020",
        "ja": "2010年から2020年頃"
      },
      "isDigital": true,
      "digitalDataHash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
      "digitalComponents": [{
        "hash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
        "category": "artwork"
      }],
      "attachmentFiles": [{
        "hash": "sha256-247e4b904322a1dd0b148cd77e8627ec7d391251380880ab4621726ecb945ef5",
        "category": "artwork"
      }],
      "name": "some nft name",
      "description": "some nft description",
      "image": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
      "external_url": "https://openseacreatures.io/3"
    }
  ],
  isConverted: false,
  message: 'Requested metadata is already up to date',
}
PreviousCreate CollectionNextCreate SRR

Last updated 1 year ago

Was this helpful?

Refer to the for all possible data

External reference URL used in the metadata externalUrl field. Refer to the for details.

The artist's name used in the metadata description field. If the SRR already exists, we use the registered artist name instead. Refer to the for details.

The user's name used in the metadata description field. If the SRR already exists, we use the registered user name instead. Refer to the for details.

Converted metadata. Refer to the for all possible data

Custom Error objects. Refer to the for possible data.

🔮
Error Catalogue
Startrail Registry (SRR) data schema
Startrail Registry (SRR) data schema
Startrail Registry (SRR) data schema
Startrail Registry (SRR) data schema
Startrail Registry (SRR) data schema