HydroCoin REST API — Quick Guide

Base URL: https://h2ocoin.org/api


Auth

POST /login → returns { token } POST /signup → create user
curl -sX POST 'https://h2ocoin.org/api/login' \
  -H 'Content-Type: application/json' \
  -d '{ "email":"you@example.com", "password":"secret" }'

# Use the token as header:
# Authorization: Bearer <token>

Wallet & Balance

GET /balance?address=HCW...
curl -s 'https://h2ocoin.org/api/balance?address=HCW_xxx'

Send H₂O

POST /send_transaction
curl -sX POST 'https://h2ocoin.org/api/send_transaction' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ "to":"HCW___", "amount":25 }'

More Endpoints (v1.1)

Pending transactions

GET /get_pending_transactions
curl -s 'https://h2ocoin.org/api/get_pending_transactions'

Mine block

POST /mine_block
curl -sX POST 'https://h2ocoin.org/api/mine_block' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

Deploy contract

POST /deploy_contract
curl -sX POST 'https://h2ocoin.org/api/deploy_contract' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ "name":"MyContract", "source":"" }'

Sync nodes

POST /sync_nodes
curl -sX POST 'https://h2ocoin.org/api/sync_nodes' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ "from_height": 0 }'

Chain length

GET /get_chain_length
curl -s 'https://h2ocoin.org/api/get_chain_length'