直达内容

获取 NFT Outputs

GET /collectibles/outputs

API 端点 URL

 https://api.mixin.one/collectibles/outputs?state=:state&offset=:offset&limit=:limit&members=:members&threshold=:threshold

授权和其他选项

授权
Authorized
限制No limitation

参数

state可选, UTXO 状态, 例如 unspent, signed, and spent.
offset可选, 开始时间, RFC3339Nano 格式, 例如 `2020-12-12T12:12:12.999999999Z`.
limit可选, 分页条数限制, 默认 500 , 最大 500
members需要跟 threshold 一起使用, 多签成员的 hash 值
threshold需要跟多签成员的 hash 值一起使用, 比如 2/3, threshold 是 2

以下是生成多签成员 hash 的 Golang 示例。

func hashMembers(ids []string) string {
sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] })
var in string
for _, id := range ids {
in = in + id
}
return crypto.NewHash([]byte(in)).String()
}

请求示例

curl -i -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/collectibles/outputs?limit=500&offset=2006-01-02T15:04:05.999999999Z&state=spent

{
"data": {
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"output_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"token_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"transaction_hash": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"output_index": 0,
"amount": "",
"senders_threshold": 1,
"senders": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"receivers_threshold": 2,
"receivers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"state": "spent",
"created_at": "2018-05-03T10:08:34.859542588Z",
"updated_at": "2018-05-03T10:08:34.859542588Z",
"signed_by": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"signed_tx": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
}
}

只有 statesigned 的时候, signed_txsigned_by 才会有值。

GET /collectibles/tokens/UUID

获取单个 NFT 的信息

API 端点 URL

 https://api.mixin.one/collectibles/tokens/UUID

请求示例

curl -i -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/collectibles/tokens/ab56be4c-5b20-41c6-a9c3-244f9a433f35
{
"data": {
"type": "non_fungible_token",
"token_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"group": "",
"token": "",
"mixin_id": "",
"nfo": "",
"meta": {
"group": "",
"name": "",
"description": "",
"icon_url": "",
"media_url": "",
"mime": "",
"hash": "",
},
"created_at": "2018-05-03T10:08:34.859542588Z",
}
}

GET /collectibles/collections/UUID

获取整个 NFT 的集合信息

API 端点 URL

 https://api.mixin.one/collectibles/collections/UUID

请求示例

curl -i -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/collectibles/collections/ab56be4c-5b20-41c6-a9c3-244f9a433f35
{
"data": {
"type": "collection",
"collection_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"name": "",
"description": "",
"icon_url": "",
"created_at": "2018-05-03T10:08:34.859542588Z",
}
}