APIP5V1_ProtocolInfo(zh-CN)



  • APIP5:ProtocolInfo
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-11-20
    Update:2021-11-28
    Filehash:""
    TXid:
    

    APIP5V1_ProtocolInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.PID详情接口

    2.协议搜索接口

    3.协议历史接口

    4.协议评价列表接口


    Type:APIP
    SerialNumber:5
    ProtocolName:ProtocolInfo
    Version:1
    Description:定义协议信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP,API,Protocol, 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. 本协议接口提供链上注册的各种协议的相关信息。

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

      • 《FEIP1_FreeProtocol》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

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

    1.PID详情接口

    名称

    pidInfoList

    说明

    给定一个或多个PID获取相应协议详情。

    请求参数

    name type description
    pidList string array

    *示例

    查询pid为2222200000000000111111111111111111111111222222222222222222233333和3333300000000000111111111111111111111111222222222222222222233333的协议最新详情。

    参数

    {
    	"pidList": ["2222200000000000111111111111111111111111222222222222222222233333","3333300000000000111111111111111111111111222222222222222222233333],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/pidInfoList?pid=2222200000000000111111111111111111111111222222222222222222233333&pid=3333300000000000111111111111111111111111222222222222222222233333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/pidInfoList?pid=2222200000000000111111111111111111111111222222222222222222233333&pid=3333300000000000111111111111111111111111222222222222222222233333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/pidInfoList?pid=2222200000000000111111111111111111111111222222222222222222233333&pid=3333300000000000111111111111111111111111222222222222222222233333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/pidInfoList
    
    - unsignedRequest:
    
    {"pidList": ["2222200000000000111111111111111111111111222222222222222222233333","3333300000000000111111111111111111111111222222222222222222233333],"timestamp":1635513688254,"url":"https://www.sign.cash/api/pidInfoList"}
    
    - sign =sha256(sha256({"pidList":["2222200000000000111111111111111111111111222222222222222222233333","3333300000000000111111111111111111111111222222222222222222233333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/pidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"pidList":["2222200000000000111111111111111111111111222222222222222222233333","3333300000000000111111111111111111111111222222222222222222233333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/pidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    pidInfoList object See below.
    height uint The latest block height when getting the data.
    • pidInfoList
    name type description key in FEIP1
    pid string The ID of the protocol,that is,the double sha256 value of the protocol file. data.pid
    type string The type of the protocol, such as"FEIP". data.type
    sn string The serial number in this type of protocol. data.sn
    ver string The version of the protocol. data.ver
    name string The name of the protocol. data.name
    lang string The language of the protocol being registered, formatted with i18n(internationalization), such as "en-US". data.lang
    title string Makeup by:type+sn+"V"+ver+'_'+name+'('+language+')',such as:FEIP3V4_CID(en-US)
    desc string Thedescriptionoftheprotocol. data.desc
    authors string The authors of the protocol. data.authors
    tags stringarray Tags about the protocol data.tags
    prePid string Double sha256 value of the previous version protocol file. data.prePid
    fileUrl string array Locations to find the protocol file. data.fileUrl
    signer string The signer of the first input of the transaction in which the protocol was first published.
    firstTxid string The txid of the transaction in which the protocol was first published.
    firstTime timeStamp The timeStamp of the transaction in which the protocol was first published.
    lastTxid string The txid of the last operation of the protocol.
    lastTime timeStamp The transaction timestamp of the last operation of the protocol.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the protocol in effect.
    • 示例
      响应pid为2222200000000000111111111111111111111111222222222222222222233333和3333300000000000111111111111111111111111222222222222222222233333的协议最新详情。
    {
    	"pidInfoList": [{
    			"pid": "2222200000000000111111111111111111111111222222222222222222233333",
    			"type": "FEIP",
    			"sn": "3",
    			"ver": "4",
    			"name": "CID",
    			"lang": "zh-CN",
    			"title": "FEIP3V4_CID(zh-CN)",
    			"desc": "Register or unregister a human friendly identity for an address.",
    			"authors": ["FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv", "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy", "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash"],
    			"tags": ["FEIP", "CID", "identity", "human friendly", "basic protocol"],
    			"prePid": "bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2",
    			"fileUrl": ["https://github.com/freecashorg/FEIP/FEIP3_CID/"],
    			"firstTxid": "dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    		{
    			"pid": "3333300000000000111111111111111111111111222222222222222222233333",
    			"type": "FEIP",
    			"sn": "6",
    			"ver": "1",
    			"name": "Master",
    			"lang": "en-US",
    			"title": "FEIP6V1_Master(en-US)",
    			"desc": "An address authorize another address as its master.",
    			"authors": "C_armX",
    			"tags": ["FEIP", "Authorization", "Master"],
    			"prePid": "",
    			"fileUrl": "https://bbs.cash/topic/565/feip6v6_master-en-us",
    			"firstTxid": "3333300000000000111111111111111111111111222222222222222222233333",
    			"signer": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    			"firstTime": 1619261292,
    			"lastTxid": "3333300000000000111111111111111111111111222222222222222222233333",
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"height":989430,"pidInfoList":[{"authors":["FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy"],"desc":"Register or unregister a human friendly identity for an address.","fileUrl":["https://github.com/freecashorg/FEIP/FEIP3_CID/"],"firstTime":1610261291,"firstTxid":"dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715","lang":"zh-CN","lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","name":"CID","pid":"2222200000000000111111111111111111111111222222222222222222233333","prePid":"bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","sn":"3","status":1,"tCdd":12300000,"tRate":4.65,"tags":["CID","FEIP","basic protocol","human friendly","identity"],"title":"FEIP3V4_CID(zh-CN)","type":"FEIP","ver":"4"},{"authors":"C_armX","desc":"An address authorize another address as its master.","fileUrl":"https://bbs.cash/topic/565/feip6v6_master-en-us","firstTime":1619261292,"firstTxid":"3333300000000000111111111111111111111111222222222222222222233333","lang":"en-US","lastTime":1619261292,"lastTxid":"3333300000000000111111111111111111111111222222222222222222233333","name":"Master","pid":"3333300000000000111111111111111111111111222222222222222222233333","prePid":"","signer":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","sn":"6","status":1,"tCdd":221800,"tRate":4.12,"tags":["Authorization","FEIP","Master"],"title":"FEIP6V1_Master(en-US)","type":"FEIP","ver":"1"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    5000 These PIDs do not exist. 这些PID不存在。 missedPidList
    5001 Too many PIDs are requested. 请求的pid数量太多。 maxPidCount

    *示例

    {
    	"code": 5000,
    	"msg": "These SIDs do not exist.",
    	"data": {
    		"missedPidList": ["3333300000000000111111111111111111111111222222222222222222233333"]
    	}
    }
    

    2. 协议搜索接口

    名称

    protocolSearch

    说明

    按条件查询协议。

    请求参数

    name type description required
    filterTitle string Filter by title N
    filterAuthors string Filter by authors N
    filterType string Filter by the type of the protocol N
    filterLang string Filter by the language of the protocol N
    filterTags stringarray Filter by tags N
    filterPrePid string Filter by prePid N
    filterFileUrl string array Filter by fileUrl N
    filterSigner string Filter by the signer N
    filterFirstTxid string Filter by firstTxid N
    filterFirstTime string Filter by firstTime N
    filterLastTxid string Filter by lastTxid N
    filterLastTime string Filter by lastTime N
    filterTCdd string Filter by tCdd N
    filterTRate string Filter by tRate N
    filterStatus bool Sort by status N
    sortSigner string Sort by the signer N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by lastTime N
    sortTCdd string Sort by tCdd N
    sortTRate string Sort by tRate N
    sortStatus string Sort by status N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项类型为FEIP,语言为zh-CN,题目中包含“cid”,累计销毁币天tCdd大于1000的协议,结果按综合评分tRate排序。

    参数

    {
    	"filterType": "FEIP",
    	"filterLang": "zh-CN",
    	"filterTitle": "cid",
    	"filterTCdd": "1000-",
    	"sortTRate": "down",
        "count":20,
        "sequence":1,
    	"timestamp": 1635513688254,
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/protocolSearch?count=20&filterLang=zh-CN&filterTCdd=1000-&filterTitle=cid&filterType=FEIP&sequence=1&sortTRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/protocolSearch?count=20&filterLang=zh-CN&filterTCdd=1000-&filterTitle=cid&filterType=FEIP&sequence=1&sortTRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/protocolSearch?count=20&filterLang=zh-CN&filterTCdd=1000-&filterTitle=cid&filterType=FEIP&sequence=1&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/protocolSearch
    
    - unsignedRequest:
    
    {"count":20,"filterLang":"zh-CN","filterTCdd":"1000-","filterTitle":"cid","filterType":"FEIP","sequence":1,"sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch"}
    
    - sign =sha256(sha256({"count":20,"filterLang":"zh-CN","filterTCdd":"1000-","filterTitle":"cid","filterType":"FEIP","sequence":1,"sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterLang":"zh-CN","filterTCdd":"1000-","filterTitle":"cid","filterType":"FEIP","sequence":1,"sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    protocolList object See below.
    height uint The latest block height when getting the data.
    • protocolList
    name type description key in FEIP1
    pid string The ID of the protocol,that is,the double sha256 value of the protocol file. data.pid
    title string Makeup by:type+sn+"V"+ver+'_'+name+'('+language+')',such as:FEIP3V4_CID(en-US)
    desc string Thedescriptionoftheprotocol. data.desc
    tags stringarray Tags about the protocol data.tags
    fileUrl string array Locations to find the protocol file. data.fileUrl
    signer string The signer of the first input of the transaction in which the protocol was first published.
    firstTime timeStamp The timeStamp of the transaction in which the protocol was first published.
    lastTime timeStamp The transaction timestamp of the last operation of the protocol.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the protocol in effect.
    • 示例
      响应pid为2222200000000000111111111111111111111111222222222222222222233333的协议信息。
    {
    	"protocolList": [{
    			"pid": "2222200000000000111111111111111111111111222222222222222222233333",
    			"title": "FEIP3V4_CID(zh-CN)",
    			"desc": "Register or unregister a human friendly identity for an address.",
    			"tags": ["FEIP", "CID", "identity", "human friendly", "basic protocol"],
    			"fileUrl": ["https://github.com/freecashorg/FEIP/FEIP3_CID/"],
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    		{
    			"pid": "3333300000000000111111111111111111111111222222222222222222233333",
    			"title": "FEIP6V1_Master(en-US)",
    			"desc": "An address authorize another address as its master.",
    			"tags": ["FEIP", "Authorization", "Master"],
    			"fileUrl": "https://bbs.cash/topic/565/feip6v6_master-en-us",
    			"signer": "FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX",
    			"firstTime": 1619261292,
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"height":989430,"protocolList":[{"desc":"Register or unregister a human friendly identity for an address.","fileUrl":["https://github.com/freecashorg/FEIP/FEIP3_CID/"],"firstTime":1610261291,"lastTime":1636526891,"pid":"2222200000000000111111111111111111111111222222222222222222233333","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"tCdd":12300000,"tRate":4.65,"tags":["CID","FEIP","basic protocol","human friendly","identity"],"title":"FEIP3V4_CID(zh-CN)"},{"desc":"An address authorize another address as its master.","fileUrl":"https://bbs.cash/topic/565/feip6v6_master-en-us","firstTime":1619261292,"lastTime":1619261292,"pid":"3333300000000000111111111111111111111111222222222222222222233333","signer":"FMZsWGT5hEUqhnZhLhXrxNXXG6uDHcarmX","status":1,"tCdd":221800,"tRate":4.12,"tags":["Authorization","FEIP","Master"],"title":"FEIP6V1_Master(en-US)"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest

    *示例

    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/protocolSearch?count=20&filterLang=zh-CN&filterTCdd=1000-&filterTitle=cid&filterType=FEIP&sequence=1&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    3. 协议历史接口

    名称

    pidHistory

    说明

    查询某pid协议的所有历史操作记录,不包括data.op值为“rate”的记录。

    请求参数

    name type description required
    pid string Y
    sortTxTimestamp string Sort by txTimestamp N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项PID为2222200000000000111111111111111111111111222222222222222222233333的协议操作记录,按txTimestamp降序。

    参数

    {
    	"pid": "0000000000011111111111111111111111122222222222222222223333333",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/pidHistory?count=20&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/pidHistory?count=20&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/pidHistory?count=20&filteOp=rate&filterCdd=1000-&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/protocolSearch
    
    - unsignedRequest:
    
    {"count":20,"pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    pid string
    signer string The signer of the first input of the transaction in which the protocol was first published.
    title string Makeup by:type+sn+"V"+ver+'_'+name+'('+language+')',such as:FEIP3V4_CID(en-US)
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description
    op string The operation, "register", "unregister", or "update".
    type string The type of the protocol, such as"FEIP".
    sn string The serial number in this type of protocol.
    ver string The version of the protocol.
    name string The name of the protocol.
    lang string The language of the protocol being registered, formatted with i18n(internationalization), such as "en-US".
    desc string Thedescriptionoftheprotocol.
    authors string The authors of the protocol.
    tags stringarray Tags about the protocol
    prePid string Double sha256 value of the previous version protocol file.
    fileUrl string array Locations to find the protocol file.
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应pid为0000000000011111111111111111111111122222222222222222223333333的协议信息。
    {
    	"pid": "0000000000011111111111111111111111122222222222222222223333333",
    	"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"title": "FEIP3V4_CID(zh-CN)",
    	"opList ": [{
    			"op": "update",
    			"type": "FEIP",
    			"sn": "3",
    			"ver": "4",
    			"name": "CID",
    			"lang": "zh-CN",
    			"desc": "Register or unregister a human friendly identity for an address.",
    			"authors": ["FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv", "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy"],
    			"tags": ["FEIP", "CID", "basic protocol"],
    			"prePid": "bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2",
    			"fileUrl": ["https://bbs.cash/topic/537/feip3v4_cid-en-us"],
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"op": "update",
    			"type": "FEIP",
    			"sn": "3",
    			"ver": "4",
    			"name": "CID",
    			"lang": "zh-CN",
    			"desc": "Register or unregister a human friendly identity for an address.",
    			"authors": ["FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv", "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy", "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash"],
    			"tags": ["FEIP", "CID", "identity", "human friendly", "basic protocol"],
    			"prePid": "bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2",
    			"fileUrl": ["https://github.com/freecashorg/FEIP/FEIP3_CID/"],
    			"txid": "dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715",
    			"txTimestamp": 1610261291848,
    			"block": 988012
    		}
    	],
    
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"opList ":[{"authors":["FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy"],"block":989302,"desc":"Register or unregister a human friendly identity for an address.","fileUrl":["https://bbs.cash/topic/537/feip3v4_cid-en-us"],"lang":"zh-CN","name":"CID","op":"update","prePid":"bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2","sn":"3","tags":["CID","FEIP","basic protocol"],"txTimestamp":"1618832997321","txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","type":"FEIP","ver":"4"},{"authors":["FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy"],"block":988012,"desc":"Register or unregister a human friendly identity for an address.","fileUrl":["https://github.com/freecashorg/FEIP/FEIP3_CID/"],"lang":"zh-CN","name":"CID","op":"update","prePid":"bd0429aaf6d7784958a36473f2f925d8d2ca76125cc610adf2afb1956a1d56b2","sn":"3","tags":["CID","FEIP","basic protocol","human friendly","identity"],"txTimestamp":"1610261291848","txid":"dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715","type":"FEIP","ver":"4"}],"pid":"0000000000011111111111111111111111122222222222222222223333333","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","title":"FEIP3V4_CID(zh-CN)"},"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    5002 The PID does not exist. 该PID不存在。 pid

    *示例

    {
    	"code": 5002,
    	"msg": "The PID does not exist.",
    	"data": {
    		"pid": "0000000000011111111111111111111111122222222222222222223333333"
    	}
    }
    

    4. 协议评价列表接口

    名称

    pidRateList

    说明

    查询对某pid协议的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    pid string Y
    filterRate string Filter by data.rate N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Filter by txTimestamp N
    filterRater string Filter by the address of the first input of the rating transaction N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortRate string Sort by data.rate N
    sortRater string Sort by the address of the first input of the rating transaction N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项PID为0000000000011111111111111111111111122222222222222222223333333的协议的币天销毁大于1000的评分记录,按评分降序。

    参数

    {
    	"pid": "0000000000011111111111111111111111122222222222222222223333333",
    	"filterCdd": "1000-",
    	"sortRate": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/pidRateList?count=20&filterCdd=1000-&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/pidRateList?count=20&filterCdd=1000-&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111111110000000000000000000000222222
    
    - signedRequest:
    
    https://www.sign.cash/api/pidRateList?count=20&filterCdd=1000-&pid=0000000000011111111111111111111111122222222222222222223333333&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000222222
    

    POST

    - URL:https://www.sign.cash/api/protocolSearch
    
    - unsignedRequest:
    
    {"count":20,"filterCdd":"1000-","pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch"}
    
    - sign =sha256(sha256({"count":20,"filterCdd":"1000-","pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","url":"https://www.sign.cash/api/protocolSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterCdd":"1000-","pid":"0000000000011111111111111111111111122222222222222222223333333","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/protocolSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    pid string
    rateList object See below.
    height uint The latest block height when getting the data.
    • rateList
    name type description
    rater uint The address of the first input of the rating transaction
    rate uint
    cdd uint64
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应pid为0000000000011111111111111111111111122222222222222222223333333的协议信息。
    {
    	"pid": "0000000000011111111111111111111111122222222222222222223333333",
    	"rateList ": [{
    			"rater": "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy",
    			"rate": 5,
    			"cdd": 3100,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"rater": "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash",
    			"rate": 4,
    			"cdd": 10000,
    			"txid": "dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715",
    			"txTimestamp": 1618834297302,
    			"block": 989302
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    
    {"height":989430,"pid":"0000000000011111111111111111111111122222222222222222223333333","rateList ":[{"block":989302,"cdd":3100,"rate":5,"rater":"FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy","txTimestamp":"1618832997321","txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989302,"cdd":10000,"rate":4,"rater":"FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","txTimestamp":"1618834297302","txid":"dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    5002 The PID does not exist. 该PID不存在。 pid
    4000 No matching record. 没有符合条件的信息。 signedRequest

    *示例

    {
    	"code": 5002,
    	"msg": "The PID does not exist.",
    	"data": {
    		"pid": "0000000000011111111111111111111111122222222222222222223333333"
    	}
    }
    

Log in to reply