📡 ViceversaChain Explorer API

Complete API documentation for blockchain data access

Base URL: http://localhost:3001

🌟 Overview

ViceversaChain Explorer API Features
  • Blockchain Data: Blocks, transactions, addresses
  • Network Statistics: Mining info, peer data, masternodes
  • Privacy Features: Spark protocol statistics
  • Address Management: Custom labeling system
  • Real-time Data: Live blockchain monitoring

🔌 REST API Endpoints

GET /api/stats

Description: Get current blockchain statistics

Response:

{ "success": true, "data": { "chain": "main", "blocks": 51839935, "difficulty": 0.00024414, "networkHashrate": 12345.67, "connections": 8 } }
POST /api/address-label

Description: Add or update an address label

Request Body:

{ "address": "VKQzVzrLvhRPAgACUEFmKYCzeFPMVMRqk3", "label": "Exchange Hot Wallet" }

Response:

{ "success": true, "message": "Label added successfully", "address": "VKQzVzrLvhRPAgACUEFmKYCzeFPMVMRqk3", "label": "Exchange Hot Wallet" }
GET /api/address-labels

Description: Get all saved address labels

Response:

{ "success": true, "labels": { "VKQzVzrLvhRPAgACUEFmKYCzeFPMVMRqk3": "Exchange Hot Wallet", "VL8m2KjDm7Fz9vhRPAgACUEFmKYCzeFP": "Mining Pool" }, "count": 2 }
DELETE /api/address-label/:address

Description: Remove an address label

Example: DELETE /api/address-label/VKQzVzrLvhRPAgACUEFmKYCzeFPMVMRqk3

Response:

{ "success": true, "message": "Label removed successfully" }

⚡ ViceversaChain RPC Methods

RPC Access

These RPC methods are used internally by the explorer. Direct RPC access requires authentication and is available on port 7778.

Blockchain Methods
  • getblockchaininfo - Network information
  • getblockcount - Current block height
  • getblockhash - Get block hash by height
  • getblock - Get block details
  • getrawtransaction - Transaction data
  • getchaintips - Chain tip information
Mining Methods
  • getmininginfo - Mining statistics
  • getnetworkhashps - Network hashrate
  • getblocktemplate - Block template
  • getdifficulty - Current difficulty
Masternode Methods
  • znode count - Masternode count
  • znode list - List active masternodes
  • znode status - Node status
  • masternode payments - Payment info
Spark Privacy Methods
  • getsparkanonymitysetmeta - Anonymity set
  • getsparklatestcoinid - Latest coin ID
  • getmempoolsparktxids - Mempool Spark TXs
  • getsparknames - Spark Names registry
  • getsparknamedata - Spark Name details

💡 Usage Examples

JavaScript (Fetch API)
// Get blockchain stats fetch('/api/stats') .then(response => response.json()) .then(data => { console.log('Block count:', data.data.blocks); console.log('Difficulty:', data.data.difficulty); }); // Add address label fetch('/api/address-label', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: 'VKQz...Mqk3', label: 'My Wallet' }) });
cURL Examples
# Get blockchain statistics curl -X GET http://localhost:3001/api/stats # Add address label curl -X POST http://localhost:3001/api/address-label \ -H "Content-Type: application/json" \ -d '{ "address": "VKQz...Mqk3", "label": "Exchange Wallet" }' # Get all labels curl -X GET http://localhost:3001/api/address-labels

⚙️ Implementation Notes

Rate Limits

No rate limits currently

Use responsibly to avoid overloading the node
CORS

No CORS restrictions

Available for cross-origin requests
Data Freshness

Real-time

Data fetched directly from blockchain node