Skip to main content

API Reference

OmbraChain expune un REST API public pe https://api.ombra-net.com pentru explorare chain, query state, broadcast tx-uri.

Interactive explorer

Sau deschide direct: api-explorer/

Endpoint-uri principale

Chain

MethodPathDescriere
GET/api/chain/heightBlock height curent
GET/api/chain/genesisBlock #0 (genesis)
GET/api/chain/block/{index}Block by index
GET/api/chain/block/hash/{hash}Block by hash
GET/api/chain/blocks?from=&to=Range bulk (max 100)
GET/api/chain/peersLista peer-uri conectate
GET/api/chain/networkInfo network (PeerID, addresses)

Transactions

MethodPathDescriere
POST/api/chain/txBroadcast tx semnată
GET/api/chain/tx/{hash}Tx by hash
GET/api/chain/mempoolMempool curent
GET/api/address/{addr}/txs?limit=Tx history per address

Accounts

MethodPathDescriere
GET/api/address/{addr}Balance + nonce
GET/api/address/{addr}/balanceDoar balance

Mining

MethodPathDescriere
GET/api/minersLista mineri activi
GET/api/miners/by-address/{addr}MinerNFT pentru adresă
GET/api/miners/{nftId}MinerNFT detail
GET/api/tasks/pendingTask-uri în mempool
GET/api/tasks/{taskId}Task status + result

Stats

MethodPathDescriere
GET/api/stats/supplyTotal supply + burn + emisie
GET/api/stats/validatorsValidator stats (last 1000 blocks)
GET/api/stats/tpsTx-uri per secundă (avg, peak)

Exemple

Get current height

curl https://api.ombra-net.com/api/chain/height
# → {"height": 9523}

Get block #9000

curl https://api.ombra-net.com/api/chain/block/9000

Response (v2 fork+):

{
"index": 9000,
"timestamp": 1715990000,
"prevHash": "abc...",
"hash": "def...",
"proposer": "5bb...",
"txRoot": "...",
"stateRoot": "...",
"tokensBurned": "10000",
"tokensConsumed": "850000",
"txs": [...],
"attestations": [
{
"validatorAddress": "abc...",
"signature": "...",
"publicKey": "..."
}
]
}

Broadcast transfer

curl -X POST https://api.ombra-net.com/api/chain/tx \
-H "Content-Type: application/json" \
-d '{
"tx": {
"type": "TRANSFER",
"from": "...",
"to": "...",
"amount": "1000000",
"fee": "10000",
"nonce": 42,
"timestamp": 1715990000,
"publicKey": "..."
},
"signature": "..."
}'
# → {"txHash": "..."}

Rate limits

TierRequests / secBurst
Public (no key)1030
API key (free)100300
API key (pro)10003000

API key disponibil prin email la team@ombra-net.com (manual approval în MVP).

Header pentru rate limit info:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1715990060

CORS

API permite CORS de la orice origin (*) pentru GET requests. POST tx requests permise doar din origin-uri whitelisted (în roadmap — momentan *).

WebSocket

Pentru subscribe live la evenimente:

const ws = new WebSocket("wss://api.ombra-net.com/ws");

ws.send(JSON.stringify({ type: "subscribe", topic: "new_block" }));
ws.onmessage = (e) => {
const block = JSON.parse(e.data);
console.log("New block:", block.index);
};

Topics disponibile:

  • new_block — fiecare bloc finalizat
  • new_tx — fiecare tx în mempool
  • address:{addr} — tx-uri care implică o adresă specifică
  • task:{taskId} — update-uri status task AI

Official SDKs

TypeScript — @ombrachain/sdk

npm install @ombrachain/sdk
import { OmbraClient, Wallet } from "@ombrachain/sdk";

const client = new OmbraClient({ endpoint: "https://api.ombra-net.com" });
const { height } = await client.chain.getHeight();

const wallet = Wallet.generate();
const { hash } = await client.send({ wallet, to: "...", amount: 1_000_000n, fee: 10_000n });

Detalii complete: SDK TypeScript guide.

Python — ombrachain

pip install ombrachain
from ombrachain import OmbraClient, Wallet

client = OmbraClient("https://api.ombra-net.com")
height = client.chain.get_height()["height"]

wallet = Wallet.generate()
result = client.send(wallet, to="...", amount=1_000_000, fee=10_000)

Detalii complete: SDK Python guide.

Go / Rust (roadmap)

Pot fi adăugate dacă vine demand. Deschideți issue pe GitHub.

Vezi și