APIP3V1_CIDInfomation(zh-CN)



  • APIP3: CIDInfo
    Version: 1
    Language: zh-CN
    Author: C_armX
    Status: draft
    Created date: 2021-10-30
    Update: 2021-11-28
    File hash: ""
    TXid: 
    

    APIP3V1_CIDInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    [1. CID信息接口](#1. CID信息接口)

    [2. 批量CID信息接口](#2. 批量CID信息接口)

    [3. CID历史接口](#3. CID历史接口)

    [4. Homepage历史接口](#4. Homepage历史接口)

    [5. NoticeFee历史接口](#5. NoticeFee历史接口)

    [6. CID搜索接口](#6. CID搜索接口)


    Type: APIP
    SerialNumber: 3
    ProtocolName: CIDInfo
    Version: 1
    Description : CID的主要信息.
    Author: C_armX
    Language: zh-CN
    tags: APIP, API, CID, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供CID相关的主要信息。

    2. 本协议接口的数据来源遵循以下协议:

      • cid:《FEIP3_CID》
      • homepage:《FEIP26_Homepage》
      • noticeFee:《FEIP27_NoticeFee》
      • master:《FEIP6_Master》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

    requester的地址: FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥: 030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥: L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey: d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    api URL: https://www.sign.cash/api/
    

    1. CID信息接口

    名称

    cidInfo

    说明

    获取cid的地址、公钥、url、noticeFee和master等信息

    请求参数

    name type description
    address string FCH address
    cid string

    查询address或cid,不可同时查询。

    • 示例

    查询FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX的cid信息。

    参数

    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/cidInfo?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/cidInfo?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/cidInfo?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/cidInfo
    
    - unsignedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfo"}
    
    - sign = sha256(sha256({"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfo","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfo","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    address string FCH address
    cid string CID of the address
    publicKey string Public key of the address.
    url string Homepage declared on the chain based on "FEIP26_Homepage".
    noticeFee uint Notice fee declared on the chain based on "FEIP27_NoticeFee" in unit of satoshi.
    master string Master declared on the chain based on "FEIP6_Master".
    height uint The latest block height when getting the data.
    • 示例
    
    {
        "address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
        "cid": "F_Gzts",
        "publicKey":"03c1c6b2c2a473ffa0cf92a11ffd0196414078e1a454d69e0a996aaca6ec953ad0",
        "url": "https://cid.cash/html/others/cid.html?cid=C_armX",
        "noticeFee":10000,
        "master":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
        "height": 963667
    }
    
    排序、压缩、签名后:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","cid":"F_Gzts","height":963667,"master":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","noticeFee":10000,"publicKey":"03c1c6b2c2a473ffa0cf92a11ffd0196414078e1a454d69e0a996aaca6ec953ad0","url":"https://cid.cash/html/others/cid.html?cid=C_armX","sign":"b7428789a9109115f248fdd780ee08e20a1bc3c6d3ba7ce6e4127efdf2abeb56"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    3000 The address has not registed CID. 该地址尚未注册cid address
    3001 The address has unregisted its CID. 该地址已注销cid address
    3002 The CID has been unregisted. 该cid已被注销。 cid
    3003 Cannot query address and CID at the same time. 不能同时查询address和cid. signedRequest
    • 示例
    {
        "code":2000,
        "msg":"The address has not been used.",
        "data":{
            "address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX"
        }
    }
    

    2. 批量cid信息接口

    名称

    cidInfoList

    说明

    批量获取cid信息。

    请求参数

    name type description
    addressList string array FCH address list
    cidList string array cid list

    addressList和cidList不可同时查询。

    • 示例

    查询FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX,FEk41Kqjar45fLDriztUDTUkdki7mmcjWK,FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z的cid信息。

    参数

    {
    	"addressList": ["FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX", "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK", "FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z"],
    	"timestamp": 1635513688254
    }
    

    GET

    
    - unsignedRequest:
    
    https://www.sign.cash/api/cidInfoList?addressList=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&addressList=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&addressList=FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/cidInfoList?addressList=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&addressList=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&addressList=FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=49815b346241f9cb827e7249eb684aa09f02b99d52399885b456c943d236cfc2
    
    - signedRequest:
    
    https://www.sign.cash/api/cidInfoList?addressList=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&addressList=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&addressList=FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=49815b346241f9cb827e7249eb684aa09f02b99d52399885b456c943d236cfc2
    

    POST

    - URL:https://www.sign.cash/api/cidInfoList
    
    - unsignedRequest:
    
    {"addressList":["FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfoList"}
    
    - sign = sha256(sha256({"addressList":["FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=c85c829b23086a4bb2034db51fce014fb88f263d84f99ca22a1c75bafdcd1228
    
    - signedRequest:
    
    {"addressList":["FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/cidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"c85c829b23086a4bb2034db51fce014fb88f263d84f99ca22a1c75bafdcd1228"}
    

    响应参数

    name type description
    cidInfoList object All "FEIP27_NoticeFee" declaration records of this address or cid.See below
    height uint The latest block height when getting the data.
    • cidInfoList
    name type description
    address string FCH address
    cid string CID of the address
    master string Master declared on the chain based on "FEIP6_Master".
    noticeFee uint Notice fee declared on the chain based on "FEIP27_NoticeFee" in unit of satoshi.
    publicKey string Public key of the address.
    url string Homepage declared on the chain based on "FEIP26_Homepage".
    • 示例
    
    {
    	"cidInfoList": [{
    			"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    			"cid": "C_armX",
    			"master": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"noticeFee": 1000,
    			"publicKey": "03c1c6b2c2a473ffa0cf92a11ffd0196414078e1a454d69e0a996aaca6ec953ad0",
    			"url": "https://cid.cash/html/others/cid.html?cid=C_armX"
    		},
    		{
    			"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"cid": "春花_cjWK",
    			"master": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    			"noticeFee": 0,
    			"publicKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"url": "https://cid.cash/html/others/cid.html?cid=春花_cjWK"
    		},
    		{
    			"address": "FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z",
    			"cid": "清欢渡_Pi7Z",
    			"master": "FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z",
    			"noticeFee": 10000,
    			"publicKey": "030c9081297c8b348dc7b0957b3ff12527817887fa2f55e4dc59c17edd2a3e4407",
    			"url": "https://cid.cash/html/others/cid.html?cid=清欢渡_Pi7Z"
    		}
    	],
    	"height": 963667
    }
    
    
    排序、压缩、签名后:
    
    {"cidInfoList":[{"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","cid":"C_armX","master":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","noticeFee":1000,"publicKey":"03c1c6b2c2a473ffa0cf92a11ffd0196414078e1a454d69e0a996aaca6ec953ad0","url":"https://cid.cash/html/others/cid.html?cid=C_armX"},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","cid":"春花_cjWK","master":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","noticeFee":0,"publicKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","url":"https://cid.cash/html/others/cid.html?cid=春花_cjWK"},{"address":"FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z","cid":"清欢渡_Pi7Z","master":"FT7P7SxogDhx3eSpFGqCsjnFNaMcfwPi7Z","noticeFee":10000,"publicKey":"030c9081297c8b348dc7b0957b3ff12527817887fa2f55e4dc59c17edd2a3e4407","url":"https://cid.cash/html/others/cid.html?cid=清欢渡_Pi7Z"}],"height":963667,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    3004 Too many addresses are requested. 请求的地址数量太多。 maxAddress
    3005 Address and cid cannot be queried at the same time 地址和cid不可同时查询。 signedRequest
    • 示例
    {
        "code":3004,
        "msg":"Too many addresses are requested.",
        "data":{
            "maxAddress":100
        }
    }
    

    3. cid历史接口

    名称

    cidHistory

    说明

    获取按照《FEIP3_CID》上链的cid操作历史信息。

    请求参数

    |name|type|description|required|
    |:---|:---|:---|
    |address|string|FCH address|N|
    |cid|string||N|
    |count|uint|How many entries are wanted in a single request.|N|
    |sequence|uint|Sequence in continuous request.Start from 0.|N|

    查询address或cid,不可同时查询,cid包括已注销的。

    • 示例

    第2批查询20条FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX的所有cid操作历史信息。

    参数

    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/cidHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&count=20&sequence=1&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/cidHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&count=20&sequence=1&timestamp=1635513688254))=0000000000011111111111111111111111111111122222222222222222222222
    
    - signedRequest:
    
    https://www.sign.cash/api/cidHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&count=20&sequence=1&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=0000000000011111111111111111111111111111122222222222222222222222
    

    POST

    - URL:https://www.sign.cash/api/cidHistory
    
    - unsignedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","count":20,"sequence":1,"timestamp":"1635513688254","url":"https://www.sign.cash/api/cidHistory"}
    
    - sign = sha256(sha256({"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","count":20,"sequence":1,"timestamp":"1635513688254","url":"https://www.sign.cash/api/cidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=d5b80202ad2a439219b48ba335c36efb14b335dc519b3797e1f60a0f7f6e8ad0
    
    - signedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","count":20,"sequence":1,"timestamp":"1635513688254","url":"https://www.sign.cash/api/cidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"d5b80202ad2a439219b48ba335c36efb14b335dc519b3797e1f60a0f7f6e8ad0"}
    

    响应参数

    name type description
    address string FCH address
    opList object All "FEIP3_CID" operation records of this address or cid.See below
    height uint The latest block height when getting the data.
    • opList
    name type description
    block uint The height of the block where the transaction is written
    cid string Registered or cancelled cid
    op string The operation
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    • 示例
    
    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"height": 963667,
    	"opList": [{
    			"block": 963002,
    			"cid": "C_armX",
    			"op": "register",
    			"txid": "dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153",
    			"txTimestamp": 1635513688254
    		},
    
    
    		{
    			"block": 962842,
    			"cid": "carm_armX",
    			"op": "unregister",
    			"txid": "4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61",
    			"txTimestamp": 1635512348343
    		},
    
    
    		{
    			"block": 928330,
    			"cid": "carm_armX",
    			"op": "register",
    			"txid": "616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead",
    			"txTimestamp": 1634503342324
    		}
    	]
    }
    
    排序、压缩、签名后:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","height":963667,"opList":[{"block":963002,"cid":"C_armX","op":"register","txTimestamp":"1635513688254","txid":"dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153"},{"block":962842,"cid":"carm_armX","op":"unregister","txTimestamp":"1635512348343","txid":"4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61"},{"block":928330,"cid":"carm_armX","op":"register","txTimestamp":"1634503342324","txid":"616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    3000 The address has not registed CID. 该地址尚未注册cid address
    3003 Cannot query address and CID at the same time. 不能同时查询address和cid. signedRequest
    • 示例
    {
        "code":2000,
        "msg":"The address has not been used.",
        "data":{
            "address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX"
        }
    }
    

    4. Homepage历史

    名称

    homepageHistory

    说明

    获取按照《FEIP26_Homepage》声明的cid的url历史信息。

    请求参数

    name type description
    address string FCH address
    count uint How many entries are wanted in a single request.
    sequence uint Sequence in continuous request.Start from 0.
    • 示例

    查询FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX链上声明的homepage,即url的所有历史操作信息。

    参数

    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/homepageHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/homepageHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=5a8e98f851dc296c793f0bb43e5c69d1485fa51769ec53caeb7a3a7613f1ecce
    
    - signedRequest:
    
    https://www.sign.cash/api/homepageHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=5a8e98f851dc296c793f0bb43e5c69d1485fa51769ec53caeb7a3a7613f1ecce
    

    POST

    - URL:https://www.sign.cash/api/homepageHistory
    
    - unsignedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/homepageHistory"}
    
    - sign = sha256(sha256({"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/homepageHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=bdb03413b5e4781cff96b178c509d24f8e0f261a5ce33bfb8b1e29d3324157a1
    
    - signedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/homepageHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"bdb03413b5e4781cff96b178c509d24f8e0f261a5ce33bfb8b1e29d3324157a1"}
    

    响应参数

    name type description
    address string FCH address
    opList object All "FEIP26_Homepage" operation records of this address or cid.See below
    height uint The latest block height when getting the data.
    • opList
    name type description
    txid string The txid of this transaction
    op string The operation
    url string Registered or updated url
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
    
    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"opList": [{
    			"txid": "dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153",
    			"op": "unregister",
    			"url": "http://111.229.195.222:8888",
    			"txTimestamp": 1635513688254,
    			"block": 963002
    		},
    
    		{
    			"txid": "4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61",
    			"op": "update",
    			"url": "http://111.229.195.222:8888",
    			"txTimestamp": 1635512348343,
    			"block": 9628342
    		},
    
    		{
    			"txid": "616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead",
    			"op": "register",
    			"url": "https://www.sign.cash/",
    			"txTimestamp": 1634503342324,
    			"block": 928330
    		}
    
    	],
    	"height": 963667
    }
    
    排序、压缩、签名后:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","height":963667,"opList":[{"block":963002,"op":"unregister","txTimestamp":"1635513688254","txid":"dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153","url":"http://111.229.195.222:8888"},{"block":9628342,"op":"update","txTimestamp":"1635512348343","txid":"4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61","url":"http://111.229.195.222:8888"},{"block":928330,"op":"register","txTimestamp":"1634503342324","txid":"616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead","url":"https://www.sign.cash/"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    3006 The address has not registed homepage. 该地址尚未注册主页 address
    • 示例
    {
        "code":2000,
        "msg":"The address has not been used.",
        "data":{
            "address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX"
        }
    }
    

    5. noticeFee历史

    名称

    noticeFeeHistory

    说明

    获取按照《FEIP27_NoticeFee》声明的cid的noticeFee历史信息。

    请求参数

    name type description
    address string FCH address
    count uint How many entries are wanted in a single request.
    sequence uint Sequence in continuous request.Start from 0.
    • 示例

    查询FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX链上声明的noticeFee所有历史操作信息。

    参数

    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/noticeFeeHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/noticeFeeHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=bfbf976316f4c36e8510c76e6fa787b195988710eef5745758b8fb6bf4bef57c
    
    - signedRequest:
    
    https://www.sign.cash/api/noticeFeeHistory?address=FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=bfbf976316f4c36e8510c76e6fa787b195988710eef5745758b8fb6bf4bef57c
    

    POST

    - URL:https://www.sign.cash/api/noticeFeeHistory
    
    - unsignedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/noticeFeeHistory"}
    
    - sign = sha256(sha256({"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/noticeFeeHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=b9dc34a0a814a1a326cefbaa8668a2518a01a36819794f5bfedab45120955e54
    
    - signedRequest:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","timestamp":1635513688254,"url":"https://www.sign.cash/api/noticeFeeHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"b9dc34a0a814a1a326cefbaa8668a2518a01a36819794f5bfedab45120955e54"}
    

    响应参数

    name type description
    address string FCH address
    feeList object All "FEIP27_NoticeFee" declaration records of this address or cid.See below
    height uint The latest block height when getting the data.
    • feeList
    name type description
    txid string The txid of this transaction
    noticeFee uint64 Amount of the notice fee declared in unit of satoshi.
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
    
    {
    	"address": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    	"feeList": [{
    			"txid": "dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153",
    			"noticeFee": 100000,
    			"txTimestamp": 1635513688254,
    			"block": 963002
    		},
    		{
    			"txid": "4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61",
    			"noticeFee": 10000,
    			"txTimestamp": 1635512348343,
    			"block": 9628342
    		},
    		{
    			"txid": "616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead",
    			"noticeFee": 1000,
    			"txTimestamp": 1634503342324,
    			"block": 928330
    		}
    
    	],
    	"height": 963667
    }
    
    排序、压缩、签名后:
    
    {"address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","feeList":[{"block":963002,"noticeFee":100000,"txTimestamp":"1635513688254","txid":"dc339b7aed07d0e04905ad5c647c936da8b7bbc9b89d0aface18970fdd5fe153"},{"block":9628342,"noticeFee":10000,"txTimestamp":"1635512348343","txid":"4d58e21511145cbb949d8b499398dae12287164a35af24cdbbff203390600d61"},{"block":928330,"noticeFee":1000,"txTimestamp":"1634503342324","txid":"616e80f09ca67974fd1c79919a451ced8a9f3d24c83437aa439b8f259be16ead"}],"height":963667,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    3007 The address has not declared notice fee. 该地址尚未声明通知费 address
    • 示例
    {
        "code":2000,
        "msg":"The address has not been used.",
        "data":{
            "address":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX"
        }
    }
    

    6. CID搜索接口

    名称

    cidSearch

    说明

    模糊搜索cid,不区分大小写。

    请求参数

    name type description
    searchContent string Text searched in the cid field
    • 示例

    查询包含”arm“的cid。

    参数

    {
    	"searchContent": "arm",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/cidSearch?searchContent=arm&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/cidSearch?searchContent=arm&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=
    951cf8e70506b3934aaad6a4d196041979d1a9ec6727b0f6c3f7e4c132608eee
    
    - signedRequest:
    
    https://www.sign.cash/api/cidSearch?searchContent=arm&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=
    951cf8e70506b3934aaad6a4d196041979d1a9ec6727b0f6c3f7e4c132608eee
    

    POST

    - URL:https://www.sign.cash/api/cidSearch
    
    - unsignedRequest:
    
    {"searchContent":"arm","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidSearch"}
    
    - sign = sha256(sha256({"searchContent":"arm","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=132380a40d6bf911092ee0dbee4cadf01ece764194c97b6ff5eb0197ec9d368a
    
    - signedRequest:
    
    {"searchContent":"arm","timestamp":1635513688254,"url":"https://www.sign.cash/api/cidSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"132380a40d6bf911092ee0dbee4cadf01ece764194c97b6ff5eb0197ec9d368a"}
    

    响应参数

    name type description
    cidList string array The list inclouding the value of searchContent. Not case sensitive.
    height uint The latest block height when getting the data.
    • 示例
    
    {
        "cidList": ["C_armX","farm_ei27"],
        "height": 963667
    }
    
    排序、压缩、签名后:
    
    {"cidList": ["C_armX","farm_ei27"],"height": 963667,"sign":"5599b8810c02f3bfc7093dec585a13eade854a392930d346c4548e1dba4868f8"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    3008 No cid containing this string was found. 没有发现包含此字符串的cid searchContent
    • 示例
    {
        "code":3008,
        "msg":"No cid containing this string was found.",
        "data":{
            "searchContent":"arm"
        }
    }
    

Log in to reply