> ## 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.

# ImOnline

## Calls

### heartbeat

**Namespace**

```
api.tx.imOnline.heartbeat
```

**Type**

```
function heartbeat(
  heartbeat: PalletImOnlineHeartbeat,
  signature: PalletImOnlineSr25519AppSr25519Signature
)
```

## Storage

### authoredBlocks

For each session index, we keep a mapping of `ValidatorId<T>` to the number of blocks authored by the given authority.

**Namespace**

```
api.query.imOnline.authoredBlocks
```

**Type**

```
function authoredBlocks(
  u32,
  SeedPrimitivesSignatureAccountId20
): u32
```

### heartbeatAfter

The block number after which it's ok to send heartbeats in the current session.

At the beginning of each session we set this to a value that should fall roughly in the middle of the session duration. The idea is to first wait for the validators to produce a block in the current session, so that the heartbeat later on will not be necessary.

This value will only be used as a fallback if we fail to get a proper session progress estimate from `NextSessionRotation`, as those estimates should be more accurate then the value we calculate for `HeartbeatAfter`.

**Namespace**

```
api.query.imOnline.heartbeatAfter
```

**Type**

```
function heartbeatAfter(

): u32
```

### keys

The current set of keys that may issue a heartbeat.

**Namespace**

```
api.query.imOnline.keys
```

**Type**

```
function keys(

): Vec<PalletImOnlineSr25519AppSr25519Public>
```

### receivedHeartbeats

For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to `WrapperOpaque<BoundedOpaqueNetworkState>`.

**Namespace**

```
api.query.imOnline.receivedHeartbeats
```

**Type**

```
function receivedHeartbeats(
  u32,
  u32
): Option<WrapperOpaque<PalletImOnlineBoundedOpaqueNetworkState>>
```

## Events

### AllGood

At the end of the session, no offence was committed.

**Namespace**

```
api.events.imOnline.AllGood
```

**Type**

```
type AllGood = {

}
```

### HeartbeatReceived

A new heartbeat was received from `AuthorityId`.

**Namespace**

```
api.events.imOnline.HeartbeatReceived
```

**Type**

```
type HeartbeatReceived = {
  authority_id: PalletImOnlineSr25519AppSr25519Public
}
```

### SomeOffline

At the end of the session, at least one validator was found to be offline.

**Namespace**

```
api.events.imOnline.SomeOffline
```

**Type**

```
type SomeOffline = {
  offline: Vec<(SeedPrimitivesSignatureAccountId20,PalletStakingExposure)>
}
```

## Errors

### DuplicatedHeartbeat

Duplicated heartbeat.

**Namespace**

```
api.errors.imOnline.DuplicatedHeartbeat
```

### InvalidKey

Non existent public key.

**Namespace**

```
api.errors.imOnline.InvalidKey
```

## Constants

### unsignedPriority

A configuration for base priority of unsigned transactions.

This is exposed so that it can be tuned for particular runtime, when multiple pallets send unsigned transactions.

**Namespace**

```
api.consts.imOnline.unsignedPriority
```

**Type**

```
type unsignedPriority = u64
```
