#NACRE API Overview
This page introduces the public HTTP and WebSocket APIs for developers building wallets, bots, or data clients. It covers units, error responses, and service paths. The Indexer HTTP API describes each route and its fields.
The first keyless launchpad on Pearl.
A pearl is a token launched on NACRE. Its keyless pool is a script-locked output. The pool has no private key and can only move by satisfying its script. Curve rules have been checked on a local test chain. There is no external audit yet, and mainnet figures are pending.
#Where to read next
| Document | What it covers | Who it is for |
|---|---|---|
| Indexer HTTP API | GET and POST under /api/v1, including list, pearl, trades, candles, address, broadcast, and errors | Wallets, websites, and data clients |
| WebSocket feed | /ws channels tip, tokens:new, token:<id> (pearl, trade, and second candles), and address:<addr> | Live boards and trade monitors |
| Queue service | WebSocket /seq/v1 and GET /seq/v1/pools/:tokenId | Wallets that buy, sell, harvest, or swap |
| Ten-minute client | A runnable TypeScript client that lists pearls and follows trades | First integration |
The schemas live in packages/shared/src/. When this page and that package disagree, the package is the contract.
#Units
JSON never uses floating-point amounts. Parse PRL amounts with bigint.
| Idea | JSON type | Rule |
|---|---|---|
| PRL amount | GrainStr | Decimal integer string. 1 PRL = 100,000,000 grains ("100000000"). Pattern ^(0|[1-9]\d*)$. |
| Token count | integer | Whole tokens. One layer is 1,000,000 tokens. Supply is 1,000,000,000 tokens. |
| Curve progress | step | Integer 0 through 800. It counts curve layers already sold. 800 means the pearl can be harvested. |
| Supply in layers | totalLots | Always 1000 on a standard pearl: 800 curve layers plus 200 layers reserved for the harvested market. |
| Curve order size | lots on a queue join | Only 1, 2, 5, 10, 20, or 50 layers. A harvest uses 0. |
| Harvested-market order size | lots on a swap join | One of 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377. |
| Trade fee | tradeFeeBps | Default 100 bps (1%). Allowed range in the schema is 1 through 10,000. Charged on each state move, rounded up. This is not the miner fee. |
| Launch fee | launchFeeGrains | Default "500000000" (5 PRL). The creator pays it when launching. The value is configurable. |
| Miner fee | grains, or grains per virtual byte | Minimum relay rate in the defaults is 1,000 grains per kvB (1 grain per vB). |
| Dust | p2trDustGrains | 330 grains is the P2TR dust floor in the defaults. Prefer at least 1,000 grains on an ordinary output. |
| Unconfirmed chain | chainDepth | At most 25 unconfirmed pool transactions per pearl per block. The queue offers a turn only while chainDepth is 24 or less. |
#Identifiers and time
- A pearl id (
tokenId) is an outpoint,"txid:vout". The txid is 64 lowercase hex characters. The public id is the launch reveal transaction's initial pool output. Encode it withencodeURIComponentin a URL (:becomes%3A). - Timestamps (
TimeMs) are Unix milliseconds, such as1763740800000. - Candle intervals are
1s,5s,15s,30s,1m,5m,15m,1h,4h, and1d. Second candles use the time a trade was first seen, cover the last 2 hours, and mark buckets containing unconfirmed trades withpending: true. Empty buckets carry forward the previous close when one is available. Intervals of1mand longer use accounting time and omitpending. See the Indexer HTTP API for examples and the WebSocket feed for second-candle updates. - A launch image is at most 30,000 bytes (
TOKEN_META_LIMITS.imageMaxBytes). Supported media types areimage/png,image/jpeg,image/webp, andimage/gif. - Addresses are Taproot (P2TR). The schema pattern is
^(prl|tprl|rprl)1p[02-9ac-hj-np-z]{58}$.
#Networks
Network | Address prefix | Default node RPC port | BIP86 coin type |
|---|---|---|---|
mainnet | prl | 44107 | 808276 |
testnet | tprl | 44109 | 1 |
regtest | rprl | 18334 | 1 |
The target block interval in the defaults is about 194 seconds. That is a target, not a promise that every block arrives on time.
#Local ports
These are the loopback ports in packages/shared/src/network.ts. A public gateway can put the same path prefixes on one host. On the machine that runs the processes, the indexer and the queue are reached on these ports.
| Service id | Loopback port | Path prefix |
|---|---|---|
web | 3000 | / |
indexer | 3001 | /api/v1, /ws |
sequencer | 3002 | /seq/v1 |
chain-tools | 3003 | /faucet, /api/v1/faucet |
status | 3004 | /status, /status/v1 |
Mainnet does not give users PRL. Faucet claim routes are for testnet and regtest only.
#Shared HTTP rules
#Pages
List routes use an opaque cursor. Do not page by offset.
| Query | Type | Rule |
|---|---|---|
cursor | string, optional | The nextCursor from the previous page. |
limit | integer, optional | Default 50, range 1 through 200. Candles default to 300 and allow up to 1,000. |
{
"items": [],
"nextCursor": null
}nextCursor is null when there is no further page. The string itself is opaque.
#Errors
Every 4xx and 5xx JSON body uses this shape:
{
"error": {
"code": "bad_request",
"message": "limit must be between 1 and 200",
"detail": { "field": "limit" }
}
}detail may be absent.
code | Typical status | Meaning | Client action |
|---|---|---|---|
bad_request | 400 | Missing field, bad format, or schema rejection | Fix the query, body, or path encoding |
not_found | 404 | Pearl, transaction, or image is not indexed | Treat the resource as absent |
conflict | 409 | State clash, such as a spent output | Reload the pool or the list and retry |
rate_limited | 429 | Per-IP limit | Wait and retry. The indexer sets Retry-After in seconds |
node_rejected | 422 | A Pearl node refused the transaction. message carries the node text | Check inputs, fee, and script conditions |
internal | 500 | Server failure | Retry later and keep the request context in the client log |
#Rate limits
The indexer applies one limit to HTTP routes other than GET /healthz and OPTIONS. The default is 300 requests per 60 seconds per IP. Response headers are X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Over the limit, the status is 429, code is rate_limited, and Retry-After is set in seconds. There is no separate broadcast bucket in the indexer. The queue has its own limits, listed in the queue service.
#What each service does
The indexer reads the chain and serves /api/v1 plus /ws. It does not order pool trades. Launch and transfer transactions go to POST /api/v1/tx/broadcast. Buys, sells, harvests, and post-harvest swaps go to the queue.
After all 800 curve layers sell, the pearl is harvested. The JSON status changes from curve to amm. The harvested market is an on-chain pool, not an order book. The timestamp field is still named graduatedAt.
| Method and path | Role |
|---|---|
GET /api/v1/tokens | List pearls |
GET /api/v1/tokens/:id | One pearl |
GET /api/v1/tokens/:id/trades | Trades and other pearl events |
GET /api/v1/tokens/:id/holders | Holder rows |
GET /api/v1/tokens/:id/candles | Second, minute, hour, and day candles |
GET /api/v1/tokens/:id/curve | Curve table |
GET /api/v1/tokens/:id/image | Image bytes |
GET /api/v1/address/:a/utxos | Plain and token outputs |
GET /api/v1/address/:a/portfolio | Balances |
GET /api/v1/address/:a/activity | Address history |
GET /api/v1/tx/:txid | Decoded transaction |
GET /api/v1/tx/:txid/raw | Raw transaction hex |
GET /api/v1/chain/tip | Height, hash, and suggested fee rate |
GET /api/v1/stats | Aggregate counters |
POST /api/v1/tx/broadcast | Broadcast a launch or transfer, not a pool trade |
GET /healthz | Process health. The indexer body matches { ok, service, network, uptimeSec } |
GET /status/v1/flags returns { pauseLaunch, pauseQueue, announcement }. A UI checks those flags before it offers launch or queue actions.
#Next
Build the smallest client in the ten-minute client, then use the Indexer HTTP API for the rest of the routes.