DocumentationAPI Reference~4134 words
Source: docs/api/REST.en.md

#REST API

This page is the HTTP reference for developers building wallets, sites, or data clients for NACRE. It covers pearls, pools, transactions, and the test PRL faucet.

The first keyless launchpad on Pearl.

Rules below were checked against the indexer and chain-tools code. They describe a local or test deployment. There is no external audit yet, and mainnet figures are pending. NACRE is not described here as live on mainnet.

A pearl is a token launched on NACRE. A layer is one increment of its curve. The JSON field for the current layer is step (0 through 800). Harvest is the move from the curve to the on-chain market after layer 800. The JSON status for that phase is amm, and the event kind is graduate. A pool is the script-locked output that holds the pearl's PRL. It is keyless: the pool has no private key and can only move by satisfying its script.

Amounts on the wire are GrainStr: a decimal integer string of grain, with no thousands separator and no unit suffix. 1 PRL is 100,000,000 grain. In this page, prose uses separators (50 PRL, 5,000 PRL). Timestamps are Unix milliseconds unless a field says otherwise.

#Shared rules

The indexer prefix is /api/v1. Path parameters :id and :a that contain : must be passed through encodeURIComponent first. ab repeated to 64 hex digits plus :1 is sent as that hex text, then %3A1.

A token id is the reveal transaction's pool output, txid:vout. The protocol comment records vout 1. A txid is 64 lowercase hex characters.

Addresses are Pay-to-Taproot. The human-readable prefix is prl on mainnet, tprl on testnet, and rprl on regtest.

Every indexer error body is JSON:

json
{
  "error": {
    "code": "bad_request",
    "message": "Invalid query: status: Invalid enum value",
    "detail": []
  }
}

detail is omitted when the handler has nothing extra. Branch on code, not on message.

HTTPerror.codeWhen
400bad_requestPath, query, or body failed validation, or broadcast rejected the transaction before the node
404not_foundUnknown token, image, transaction, or route
409conflictReserved by the error enum. The indexer routes on this page do not return it
422node_rejectedThe Pearl node refused the broadcast, or the tip could not be read during broadcast
429rate_limitedThe shared indexer limit was exceeded
500internalUnhandled indexer failure. The message is Internal server error

Successful JSON responses use Content-Type: application/json; charset=utf-8. Cached GET responses send ETag and Cache-Control. Repeat the request with If-None-Match to receive 304 and an empty body. The default JSON cache lifetime is 1 second (max-age=1). POST /api/v1/tx/broadcast and GET /healthz send Cache-Control: no-store.

The indexer applies one limit to every route except GET /healthz and OPTIONS: 300 requests per 60 seconds per client IP. The response headers are X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix seconds), and, when limited, Retry-After (seconds, at least 1). The indexer reads the first address in X-Forwarded-For when that header is present.

The faucet is a different process. Its default listen address is 127.0.0.1:18787. It does not serve /api/v1/faucet.

#Indexer routes

Method and pathUse
GET /healthzIndexer process and chain tip
GET /api/v1/tokensList pearls
GET /api/v1/tokens/:idOne pearl
GET /api/v1/tokens/:id/tradesTrades for one pearl
GET /api/v1/tokens/:id/holdersHolders
GET /api/v1/tokens/:id/candlesPrice candles
GET /api/v1/tokens/:id/curveCurve table
GET /api/v1/tokens/:id/imageLaunch image bytes
GET /api/v1/address/:a/utxosUTXOs for an address
GET /api/v1/address/:a/portfolioPRL balance and pearls held
GET /api/v1/address/:a/activityTrades that include an address
GET /api/v1/tx/:txidDecoded transaction
GET /api/v1/tx/:txid/rawRaw transaction hex
GET /api/v1/chain/tipChain tip and fee hint
GET /api/v1/statsSite counters
POST /api/v1/tx/broadcastLaunch and transfer only

The indexer does not mount /api/v1/market/:tokenId/orders. Do not send order-book create, list, or cancel calls to it.

#GET /healthz

Reports whether the indexer process is answering and can read the chain tip. It is not the faucet probe. A slow node fails this route, because the handler reads the tip before it responds.

