Skip to the content.

ReweCoin Public API

Base URL (mainnet): https://api.rewecoin.com

Read-only REST API returning JSON. No API key required.

Conventions

Endpoints

GET /api/health

Liveness check.

{"ok": true}

GET /api/network

Chain and node status.

{
  "chain": "main",
  "blocks": 4144,
  "headers": 4144,
  "bestBlockHash": "05f01fd4...",
  "difficulty": 1,
  "connections": 4
}

chain must be "main" on mainnet. Additional node fields (version, subversion, protocol version) may be present.

GET /api/block/latest

GET /api/block/{height}

Block by height, or the chain tip with latest.

GET /api/block/4000

Key fields: hash, height, confirmations, size, version, merkleroot, tx (array of txids), time.

The tip has confirmations: 1. Do not treat a transaction as final with very few confirmations; reorganizations are possible.

GET /api/tx/{txid}

Transaction as returned by the node (Zcash-style fields). Key fields: txid, size, version, locktime, expiryheight, vin, vout, vjoinsplit, vShieldedSpend, vShieldedOutput, orchard, blockhash, height, confirmations, time.

GET /api/address/{address}

Balance and history for a transparent address.

{
  "address": "C7WoFm8QNufcRnpcQA13FjhY4FEGcQYYskD",
  "balance": 0,
  "received": 0,
  "sent": 0,
  "txCount": 0,
  "txids": []
}

Shielded balances are not visible here.

GET /api/hashrate

Estimated network hashrate, computed from chainwork over the last blocks. Fields: solsPerSecond, windowBlocks, avgBlockTimeSeconds, difficulty, note.

GET /api/supply

Coin supply split by pool.

{
  "total": 207200.0,
  "transparent": 195004.382829,
  "shielded": 12195.617171,
  "pools": [{"id": "transparent", "value": 195004.382829}]
}

GET /api/richlist

Top transparent addresses by balance.

{
  "cached": true,
  "list": [
    {"rank": 1, "address": "C7...", "balance": 106658.48, "percentage": 54.68}
  ]
}

The list is cached for about 5 minutes and covers transparent addresses only; shielded funds are not included. The cached and generatedAt fields show whether the response came from the cache and when the list was built. A request that rebuilds the list can take about 10 to 15 seconds, so use a timeout of at least 30 seconds.

Token routes

Read-only routes for tokens created on the ReweCoin token layer.

GET /api/tokens

All tokens, newest first.

{
  "count": 7,
  "tokens": [
    {
      "token_id": "tok_a7d6f80f8a34",
      "name": "$MOTO",
      "symbol": "MOTO",
      "decimals": 8,
      "total_supply": "10000000000000000",
      "holders_count": 1,
      "transfers_count": 0,
      "deploy_txid": "3f5ce1cc...",
      "deploy_block_height": 3166,
      "creator_address": "rwu1...",
      "is_official": true,
      "is_verified": 1,
      "is_test": false,
      "logo_path": "tok_a7d6f80f8a34.png",
      "logo_status": "approved",
      "created_at": 1791411864
    }
  ]
}

is_verified can be null. Logo fields (logo_status, logo_reject_reason, logo_uploaded_at) and receive_address are also present and may be null.

GET /api/token/{token_id}

One token, same object as in the list above. 404 if the token does not exist.

Supply and management fields

Each token object also carries the fields below. The operations behind them (mint, burn, freeze, pause) are described in tokens.md.

Field Type Meaning
total_supply string Supply at creation, in base units (1 token = 100000000 units). Does not change.
current_supply string Supply now. It differs from total_supply only for tokens that used mint or burn.
mintable boolean The creator can issue more tokens, up to max_supply.
burnable boolean Holders can burn their own tokens.
max_supply string or null Supply cap of a mintable token. null for tokens that are not mintable.
paused boolean true while the token is paused by its creator.

On mainnet, mint, burn and pause are not active yet. For now every token there has mintable and burnable set to false, max_supply set to null, paused set to false, and current_supply equal to total_supply.

GET /api/token/{token_id}/holders

Addresses with a balance above zero, largest first.

{
  "token_id": "tok_a7d6f80f8a34",
  "count": 1,
  "holders": [{"address": "rwu1...", "balance": "10000000000000000"}]
}

GET /api/token/{token_id}/transfers

Transfers of this token, newest block first.

{
  "token_id": "tok_a7d6f80f8a34",
  "count": 0,
  "transfers": []
}

Each transfer has txid, block_height, status, error_message, from, to, amount and executed_at. from may be null when the sender is not made public.

GET /api/token/{token_id}/balance/{address}

{"token_id": "tok_a7d6f80f8a34", "address": "rwu1...", "balance": "0"}

An address with no balance returns "0", not an error.

GET /api/tx/{txid}/token

Tells you whether a transaction is a token deploy or transfer.

{"kind": "deploy", "token": {"token_id": "tok_a7d6f80f8a34", "symbol": "MOTO"}}

For a successful transfer, kind is "transfer" and the response also has to and amount. If the transaction is neither, the answer is 404 with {"kind": null}.

Not exposed publicly

Wallet and send routes (/api/wallet, /api/send) are intentionally disabled on the public API.

SDK

const { ReweCoin } = require('rewecoin');
const rwc = new ReweCoin();
const info = await rwc.getBalance('C7WoFm8QNufcRnpcQA13FjhY4FEGcQYYskD');

Install with npm i rewecoin. See the SDK docs.

Examples

curl https://api.rewecoin.com/api/network
curl https://api.rewecoin.com/api/block/latest
curl https://api.rewecoin.com/api/address/C7WoFm8QNufcRnpcQA13FjhY4FEGcQYYskD
const r = await fetch('https://api.rewecoin.com/api/supply');
console.log(await r.json());