let land = {
issuer: "土地发行方的唯一标识",
id: "在整个NFT集合中的 id",
metadata: "ipfs://XXX",
protocol: 'avatar_1_1:xxxxx',
vest: '上级NFT',
owner: '',
properties: [
{
name: 'gold',
value: 12234555,
slot: [
{
name: "mining_machines",
issuer: "矿机的唯一标识",
metadata: "ipfs://XXX",
properties: [
{
name: 'fuel_consumption',
value: 12333,
slot: []
},
{
name: 'power',
value: 142,
slot: []
},
{
name: 'fuel_consumption',
value: 12333,
slot: []
},
{
name: 'power',
value: 142,
slot: []
}
]
}
]
}
],
collection: [
{
id: "在整个NFT集合中的 id",
metadata: "ipfs://XXX",
properties: [
{
name: "gold",
value: 12234555,
slots: [
{
name: 'mining_machines',
issuer: "矿机的唯一标识",
id: "在整个NFT集合中的 id",
metadata: "ipfs://XXX",
properties: [
{
name: 'fuel_consumption',
value: 12333,
},
{
name: 'power',
value: 142,
},
{
name: 'fuel_consumption',
value: 12333,
},
{
name: 'power',
value: 142,
}
],
collection: [
{
id: "在整个NFT集合中的 id",
metadata: "ipfs://XXX",
properties: [
{
name: 'fuel_consumption',
value: 12333,
},
{
name: 'power',
value: 142,
},
{
name: 'fuel_consumption',
value: 12333,
},
{
name: 'power',
value: 142,
}
],
}
]
}
]
}
],
}
]
}
let nft = {
"issuer": {
"type": "string",
"description": "NFTs 的发行方唯一标识"
},
"id": {
"type": "string",
"description": "NFT 在发行方中的唯一标识"
},
"owner": {
"type": "string",
"description": "NFT 的所有权,它可以是一个合约地址"
},
"vest": {
"type": "string",
"description": "归属于另一个 NFT"
},
"metadata": {
"type": "string",
"description": "描述性资源地址,HTTP(s) / IPFS URI 等"
},
"protocol": {
"type": "string",
"description": "该 NFT 采用的协议,格式为 协议名称:协议合约地址,地址可省略"
},
"properties": {
"type": "array",
"description": "NFT 的属性集",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "属性名称"
},
"data": {
"type": "integer" | "string" | "array",
"description": "属性的值"
},
"slot": {
"type": "array",
"description": "插槽,可插入另一个 NFT",
"items": {
"$ref": "#"
}
}
},
}
}
}
let avatar = {
"issuer": "0x9ab5f62aaab8813c67d895901b8d4eba34461445",
"id": "12",
"metadata": "ipfs://XXX",
"owner": '0xas2443544assd12092ad1028285549',
"properties": [
{
"name": 'hat',
"value": 133,
"slot": [],
},
{
"name": 'hair',
"value": 654,
"slot": [],
},
{
"name": 'renderer',
"value": '',
"slot": [
{
"issuer": "0x21a31ee1afc51d94c2efccaa2092ad1028285549",
"id": "29",
"metadata": "ipfs://XXX",
"protocol": 'avatarimage',
"properties": [
{
"name": "uri",
"value": "ipfs://XXX",
"slot": [],
}
],
}
],
}
],
}
let avatar_contract = {
"properties": [
{
"name": "hat",
"data": 0,
"rule": {
"variable": "immut",
"slot": {}
}
},
{
"name": "hair",
"data": 0,
"rule": {
"variable": "immut",
"slot": {}
}
},
{
"name": "renderer",
"data": 0,
"rule": {
"variable": "protocol",
"slot": {
"whitelist": ["0x21a31ee1afc51d94c2efccaa2092ad1028285549"],
"protocol": {
"name": "3davatar",
"params": []
}
}
}
},
]
}
let unit = {
issuer: "发行方标识,这应该是一个合约地址。",
id: "在整个NFT集合中的 id",
metadata: "ipfs://XXX",
protocol: 'avatar_1_1:xxxxx',
vest: '上级NFT',
owner: '',
author: "",
properties: {
gold: {
value: "",
slot: {
renderer: [],
default: [],
}
}
},
}
let contract = {
"issuer": "INFTs 的发行方唯一标识",
"author": "",
"owner": "eth:发行用户地址、合约等等",
"metadata": "",
"protocol": 'apple:合约地址',
"properties": [
{
"name": {
"value": "默认数据",
"rules": {
"variable": "数据可变性质:不可变、总额恒定、自定义、消耗",
"slot": {
"whitelist?": [],
"protocol?": ["5", "98"]
}
}
}
}
]
}
// 发行方
let is = {
"type": "object",
"properties": {
"max": {
"type": "integer",
"description": "NFT 的最大发行数量"
},
"issuer": {
"type": "string",
"description": "INFTs 的发行方唯一标识"
},
"owner": {
"type": "string",
"description": "发行方的所有权,它可以是一个合约地址"
},
"metadata": {
"type": "string",
"description": "描述性资源地址,HTTP(s) / IPFS URI 等"
},
"protocol": {
"type": "string",
"description": "该 NFT 采用的协议,格式为 协议名称:协议合约地址,地址可省略"
},
"properties": {
"type": "array",
"description": "NFT 的属性集规则",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "属性名称,需与协议中保持一致"
},
"data": {
"type": "integer" | "string" | "array",
"description": "属性的默认值"
},
"rules": {
"type": "array",
"description": "该属性应遵循的规则",
"items": {
"type": "object",
"properties": {
"variable": {
"type": "string",
"enum": ["immut", "conserves", "consume", "auto"],
"description": "该属性的数据变化限制"
},
"slot": {
"type": "object",
"description": "插槽规则",
"properties": {
"whitelist": {
"type": "array",
"description": "允许添加进该 NFT 的发行发集合,[]则是不允许,[" * "]则是不限制",
"items": {
"type": "string",
"description": "允许添加进该 NFT 插槽的合约地址",
},
},
"protocol": {
"type": "object",
"description": "该插槽采用的协议以及与协议交互的数据",
"properties": {
"name": {
"type": "string",
"description": "属性协议,为空则使用默认,格式为协议名称:协议合约地址,地址可省略",
},
"params": {
"type": "array",
"description": "提交给协议合约的参数集",
}
}
}
}
},
},
"required": ["variable", "slot"]
}
},
},
"required": ["name", "data", "rules"]
}
},
"required": ["max", "issuer", "owner", "metadata"]
}
}
console