JSON-RPC API Reference

Complete API documentation for SilverBitcoin node

API Endpoints

RPC Endpoint

http://localhost:8332

WebSocket Endpoint

ws://localhost:8332

Common Methods

getblockcount

Get the current block height

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'

Response: {"jsonrpc":"2.0","result":123456,"id":1}

getbalance

Get account balance

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"getbalance","params":["slvr1..."],"id":1}'

Response: {"jsonrpc":"2.0","result":"1.5","id":1}

sendtransaction

Send a transaction

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0",
    "method":"sendtransaction",
    "params":["0x..."],
    "id":1
  }'

Error Codes

CodeMessageDescription
-32700Parse errorInvalid JSON was received
-32600Invalid RequestThe JSON sent is not a valid Request object
-32601Method not foundThe method does not exist
-32602Invalid paramsInvalid method parameter(s)
-32603Internal errorInternal JSON-RPC error

Need more help?

Getting StartedSlvr Language