Skip to main content

Introduction

Viction provides a JSON-RPC API that allows applications to interact with the blockchain. The API is compatible with Ethereum’s JSON-RPC specification, making it easy to integrate existing Ethereum tools and libraries.

API Namespaces

The Viction RPC API is organized into the following namespaces:

eth

Ethereum-compatible methods for querying blockchain data, managing accounts, and sending transactions

net

Network-related methods for checking connectivity and network version

web3

Web3 utility methods including client version and SHA3 hashing

personal

Account management methods for creating, importing, and managing wallets

debug

Debugging and diagnostic methods for transaction tracing and state inspection

Connection Methods

Viction nodes support multiple connection methods:

HTTP/HTTPS

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

WebSocket

const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.viction.xyz');

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_blockNumber',
    params: [],
    id: 1
  }));
});

IPC (Inter-Process Communication)

geth attach /path/to/geth.ipc

Request Format

All JSON-RPC requests follow this structure:
{
  "jsonrpc": "2.0",
  "method": "method_name",
  "params": [],
  "id": 1
}
jsonrpc
string
required
Protocol version (always “2.0”)
method
string
required
The RPC method to call (e.g., “eth_blockNumber”)
params
array
required
Array of method parameters (can be empty)
id
number
required
Request identifier for matching responses

Response Format

Successful responses:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x4b7"
}
Error responses:
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32600,
    "message": "Invalid request"
  }
}
result
any
The result of the method call (type varies by method)
error
object
Error object if the request failed

Data Encoding

Hexadecimal Encoding

All numeric values and binary data are encoded as hexadecimal strings with the 0x prefix:
  • Quantities (integers): Encoded as hex, no leading zeros (except 0x0)
    • Example: 12070x4b7
  • Data (byte arrays): Encoded as hex, even length, two hex digits per byte
    • Example: [1, 2, 3]0x010203

Addresses

Ethereum-style addresses are 20-byte hex strings:
0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

Block Identifiers

Block numbers can be specified as:
  • Hex number: 0x4b7 (specific block)
  • “latest”: Most recent block
  • “earliest”: Genesis block
  • “pending”: Pending block being mined

Rate Limiting

Public RPC endpoints may have rate limits. For production applications, consider running your own node or using a dedicated RPC provider.

API Compatibility

Viction’s RPC API is compatible with:
  • Ethereum JSON-RPC specification
  • Web3.js library
  • Ethers.js library
  • Other Ethereum-compatible tools

Next Steps

Ethereum Methods

Explore the eth namespace for blockchain queries

Account Management

Learn about personal namespace methods

Build docs developers (and LLMs) love