# NFT付与(生成+転送)

## **createnfttrans** <a href="#createnfttrans" id="createnfttrans"></a>

新規にNFTを生成し、同時に転送します。

## **基本情報** <a href="#basic-info" id="basic-info"></a>

<table><thead><tr><th width="134">プロパティ</th><th width="260">詳細</th></tr></thead><tbody><tr><td>URL</td><td><code>/api/v1/createnfttrans</code></td></tr><tr><td>Method</td><td>POST</td></tr></tbody></table>

## **リクエストパラメータ** <a href="#request" id="request"></a>

<table><thead><tr><th width="231">パラメータ</th><th width="86">種類</th><th width="78">必須</th><th width="318">詳細</th></tr></thead><tbody><tr><td>contract_address</td><td>str</td><td>yes</td><td>コレクション(コントラクト)のアドレス</td></tr><tr><td>blockchain</td><td>str</td><td>yes</td><td>生成先のブロックチェーン</td></tr><tr><td>receiver_wallet_address</td><td>str</td><td>Yes</td><td>NFT転送先の所有者</td></tr><tr><td>metadata</td><td>object</td><td>yes</td><td>NFTのメタデータ</td></tr></tbody></table>

## **blockchainパラメータに指定できるブロックチェーン** <a href="#parameter" id="parameter"></a>

[対応ブロックチェーン](/jp/blockchain.md)のページのネットワークの項目の名称をご指定ください。

{% hint style="warning" %}
`solana`と`solana-testnetは未対応です。`
{% endhint %}

{% hint style="info" %}
`blockchain`パラメータで指定するブロックチェーンとコレクション(contract\_address)のブロックチェーンが一致する必要があります。
{% endhint %}

## **metadata** <a href="#metadata" id="metadata"></a>

NFTのメタデータを定義します。ファイルアップロードが必要な項目は、`file_fields`に指定します。

<table><thead><tr><th width="140">パラメータ</th><th width="75">種類</th><th width="73">必須</th><th width="358">詳細</th></tr></thead><tbody><tr><td>title</td><td>str</td><td>Yes</td><td>NFTのタイトル</td></tr><tr><td>description</td><td>str</td><td>Yes</td><td>NFTの説明</td></tr><tr><td>file_fields</td><td>list</td><td>Yes</td><td>ファイルアップロードが必要なメタデータの項目。KeyとUrlのペアで登録（下記参考）。最大8件。</td></tr><tr><td>attribute</td><td>list</td><td>No</td><td>NFTに追加するプロパティ</td></tr><tr><td>任意</td><td>str</td><td>No</td><td>その他メタデータ</td></tr></tbody></table>

{% hint style="warning" %}
メタデータの数は、`title`, `description`, 各`file_fields`, 任意のものを合計して10個。
{% endhint %}

## **file\_fields** <a href="#file-fields" id="file-fields"></a>

`file_fields`は`key`, `url`のペアの配列です。

<table><thead><tr><th width="131">パラメータ</th><th width="69">種類</th><th width="66">必須</th><th width="277">詳細</th></tr></thead><tbody><tr><td>key</td><td>str</td><td>Yes</td><td>メタデータのkey</td></tr><tr><td>url</td><td>str</td><td>Yes</td><td>アップロードするファイルのURL</td></tr></tbody></table>

## attribute <a href="#attribute" id="attribute"></a>

`attribute`は`tag`,`value`のペアの配列です。

<table><thead><tr><th width="139">パラメータ</th><th width="76">種類</th><th width="75">必須</th><th width="280">詳細</th></tr></thead><tbody><tr><td>tag</td><td>str</td><td>Yes</td><td>プロパティのタグ</td></tr><tr><td>value</td><td>str</td><td>Yes</td><td>プロパティの値</td></tr></tbody></table>

{% hint style="info" %}
URLに指定したファイルがIPFSなどのストレージにアップロードされます。
{% endhint %}

## **リクエストのサンプル** <a href="#sample-request" id="sample-request"></a>

```json
{
  "contract_address": "0x0000000000000000000000000000000000000000",
  "blockchain": "polygon",
  "receiver_wallet_address": "0x2222222222222222222222222222222222222222",
  "metadata": [
    {
      "title": "NFT Name1",
      "description": "Description of NFT1",
      "file_fields": [
        {
          "key": "image",
          "url": "https://my.nftgarden.app/image.png"
        }
    ],
      "attribute": [
        {
          "tag": "color",
          "value": "Red"
        }
      ]
    },
    {
      "title": "NFT Name2",
      "description": "Description of NFT2",
      "file_fields": [
        {
          "key": "image",
          "url": "https://my.nftgarden.app/image.png"
        }
      ]
    }
  ]
}
```

## **成功した場合のレスポンス例** <a href="#response" id="response"></a>

```json
{
  "message": "Create NFT request accepted",
  "requests": {
    "contract_address": "0x0000000000000000000000000000000000000000",
    "receiver_wallet_address": "0x2222222222222222222222222222222222222222",
    "metadata": [
      {
        "title": "NFT Name1",
        "description": "Description of NFT1",
        "file_fields": [
          {
            "key": "image",
            "url": "https://my.nftgarden.app/image.png"
          }
        ],
      "attribute": [
          {
            "tag": "color",
            "value": "Red"
          }
        ]
      },
      {
        "title": "NFT Name2",
        "description": "Description of NFT2",
        "file_fields": [
          {
            "key": "image",
            "url": "https://my.nftgarden.app/image.png"
          }
        ],
        "attribute": [
          {
            "tag": "color",
            "value": "Blue"
          }
        ]
      }
    ]
  },
  "nfts": [
    {
      "nft_gdn_ids": "cf7faf94-a5ec-462c-ad06-1bd772fefe21",
      "accepted_date": "2022-07-04 04:20:18"
    },
    {
      "nft_gdn_ids": "b27752b7-9803-4d28-b29f-9532ad0f0dbb",
      "accepted_date": "2022-07-04 04:20:18"
    }
  ]
}
```

## **失敗した場合のレスポンス例(ステータスコード400)** <a href="#error" id="error"></a>

```json
{
  "error": {
    "title": "Bad Request",
    "message": "contract_address and blockchain are inconsistent"
  }
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nftgarden.app/jp/api/nft-api/v1.2/mint-transfer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