Parameters: none.

http
GET /healthz HTTP/1.1
Host: indexer.example
json
{
  "ok": true,
  "service": "indexer",
  "network": "testnet",
  "uptimeSec": 3600
}

service is indexer. network is mainnet, testnet, or regtest. uptimeSec counts from process start.

HTTPerror.codeWhen
500internalThe tip query failed

Rate limit: none. This path is excluded from the indexer counter.

#GET /api/v1/tokens

Lists pearls, optionally filtered by phase, name prefix, or creator.

NameInTypeRequiredDefaultRules
sortquerystringnonewnew, trending, marketCap, volume24h, progress, or lastTrade
statusquerystringnoomittedcurve while the pearl is on the bonding curve, or amm after harvest. There is no graduated value
qquerystringnoomittedPrefix match on name, symbol, or id. At most 64 characters
creatorqueryaddressnoomittedP2TR address for the network you are querying
cursorquerystringnoomittedOpaque cursor from the previous nextCursor
limitqueryintegerno501 through 200
http
GET /api/v1/tokens?sort=new&status=curve&limit=1 HTTP/1.1
Host: indexer.example
json
{
  "items": [
    {
      "id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
      "genesisOutpoint": "fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210:0",
      "name": "Pearl Cat",
      "symbol": "PCAT",
      "description": "Example pearl",
      "image": "/api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/image",
      "creator": "tprl1examplecreator",
      "status": "curve",
      "ammState": null,
      "ammReserveTokens": null,
      "step": 120,
      "confirmedStep": 118,
      "totalLots": 1000,
      "poolAddress": "tprl1examplepool",
      "poolOutpoint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:1",
      "poolValue": "10000",
      "nextPrice": "10000",
      "marketCap": "10000000",
      "holders": 2,
      "volume24h": "0",
      "progressBps": 1500,
      "createdHeight": 10,
      "createdAt": 1763740000000,
      "graduatedAt": null
    }
  ],
  "nextCursor": null
}

name is 1 to 32 characters. symbol matches ^[A-Z0-9]{2,10}$. description is optional and at most 280 characters. website, twitter, and telegram are optional and at most 200 characters. step includes the unconfirmed chain. confirmedStep counts confirmed blocks only. progressBps is step / 800 in basis points, from 0 to 10,000. poolValue, nextPrice, marketCap, and volume24h are grain strings. totalLots is the supply counted in layers (1,000 for the full 1,000,000,000 tokens). On the curve, ammState and ammReserveTokens are null. After harvest they are set, status is amm, and graduatedAt is the harvest time in milliseconds. nextCursor is null when there is no next page.

The numbers in the sample are shapes, not a live pearl.

HTTPerror.codeWhen
400bad_requestA query field failed validation
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id

Returns one pearl. step includes the unconfirmed chain. confirmedStep does not.

NameInTypeRequiredDefaultRules
idpathoutpointyestxid:vout, URL-encoded
http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1 HTTP/1.1
Host: indexer.example

The body is one object with the same fields as items[0] in the list response.

HTTPerror.codeWhen
400bad_requestid is not an outpoint
404not_foundNo pearl with that id
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id/trades

Pages through launch, buy, sell, transfer, and harvest events for one pearl.

NameInTypeRequiredDefaultRules
idpathoutpointyesURL-encoded
kindquerystringnoomittedComma-separated launch, buy, sell, transfer, graduate. Unknown names return 400
cursorquerystringnoomittedOpaque
limitqueryintegerno501 through 200
http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/trades?kind=buy,sell&limit=1 HTTP/1.1
Host: indexer.example
json
{
  "items": [
    {
      "txid": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
      "tokenId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
      "kind": "buy",
      "phase": "curve",
      "address": "tprl1examplebuyer",
      "counterparty": null,
      "tokens": 1000000,
      "grains": "10000",
      "feeGrains": "100",
      "stepFrom": 0,
      "stepTo": 1,
      "status": "confirmed",
      "seq": 1,
      "height": 11,
      "time": 1763740800000
    }
  ],
  "nextCursor": null
}

