取得(アイテムトークン)
指定されたアイテムトークンのコントラクト情報を取得します。
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()
作成(create)をリクエストしたアイテムトークンコレクションのcontract IDおよび情報を取得します。
Path
なし
Query
Name | Type | Description |
---|---|---|
txHash | string | アイテムトークンコレクションを作成するをリクエストし、その応答として受信した |
isOnlyContractId | boolean | Contract IDの値のみを受け取るかどうか
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_collection():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens'
query_params = {
'txHash': '0D17ABF5F8CB396822B9BFB110079C0892F6D43A988DE3EF6801450A7D361705',
'isOnlyContractId': false
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret, query_params)
headers['signature'] = signature
res = requests.get(server_url + path, params=query_params, headers=headers)
return res.json()
指定されたcontractで作成したNFTの一覧と情報を取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのcontract ID |
Query
Name | Type | Description |
---|---|---|
limit | integer | 取得するデータ数
|
orderBy | string | 並べ替え順。並べ替えの基準はToken Typeで、この属性で順番を指定できます。以下のうち1つを入力してください。
|
page | integer | 取得するページ番号。全体のデータ一覧のうち、
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non_fungibles():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles'
query_params = {
'limit': 10,
'orderBy': 'desc',
'page': 1
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret, query_params)
headers['signature'] = signature
res = requests.get(server_url + path, params=query_params, headers=headers)
return res.json()
指定されたcontract ID、Token Typeで鋳造されたNFTを取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのcontract ID |
tokenType Required | string | 取得するアイテムトークンのToken Type |
Query
Name | Type | Description |
---|---|---|
limit | integer | 取得するデータ数
|
orderBy | string | 並べ替え順。並べ替えの基準はToken Indexで、この属性で並べ替えの順番を指定できます。以下のいずれかを入力してください。
|
page | integer | 取得するページ番号。全体のデータ一覧のうち、
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non_fungibles_tokenType():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/10000001'
query_params = {
'limit': 10,
'orderBy': 'desc',
'page': 1
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret, query_params)
headers['signature'] = signature
res = requests.get(server_url + path, params=query_params, headers=headers)
return res.json()
Contract ID、Token Type、Token Indexで指定されたNFTを取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのcontract ID |
tokenType Required | string | 取得するアイテムトークンのToken Type |
tokenIndex Required | string | 取得するアイテムトークンのToken Index |
Query
なし
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non_fungibles_tokenType_tokenIndex():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/10000001/00000001'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()
指定されたcontract IDおよびToken Typeを持つNFTの保有者を取得します。
> このエンドポイントは保有者一覧を保有量でソートします。アドレスでソートするには、 NFTの特定token typeの保有者を取得する v2を使用してください。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのContract ID |
tokenType Required | string | 取得するアイテムトークンのToken Type |
Query
Name | Type | Description |
---|---|---|
limit | integer | 取得するデータ数
|
orderBy | string | 並べ替え順。並べ替えの基準は保有量で、この属性で順番を指定できます。以下のうち1つを入力してください。
|
page | integer | 取得するページ番号。全体のデータ一覧のうち、
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non_fungibles_tokenType_holders():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/10000001/holders'
query_params = {
'limit': 10,
'orderBy': 'desc',
'page': 1
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret, query_params)
headers['signature'] = signature
res = requests.get(server_url + path, params=query_params, headers=headers)
return res.json()
指定されたcontract IDおよびtoken typeを持つNFTの保有者を取得します。 NFTの特定token typeの保有者を取得すると結果は同じですが、walletアドレスで一覧をソートします。
一度に取得する最大のトークン数(limit
パラメータで設定可能)を超えて取得したい場合は、ページ単位で取得するを行います。ページ単位で取得する前に必ず詳細を確認してください。
ページ単位で取得する(pagination)
LINE Blockchain Developer APIは、ページをスクロールする方式でページ単位で取得するを設計しました。並べ替えたトークン一覧で、昇順または降順のいずれかの方向にページをスクロールしながらそのページにあるトークンを読み取る方式です。
この方式では、読む方向を維持したまま次のページを順番に閲覧することを推奨します。 途中で前のページに戻ると、読む方向が変わります。例えば、降順のページを読んでいる途中で前のページに戻ると、読む方向は昇順になります。1ページにトークンが2つ以上の場合、ページ内のトークンの順番も読む方向に従います。以下の例を参照してください。
1、2、3、4、5、6、7の7つのトークンがあると想定します。ページのサイズ(1ページに含まれる最大のトークン数)を2に設定してページを降順で読むと、最初のページの値は以下のとおりになります。
- 並び順:降順
- 並べ替えられたトークン:7、6、5、4、3、2、1
- ページに含まれるトークン:7、6
スクロール方向とページのサイズを維持する場合、次のページは以下の値になります。
- 並び順:降順
- 並べ替えられたトークン:7、6、5、4、3、2、1
- ページに含まれるトークン:5、4
これで2ページまで読みました。ここで前のページに戻ると、スクロール方向が変わってしまい、トークンも逆順に表示されます。
- 並び順:昇順(*逆方向)
- 並べ替えられたトークン:1、2、3、4、5、6、7
- ページに含まれるトークン:6、7 (*逆順)
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのcontract ID |
tokenType Required | string | 取得するアイテムトークンのtoken type |
Query
Name | Type | Description |
---|---|---|
limit | integer | 取得するデータ数
|
orderBy † | string | 並べ替え順。並べ替えの基準はウォレットのアドレスで、この属性で順番を指定できます。以下のうち1つを入力してください。
|
pageToken † | string | 取得するページの最初の要素を指すpage token。
以前の応答の
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_users_userId_item_tokens_contractId_non_fungibles_tokenType():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v2/item-tokens/61e14383/non-fungibles/10000001/holders'
query_params = {
'limit': 5,
'orderBy': 'desc',
'pageToken': ''
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret, query_params)
headers['signature'] = signature
res = requests.get(server_url + path, params=query_params, headers=headers)
return res.json()
Contract ID、Token Type、 Token Indexに指定されたNFTの保有者を取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | 取得するアイテムトークンのContract ID |
tokenType Required | string | 取得するアイテムトークンのToken Type |
tokenIndex Required | string | 取得するアイテムトークンのToken Index |
Query
Name | Type | Description |
---|---|---|
isMetaRequired | boolean | トークンのメタデータ有無。このパラメータは、大文字小文字を区別しない文字列で入力します。
|
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non_fungibles_tokenType_tokenIndex_holder():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/10000001/00000001/holder?isMetaRequired=true'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()
このエンドポイントは、まもなく非推奨になります。代わりに複数のNFTのメディアリソースの状態を取得するを使用してください。
Contract IDとrequest IDで指定されたアイテムトークンのNFTアイコン(画像/動画)の更新結果を取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | アイコン(画像/動画)の更新をリクエストしたアイテムトークンのcontract ID |
requestId Required | string | アイコン(画像/動画)の更新をリクエストした後、レスポンス値として受け取ったrequest ID |
Query
なし
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non-fungible_icon_requestId_status():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/icon/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/status'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()
Contract IDとrequest IDで指定されたアイテムトークンのアイコン(画像/動画)の更新結果を取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | アイコン(画像/動画)の更新をリクエストしたアイテムトークンのcontract ID |
requestId Required | string | アイコン(画像/動画)の更新をリクエストした後、レスポンス値として受け取ったrequest ID |
Query
なし
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non-fungible_media-resources_requestId_status():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/media-resources/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/status'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()
Contract IDとrequest IDで指定されたアイテムトークンのNFTアイコンサムネイルの更新結果を取得します。
Path
Name | Type | Description |
---|---|---|
contractId Required | string | サムネイルの更新をリクエストしたアイテムトークンのcontract ID |
requestId Required | string | サムネイルの更新をリクエストした後、レスポンス値として受け取ったrequest ID |
Query
なし
Body
なし
- service-api-key
- Signature
- Timestamp
- Nonce
詳しくは、リクエストヘッダーを参照してください。
リクエストの例
import os
import requests
import random
import string
import time
def GET_v1_item_tokens_contractId_non-fungible_thumbnails_requestId_status():
server_url = os.environ['SERVER_URL']
service_api_key = os.environ['SERVICE_API_KEY']
service_api_secret = os.environ['SERVICE_API_SECRET']
nonce = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(8))
timestamp = int(round(time.time() * 1000))
path = '/v1/item-tokens/61e14383/non-fungibles/thumbnails/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/status'
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp)
}
signature = get_signature('GET', path, nonce, timestamp, service_api_secret)
headers['signature'] = signature
res = requests.get(server_url + path, headers=headers)
return res.json()