diff --git a/doc/API.md b/doc/API.v0.md similarity index 100% rename from doc/API.md rename to doc/API.v0.md diff --git a/doc/API.v1.md b/doc/API.v1.md new file mode 100644 index 0000000..e941f6b --- /dev/null +++ b/doc/API.v1.md @@ -0,0 +1,179 @@ +# Cyphernode + +## API v1 (RESTful) + +### Collections + +#### watchedAddresses + +| Request | Descripton | +|---------|------------| +| `POST /v1/watchedAddresses` | Create new address watch | +| `GET /v1/watchedAddresses` | Get list of watched addresses | +| `GET /v1/watchedAddresses/
` | Get details of watched address | +| `DELETE /v1/watchedAddresses/
` | Remove watched address | + +##### POST /v1/watchedAddresses + +**Request body** +```json +{ + "address": , + "callback": +} +``` + +**Response body - 200 - OK** +```json +{ + "id": , + "address": , + "callback": ", + "estimatesmartfee2blocks": , + "estimatesmartfee6blocks": , + "estimatesmartfee36blocks": , + "estimatesmartfee144blocks": +} +``` + +**Response body - 503 - Resource temporarily unavailable** +```json +{ + "reason": +} +``` + +**Response body - 403 - Forbidden** +```json +{ +} +``` + +##### GET /v1/watchedAddresses + +**Response body - 200 - OK** +```json +[ + { + "id": , + "address": , + "imported": , + "callback": , + "watching_since": + }, + ... +] +``` + +**Response body - 503 - Resource temporarily unavailable** +```json +{ + "reason": +} +``` + +**Response body - 403 - Forbidden** +```json +{ +} +``` + +##### GET /v1/watchedAddresses/
+ +**Response body - 200 - OK** +```json +{ + "id": , + "address": , + "imported": , + "callback": , + "watching_since": +} +``` + +**Response body - 503 - Resource temporarily unavailable** +```json +{ + "reason": +} +``` + +**Response body - 403 - Forbidden** +```json +{ +} +``` + +**Response body - 404 - Not found** +```json +{ +} +``` + + +##### DELETE /v1/watchedAddresses/
+ +**Response body - 200 - OK** +```json +{ + "address": "
", + "imported": , + "callback": , + "watching_since": +} +``` + +**Response body - 503 - Resource temporarily unavailable** +```json +{ + "reason": +} +``` + +**Response body - 403 - Forbidden** +```json +{ +} +``` + +**Response body - 404 - Not found** +```json +{ +} +``` + +##### Asynchronous callbacks + +**Request body** +```json +{ + "id": , + "address": , + "hash": , + "vout_n": , + "sent_amount": , + "confirmations": , + "received": , + "size": , + "vsize": , + "fees": , + "is_replaceable": , + "blockhash": , + "blocktime": , + "blockheight": +} +``` + +**Response body - 200 - OK** +```json +{ +} +``` + +**Response body - 503 - Resource temporarily unavailable** +```json +{ + "reason": +} +``` +