tokens is the pearl amount as an integer count, not a layer count. One layer is 1,000,000 tokens. grains is principal: PRL the buyer adds to the pool, or PRL the pool pays out on a sell. Other kinds use "0". feeGrains is the platform fee, not the miner fee. phase is required on buy and sell. For phase amm, stepFrom and stepTo are null. seq is the queue number for that pool, or null when the trade did not go through the queue. status is queued, mempool, confirmed, or dropped.

HTTPerror.codeWhen
400bad_requestBad id, kind, or limit
404not_foundUnknown pearl
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id/holders

Pages through current holders of one pearl.

NameInTypeRequiredDefaultRules
idpathoutpointyesURL-encoded
cursorquerystringnoomittedOpaque
limitqueryintegerno501 through 200
http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/holders?limit=1 HTTP/1.1
Host: indexer.example
json
{
  "items": [
    {
      "tokenId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
      "address": "tprl1examplepool",
      "tokens": 800000000,
      "shareBps": 8000,
      "tag": "pool"
    }
  ],
  "nextCursor": null
}

tokens is the integer pearl count. shareBps is that holder's share of supply in basis points, from 0 to 10,000. tag is creator, pool, market, or null.

HTTPerror.codeWhen
400bad_requestBad id or limit
404not_foundUnknown pearl
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id/candles

Returns price and volume buckets in ascending order by bucket start. Prices are in grains per 1,000,000 tokens, excluding the platform fee.

  • Second candles (1s, 5s, 15s, and 30s) use the time the indexer first sees the trade in the mempool, falling back to its accounting time if no mempool timestamp is available.
  • A second candle has pending: true while it contains at least one unconfirmed trade (queued or mempool). Once all its trades confirm, pending becomes false. When a trade is dropped, the next read rebuilds the series without it.
  • Second candles cover a rolling 2-hour window. A bucket with no trades carries forward the previous close when one is available. In that bucket, all four prices equal that close, n and tokens are 0, v is "0", and pending is false.
  • Intervals of 1m and longer use the trade's accounting time and omit pending. Only second candles are sent as candle events on the WebSocket feed.
NameInTypeRequiredDefaultRules
idpathoutpointyesURL-encoded
intervalquerystringno5m1s, 5s, 15s, 30s, 1m, 5m, 15m, 1h, 4h, or 1d
fromqueryintegernoomittedNonnegative Unix milliseconds. Second intervals clamp the lower bound to the start of the 2-hour window and align it down to a bucket start
toqueryintegernoomittedNonnegative Unix milliseconds. Must be at least from if both are set. Second intervals clamp the upper bound to the indexer's current time and align it down to the last included bucket start
limitqueryintegerno3001 through 1,000. Keeps the most recent buckets in the requested range

A five-minute candle omits pending:

http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/candles?interval=5m&limit=1 HTTP/1.1
Host: indexer.example
json
[
  {
    "t": 1763740500000,
    "o": "10000",
    "h": "10000",
    "l": "10000",
    "c": "10000",
    "v": "10000",
    "tokens": 1000000,
    "n": 1
  }
]

A one-second request made within the example's 2-hour window returns an unconfirmed trade and the empty bucket after it:

http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/candles?interval=1s&from=1763741094000&to=1763741095000 HTTP/1.1
Host: indexer.example
json
[
  {
    "t": 1763741094000,
    "o": "10000",
    "h": "12000",
    "l": "10000",
    "c": "12000",
    "v": "50000",
    "tokens": 1000000,
    "n": 1,
    "pending": true
  },
  {
    "t": 1763741095000,
    "o": "12000",
    "h": "12000",
    "l": "12000",
    "c": "12000",
    "v": "0",
    "tokens": 0,
    "n": 0,
    "pending": false
  }
]

The response body is a JSON array of candle objects.

FieldTypeMeaning
tintegerBucket start in Unix milliseconds
o, h, l, cGrainStrOpen, high, low, and close
vGrainStrVolume in grains
tokensintegerNumber of tokens traded. A token counts each time it trades
nintegerNumber of trades
pendingbooleanPresent on second candles. Indicates whether the bucket contains an unconfirmed trade
HTTPerror.codeWhen
400bad_requestInvalid id, interval, time bounds, or limit
404not_foundUnknown pearl
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id/curve

