Pour les développeurs / API des applications
L'API de l'explorateur
L'archive que le nœud n'est délibérément pas. Elle tient tout l'historique, c'est la seule surface de cette chaîne avec des traces d'appels, et elle est en lecture seule au sens fort - chaque POST donne un 405.
Pourquoi cela existe
Le nœud garde une courte fenêtre d'historique - environ deux minutes de blocs - et une requête en dehors répond null plutôt qu'une erreur. C'est un arbitrage délibéré : il sert le présent rapidement et confie le passé à quelque chose de bâti pour ça. Ce service est ce quelque chose. Le séquenceur copie chaque log dans Postgres au fil de l'eau, et cette API lit cet index.
Deux questions trouvent donc ici leur réponse, et nulle part ailleurs :
- Tout ce qui est plus ancien que la fenêtre du nœud. Une transaction de ce matin, un bloc de la semaine dernière, tout l'historique de transferts d'un jeton.
- Les traces d'appels. Le nœud n'expose aucun espace de noms
debug, doncGET /tx/{hash}est le seul endroit sur cette chaîne où voir les appels internes d'une transaction.
Certains champs de certaines routes sont lus en direct depuis le nœud au moment de servir la requête - un solde, un enregistrement du service de noms, une sonde de contrat, les mini-blocs d'un bloc que l'index n'a pas rattrapé. Quand le nœud est injoignable, ils reviennent nuls ou absents tandis que le reste de la réponse est servi depuis l'index : une réponse partielle est donc normale et ne lève pas d'erreur.
URL de base et CORS
| Point d'accès | Value |
|---|---|
| Public | https://explorer.picklechain.xyz/api/aussi montée sur /api/ par les sites du service de noms et de la boîte à outils |
| Une pile à vous | http://127.0.0.1:4010le port propre du service ; il n'est pas publié hors du réseau de conteneurs dans le fichier compose livré |
| CORS | une liste d'autorisationOPTIONS répond 204 avec GET et OPTIONS autorisés ; une Origin absente de la liste est refusée 403 |
La chaîne
Blocs, mini-blocs, transactions et la répartition des frais.
/stats
GET- Params
- none
- Retour
- a flat object of counters
Chain-wide counters: block and transaction totals, wallets, gas used, the cadence figures the node reports, the mini-block head, index lag and the spool's own health.
Aussi à. GET /
Bon à savoir. Recomputed once a second by a background thread and served from a cache for six tenths of a second, so two calls in the same instant give the same answer. It also carries a rate counter this reference does not quote: the site publishes no throughput figure, and the number is local anyway.
/overview
GET- Params
- none
- Retour
- {stats, charts, blocks, txs, topAccounts}
The explorer's front page in one call: the cached stats, 48 chart points, the 8 most recent blocks that carried transactions, 12 transactions and the 8 busiest accounts.
Bon à savoir. Use this instead of five calls. Its parts are the other routes' defaults and nothing about it is configurable.
/charts
GET- Params
- limit (default 48, clamped to 200)
- Retour
- [{number, timestamp, txCount, gasUsed}]
A bare array, oldest first.
Bon à savoir. It prefers blocks that carried transactions and falls back to all blocks only when fewer than four match, so the series is not evenly spaced in time and must not be read as one.
/blocks
GET- Params
- limit, offset, active=1
- Retour
- [{number, hash, timestamp, gasUsed, txCount, miniCount}]
A bare array, newest first. `active=1` returns only blocks that carried transactions.
Bon à savoir. No total is returned, so there is nothing to page against except asking until you get a short answer.
- Params
- limit, offset over the block's transactions
- Retour
- one block with its transactions and mini-blocks
The number is parsed permissively: decimal and 0x both work.
Bon à savoir. `limit` defaults to 50 here rather than 25, and the mini-blocks fall back to a live read against the node when the index has none for the block. 404 when unknown.
/minis
GET- Params
- limit, offset
- Retour
- {total, minis: [...]}
Mini-blocks, newest first. One of the few routes that does return a total.
Bon à savoir. Timestamps are `timestamp_us`: MICROSECONDS, not seconds, and a decimal number rather than a hex quantity.
- Params
- limit, offset over the transactions
- Retour
- one mini-block
By decimal number or by hash.
Bon à savoir. When the index does not have it, the service asks the node - and the answer then ALSO carries `stateDiffHash`, `sequencerSig` and `receipts`, which the indexed answer does not. The shape depends on where it was found.
/txs
GET- Params
- limit, offset
- Retour
- a bare array, newest first
Transaction summaries.
Bon à savoir. No total.
/tx/{hash}
GET- Params
- none
- Retour
- the full transaction
The richest object in the API: input data, the decoded method for known selectors, logs with labelled addresses, CALL TRACES, token transfers and NFT transfers.
Bon à savoir. The traces are the reason this route exists. The node exposes no debug namespace at all, so there is nowhere else on this chain to get them. 404 when unknown.
/fees
GET- Params
- none
- Retour
- {deployed, router, split, burn, launches, arcadeSkims, deferred, claimed, pendingEthWei, ...}
Everything the fee split has done and everything still waiting, read from the log spool rather than over RPC.
Bon à savoir. `{"deployed": false}` and NOTHING ELSE when the fee layer is not in the manifest - that is an ordinary state, not an error, because that layer is deployed by hand. The ether side and the token side are kept as separate figures and never summed.
Les comptes
Qui a transigé, et tout ce qu'on sait d'une adresse.
/accounts
GET- Params
- limit, offset
- Retour
- {total, accounts: [...]}
Accounts ordered by how much they have transacted.
Bon à savoir. The ordering is by transaction count, not by balance.
- Params
- limit, offset over the transaction lists
- Retour
- the largest payload in the service
Balance, nonce, counts, whether it is a contract, its creator and what it created, token and NFT holdings with metadata, the name-service record, and recent transactions and transfers.
Bon à savoir. `bytecode` is TRUNCATED to 400 hex characters with an ellipsis appended; `bytecodeSize` is the real length. The whole answer is cached for a few seconds under a key that includes the paging, so two different pages are two different cache entries.
Jetons, NFT et noms
Des métadonnées fusionnées avec le registre, et la seule route qui n'est pas du JSON.
/tokens
GET- Params
- none
- Retour
- a list of at most 40 tokens
PKL pinned first, then by transfer count. Each entry merges a live probe of the contract with the operator's registry entry.
Bon à savoir. Forty is a hard cap and there is no paging past it. An address that probes as an NFT is skipped even if the registry calls it a token.
/nfts
GET- Params
- none
- Retour
- {nfts: [...]}
At most 40 collections, verified ones first, then by how many have been minted.
Bon à savoir. The collection list is DISCOVERED from transfer logs rather than registered, so a collection nobody has traded is absent.
- Params
- limit, clamped to 48
- Retour
- the collection, its items and its 30 most recent transfers
Collection metadata merged from the chain and the registry.
Bon à savoir. Items are fetched one at a time up to the clamp, and off-chain metadata is resolved by a BACKGROUND thread - so the first request for a cold collection returns items whose metadata is still missing, and a second request a moment later returns more. Held for fifteen seconds in a cache of its own.
- Params
- none
- Retour
- one item plus `collectionMeta`
One token of a collection.
Bon à savoir. The token id must be all digits, or the path does not match this route at all and you get the 404 for an unknown route.
/name/{name}
GET- Params
- none
- Retour
- {name, label, available, reserved, owner, resolved, expires, price, twitter, website, description}
A name-service lookup, read live from the registry contract.
Bon à savoir. A trailing suffix is stripped, and the label must be 3 to 32 characters. A name outside that range, and any lookup at all when the name service is not configured, is a 404 - which is indistinguishable from a name that does not exist.
- Params
- none
- Retour
- raw image bytes
The only non-JSON, non-stream route. The content type is inferred from the stored file's extension.
Bon à savoir. 404 as JSON when there is no logo, so a client must check the status before treating the body as an image.
Le direct, et les deux verbes qui ne sont pas GET
Le flux d'événements, le préflight, et le 405.
/live
GET- Params
- none
- Retour
- text/event-stream, one stats frame per update
Server-sent events carrying the same object /stats returns, pushed when it changes.
Bon à savoir. Bounded to 32 concurrent streams - the 33rd gets 503 - and the server CLOSES every stream after five minutes. A client that does not reconnect simply stops receiving, with no error.
any
OPTIONS- Params
- none
- Retour
- 204
The preflight. Allowed methods are GET and OPTIONS, allowed header is Content-Type.
Bon à savoir. 403 when an Origin is present and not on the allowlist, rather than a 204 without the allow header.
any
POST- Params
- none
- Retour
- 405
This API is read-only and answers 405 to every POST, in JSON and with the CORS headers.
Bon à savoir. It had one write route: a token-metadata edit signed by the contract's owner. It is gone, along with the form that called it, because an explorer that takes visitor-supplied identity for an asset is an impersonation surface.
Limites, pagination et caches
| Limite | Value |
|---|---|
| Request rate | 300 per minute per client addressthen 429; the window is wall-clock and resets on the minute |
| Client identity | the rightmost trusted X-Forwarded-For entryindexed from the right by the number of trusted proxy hops, because the leftmost entry is whatever the client wrote |
| Request body | 600,000 bytesthere is nothing to POST, but the cap exists |
| List paging | limit <= 100, offset >= 0a non-numeric limit silently becomes the default rather than erroring |
| Live streams | 32 concurrent, 300 seconds each503 above the first, silent close at the second |
| Answer cache | about 3 secondson /address, /tokens, /nfts and the NFT routes; the stats cache is shorter |
La limite de débit est par adresse cliente, et elle est partagée avec la page de l'explorateur elle-même
Trois cents requêtes par minute, c'est généreux pour une personne et maigre pour une reprise d'historique. La fenêtre est à l'horloge murale : elle se réinitialise à la minute plutôt que de glisser, donc une rafale au tournant d'une minute peut dépenser deux fenêtres en deux secondes puis répondre 429 pendant tout le reste de la seconde. Il n'y a pas d'en-tête retry-after sur ce service - temporisez vous-même.
L'identité derrière le compteur est l'adresse cliente transmise, lue à l'extrémité droite de la chaîne parce que l'entrée la plus à gauche est ce que l'appelant a bien voulu écrire. Derrière un proxy qui n'ajoute rien, tous les appelants s'effondrent en un seul seau et tout l'internet partage un budget.
La pagination est limit et offset, écrêtée à cent. Une limite non numérique devient la valeur par défaut plutôt qu'une erreur, et une limite négative devient un - une requête mal formée obtient donc une réponse plausible plutôt qu'une protestation. La plupart des routes de liste ne renvoient pas de total ; /minis et /accounts sont les exceptions.
/address, /tokens, /nfts et les routes NFT sont tenues dans un cache de courte durée indexé par chemin et pagination, et /stats est recalculé par un fil d'arrière-plan et servi depuis un cache plus court encore. Deux requêtes identiques au même instant donnent des réponses identiques, ce qui convient à une page et ne convient pas à une boucle de confirmation. Sondez le nœud pour un reçu, pas ceci.
Fraîcheur et retard
/stats porte les nombres qui disent à quel point l'index est à jour : indexedBlock face à latestBlock, indexLag comme différence, et derivedLag pour les vues matérialisées - les soldes de jetons et la propriété des NFT sont construits par des travailleurs séparés et peuvent traîner derrière les transactions dont ils viennent.
# Is the archive current? Compare the two, do not trust either alone.
curl -s "$EXPLORER_API/stats" | jq '{latestBlock, indexedBlock, indexLag, derivedLag}'
# One transaction, whole, traces included. This is the route with no substitute.
curl -s "$EXPLORER_API/tx/$HASH" | jq '{success, decoded, traces: (.traces|length), tokenTransfers}'
# Page an address's history by offset - and see the note below before relying on it.
curl -s "$EXPLORER_API/address/$ADDR?limit=100&offset=0" | jq '.transactions | length'La pagination par offset glisse sous une liste qui grandit
Chaque liste ici va du plus récent au plus ancien, et les nouvelles lignes arrivent par la tête. La page deux, récupérée un instant après la page un, la chevauche donc - et des lignes peuvent être sautées entièrement pendant que vous marchez. Pour une reprise d'historique qui doit être complète, paginez par numéro de bloc en descendant, ou récupérez un bloc à la fois ; offset est fait pour une interface, pas pour un importateur.
Une dernière asymétrie bonne à connaître avant d'indexer quoi que ce soit : cette chaîne énumère logIndex par transaction plutôt que par bloc, donc la paire (blockNumber, logIndex) n'est pas unique. Incluez le hash de la transaction dans toute clé que vous construisez.