Mixin Inscription API
本篇我们主要介绍 inscription 相关的 API 调用,关于 Inscription 的部署跟铭记,可以参考该协议: https://github.com/MixinNetwork/mixin/blob/master/INSCRIPTION.md
默认情况下,交易的 memo 长度是 256 byte, 所以 inscription 的部署需要用到 Mixin Object Storage, 相关的内容可以参考:https://github.com/MixinNetwork/mixin/blob/master/STORAGE.md
信息
- 如何区分普通交易跟铭文交易, 在 Safe 相关文档中, 如果有
inscription_hash
字段代表,这是一笔铭文交易 - 铭文交易是以 utxo 的形式出现的,如果要交易藏品,必须要完整的花费整个的 output, 也就是交易只能有一个 intput, 跟 output。
- 如果不小心释放了藏品,也可以通过交易占用回来, 具体看上面的 Inscription 文档
Inscription 主要包含两部分:
- 藏品的集合, 包含的图片跟币的相关信息
- 单个的藏品, 主要包含
获取集合信息
通过集合的交易 hash, 或者这个集合资产的 kernel_asset_id 来获取集合的详细信息
API 端点 URL
GET https://api.mixin.one/safe/inscriptions/collections/:hash
Response
{
"data": [
{
"type": "COLLECTION-TYPE",
"collection_hash": "HASH-VALUE",
"supply": "SUPPLY-NUMBER",
"unit": "UNIT-NAME",
"symbol": "SYMBOL",
"name": "COLLECTION-NAME",
"description": "DESCRIPTION-TEXT",
"icon_url": "URL",
"treasury": {
"ratio": "RATIO-VALUE",
"recipient": "RECIPIENT-ADDRESS"
},
"asset_key": "ASSET-KEY",
"created_at": "RFC3339NANO-TIMESTAMP",
"updated_at": "RFC3339NANO-TIMESTAMP"
}
]
}
获取藏品信息
通过 inscription hash 来获取藏品的详情
API 端点 URL
GET https://api.mixin.one/safe/inscriptions/items/:hash
Response
{
"data": [
{
"type": "ITEM-TYPE",
"inscription_hash": "HASH-VALUE",
"collection_hash": "COLLECTION-HASH-VALUE",
"sequence": SEQUENCE-NUMBER,
"content_type": "CONTENT-TYPE",
"content_url": "CONTENT-URL",
"recipient": "RECIPIENT-ADDRESS",
"occupied_by": "OCCUPIED-BY-ADDRESS",
"created_at": "RFC3339NANO-TIMESTAMP",
"updated_at": "RFC3339NANO-TIMESTAMP"
}
]
}