Für Entwickler / Anwendungs-APIs
Explorer-API
Das Archiv, das der Node bewusst nicht ist. Es hält die ganze Historie, es ist die einzige Oberfläche auf dieser Chain mit Aufruf-Traces, und es ist nur lesend im stärksten Sinn - jedes POST ist eine 405.
Warum es das gibt
Der Node behält ein kurzes Fenster der Historie - grob zwei Minuten an Blöcken - und eine Abfrage außerhalb davon antwortet null statt mit einem Fehler. Das ist ein bewusster Tausch: Er bedient die Gegenwart schnell und reicht die Vergangenheit an etwas weiter, das dafür gebaut ist. Dieser Dienst ist dieses Etwas. Der Sequencer kopiert jedes Log laufend nach Postgres, und diese API liest diesen Index.
Zwei Fragen werden also hier und nirgendwo sonst beantwortet:
- Alles, was älter ist als das Fenster des Node. Eine Transaktion von heute Morgen, ein Block von letzter Woche, die ganze Transferhistorie eines Tokens.
- Aufruf-Traces. Der Node stellt überhaupt keinen
debug-Namensraum bereit,GET /tx/{hash}ist also der einzige Ort auf dieser Chain, an dem die internen Aufrufe einer Transaktion zu sehen sind.
Einige Felder auf einigen Routen werden während der Bearbeitung der Anfrage live vom Node gelesen - ein Guthaben, ein Eintrag im Namensdienst, eine Contract-Sonde, die Mini-Blöcke eines Blocks, den der Index noch nicht eingeholt hat. Wenn der Node nicht erreichbar ist, kommen die als null oder gar nicht zurück, während der Rest der Antwort aus dem Index bedient wird, eine unvollständige Antwort ist also normal und löst keinen Fehler aus.
Basis-URL und CORS
| Endpunkt | Value |
|---|---|
| Öffentlich | https://explorer.picklechain.xyz/api/auch von den Seiten des Namensdienstes und des Werkzeugkastens unter /api/ eingehängt |
| Ein Stack, den Sie betreiben | http://127.0.0.1:4010der eigene Port des Dienstes; in der ausgelieferten Compose-Datei ist er außerhalb des Container-Netzes nicht veröffentlicht |
| CORS | eine AllowlistOPTIONS antwortet mit 204 und erlaubt GET und OPTIONS; eine Origin, die nicht auf der Liste steht, wird mit 403 abgelehnt |
Chain
Blöcke, Mini-Blöcke, Transaktionen und die Gebührenaufteilung.
/stats
GET- Params
- none
- Rückgabe
- 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.
Auch unter. GET /
Gut zu wissen. 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
- Rückgabe
- {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.
Gut zu wissen. 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)
- Rückgabe
- [{number, timestamp, txCount, gasUsed}]
A bare array, oldest first.
Gut zu wissen. 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
- Rückgabe
- [{number, hash, timestamp, gasUsed, txCount, miniCount}]
A bare array, newest first. `active=1` returns only blocks that carried transactions.
Gut zu wissen. 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
- Rückgabe
- one block with its transactions and mini-blocks
The number is parsed permissively: decimal and 0x both work.
Gut zu wissen. `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
- Rückgabe
- {total, minis: [...]}
Mini-blocks, newest first. One of the few routes that does return a total.
Gut zu wissen. Timestamps are `timestamp_us`: MICROSECONDS, not seconds, and a decimal number rather than a hex quantity.
- Params
- limit, offset over the transactions
- Rückgabe
- one mini-block
By decimal number or by hash.
Gut zu wissen. 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
- Rückgabe
- a bare array, newest first
Transaction summaries.
Gut zu wissen. No total.
/tx/{hash}
GET- Params
- none
- Rückgabe
- 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.
Gut zu wissen. 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
- Rückgabe
- {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.
Gut zu wissen. `{"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.
Konten
Wer transagiert hat, und alles, was über eine Adresse bekannt ist.
/accounts
GET- Params
- limit, offset
- Rückgabe
- {total, accounts: [...]}
Accounts ordered by how much they have transacted.
Gut zu wissen. The ordering is by transaction count, not by balance.
- Params
- limit, offset over the transaction lists
- Rückgabe
- 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.
Gut zu wissen. `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.
Token, NFTs und Namen
Mit dem Register zusammengeführte Metadaten, und die eine Route, die kein JSON ist.
/tokens
GET- Params
- none
- Rückgabe
- 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.
Gut zu wissen. 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
- Rückgabe
- {nfts: [...]}
At most 40 collections, verified ones first, then by how many have been minted.
Gut zu wissen. The collection list is DISCOVERED from transfer logs rather than registered, so a collection nobody has traded is absent.
- Params
- limit, clamped to 48
- Rückgabe
- the collection, its items and its 30 most recent transfers
Collection metadata merged from the chain and the registry.
Gut zu wissen. 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
- Rückgabe
- one item plus `collectionMeta`
One token of a collection.
Gut zu wissen. 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
- Rückgabe
- {name, label, available, reserved, owner, resolved, expires, price, twitter, website, description}
A name-service lookup, read live from the registry contract.
Gut zu wissen. 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
- Rückgabe
- raw image bytes
The only non-JSON, non-stream route. The content type is inferred from the stored file's extension.
Gut zu wissen. 404 as JSON when there is no logo, so a client must check the status before treating the body as an image.
Live, und die zwei Verben außer GET
Der Ereignisstrom, der Preflight und die 405.
/live
GET- Params
- none
- Rückgabe
- text/event-stream, one stats frame per update
Server-sent events carrying the same object /stats returns, pushed when it changes.
Gut zu wissen. 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
- Rückgabe
- 204
The preflight. Allowed methods are GET and OPTIONS, allowed header is Content-Type.
Gut zu wissen. 403 when an Origin is present and not on the allowlist, rather than a 204 without the allow header.
any
POST- Params
- none
- Rückgabe
- 405
This API is read-only and answers 405 to every POST, in JSON and with the CORS headers.
Gut zu wissen. 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.
Grenzen, Blättern und Caches
| Grenze | 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 |
Die Ratengrenze gilt pro Client-Adresse und wird mit der eigenen Seite des Explorers geteilt
Dreihundert Anfragen die Minute sind großzügig für einen Menschen und dünn für ein Nachladen. Das Fenster läuft an der Wanduhr: Es setzt zur vollen Minute zurück, statt zu gleiten, ein Schwall zur Minutenwende kann also zwei Fenster in zwei Sekunden verbrauchen und danach für den Rest des zweiten mit 429 antworten. Es gibt bei diesem Dienst keinen retry-after-Header - weichen Sie selbst zurück.
Die Identität hinter der Zählung ist die weitergereichte Client-Adresse, gelesen vom rechten Ende der Kette, denn der Eintrag ganz links ist das, was die Aufrufende hingeschrieben hat. Hinter einem Proxy, der nichts anhängt, fallen alle Aufrufer in einen Eimer zusammen, und das ganze Internet teilt sich ein Budget.
Geblättert wird mit limit und offset, gekappt bei hundert. Ein nicht numerisches Limit wird zum Standardwert statt zu einem Fehler, und ein negatives wird zu eins - eine fehlerhafte Anfrage bekommt also eine plausible Antwort statt einer Beschwerde. Die meisten Listenrouten geben keine Gesamtzahl zurück; /minis und /accounts sind die Ausnahmen.
/address, /tokens, /nfts und die NFT-Routen werden in einem kurzlebigen Cache gehalten, geschlüsselt über Pfad und Blätterung, und /stats wird von einem Hintergrund-Thread neu berechnet und aus einem noch kürzeren Cache bedient. Zwei identische Anfragen im selben Augenblick geben identische Antworten, was für eine Seite in Ordnung und für eine Bestätigungsschleife falsch ist. Fragen Sie den Node nach einer Quittung, nicht diesen Dienst.
Frische und Rückstand
/stats trägt die Zahlen, die sagen, wie aktuell der Index ist: indexedBlock gegen latestBlock, indexLag als Differenz, und derivedLag für die materialisierten Sichten - Token-Guthaben und NFT-Eigentum werden von eigenen Workern gebaut und können hinter den Transaktionen zurückbleiben, aus denen sie stammen.
# 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'Blättern über einen Offset verrutscht unter einer wachsenden Liste
Jede Liste hier ist nach Neuestem zuerst sortiert, und neue Zeilen treffen am Kopf ein. Seite zwei, einen Moment nach Seite eins geholt, überlappt sie daher - und Zeilen können beim Durchgehen ganz übersprungen werden. Für ein Nachladen, das vollständig sein muss, blättern Sie über die Blocknummer und arbeiten sich abwärts, oder holen Sie einen Block nach dem anderen; offset ist für eine Benutzeroberfläche da, nicht für einen Importeur.
Noch eine Asymmetrie, die man kennen sollte, bevor man irgendetwas schlüsselt: Diese Chain nummeriert logIndex pro Transaktion statt pro Block durch, das Paar (blockNumber, logIndex) ist also nicht eindeutig. Nehmen Sie den Transaktions-Hash in jeden Schlüssel auf, den Sie bauen.