Returns the curve fee, the allowed layer sizes, the pool reserve at every layer, and the principal for buying one layer from each layer.

NameInTypeRequiredDefaultRules
idpathoutpointyesURL-encoded
http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/curve HTTP/1.1
Host: indexer.example
json
{
  "tokenId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
  "tradeFeeBps": 100,
  "allowedStepLots": [1, 2, 5, 10, 20, 50],
  "poolReserve": ["10000"],
  "price": ["10000"],
  "step": 0
}

tradeFeeBps is an integer from 1 to 10,000. 100 bps is 1%. allowedStepLots lists how many layers one curve trade may move. The live curve response has 801 poolReserve strings (step 0 through 800) and 800 price strings. price[s] is the principal, in grain, to buy one layer from layer s. The sample above is shortened. step is the pearl's current layer.

HTTPerror.codeWhen
400bad_requestBad id
404not_foundUnknown pearl
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tokens/:id/image

Returns the raw image bytes embedded in the launch inscription. The maximum size is 30,000 bytes, set by TOKEN_META_LIMITS.imageMaxBytes.

NameInTypeRequiredDefaultRules
idpathoutpointyesURL-encoded
http
GET /api/v1/tokens/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef%3A1/image HTTP/1.1
Host: indexer.example
http
HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: public, max-age=31536000, immutable

The image bytes follow the headers. Supported media types are image/png, image/jpeg, image/webp, and image/gif. Send the response's ETag in If-None-Match on a later request to receive 304 if the image is unchanged.

HTTPerror.codeWhen
400bad_requestInvalid id, unsupported media type, empty image, or image larger than 30,000 bytes
404not_foundNo image for that pearl
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes. The image route does not have a separate counter.

#GET /api/v1/address/:a/utxos

Lists plain and pearl UTXOs for one address, including unconfirmed outputs. A payment spends only rows with kind plain and spentBy null. A token row carries a pearl. Do not spend it as plain PRL.

NameInTypeRequiredDefaultRules
apathaddressyesP2TR address. Encode it if your client encodes every path segment
http
GET /api/v1/address/tprl1examplebuyer/utxos HTTP/1.1
Host: indexer.example
json
[
  {
    "txid": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
    "vout": 1,
    "value": "500000000",
    "scriptPubKey": "5120aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "address": "tprl1examplebuyer",
    "height": 11,
    "kind": "plain",
    "tokenId": null,
    "tokens": null,
    "spentBy": null
  },
  {
    "txid": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
    "vout": 4,
    "value": "1000",
    "scriptPubKey": "5120bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "address": "tprl1examplebuyer",
    "height": null,
    "kind": "token",
    "tokenId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
    "tokens": 1000000,
    "spentBy": null
  }
]

value is grain. height is null while the output is unconfirmed. tokens is null on a plain output and the pearl count on a token output. spentBy is the spending txid when a pending or queued transaction already uses the output.

HTTPerror.codeWhen
400bad_requesta is not a P2TR address
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/address/:a/portfolio

Returns confirmed and unconfirmed plain PRL, plus each pearl the address holds. Plain balances leave out the grain that sits on pearl UTXOs.

NameInTypeRequiredDefaultRules
apathaddressyesP2TR address
http
GET /api/v1/address/tprl1examplebuyer/portfolio HTTP/1.1
Host: indexer.example
json
{
  "address": "tprl1examplebuyer",
  "confirmed": "500000000",
  "unconfirmed": "0",
  "tokens": [
    {
      "token": {
        "id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
        "name": "Pearl Cat",
        "symbol": "PCAT",
        "status": "curve"
      },
      "tokens": 1000000,
      "valueGrains": "10000"
    }
  ]
}

confirmed and unconfirmed are grain strings. Each tokens[] entry embeds a full Token object (the sample shows only the identifying fields) plus tokens (count) and valueGrains (grain string, floor of count times nextPrice divided by 1,000,000).

HTTPerror.codeWhen
400bad_requesta is not a P2TR address
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/address/:a/activity

Pages through protocol trades that include this address.

