REST API Reference
The ACDC REST API provides a RESTful interface for querying chain data. This API is read-only; transactions must be submitted via JSON-RPC.
Base URLs
| Chain | Network | Base URL |
|---|---|---|
| Alpha | Mainnet | https://api.ac-dc.network/v1/alpha |
| Alpha | Testnet | https://api.ac-dc.network/v1/alpha-testnet |
| Delta | Mainnet | https://api.ac-dc.network/v1/delta |
| Delta | Testnet | https://api.ac-dc.network/v1/delta-testnet |
Response Format
All responses are JSON with the following structure:
{
"success": true,
"data": { ... },
"meta": {
"timestamp": 1704067200,
"requestId": "req_abc123"
}
}
Error responses:
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
},
"meta": {
"timestamp": 1704067200,
"requestId": "req_abc123"
}
}
Chain Endpoints
GET /chain/info
Returns general chain information.
Request:
curl https://api.ac-dc.network/v1/delta/chain/info
Response:
{
"success": true,
"data": {
"chain": "delta",
"network": "mainnet",
"version": "1.0.0",
"blockHeight": 1234567,
"blockTime": 2.5,
"totalTransactions": 98765432,
"activeValidators": 100
}
}
GET /chain/stats
Returns chain statistics.
Request:
curl https://api.ac-dc.network/v1/delta/chain/stats
Response:
{
"success": true,
"data": {
"tps": 1250.5,
"avgBlockTime": 2.48,
"totalSupply": "1000000000000000000000000000",
"circulatingSupply": "750000000000000000000000000",
"totalStaked": "500000000000000000000000000",
"stakingRatio": 0.667
}
}
Block Endpoints
GET /blocks
Returns a paginated list of blocks.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| limit | integer | 20 | Results per page (max 100) |
| order | string | "desc" | Sort order ("asc" or "desc") |
Request:
curl "https://api.ac-dc.network/v1/delta/blocks?page=1&limit=10"
Response:
{
"success": true,
"data": {
"blocks": [
{
"number": 1234567,
"hash": "0xabc123...",
"timestamp": 1704067200,
"txCount": 150,
"validator": "dx1validator..."
}
],
"pagination": {
"page": 1,
"limit": 10,
"totalPages": 123456,
"totalItems": 1234567
}
}
}
GET /blocks/:identifier
Returns a specific block by number or hash.
Request:
# By number
curl https://api.ac-dc.network/v1/delta/blocks/1234567
# By hash
curl https://api.ac-dc.network/v1/delta/blocks/0xabc123...
Response:
{
"success": true,
"data": {
"number": 1234567,
"hash": "0xabc123...",
"parentHash": "0xdef456...",
"timestamp": 1704067200,
"stateRoot": "0xstate...",
"transactionsRoot": "0xtxroot...",
"receiptsRoot": "0xreceipts...",
"validator": "dx1validator...",
"gasUsed": "15000000",
"gasLimit": "30000000",
"txCount": 150
}
}
GET /blocks/:number/transactions
Returns transactions in a block.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| limit | integer | 20 | Results per page (max 100) |
Request:
curl "https://api.ac-dc.network/v1/delta/blocks/1234567/transactions?limit=10"
Transaction Endpoints
GET /transactions/:hash
Returns transaction details.
Request:
curl https://api.ac-dc.network/v1/delta/transactions/0xtxhash...
Response:
{
"success": true,
"data": {
"hash": "0xtxhash...",
"blockNumber": 1234567,
"blockHash": "0xblock...",
"from": "dx1sender...",
"to": "dx1receiver...",
"value": "1000000000000000000",
"nonce": 42,
"gasPrice": "1000000000",
"gasLimit": "21000",
"gasUsed": "21000",
"status": "success",
"timestamp": 1704067200,
"type": "transfer"
}
}
GET /transactions
Returns recent transactions.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| limit | integer | 20 | Results per page (max 100) |
| type | string | all | Filter by type |
| address | string | - | Filter by address (from or to) |
Request:
curl "https://api.ac-dc.network/v1/delta/transactions?address=dx1abc...&limit=10"
Account Endpoints
GET /accounts/:address
Returns account information.
Request:
curl https://api.ac-dc.network/v1/delta/accounts/dx1abc123...
Response:
{
"success": true,
"data": {
"address": "dx1abc123...",
"balance": "1000000000000000000",
"nonce": 42,
"txCount": 156,
"isContract": false,
"firstSeen": 1704000000,
"lastSeen": 1704067200
}
}
GET /accounts/:address/transactions
Returns transactions for an account.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| limit | integer | 20 | Results per page |
| direction | string | "all" | Filter: "in", "out", or "all" |
Request:
curl "https://api.ac-dc.network/v1/delta/accounts/dx1abc.../transactions?direction=out"
GET /accounts/:address/tokens
Returns token balances for an account.
Request:
curl https://api.ac-dc.network/v1/delta/accounts/dx1abc.../tokens
Response:
{
"success": true,
"data": {
"tokens": [
{
"contract": "dx1token...",
"symbol": "USDC",
"decimals": 6,
"balance": "1000000000"
}
]
}
}
Validator Endpoints
GET /validators
Returns active validators.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| status | string | "active" | Filter: "active", "inactive", "all" |
| page | integer | 1 | Page number |
| limit | integer | 20 | Results per page |
Request:
curl "https://api.ac-dc.network/v1/delta/validators?status=active"
Response:
{
"success": true,
"data": {
"validators": [
{
"address": "dx1validator...",
"name": "Validator One",
"stake": "1000000000000000000000000",
"delegatedStake": "5000000000000000000000000",
"commission": 0.05,
"uptime": 0.9995,
"status": "active"
}
],
"pagination": {
"page": 1,
"limit": 20,
"totalItems": 100
}
}
}
GET /validators/:address
Returns detailed validator information.
Request:
curl https://api.ac-dc.network/v1/delta/validators/dx1validator...
Governance Endpoints
GET /governance/proposals
Returns governance proposals.
Query Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| status | string | "active" | Filter: "active", "passed", "rejected", "all" |
| page | integer | 1 | Page number |
Request:
curl "https://api.ac-dc.network/v1/delta/governance/proposals?status=active"
Response:
{
"success": true,
"data": {
"proposals": [
{
"id": 42,
"title": "Increase Block Gas Limit",
"proposer": "dx1proposer...",
"status": "active",
"votesFor": "500000000000000000000000000",
"votesAgainst": "100000000000000000000000000",
"votesAbstain": "50000000000000000000000000",
"startBlock": 1234000,
"endBlock": 1244000
}
]
}
}
GET /governance/proposals/:id
Returns detailed proposal information.
Request:
curl https://api.ac-dc.network/v1/delta/governance/proposals/42
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
| NOT_FOUND | 404 | Resource not found |
| INVALID_PARAM | 400 | Invalid parameter value |
| RATE_LIMITED | 429 | Too many requests |
| INTERNAL_ERROR | 500 | Server error |