<!-- Generated from the function registry (sdk/src/functions) by `cd sdk && npm run gen`. Do not edit. -->

# Chain

> **Status:** Current (generated)

The network's state as validators see it: status, epochs, fees, rewards, checkpoints, bootstrap security.

| Function | Kind | Description |
|---|---|---|
| [`chain.status`](#chainstatus) | read | A validator's status: chain id, epoch, latest decided and executed commits, mempool, peers, health |
| [`chain.epoch`](#chainepoch) | read | The current epoch (committee, threshold key) and any scheduled reconfiguration |
| [`chain.fees`](#chainfees) | read | Prices in force (per million compute units, per byte, deposit per stored byte), surcharges by domain, the fee pool, burned and minted totals, deposits held, and optionally one fee tank |
| [`chain.rewards`](#chainrewards) | read | Validator rewards: parameters, this period's committed blocks per node, the last payout |
| [`chain.bootstrap`](#chainbootstrap) | read | Bootstrap security: the phase, its gate and the readings against it, guardian and open stake per node, jailed nodes |
| [`chain.checkpoint`](#chaincheckpoint) | read | A certified checkpoint: state and receipts roots, peers and outbox roots, the threshold signature, and the payload to anchor it elsewhere |
| [`chain.security`](#chainsecurity) | read | Shared security: the provider this chain borrows stake from, rent, the borrowed stake table, and leases to consumer chains |

## chain.status

A validator's status: chain id, epoch, latest decided and executed commits, mempool, peers, health.

- **Kind:** read
- **Runs:** JSON-RPC `mox_status` (`POST /`) on the gateway

**Input**

None.

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `validator` | integer |  | Node index |
| `member` | integer or null |  |  |
| `epoch` | integer |  | Epoch |
| `chain_id` | integer |  | Chain id |
| `commit_index` | integer |  | Latest commit decided |
| `executed_index` | integer |  | Latest commit executed (use as a transaction's snapshot) |
| `highest_round` | integer |  | Highest DAG round seen |
| `effects` | string |  | Effects digest after executed_index |
| `mempool` | integer |  | Transactions waiting |
| `peers_connected` | integer |  | Peers |
| `halted` | boolean |  | Stopped on a safety alarm |
| `executed_txs` | integer |  | Transactions executed |
| `alarms` | array of string |  |  |
| `excluded_leaders` | array of integer |  |  |

**Example**

```json
{
  "name": "chain.status",
  "input": {}
}
```

```json
{
  "chain_id": 1337,
  "epoch": 0,
  "commit_index": 5120,
  "executed_index": 5120,
  "member": 0,
  "halted": false
}
```

## chain.epoch

The current epoch (committee, threshold key) and any scheduled reconfiguration.

- **Kind:** read
- **Runs:** JSON-RPC `mox_epoch` (`POST /`) on the gateway

**Input**

None.

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `current` | object or null |  |  |
| `next` | object or null |  |  |

**Example**

```json
{
  "name": "chain.epoch",
  "input": {}
}
```

## chain.fees

Prices in force (per million compute units, per byte, deposit per stored byte), surcharges by domain, the fee pool, burned and minted totals, deposits held, and optionally one fee tank.

- **Kind:** read
- **Runs:** JSON-RPC `mox_fees` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `tank` | hex32 |  | Also show the fee tank of this address: 32 bytes, 0x hex |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `tariff` | object |  |  |
| `surcharges` | object |  | ORDERED surcharge per domain |
| `pool` | decimal string |  | Fee pool |
| `burned` | decimal string |  | Burned |
| `deposits` | decimal string |  | Deposits held |
| `tank` | object or null |  |  |

**Example**

```json
{
  "name": "chain.fees",
  "input": {}
}
```

## chain.rewards

Validator rewards: parameters, this period's committed blocks per node, the last payout. Null if the chain pays none.

- **Kind:** read
- **Runs:** JSON-RPC `mox_rewards` (`POST /`) on the gateway

**Input**

None.

**Output**

An object (or null).

| Field | Type | Required | Description |
|---|---|---|---|
| `period_ms` | integer |  | Period |
| `commission_ppm` | integer |  | Commission |
| `blocks` | array of object |  |  |
| `distributed` | decimal string |  | Paid so far |

**Example**

```json
{
  "name": "chain.rewards",
  "input": {}
}
```

## chain.bootstrap

Bootstrap security: the phase, its gate and the readings against it, guardian and open stake per node, jailed nodes. Null if the chain is governed directly.

- **Kind:** read
- **Runs:** JSON-RPC `mox_bootstrap` (`POST /`) on the gateway

**Input**

None.

**Output**

An object (or null).

| Field | Type | Required | Description |
|---|---|---|---|
| `phase` | integer |  | Phase 0–3 |
| `gate_open` | boolean |  | The next phase may begin |
| `jailed` | array of integer |  |  |
| `stakes` | array of object |  |  |

**Example**

```json
{
  "name": "chain.bootstrap",
  "input": {}
}
```

## chain.checkpoint

A certified checkpoint: state and receipts roots, peers and outbox roots, the threshold signature, and the payload to anchor it elsewhere. Default: the latest.

- **Kind:** read
- **Runs:** JSON-RPC `mox_checkpoint` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer |  | Checkpoint (commit) index |

**Output**

An object (or null).

| Field | Type | Required | Description |
|---|---|---|---|
| `chain_id` | integer |  | Chain |
| `index` | integer |  | Commit |
| `state_root` | hex |  | State root: 0x hex |
| `receipts_root` | hex |  | Receipts root: 0x hex |
| `message` | hex |  | Signed message: 0x hex |
| `signature` | hex |  | Threshold signature: 0x hex |
| `anchor` | hex |  | External anchor payload: 0x hex |

**Example**

```json
{
  "name": "chain.checkpoint",
  "input": {}
}
```

## chain.security

Shared security: the provider this chain borrows stake from, rent, the borrowed stake table, and leases to consumer chains.

- **Kind:** read
- **Runs:** JSON-RPC `mox_security` (`POST /`) on the gateway

**Input**

None.

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `provider` | integer or null |  |  |
| `rent_paid` | decimal string |  | Rent paid |
| `borrowed` | array of object |  |  |
| `leases` | array of object |  |  |

**Example**

```json
{
  "name": "chain.security",
  "input": {}
}
```
