RESTful API
工具:httpie
apt-get install httpie
http get http://127.0.0.1:8080/ETH(测试网换成ETHTEST)/balance/0x2028aa76c84802cd61ab3bec4f142ca33743068b
正常响应 json:
{
"balance": "1575119465000126000",
"message": "", (为空)
"txcount": "0xaf1"
}
异常响应 json:
{
"balance": "-1",
"message": "format error", (或者其他错误信息)
"txcount": "-1"
}
http get http://127.0.0.1:8080/ETH(测试网换成ETHTEST)/unspent/1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ
响应格式同比特币
http get http://127.0.0.1:8080/BTC(测试网换成BTCTEST)/unspent/1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ
正常响应 json:
{
"message": "",
"uTXO": [
{
"confirmations": 94,
"output_no": 0,
"txId": "dd67f8edce5c907784212c9813e414fa6b8c4bc188b1023116fa868371905ce2",
"value": "12.57566486"
}
]
}
异常响应 json:
{
"error": "400 Bad Request", (或者其他错误信息)
"uTXO": null
}
http post http://127.0.0.1:8080/BTCTEST(主网改为BTC)/pushtx rawtx="hextx"
正常响应 json:
{
"message": "",
"txid": "7ac190df8bee2ca7c55848179f10d279d3fd344b631654a4c3b7db6f56de3c98"
}
异常响应 json:
{
"message": "400 Bad Request", (或者其他错误信息)
"txid": ""
}