Skip to main content

API Reference Overview

VIDDHANA provides a comprehensive JSON-RPC API compatible with Ethereum tooling.

Endpoints

NetworkEndpoint
Mainnethttps://rpc.viddhana.com
Testnethttp://localhost:8545
API Serverhttps://api.viddhana.com
WebSocket (Mainnet)wss://ws.viddhana.com

Authentication

Public endpoints are available without authentication. For higher rate limits, include an API key:

curl -X POST https://rpc.viddhana.com \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Rate Limits

TierRequests/SecondDaily Limit
Free10100,000
Developer501,000,000
EnterpriseUnlimitedUnlimited

Supported Methods

Standard Ethereum Methods

VIDDHANA supports all standard Ethereum JSON-RPC methods:

  • eth_chainId
  • eth_blockNumber
  • eth_getBalance
  • eth_getTransactionCount
  • eth_getBlockByNumber
  • eth_getBlockByHash
  • eth_getTransactionByHash
  • eth_getTransactionReceipt
  • eth_sendRawTransaction
  • eth_call
  • eth_estimateGas
  • eth_getLogs
  • And more...

VIDDHANA-Specific Methods

MethodDescription
vdh_getValidatorsGet current validator set
vdh_getStakingInfoGet staking statistics
vdh_getAIPredictionQuery Prometheus AI predictions
vdh_getDePINNodesList active DePIN nodes

Response Format

All responses follow the JSON-RPC 2.0 specification:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x..."
}

Error responses:

{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "Invalid Request"
}
}

Error Codes

CodeMessageDescription
-32700Parse errorInvalid JSON
-32600Invalid RequestInvalid JSON-RPC request
-32601Method not foundUnknown method
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC error
-32000Server errorGeneric server error
-32001Resource not foundBlock, tx, etc. not found
-32002Resource unavailableResource temporarily unavailable
-32003Transaction rejectedTransaction rejected by node

Quick Examples

Get Current Block Number

curl -X POST https://rpc.viddhana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'

Get Account Balance

curl -X POST https://rpc.viddhana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xYourAddress", "latest"],
"id": 1
}'

Send Transaction

curl -X POST https://rpc.viddhana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0xSignedTransactionData"],
"id": 1
}'

WebSocket Subscriptions

Connect to WebSocket endpoint for real-time updates:

const ws = new WebSocket('wss://ws.viddhana.com');

// Subscribe to new blocks
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: ['newHeads'],
id: 1
}));

ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('New block:', data.params.result);
};

Next: JSON-RPC Methods