Slide 12
Slide 12 text
12
©2022 SoftBank Corp.
アイテムトークン(NFT)の転送
import os
import requests
import random
import string
import time
def POST_v1_wallets_walletAddress_item_tokens_contractId_non_fungibles_tokenType_tokenIndex_transfer():
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/wallets/tlink1fr9mpexk5yq3hu6jc0npajfsa0x7tl427fuveq/item-tokens/61e14383/non-fungibles/10000001/00000001/transfer'
request_body = {
'walletSecret': 'PCSO7JBIH1gWPNNR5vT58Hr2SycFSUb9nzpNapNjJFU=',
'toAddress': 'tlink1s658utvasn7f5q92034h6zgv0zh2uxy9tzmtqv'
}
headers = {
'service-api-key': service_api_key,
'nonce': nonce,
'timestamp': str(timestamp),
'Content-Type': 'application/json'
}
signature = get_signature('POST', path, nonce, timestamp, service_api_secret, body=request_body)
headers['signature'] = signature
res = requests.post(server_url + path, headers=headers, json=request_body)
return res.json()
出典︓LINE Blockchain Docs APIリファレンス
「Non-fungibleアイテムトークンを転送する(サービスウォレット)」より
https://docs.blockchain.line.me/ja/api-guide/category-service-wallets/transf