Publication
Content
发布内容
function post(string memory content) external;
提供预生成的tokenId和待发布内容的Arweave哈希,生成一个SBT。实际内容存放在Arweave上,将Arweave交易哈希作为内容记录在链上
参数:
content: 发布的内容对应的Arweave交易哈希,可通过此交易哈希访问到原始发布内容
上传至Arweave的内容格式如下:
{
"content": {
"body": "${The body of content}",
"title": "${The title of content}"
}
}
查询发布内容
function contentOf(uint256 tokenId) external view returns (string memory content);
根据tokenId查询关联的发布内容
参数:
tokenId
返回:
content: 发布的内容对应的Arweave交易哈希,可通过此交易哈希访问到原始发布内容
PrivacyContent
预生成tokenId
function prepareToken() external returns (uint256);
用户预生成一个tokenId
返回:
tokenId: 预生成的tokenId
查询持有的预生成tokenId
function ownedPrepareToken(address owner) external view returns (uint256);
参数:
owner: 被查询的地址
返回:
tokenId: 预生成的tokenId
发布隐私内容
function post(uint256 tokenId, string memory content) external;
提供预生成的tokenId和待发布内容的Arweave哈希,生成一个SBT。实际隐私内容以及许可条件存放在Arweave上,将Arweave交易哈希作为内容记录在链上
参数:
tokenId: 预生成的tokenId
content: 隐私内容以及许可条件对应的Arweave交易哈希,可通过此交易哈希访问到原始发布内容
上传至Arweave的内容格式如下:
{
"encryptionBy": "lit-protocol",
"accessCondition": [
{
"contractAddress": "${The contract address of Semantic SBT}",
"standardContractType": "ERC721",
"chain": "polygon",
"method": "isViewerOf",
"parameters": [
":userAddress",
"${The tokenId}"
],
"returnValueTest": {
"comparator": "=",
"value": true
}
}
],
"encryptedSymmetricKey": "${A hex string that LIT will use to decrypt your content as long as you satisfy the conditions}",
// encrypted content
"encryptedObject": "${The encrypted content}"
}
是否具备查看权限
function isViewerOf(address viewer, uint256 tokenId) external view returns (bool);
查询某个地址是否具备tokenId对应的隐私数据的查看权限。
参数:
viewer: 查看者的地址
tokenId
返回:
isViewer: true--具备查看权限;false--不具备查看权限
查询发布内容
function contentOf(uint256 tokenId) external view returns (string memory content);
根据tokenId查询关联的发布内容
参数:
tokenId
返回:
content: 发布的内容对应的Arweave交易哈希,可通过此交易哈希访问到原始发布内容
Last updated