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

# Preimage

## Calls

### notePreimage

Register a preimage on-chain.

If the preimage was previously requested, no fees or deposits are taken for providing the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.

**Namespace**

```
api.tx.preimage.notePreimage
```

**Type**

```
function notePreimage(
  bytes: Bytes
)
```

### requestPreimage

Request a preimage be uploaded to the chain without paying any fees or deposits.

If the preimage requests has already been provided on-chain, we unreserve any deposit a user may have paid, and take the control of the preimage out of their hands.

**Namespace**

```
api.tx.preimage.requestPreimage
```

**Type**

```
function requestPreimage(
  hash: H256
)
```

### unnotePreimage

Clear an unrequested preimage from the runtime storage.

**Namespace**

```
api.tx.preimage.unnotePreimage
```

**Type**

```
function unnotePreimage(
  hash: H256
)
```

### unrequestPreimage

Clear a previously made request for a preimage.

IMPORTANT: This must not be called on`hash`more times than`request_preimage`.

**Namespace**

```
api.tx.preimage.unrequestPreimage
```

**Type**

```
function unrequestPreimage(
  hash: H256
)
```

## Storage

### preimageFor

The preimages stored by this pallet.

**Namespace**

```
api.query.preimage.preimageFor
```

**Type**

```
function preimageFor(
  H256
): Option<Bytes>
```

### statusFor

The request status of a given hash.

**Namespace**

```
api.query.preimage.statusFor
```

**Type**

```
function statusFor(
  H256
): Option<PalletPreimageRequestStatus>
```

## Events

### Cleared

A preimage has ben cleared.

**Namespace**

```
api.events.preimage.Cleared
```

**Type**

```
type Cleared = {
  hash: H256
}
```

### Noted

A preimage has been noted.

**Namespace**

```
api.events.preimage.Noted
```

**Type**

```
type Noted = {
  hash: H256
}
```

### Requested

A preimage has been requested.

**Namespace**

```
api.events.preimage.Requested
```

**Type**

```
type Requested = {
  hash: H256
}
```

## Errors

### AlreadyNoted

Preimage has already been noted on-chain.

**Namespace**

```
api.errors.preimage.AlreadyNoted
```

### NotAuthorized

The user is not authorized to perform this action.

**Namespace**

```
api.errors.preimage.NotAuthorized
```

### NotNoted

The preimage cannot be removed since it has not yet been noted.

**Namespace**

```
api.errors.preimage.NotNoted
```

### NotRequested

The preimage request cannot be removed since no outstanding requests exist.

**Namespace**

```
api.errors.preimage.NotRequested
```

### Requested

A preimage may not be removed when there are outstanding requests.

**Namespace**

```
api.errors.preimage.Requested
```

### TooLarge

Preimage is too large to store on-chain.

**Namespace**

```
api.errors.preimage.TooLarge
```

undefined
