APIP6V1_ServiceInfo(zh-CN)



  • APIP6:ServiceInfo
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-01
    Update:2021-12-01
    Filehash:""
    TXid:
    

    APIP6V1_ServiceInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.sid详情接口

    2.服务搜索接口

    3.服务历史接口

    4.服务评价列表接口


    Type:APIP
    SerialNumber:6
    ProtocolName:ServiceInfo
    Version:1
    Description:定义服务信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, service, 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. 本协议接口的数据来源遵循以下协议:

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

    4. 示例数据:

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

    1.sid详情接口

    名称

    sidInfoList

    说明

    给定一个或多个sid获取相应服务详情。

    请求参数

    name type description
    sidList string array

    *示例

    查询sid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的服务最新详情。

    参数

    {
    	"sidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/sidInfoList
    
    - unsignedRequest:
    
    {"sidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList"}
    
    - sign =sha256(sha256({"sidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"sidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    sidInfoList object See below.
    height uint The latest block height when getting the data.
    • sidInfoList
    name type description key in FEIP29
    sid string The ID of the service,that is,the txid of the transaction in which the service started up.
    stdName string The name of the service in english data.stdName
    localName string array Service names in different languages data.localName
    desc string Description of this service data.desc
    type string array The types of the service data.type
    url string URL of the service data.url
    pubKey string The public key designated by the publisher for this service data.pubKey
    signer string The signer of the first input of the transaction in which the service starts up.
    firstTime timeStamp The timeStamp of the transaction in which the service started up.
    lastTxid string The txid of the last operation of the service.
    lastTime timeStamp The transaction timestamp of the last operation of the service.
    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 service in effect.
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的服务最新详情。
    {
    	"sidInfoList": [{
    			"sid": "000000001111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"sid": "2222222200000000000000000001111111111111111333333333333333",
    			"stdName": "Lianjia Housing agency",
    			"localName": "链家房屋中介",
    			"desc": "在世界各地提供优质的房屋中介服务。",
    			"type": ["House", "Agency"],
    			"url": "https://www.lianjia.com/index.html",
    			"pubKey": "000002020022222222222",
    			"signer": "F0000000000000008838dsjf",
    			"firstTime": 1619261292,
    			"lastTxid": "2222222200000000000000000001111111111111111333333333333333",
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"height":989430,"sidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","sid":"000000001111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"在世界各地提供优质的房屋中介服务。","firstTime":1619261292,"lastTime":1619261292,"lastTxid":"2222222200000000000000000001111111111111111333333333333333","localName":"链家房屋中介","pubKey":"000002020022222222222","sid":"2222222200000000000000000001111111111111111333333333333333","signer":"F0000000000000008838dsjf","status":1,"stdName":"Lianjia Housing agency","tCdd":221800,"tRate":4.12,"type":["Agency","House"],"url":"https://www.lianjia.com/index.html"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    6000 These SIDs do not exist. 这些SID不存在。 missedSidList
    6001 Too many SIDs are requested. 请求的SID数量太多。 maxSidCount
    • 示例
    {
    	"code": 6000,
    	"msg": "These SIDs do not exist.",
    	"data": {
    		"missedSidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 服务搜索接口

    名称

    serviceSearch

    说明

    按条件查询服务。

    请求参数

    name type description required
    filterName string Filter by the stdName or localName N
    filterAddress string Filter by the designated address of the service,calculated from data.pubKey N
    filterType string Filter by the type of the service N
    filterUrl string Filter by URL N
    filterSigner string Filter by the signer N
    filterFirstTime string Filter by firstTime 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项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的服务,结果按综合评分tRate排序。

    参数

    {
    	"filterType": "API",
    	"filterUrl": "sign.cash",
    	"filterTCdd": "1000-",
    	"sortTRate": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/serviceSearch
    
    - unsignedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch"}
    
    - sign =sha256(sha256({"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    serviceList object See below.
    height uint The latest block height when getting the data.
    • serviceList
    name type description key in FEIP29
    sid string The ID of the service,that is,the txid of the transaction in which the service started up.
    stdName string The name of the service in english data.stdName
    localName string array Service names in different languages data.localName
    desc string Description of this service data.desc
    type string array The types of the service data.type
    url string URL of the service data.url
    pubKey string The public key designated by the publisher for this service data.pubKey
    signer string The signer of the first input of the transaction in which the service starts up.
    firstTime timeStamp The timeStamp of the transaction in which the service started up.
    lastTxid string The txid of the last operation of the service.
    lastTime timeStamp The transaction timestamp of the last operation of the service.
    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 service in effect.
    • 示例

    响应查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的服务,结果按综合评分tRate排序。

    {
    	"sidInfoList": [{
    			"sid": "11111111111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"sid": "22222222222222222222222222222222220000000000000000000000",
    			"stdName": "protocol information API",
    			"localName": ["协议信息接口"],
    			"desc": "提供协议的查询",
    			"type": ["PID", "protocol", "Basic API"],
    			"url": "https://www.sign.cash/pidInfo",
    			"pubKey": "03002320000000000000000000000000000000000000",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "133429999900000000000000000000000000",
    			"lastTime": 1636526891,
    			"tCdd": 300000,
    			"tRate": 4.32,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"height":989430,"sidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","sid":"11111111111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"提供协议的查询","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"133429999900000000000000000000000000","localName":["协议信息接口"],"pubKey":"03002320000000000000000000000000000000000000","sid":"22222222222222222222222222222222220000000000000000000000","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"protocol information API","tCdd":300000,"tRate":4.32,"type":["Basic API","PID","protocol"],"url":"https://www.sign.cash/pidInfo"}],"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/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    3. 服务历史接口

    名称

    sidHistory

    说明

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

    请求参数

    name type description required
    sid 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项sid为000000001111111111111111111111122222222222222222222222222的服务操作记录,按txTimestamp降序。

    参数

    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

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

    POST

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

    响应参数

    name type description
    sid string
    signer string The signer of the first input of the transaction in which the service starts up.
    stdName string The recent name of the service in english
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description
    op string The operation, "start", "update", "stop", or "restart".
    stdName string The name of the service in english
    localName string array Service names in different languages
    desc string Description of this service
    type string array The types of the service
    url string URL of the service
    pubKey string The public key designated by the publisher for this service
    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
    • 示例
      响应sid为000000001111111111111111111111122222222222222222222222222的服务信息。
    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
    	"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"stdName": "Free cid API",
    	"sidInfoList": [{
    			"op": "stop",
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"txTimestamp": 1610261291,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"sid":"000000001111111111111111111111122222222222222222222222222","sidInfoList":[{"block":989239,"op":"stop","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","localName":["免费cid信息接口"],"op":"update","pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","stdName":"Free cid API","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"}],"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","stdName":"Free cid API","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

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

    *示例

    {
    	"code": 6002,
    	"msg": "The SID does not exist.",
    	"data": {
    		"sid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    4. 服务评价列表接口

    名称

    sidRateList

    说明

    查询对某sid服务的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    sid 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项sid为000000001111111111111111111111122222222222222222222222222的服务的币天销毁大于1000的评分记录,按评分降序。

    参数

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

    GET

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

    POST

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

    响应参数

    name type description
    sid 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
    • 示例
      响应sid为000000001111111111111111111111122222222222222222222222222的服务信息。
    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
    	"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,"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"}],"sid":"000000001111111111111111111111122222222222222222222222222","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

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

    *示例

    {
    	"code": 6002,
    	"msg": "The SID does not exist.",
    	"data": {
    		"sid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

Log in to reply