> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kronex.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Explorer integration

> Index Kronex workshares against a frozen contract, with reorg-safe paging.

The workshare explorer API is the one part of the `krnx_` namespace with a
frozen contract: result and error shapes do not change without a version bump.
Build indexers against it, not against the pending views.

## Ask what is queryable

Call [`krnx_getWorkshareCapabilities`](/rpc/krnx/getWorkshareCapabilities)
first. It always answers, even when the explorer API is disabled, and it tells
you:

* whether the API is enabled,
* the canonical history anchors, including `history.firstAvailableBlock`,
* the frozen limits,
* the parent-chain mappings for BCH, LTC, RVN and ZEC.

If the API is off, every other explorer call returns
`KRNX_EXPLORER_RPC_DISABLED`.

## Page through workshares

[`krnx_getWorkshares`](/rpc/krnx/getWorkshares) takes exactly one object:

```json theme={null}
[
  {
    "fromBlock": "0x100000",
    "toBlock": "latest",
    "limit": 500,
    "maxBlocks": 64,
    "parentChainIds": [1, 2, 3, 4],
    "algorithmIds": ["sha256d", "scrypt", "kawpow", "equihash"]
  }
]
```

| Field            | Required | Rule                                              |
| ---------------- | -------- | ------------------------------------------------- |
| `fromBlock`      | yes      | Explicit quantity. Tags are invalid.              |
| `toBlock`        | yes      | Explicit quantity, or exactly `latest`.           |
| `limit`          | no       | Default 500, range 1..500.                        |
| `maxBlocks`      | no       | Default 64, range 1..64.                          |
| `parentChainIds` | no       | Subset of `[1,2,3,4]`. Omitted means all.         |
| `algorithmIds`   | no       | Subset of the four algorithms. Omitted means all. |

Both filters, when supplied, are intersected against the frozen
parent/algorithm tuples — a contradictory intersection is an error, not an
empty page. `fromBlock` cannot precede `history.firstAvailableBlock`, and a
numeric `toBlock` must exist and cannot exceed the canonical head.

## Snapshots and reorgs

On the first request the node resolves `latest` once, records the resolved
number and hash, materializes defaults, normalizes the filters, and returns the
whole normalized query back to you as `snapshot`.

Send that snapshot back with the cursor on every subsequent page. The node
re-checks the anchor, so a reorg under your feet surfaces as an error instead of
a silently inconsistent result set. Restart paging from the new head when that
happens.

<Warning>
  `shareDifficulty` is the achieved proof-of-work difficulty of the share as a
  fixed-12 decimal string. It is not the DAA threshold, and it is not a hex
  quantity. Historical payloads with zero metadata are projected from
  `shareHash` rather than rewritten in place.
</Warning>

## What not to index

Index the durable view only. A node also keeps in-memory views of work it has
not yet bound to a canonical block; those are process-local diagnostics, two
nodes will disagree about them, and nothing in them is authenticated as history.

## Block-level data

For a block-at-a-time view rather than a share-at-a-time one, pair
[`krnx_getBlockReward`](/rpc/krnx/getBlockReward), which returns every recipient
and amount for one block, with
[`krnx_getAuxPowStatus`](/rpc/krnx/getAuxPowStatus).
