Technical Reference

Tetreum Testnet API Reference

Complete API documentation for interacting with Tetreum Testnet blockchain.

Base URLs

Testnet Endpoints

Explorer JSON-RPC API
POST /api/rpc

JSON-RPC 2.0 interface with rate limiting (100 requests/minute)

Explorer REST API
GET /api/*

RESTful endpoints for blocks, transactions, contracts, and tokens

External Tetreum Testnet RPC
/api/rpc

Direct access to Tetreum Testnet node

Rate Limits

Public Endpoints

Rate Limit:
100 requests/minute

All public API endpoints are limited to 100 requests per minute per IP address. Rate limit headers are included in all responses.

Rate Limit Headers

X-RateLimit-Limit100
X-RateLimit-Remaining98
X-RateLimit-Reset1640995200

Rate Limit Exceeded

When rate limit is exceeded, you'll receive a 429 status code with the following response:

{
  "error": {
    "code": 429,
    "message": "Rate limit exceeded. Try again in 60 seconds."
  }
}
REST API Endpoints

Blocks

GET /api/blocks
GET

Get latest blocks with optional limit parameter.

curl -X GET "/api/blocks?limit=10"
GET /api/blocks/:number
GET

Get specific block by block number.

curl -X GET "/api/blocks/8119"

Transactions

GET /api/transactions
GET

Get latest transactions with optional limit.

curl -X GET "/api/transactions?limit=20"
GET /api/transactions/:hash
GET

Get transaction details by hash.

curl -X GET "/api/transactions/0x..."

Contracts & Tokens

GET /api/contracts
GET

Get deployed contracts list.

curl -X GET "/api/contracts?limit=50"
GET /api/tokens
GET

Get token information and statistics.

curl -X GET "/api/tokens?limit=25"
GET /api/search
SEARCH

Search across blocks, transactions, and contracts.

curl -X GET "/api/search?q=0x..."
JSON-RPC Methods

Block Methods

eth_blockNumber
GET

Returns the current block number.

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

Returns block information by block number.

curl -X POST /api/rpc \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": ["latest", true],
    "id": 1
  }'

Transaction Methods

eth_sendTransaction
POST

Sends a transaction to the network.

curl -X POST /api/rpc \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_sendTransaction",
    "params": [{
      "from": "0x...",
      "to": "0x...",
      "value": "0x9184e72a000",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000"
    }],
    "id": 1
  }'
eth_getTransactionReceipt
GET

Returns transaction receipt by hash.

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

Account Methods

eth_getBalance
GET

Returns the balance of an account.

curl -X POST /api/rpc \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0x...", "latest"],
    "id": 1
  }'
Explorer REST API

Available Endpoints

GET /api/blocks
GET

Get latest blocks with pagination support.

GET /api/transactions
GET

Get latest transactions with filtering options.

GET /api/contracts
GET

Get deployed smart contracts and verification status.

GET /api/tokens
GET

Get token information and market data.

GET /api/stats
GET

Get network statistics and performance metrics.

Example Usage

# Get latest 10 blocks
curl https://testnet.tetscan.com/api/blocks?limit=10

# Get transactions for specific block
curl https://testnet.tetscan.com/api/transactions?block=793788

# Get contract verification status
curl https://testnet.tetscan.com/api/contracts/0x...

# Get network statistics
curl https://testnet.tetscan.com/api/stats
Rate Limits & Authentication

Public Endpoints

  • • 100 requests per minute
  • • No authentication required
  • • Suitable for testing and development
  • • Subject to fair use policy

Premium Access

  • • 1000 requests per minute
  • • API key authentication
  • • Priority support
  • • Advanced analytics

Need higher limits? Contact our team for enterprise API access and custom rate limits.

SDKs and Libraries

JavaScript/TypeScript

npm install @tetreum/sdk

Official SDK for Node.js and browser applications.

Python

pip install tetreum-python

Python library for blockchain interaction.

Go

go get github.com/tetreum/go-sdk

Go SDK for high-performance applications.

Web3.js Compatible

npm install web3

Use existing Web3.js applications with Tetreum.