DocumentationAPI Reference~1200 words
Source: docs/api/README.en.md

#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.

DocumentWhat it coversWho it is for
Indexer HTTP APIGET and POST under /api/v1, including list, pearl, trades, candles, address, broadcast, and errorsWallets, 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 serviceWebSocket /seq/v1 and GET /seq/v1/pools/:tokenIdWallets that buy, sell, harvest, or swap
Ten-minute clientA runnable TypeScript client that lists pearls and follows tradesFirst 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.

IdeaJSON typeRule
PRL amountGrainStrDecimal integer string. 1 PRL = 100,000,000 grains ("100000000"). Pattern ^(0|[1-9]\d*)$.
Token countintegerWhole tokens. One layer is 1,000,000 tokens. Supply is 1,000,000,000 tokens.
Curve progressstepInteger 0 through 800. It counts curve layers already sold. 800 means the pearl can be harvested.
Supply in layerstotalLotsAlways 1000 on a standard pearl: 800 curve layers plus 200 layers reserved for the harvested market.
Curve order sizelots on a queue joinOnly 1, 2, 5, 10, 20, or 50 layers. A harvest uses 0.
Harvested-market order sizelots on a swap joinOne of 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377.
Trade feetradeFeeBpsDefault 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 feelaunchFeeGrainsDefault "500000000" (5 PRL). The creator pays it when launching. The value is configurable.
Miner feegrains, or grains per virtual byteMinimum relay rate in the defaults is 1,000 grains per kvB (1 grain per vB).
Dustp2trDustGrains330 grains is the P2TR dust floor in the defaults. Prefer at least 1,000 grains on an ordinary output.
Unconfirmed chainchainDepthAt 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 with encodeURIComponent in a URL (: becomes %3A).
  • Timestamps (TimeMs) are Unix milliseconds, such as 1763740800000.
  • Candle intervals are 1s, 5s, 15s, 30s, 1m, 5m, 15m, 1h, 4h, and 1d. Second candles use the time a trade was first seen, cover the last 2 hours, and mark buckets containing unconfirmed trades with pending: true. Empty buckets carry forward the previous close when one is available. Intervals of 1m and longer use accounting time and omit pending. 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 are image/png, image/jpeg, image/webp, and image/gif.
  • Addresses are Taproot (P2TR). The schema pattern is ^(prl|tprl|rprl)1p[02-9ac-hj-np-z]{58}$.

#Networks

NetworkAddress prefixDefault node RPC portBIP86 coin type
mainnetprl44107808276
testnettprl441091
regtestrprl183341

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 idLoopback portPath prefix
web3000/
indexer3001/api/v1, /ws
sequencer3002/seq/v1
chain-tools3003/faucet, /api/v1/faucet
status3004/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.

QueryTypeRule
cursorstring, optionalThe nextCursor from the previous page.
limitinteger, optionalDefault 50, range 1 through 200. Candles default to 300 and allow up to 1,000.
json
{
  "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:

json
{
  "error": {
    "code": "bad_request",
    "message": "limit must be between 1 and 200",
    "detail": { "field": "limit" }
  }
}

detail may be absent.

codeTypical statusMeaningClient action
bad_request400Missing field, bad format, or schema rejectionFix the query, body, or path encoding
not_found404Pearl, transaction, or image is not indexedTreat the resource as absent
conflict409State clash, such as a spent outputReload the pool or the list and retry
rate_limited429Per-IP limitWait and retry. The indexer sets Retry-After in seconds
node_rejected422A Pearl node refused the transaction. message carries the node textCheck inputs, fee, and script conditions
internal500Server failureRetry 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 pathRole
GET /api/v1/tokensList pearls
GET /api/v1/tokens/:idOne pearl
GET /api/v1/tokens/:id/tradesTrades and other pearl events
GET /api/v1/tokens/:id/holdersHolder rows
GET /api/v1/tokens/:id/candlesSecond, minute, hour, and day candles
GET /api/v1/tokens/:id/curveCurve table
GET /api/v1/tokens/:id/imageImage bytes
GET /api/v1/address/:a/utxosPlain and token outputs
GET /api/v1/address/:a/portfolioBalances
GET /api/v1/address/:a/activityAddress history
GET /api/v1/tx/:txidDecoded transaction
GET /api/v1/tx/:txid/rawRaw transaction hex
GET /api/v1/chain/tipHeight, hash, and suggested fee rate
GET /api/v1/statsAggregate counters
POST /api/v1/tx/broadcastBroadcast a launch or transfer, not a pool trade
GET /healthzProcess 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.

NACRE · The first keyless launchpad on Pearl