NameInTypeRequiredDefaultRules
apathaddressyesP2TR address
kindquerystringnoomittedSame comma-separated kinds as token trades
cursorquerystringnoomittedOpaque
limitqueryintegerno501 through 200
http
GET /api/v1/address/tprl1examplebuyer/activity?limit=1 HTTP/1.1
Host: indexer.example

The body is a page of Trade objects, the same shape as GET /api/v1/tokens/:id/trades.

HTTPerror.codeWhen
400bad_requestBad address, kind, or limit
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tx/:txid

Returns one transaction's status and the protocol events the indexer decoded from it.

NameInTypeRequiredDefaultRules
txidpathtxidyes64 hex characters
http
GET /api/v1/tx/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb HTTP/1.1
Host: indexer.example
json
{
  "txid": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "status": "confirmed",
  "height": 11,
  "time": 1763740800000,
  "vsize": 1214,
  "minerFee": "3642",
  "events": [
    {
      "kind": "buy",
      "phase": "curve",
      "txid": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
      "tokenId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:1",
      "address": "tprl1examplebuyer",
      "tokens": 1000000,
      "grains": "10000",
      "fee": "100",
      "poolOutpoint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:1",
      "poolValue": "20000",
      "stepFrom": 0,
      "stepTo": 1
    }
  ]
}

minerFee is grain. Event fee is the platform fee in grain. A curve buy or sell includes stepFrom and stepTo. An amm buy or sell sets those to null and adds stateFrom and stateTo. A launch event carries creator, meta, imageMime, poolOutpoint, launchFee, and tradeFeeBps. A transfer event carries from, to, and tokens. A graduate event carries address and poolValue.

vsize in the sample is an illustration of the field, not a promise about every buy.

HTTPerror.codeWhen
400bad_requesttxid is not 64 hex characters
404not_foundThe indexer has no such transaction
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/tx/:txid/raw

Returns the raw transaction, including the witness, as lowercase hex. The wallet SDK calls this when it must rebuild a launch reveal, a pool transaction, or the transaction that created a pearl UTXO, and that transaction is not already in memory. Mempool transactions are included. The node must be running with a transaction index.

NameInTypeRequiredDefaultRules
txidpathtxidyes64 hex characters
http
GET /api/v1/tx/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/raw HTTP/1.1
Host: indexer.example
json
{
  "rawTx": "02000000000101"
}

Before it returns, the indexer strips the witness, hashes the remainder, and checks that the result equals the path txid. A mismatch is 404. The sample hex is only a shape.

HTTPerror.codeWhen
400bad_requesttxid is not 64 hex characters
404not_foundThe node does not know the transaction, or the returned bytes hash to a different txid
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/chain/tip

Returns the current tip, the mempool size, and the suggested miner fee.

Parameters: none.

http
GET /api/v1/chain/tip HTTP/1.1
Host: indexer.example
json
{
  "network": "testnet",
  "height": 11,
  "hash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  "time": 1763740800000,
  "mempoolTxs": 1,
  "feeRate": 2
}

feeRate is grain per virtual byte. hash is the tip block hash.

HTTPerror.codeWhen
429rate_limitedShared indexer limit
500internalThe tip could not be read

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes.

#GET /api/v1/stats

Returns site-wide counters.

Parameters: none.

http
GET /api/v1/stats HTTP/1.1
Host: indexer.example
json
{
  "tokens": 1,
  "graduated": 0,
  "trades24h": 1,
  "volume24h": "10000",
  "tvl": "10000",
  "traders24h": 1
}

graduated counts pearls whose status is amm (harvested). volume24h and tvl are grain strings. tvl is PRL locked in pools. The sample is a shape, not a measured deployment.

HTTPerror.codeWhen
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes. Stats does not have its own lower limit in the indexer.

#POST /api/v1/tx/broadcast

Submits a launch (commit or reveal) or a pearl transfer. Curve buys, curve sells, harvest (graduate), and post-harvest market buys and sells are rejected here. Submit those to the queue at /seq/v1.

The indexer reads the next block height as tip height plus 1. It forwards the transaction only when every input has nSequence equal to 0xffffffff, or when nLockTime is strictly less than that next height. Anything else is 400 and is not sent to the node. This check exists because Pearl node v1.5.7 does not apply absolute lock time inside the mempool, so a non-final transaction can sit there and never be mined.

