Build
Public testnet APIs
Everything below is free and needs no account. The JSON-RPC proxy and the explorer API send
Access-Control-Allow-Origin: *, so you can call them straight from a web page, as this portal
does for its live figures.
JSON-RPC
Public RPC proxy
A full node behind neurai-rpc-proxy: POST a JSON-RPC request, no credentials.
Only whitelisted methods pass; wallet and node-control methods are blocked. The node keeps the address
and spent indexes, so balance, UTXO and history queries work.
| Endpoint | https://rpc-testnet.neurai.org/rpc |
|---|---|
| DePIN endpoint | https://rpc-testnet-depin.neurai.org/rpc used by Neurai Sign |
| Whitelist | GET /whitelist lists the allowed methods |
| Settings | GET /settings |
| Limits | DePIN calls: 60 per minute per IP, with a temporary ban above that. |
curl -s -X POST https://rpc-testnet.neurai.org/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"1.0","id":1,"method":"getblockchaininfo","params":[]}'
import { getRPC, methods } from "@neuraiproject/neurai-rpc";
// The public proxy ignores the credentials.
const rpc = getRPC("anonymous", "anonymous", "https://rpc-testnet.neurai.org/rpc");
const height = await rpc(methods.getblockcount, []);
async function rpc(method, params = []) {
const res = await fetch("https://rpc-testnet.neurai.org/rpc", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ jsonrpc: "1.0", id: 1, method, params }),
});
const { result, error } = await res.json();
if (error) throw new Error(JSON.stringify(error));
return result;
}
// Make sure you are on the reset testnet before anything else.
const genesis = await rpc("getblockhash", [0]);
if (genesis !== "0000008b384aeffecdab182575dc4e86c9f07f90318c65088532660ed9a8a021") throw new Error("Wrong chain");
const utxos = await rpc("getaddressutxos", [{ addresses: ["tDjYjjNMUiEfSKxSWB5RhgNqFWHCzdGtf3"] }]);
Allowed methods (65)
Blockchain
getblockchaininfogetblockcountgetbestblockhashgetblockhashgetblockheadergetblockdecodeblockgetchaintipsgetchaintxstatsgetdifficultygettxoutgettxoutproofgetspentinfo
Mempool
getmempoolinfogetrawmempoolgetmempoolentrygetmempoolancestorsgetmempooldescendants
Address index
getaddressbalancegetaddressdeltasgetaddressmempoolgetaddresstxidsgetaddressutxos
Transactions
createrawtransactiondecoderawtransactiondecodescriptcombinerawtransactiongetrawtransactionsendrawtransactionsignrawtransactiontestmempoolacceptestimatefeeestimatesmartfee
Assets
getassetdatalistassetslistaddressesbyassetlistassetbalancesbyaddresscheckaddressrestrictioncheckaddresstagcheckglobalrestrictiongetverifierstringisvalidverifierstringlistaddressesfortaglistaddressrestrictionslistglobalrestrictionslisttagsforaddress
DePIN
checkdepinvaliditylistdepinholderslistdepinaddressesdepinchallengedepinsubmitmsgdepinreceivemsgdepingetmsginfodepinlistsectionsdepinclearmsgdepingetancestorrecipientsdepinpoolstatsdepinmcpstatus
Utility
validateaddressverifymessagesignmessagewithprivkeygetpubkeygetnetworkinfogetnetworkhashpshelp
REST
Explorer API
Rebel Explorer's JSON endpoints. GET only, paginated lists, amounts as strings.
| Path | Returns |
|---|---|
/api/stats |
Height, supply, difficulty, hashrate, average block time, mempool. |
/api/chain |
Chain summary. |
/api/bestblock |
The tip. |
/api/recent |
Recent blocks and transactions. |
/api/mempool |
Transactions waiting for a block. |
/api/blocks |
Latest blocks. |
/api/blocks/:id |
A block by height or hash. |
/api/blocks/:id/txs |
Transactions of a block. |
/api/blockheader/:height |
A block header. |
/api/transactions/:txid |
A transaction, decoded. |
/api/addresses/:address |
Balance, address family and assets. |
/api/addresses/:address/history |
Transaction history. |
/api/addresses/:address/utxos |
Unspent outputs. |
/api/addressdeltas/:address |
Raw balance changes. |
/api/assets |
Asset list. |
/api/assets/:name |
One asset. |
/api/assets/:name/holders |
Holders of an asset. |
/api/assetdata/:name |
Asset metadata from the node. |
/gettype/:value |
Tells whether a value is a block, transaction, address or asset. |
curl -s https://rebel-explorer-testnet.neurai.org/api/addresses/tDjYjjNMUiEfSKxSWB5RhgNqFWHCzdGtf3
REST
Faucet API
GET /api/info and POST /api/claim at https://faucet-testnet.neurai.org. No CORS headers:
call it from a server or the shell. A claim needs a captcha token or a Neurai Connect ticket.
WebSocket
Neurai Connect relay
Carries encrypted messages between a website and a wallet, so users sign in or approve a signature by
scanning a QR. The relay is network-agnostic and needs no API key. Use it through
@neuraiproject/neurai-connect.
| WebSocket | wss://relay.neurai.org/v1 |
|---|---|
| Status | GET /info · GET /health |
WebSocket
Wallet push service
neurai-wallet-services keeps a socket open per wallet and pushes events instead of making
the wallet poll: new tip, reorgs, and changes on subscribed addresses. It needs an access token, sent as the
WebSocket subprotocol auth.<token>; ask the Neurai team on Discord for one.
| Endpoint | wss://wallet-testnet-wss.neurai.org/push |
|---|---|
| Calls | hello, ping, address.subscribe, address.unsubscribe, address.get_state, tx.broadcast, depin.* |
| Events | chain.tip, chain.reorg, address.changed, node.synced, node.syncing |
const ws = new WebSocket("wss://wallet-testnet-wss.neurai.org/push", ["wss", "auth." + token]);
ws.onopen = () => {
ws.send(JSON.stringify({ id: 1, method: "hello",
params: { client: "my-app", version: "1.0.0", network: "testnet", protocol: "wss/2" } }));
ws.send(JSON.stringify({ id: 2, method: "address.subscribe", params: { address } }));
};
ws.onmessage = (event) => console.log(JSON.parse(event.data)); // chain.tip, address.changed…
Self-hosted
Electrum server
There is no public Electrum server for testnet. electrs-neurai
runs against your own testnet node and listens on port 60001, with Neurai extensions such as
blockchain.asset.get_meta and blockchain.asset.get_history.