> For the complete documentation index, see [llms.txt](https://docs.startrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.startrail.io/startrail-sdk-js/startrail-api-methods/createsrr.md).

# Create SRR

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

## `createSRR()`

Issue a new SRR on Startrail. Sends a transaction to Startrail smart contract via Startrail-API.

{% hint style="info" %}
Please call convertMetadata() in prior and replace with the converted metadata in order to keep the metadata always up to date [`convertMetadata()`](/startrail-sdk-js/startrail-api-methods/convertmetadata.md)
{% endhint %}

## Method parameters

| Variable                      | Type      | Description                                                                                                           |
| ----------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------- |
| `startrailLUWContractAddress` | `string`  | The address of LicensedUserWallet(LUW) contract.                                                                      |
| `contractAddress`             | `string`  | The address of collection contract. Sets it when you want to associate collection contract address with the SRR.      |
| `isPrimaryIssuer`             | `boolean` | If you are the primary issuer of this NFT, set this to true                                                           |
| `artistAddress`               | `string`  | The ethereum address of the artist of the artwork.                                                                    |
| `metadata`                    | `object`  | Refer to the [Startrail Registry (SRR) data schema](/metadata-schema/startrail-registry-srr.md) for all possible data |
| `lockExternalTransfer`        | `boolean` | If you want to prevent your NFTs to be transferred on decentralized marketplaces, sets this to true                   |

### Parameters Example

```
await sdk.approveSRRByCommitment(
  {  
    startrailLUWContractAddress: '0x113c6880fc4a2664E125973BC0Dfd37d62Ec7c3f',
    isPrimaryIssuer: true,
    artistAddress: '0x4a2B3Ca3c9C96898d1000137521427e9f4fdD019',
    lockExternalTransfer: false,
    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: "ipfs://bafkreihmlsij6s5ri6e347h7yqjlsl4qa3iykub6qmumctb2mshc4u7vlm"
      },
      note: {
        en: "note",
        zh: "注意"
      },
      thumbnailURL: "ipfs://bafkreiedkaf4w5ogbbnfgp4jyrlvdqmwh3edryszcciee3puyn7nltcomi",
      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: "ipfs://bafkreiedkaf4w5ogbbnfgp4jyrlvdqmwh3edryszcciee3puyn7nltcomi",
      external_url: "https://openseacreatures.io/3"
    }
  },
)

```

## 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>`

Note: txReceiptId returns currently 0 in order to avoid slow response due to the congestion for blockchin mining.

### Response

| Variable      | Type        | Description                                             |
| ------------- | ----------- | ------------------------------------------------------- |
| `txReceiptId` | `string`    | ID to identify transaction details in Startrail-API DB. |
| `tx`          | `TxDetails` | Transaction details                                     |

### TxDetails

| Variable      | Type     | Description              |
| ------------- | -------- | ------------------------ |
| `metadataCID` | `string` | A calculated metadataCID |
| `tokenId`     | `string` | A calculated tokenId     |

### Error

Custom `Error` objects. Refer to the [Error Catalogue](/startrail-sdk-js/errors.md) for possible data.

### Response Example

```
{
  "txReceiptId": 0,
  "tx": {
      "tokenId": "209850285627",
      "metadataCID": "bafkreibjdtcklpe5wjgh6qp2dqygaydm3d4xttfhaphgian73bpprkr7xu"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.startrail.io/startrail-sdk-js/startrail-api-methods/createsrr.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
