Etherscan-compatible API¶
The explorer answers the Etherscan API at /api for chain 20778, so tools that already speak Etherscan can read
PQWERAI: transaction and token history, balances, logs, block rewards, contract ABIs of the registered PQWERAI
contracts, and a read-only JSON-RPC proxy.
Read-only
Served at https://explorer.pqwerai.com/api since explorer 0.7.0 (CR-0094 part C); the public explorer serves
chain 20778 since 28 November 2026. A local
explorer serves the same API at http://127.0.0.1:8089/api (Explorer).
Source code verification is not supported. On the public endpoint the proxy refuses POST /api with HTTP 405
(a local explorer answers verifysourcecode with NOTOK), so npx hardhat verify and forge verify-contract
fail. Use byte-for-byte verification.
| Base URL | https://explorer.pqwerai.com/api (public, read-only) · local http://127.0.0.1:8089/api |
| Chain | chainid=20778 (optional, Etherscan API v2 style; any other value is rejected) |
| API key | not required; apikey is accepted and ignored |
| Method | GET only |
| Rate limit | enforced by the reverse proxy (same zone as /api/v1: 10 requests/s per IP, burst 40); HTTP 429 when exceeded |
| CORS | Access-Control-Allow-Origin: * (added by the reverse proxy) |
| Data | the reorganisation-safe index plus cached read-only node calls; nothing is ever written to the node |
Response format¶
Exactly Etherscan's envelope. Every number is a decimal string (getLogs and proxy use 0x hex, as Etherscan).
{"status": "1", "message": "OK", "result": "1000000000000000000"}
{"status": "0", "message": "NOTOK", "result": "Error! Invalid address format"}
{"status": "0", "message": "No transactions found", "result": []}
Errors are HTTP 200 with status "0"; only an internal failure (database or node outage) is HTTP 503, with the
same envelope and "result": "Error! Temporarily unavailable". The proxy module answers with JSON-RPC envelopes
({"jsonrpc": "2.0", "id": 1, "result": …} or "error": {…}).
Lists accept page (from 1), offset (page size, at most 10,000; getLogs 1,000) and sort=asc|desc, with
page × offset ≤ 10,000 like Etherscan. startblock/endblock (and fromBlock/toBlock) take decimal, 0x hex
or latest.
Supported actions¶
| Module | Action | Source | Notes |
|---|---|---|---|
account |
balance, balancemulti (≤ 20) |
node eth_getBalance at the indexed tip block |
tag=latest only |
account |
txlist |
indexed transactions | Etherscan fields and order; see fields |
account |
tokentx |
indexed ERC-20 Transfer logs |
by address and/or contractaddress |
account |
tokennfttx |
indexed ERC-721 Transfer logs |
tokenID, tokenDecimal "0" |
account |
getminedblocks |
indexed blocks + issuance journal | blockReward explained below |
contract |
getabi, getsourcecode |
registered PQWERAI contracts | ABI lists events only; SourceCode is always "" |
contract |
getcontractcreation (≤ 5) |
indexed contract creations | direct creations only (no traces) |
transaction |
getstatus, gettxreceiptstatus |
indexed receipt status | revert reasons are not indexed ("Reverted") |
block |
getblockreward |
indexed blocks + issuance journal | uncles is always [] |
block |
getblocknobytime |
indexed block timestamps | closest = before or after |
logs |
getLogs |
indexed logs | address and/or topic0–topic3, topicX_Y_opr = and or or (default and, applied left to right); without an address at most 2,000 blocks per call |
stats |
ethsupply |
exact supply (/api/v1/supply total_supply_wei) |
minted − base-fee burn − slashing burn |
proxy |
eth_blockNumber, eth_getBlockByNumber, eth_getTransactionByHash, eth_getTransactionReceipt, eth_call, eth_getCode, eth_gasPrice, eth_estimateGas |
node, read-only, cached 3 s | eth_call/eth_estimateGas calldata ≤ 64 KiB |
Not served, each answering NOTOK with the reason: txlistinternal (PQWERAI Core serves no trace API, so internal
calls are not indexed), token1155tx (ERC-1155 is not indexed), verifysourcecode and the other verification
actions (no compiler pipeline), ethprice (testnet coins have no price) and eth_sendRawTransaction (send
transactions to the public RPC https://rpc-testnet.pqwerai.com). Any other action answers
"Error! Missing Or invalid Action name". The complete list with parameters is the x-etherscan-api section of the
OpenAPI file.
Fields that can be empty¶
txlist returns nonce, gas, input, cumulativeGasUsed and methodId from a table added in explorer schema 3.
Transactions indexed before that upgrade show "" for these five fields until the operator runs the optional
backfill (python -m pqwexplorer backfill-tx-extra). functionName is always "": the explorer bundles event ABIs,
not function ABIs. gasPrice is the effective gas price paid. tokentx/tokennfttx return input as
"deprecated", as Etherscan does.
Block rewards¶
PQWERAI pays PoW issuance once per 32-block epoch: the settlement block P+1 (P a multiple of 32) credits the 32
producers of blocks P-31 … P an equal floor(PoW / 32) each, and the producer of block P also the remainder.
blockReward is that share, read exactly from the on-chain issuance journal, plus the block's priority fees. It is
0 (plus fees) until the epoch is settled. Base fees are burned and not included. Smartnode (PoS), founder, Quantum
Reserve and IPFS shares are not block rewards; see /api/v1/issuance.
Examples¶
API=https://explorer.pqwerai.com/api # or http://127.0.0.1:8089/api for a local explorer
curl -s "$API?chainid=20778&module=account&action=balance&address=0xYourAddress"
curl -s "$API?module=account&action=txlist&address=0xYourAddress&page=1&offset=25&sort=desc"
# ModelRegistry / AIJobMarket addresses are published after their deployment on chain 20778
curl -s "$API?module=logs&action=getLogs&address=$MODEL_REGISTRY&fromBlock=0&toBlock=latest"
curl -s "$API?module=contract&action=getabi&address=$AI_JOB_MARKET"
curl -s "$API?module=proxy&action=eth_blockNumber"
Tool configuration¶
Snippets not executed
The snippets below follow each tool's documented Etherscan configuration; the tools themselves were not run
against explorer.pqwerai.com. The API is covered by the explorer tests and was probed live after deployment.
Hardhat (@nomicfoundation/hardhat-verify)¶
Lookups work; npx hardhat verify fails because the public endpoint refuses its POST /api (HTTP 405).
const config: HardhatUserConfig = {
// ... solidity and networks.pqwerai as on the Hardhat page
etherscan: {
apiKey: { pqwerai: "not-needed" }, // any non-empty value; the explorer ignores it
customChains: [
{
network: "pqwerai",
chainId: 20778,
urls: {
apiURL: "https://explorer.pqwerai.com/api",
browserURL: "https://explorer.pqwerai.com",
},
},
],
},
};
Foundry¶
[etherscan]
pqwerai = { key = "not-needed", url = "https://explorer.pqwerai.com/api", chain = 20778 }
cast commands that read from Etherscan (for example cast source <address> --chain 20778) use the
getsourcecode lookup; because no PQWERAI contract is verified, they report that the source is not verified.
forge verify-contract is not supported.
ethers v6 EtherscanProvider¶
import { EtherscanProvider, Network } from "ethers";
class PqwerAIExplorer extends EtherscanProvider {
getBaseUrl(): string { return "https://explorer.pqwerai.com"; } // ethers appends /api?...
}
const explorer = new PqwerAIExplorer(new Network("pqwerai", 20778n));
console.log(await explorer.getBlockNumber());
Use the public RPC (https://rpc-testnet.pqwerai.com) with a JsonRpcProvider to send transactions: the explorer
proxy does not accept eth_sendRawTransaction.
Sources at 83ff5b69f0 (project repository, not public yet): explorer/pqwexplorer/etherscan.py · explorer/openapi.yaml
Found a problem? Report a documentation issue · Build testnet-20778+83ff5b69f0