NameInTypeRequiredDefaultRules
rawTxbodyhex stringyesEven-length hex. The decoder accepts witness and legacy transactions
http
POST /api/v1/tx/broadcast HTTP/1.1
Host: indexer.example
Content-Type: application/json

{"rawTx":"02000000000101"}
json
{
  "txid": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
HTTPerror.codeWhen
400bad_requestdetail.reason is non_final_tx (also lockTime, nextHeight, nonFinalInputIndex, and sequence), or invalid_raw_tx, or the hex is too short, or the decoded events include buy, sell, or graduate
422node_rejectedThe node rejected the transaction, or the tip read failed
429rate_limitedShared indexer limit
500internalUnhandled failure

Rate limit: 300 requests per 60 seconds per IP, shared with the other indexer routes. Broadcast does not have a separate 30-per-minute bucket in the indexer.

#Faucet

The faucet hands out test PRL on regtest and testnet. chain-tools refuses to start when PAD_NETWORK is mainnet, so this process does not pay mainnet PRL. Default bind is 127.0.0.1:18787. Amounts are grain strings. The address you submit must be a P2TR address on the faucet's network: rprl on regtest, tprl on testnet.

GET /healthz on this process returns {"ok":true} and does not call the node. Node trouble shows up on GET /faucet/v1/status instead.

Send Origin from a browser. The faucet echoes that origin. It never sends *. A request whose origin is not allowed still gets a body, but without Access-Control-Allow-Origin, so the browser drops it. OPTIONS returns 204 when the origin is allowed and 403 with no CORS header when it is not.

ItemValue
FAUCET_CORS_ORIGINSComma-separated origins, or the keyword local
One originhttps://host[:port] with no path
locallocalhost, 127.0.0.1, and [::1], any port, http or https
Unset, not productionSame as local
Unset, NODE_ENV=productionSITE_URL, plus https:// plus SITE_DOMAIN. Entries that contain __ are dropped. If both are missing, no browser origin is allowed
MethodsGET, POST, HEAD, OPTIONS
Request headerContent-Type
Preflight cacheAccess-Control-Max-Age: 600
VaryOrigin

Requests with no Origin (a script on the same machine) are unchanged. X-Forwarded-For is ignored unless FAUCET_TRUST_PROXY=1. Behind a proxy, set that flag or the challenge and the IP limit use the proxy address.

Claim in this order:

  1. GET /faucet/v1/status?address=<address> and read drip, balance, and that address's eligible and retryAt.
  2. When eligible is true, GET /faucet/v1/challenge and keep id, prompt, and expiresAt.
  3. prompt looks like 17 + 42. Each addend is an integer from 10 to 99. Sum them and send the sum as a decimal string, for example 59.
  4. Within 120 seconds, POST /faucet/v1/claim from the same IP, with Content-Type: application/json. answer must be a JSON string, not a JSON number.
  5. Show the returned txid as unconfirmed. The next status call for that address has eligible false.

The challenge is bound to the IP. A new challenge from the same IP deletes the previous one. A wrong answer, an expired challenge, or a different IP deletes the challenge. Request another one. Every POST /faucet/v1/claim counts toward the IP limit, including a body the parser rejects.

#GET /healthz

Process liveness check for chain-tools.

Parameters: none.

http
GET /healthz HTTP/1.1
Host: 127.0.0.1:18787
json
{
  "ok": true
}
HTTPerror.codeWhen
500internalThe process failed outside the faucet handlers

Rate limit: none on this path.

#GET /faucet/v1/status

Returns faucet balances and, when an address is passed, whether that address may claim now.

NameInTypeRequiredDefaultRules
addressqueryaddressnoomittedWhen omitted, the response field address is null. When present, it must match PAD_NETWORK
http
GET /faucet/v1/status?address=rprl1example HTTP/1.1
Host: 127.0.0.1:18787
json
{
  "network": "regtest",
  "faucetAddress": "rprl1faucet",
  "balance": "100000000000",
  "todaySent": "5000000000",
  "dailyCap": "500000000000",
  "drip": "5000000000",
  "cooldownMs": 86400000,
  "address": {
    "address": "rprl1example",
    "eligible": false,
    "retryAt": 1763740800000
  }
}
FieldUnitMeaning
balancegrainConfirmed plain UTXOs the faucet can spend. Excludes pearl outputs, unconfirmed outputs, and spent outputs
todaySentgrainGrain already counted for the current UTC day
dailyCapgrainCap for that UTC day. Default 500000000000 (5,000 PRL)
dripgrainOne claim. Default 5000000000 (50 PRL)
cooldownMsmillisecondsPer address. Default 86,400,000 (24 hours)
address.eligiblebooleanWhether that address may claim now
address.retryAtUnix millisecondsNext claim time while cooling down. Null when the address may claim
HTTPerror.codeWhen
400bad_requestThe address is malformed or belongs to another network
503internalThe node could not be reached while reading the faucet balance
500internalAny other handler failure

GET /faucet/v1/status does not count toward the claim IP limit.

Rate limit: not part of the 10-claim window. A browser origin that is not allowed still receives this JSON, without a CORS allow header.

#GET /faucet/v1/challenge

Issues one addition problem bound to the connection IP. There is no body.

Parameters: none.

http
GET /faucet/v1/challenge HTTP/1.1
Host: 127.0.0.1:18787
json
{
  "id": "0123456789abcdef0123456789abcdef",
  "prompt": "17 + 42",
  "expiresAt": 1763740920000
}
FieldMeaning
id32 hex characters from 16 random bytes. Send it back as challengeId
prompt"<a> + <b>" with a and b each from 10 to 99
expiresAtUnix milliseconds. The challenge lasts 120 seconds
HTTPerror.codeWhen
500internalThe handler failed

GET /faucet/v1/challenge does not count toward the claim IP limit.

Rate limit: not part of the 10-claim window.

#POST /faucet/v1/claim

Pays one drip after the challenge is solved from the same IP.

NameInTypeRequiredDefaultRules
addressbodyaddressyesP2TR address on PAD_NETWORK
challengeIdbodystringyesLength 16 through 128
answerbodystringyesMatches ^[0-9]{1,6}$. The decimal sum, as a JSON string
http
POST /faucet/v1/claim HTTP/1.1
Host: 127.0.0.1:18787
Content-Type: application/json

{"address":"rprl1example","challengeId":"0123456789abcdef0123456789abcdef","answer":"59"}
json
{
  "txid": "5555555555555555555555555555555555555555555555555555555555555555",
  "address": "rprl1example",
  "amount": "5000000000"
}

amount equals the current drip, in grain. txid is the transaction submitted to the node. Show it as unconfirmed until it is in a block.

HTTPerror.codeWhen
400bad_requestBad address, wrong network, body shape, or a challenge that is wrong, expired, or from another IP. Request a new challenge after a failed check
404not_foundThe path is not a faucet route. Do not retry it as a claim
409conflictThe faucet balance cannot cover the drip, or coinbase outputs are not yet spendable. Do not hammer the route
429rate_limitedThe address is still cooling down, the UTC daily cap is spent, or this IP has posted too many claims. Cooldown responses include detail.retryAt (Unix milliseconds) and Retry-After (seconds, at least 1). A spent daily cap has no retryAt. Wait for the next UTC day
502node_rejectedThe node rejected the transaction. The address cooldown is not consumed. Request a new challenge and try again
503internalThe node was unreachable
500internalAny other handler failure. Do not treat the body as a claim

Rate limit: 10 POST requests per 600,000 milliseconds (10 minutes) per IP, by default. Change it with FAUCET_IP_LIMIT and FAUCET_IP_WINDOW_MS. Change the drip, cap, and cooldown with FAUCET_DRIP_GRAINS, FAUCET_DAILY_CAP_GRAINS, and FAUCET_COOLDOWN_MS. The drip cannot be below 1,000 grain, and the daily cap cannot be below the drip.

message on a faucet error is a short human string. It is not a stable contract. Branch on error.code.

#Next

Pool trades and harvest use the queue reference. Live updates use the indexer WebSocket reference.

NACRE · The first keyless launchpad on Pearl