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

# Explorer

> **Status:** Current (generated)

History from the gateway's indexer: transactions, addresses, commits, events, contracts, search.

| Function | Kind | Description |
|---|---|---|
| [`explorer.txs`](#explorertxs) | read | Recent transactions, newest first |
| [`explorer.tx`](#explorertx) | read | One transaction: its row, the decoded transaction, the signed bytes and the receipt |
| [`explorer.address_txs`](#exploreraddress_txs) | read | Transactions sent by an address, or to it (a transfer's recipient or a called contract), newest first |
| [`explorer.address_tokens`](#exploreraddress_tokens) | read | Tokens an address has sent or received |
| [`explorer.commits`](#explorercommits) | read | Recent commits, newest first; nonempty=1 skips commits without transactions |
| [`explorer.commit`](#explorercommit) | read | One commit with its transactions |
| [`explorer.events`](#explorerevents) | read | Indexed contract events, newest first, optionally of one contract and first topic |
| [`explorer.contracts`](#explorercontracts) | read | Known contracts, newest first, optionally of one kind (mrc20, exchange, staking, other) |
| [`explorer.search`](#explorersearch) | read | What a search box means: a transaction or an address (32-byte hex), or a commit index |

## explorer.txs

Recent transactions, newest first.

- **Kind:** read
- **Runs:** `GET /api/txs` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `before` | integer |  | Only items before this (commit index or id): for paging back |
| `limit` | integer |  | Most to return (default 50) |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex |  | Hash: 0x hex |
| `commit` | integer |  | Commit |
| `timestamp_ms` | integer or null |  |  |
| `sender` | hex or null |  |  |
| `seq` | integer or null |  |  |
| `kind` | string or null |  |  |
| `target` | hex or null |  |  |
| `entry` | string or null |  |  |
| `amount` | string or null |  |  |
| `status` | integer or null |  |  |
| `status_name` | string or null |  |  |
| `fee` | string or null |  |  |
| `compute_used` | integer or null |  |  |

**Example**

```json
{
  "name": "explorer.txs",
  "input": {
    "limit": 5
  }
}
```

## explorer.tx

One transaction: its row, the decoded transaction, the signed bytes and the receipt.

- **Kind:** read
- **Runs:** `GET /api/tx/{hash}` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex32 | yes | Transaction hash: 32 bytes, 0x hex |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex |  | Hash: 0x hex |
| `tx` | object |  |  |
| `raw` | hex |  | Signed bytes: 0x hex |
| `receipt` | object or null |  |  |

## explorer.address_txs

Transactions sent by an address, or to it (a transfer's recipient or a called contract), newest first.

- **Kind:** read
- **Runs:** `GET /api/address/{address}/txs` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | hex32 | yes | Address: 32 bytes, 0x hex |
| `before` | integer |  | Before this commit |
| `limit` | integer |  | Most (default 50) |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex |  | Hash: 0x hex |
| `commit` | integer |  | Commit |
| `timestamp_ms` | integer or null |  |  |
| `sender` | hex or null |  |  |
| `seq` | integer or null |  |  |
| `kind` | string or null |  |  |
| `target` | hex or null |  |  |
| `entry` | string or null |  |  |
| `amount` | string or null |  |  |
| `status` | integer or null |  |  |
| `status_name` | string or null |  |  |
| `fee` | string or null |  |  |
| `compute_used` | integer or null |  |  |

**Example**

```json
{
  "name": "explorer.address_txs",
  "input": {
    "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
  }
}
```

## explorer.address_tokens

Tokens an address has sent or received.

- **Kind:** read
- **Runs:** `GET /api/address/{address}/tokens` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | hex32 | yes | Address: 32 bytes, 0x hex |

**Output**

array of hex.

**Example**

```json
{
  "name": "explorer.address_tokens",
  "input": {
    "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
  }
}
```

## explorer.commits

Recent commits, newest first; nonempty=1 skips commits without transactions.

- **Kind:** read
- **Runs:** `GET /api/commits` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `before` | integer |  | Only items before this (commit index or id): for paging back |
| `limit` | integer |  | Most to return (default 50) |
| `nonempty` | integer |  | 1: only commits with transactions |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer |  | Commit index |
| `timestamp_ms` | integer |  | Commit time |
| `leader` | array of integer or null |  | [round, author] |
| `blocks` | integer or null |  |  |
| `txs` | integer or null |  |  |
| `executed` | integer or null |  |  |
| `failed` | integer or null |  |  |
| `dropped` | integer or null |  |  |
| `fees` | string or null |  |  |

**Example**

```json
{
  "name": "explorer.commits",
  "input": {
    "limit": 5
  }
}
```

## explorer.commit

One commit with its transactions.

- **Kind:** read
- **Runs:** `GET /api/commit/{index}` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer | yes | Commit index |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `index` | integer |  | Index |
| `transactions` | array of object |  |  |

## explorer.events

Indexed contract events, newest first, optionally of one contract and first topic.

- **Kind:** read
- **Runs:** `GET /api/events` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `before` | integer |  | Only items before this (commit index or id): for paging back |
| `limit` | integer |  | Most to return (default 50) |
| `contract` | hex32 |  | Contract: 32 bytes, 0x hex |
| `topic` | hex32 |  | First topic: 32 bytes, 0x hex |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | integer |  | Id |
| `commit` | integer |  | Commit |
| `tx` | string or null |  |  |
| `contract` | string or null |  |  |
| `topics` | any |  | Any JSON value |
| `data` | string or null |  |  |

**Example**

```json
{
  "name": "explorer.events",
  "input": {
    "limit": 5
  }
}
```

## explorer.contracts

Known contracts, newest first, optionally of one kind (mrc20, exchange, staking, other).

- **Kind:** read
- **Runs:** `GET /api/contracts` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | string |  | mrc20, exchange, staking or other |
| `limit` | integer |  | Most (default 50) |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string |  | Address |
| `kind` | string |  | Kind |
| `code` | string or null |  |  |
| `creator` | string or null |  |  |
| `commit` | integer or null |  |  |

**Example**

```json
{
  "name": "explorer.contracts",
  "input": {
    "kind": "mrc20"
  }
}
```

## explorer.search

What a search box means: a transaction or an address (32-byte hex), or a commit index.

- **Kind:** read
- **Runs:** `GET /api/search` on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `q` | string | yes | Hash, address or commit index |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | string |  | tx, address, commit or none |

**Example**

```json
{
  "name": "explorer.search",
  "input": {
    "q": "1"
  }
}
```
