请求:
参数 | 类型 | 说明 |
---|---|---|
appid | string | 用户身份ID, 一个唯一的随机字符串 |
cryptype | int | 0=data未加密(json格式),1=data已加密(加密字符串),当前只支持0 |
api_key | string | api访问公钥 |
token | string | md5("{api_key}_{secret_key}_{userid}_{timestamp}") |
timestamp | int | 时间戳,单位秒 |
chain | string | 主链 |
coin | string | 币种 |
字段值参考上表:
{
"appid": "",
"cryptype": 0,
"data": {
"auth": {
"token": "",
"timestamp": 0,
"api_key": ""
},
"chain":"eth",
"coin":"eth"
}
}
正常响应:
参数 | 类型 | 说明 |
---|---|---|
cryptype | int | 0=data未加密(json格式),1=data已加密(加密字符串),当前只支持0 |
eno | int | 0是正常,非0对应下面错误返回列表中的错误码 |
emsg | string | eno非0时对应下面错误返回列表中的错误描述 |
height | string | 节点高度 |
update_on | string | 更新时间 |
字段值参考上表:
{
"cryptype": 0,
"data": {
"eno": 0,
"emsg": "",
"data": {
"height": "1000",
"update_on": "2021-01-13 15:01:18"
}
}
}
错误响应:(emsg中带有括号表示可能变动部分)
eno | emsg | description |
---|---|---|
1 | system error (number) | 系统内部错误 |
2 | invalid json request | 不是有效的json请求 |
3 | lack field: appid | 缺少appid字段 |
4 | lack field: cryptype | 缺少cryptype字段 |
5 | lack field: data | 缺少data字段 |
6 | cryptype is invalid | 非法的cryptype字段 |
10 | frequency byond limit | 频率超过限制 |
1001 | lack field: auth | 缺少auth字段 |
3001 | lack field: token | 缺少token字段 |
4001 | lack field: pubkey | 缺少pubkey字段 |
5001 | lack field: timestamp | 缺少timestamp字段 |
6001 | appid not found | appid未找到 |
7001 | timestamp difference over 30 seconds | 请求时间间隔超过30秒 |
8001 | appid is invalid | 非法的appid |
9001 | (name) not in ip whitelist | 不受信任的IP地址 |
10001 | token verifiy failed | token验证失败 |
11001 | appid is disabled | appid未启用 |
字段值参考上表:
{
"cryptype": 0,
"data" : {
"eno": "",
"emsg": "",
"data": {}
}
}